# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet v2.5.59 -> 1.988 # drivers/net/8139too.c 1.48 -> 1.49 # drivers/acpi/include/acglobal.h 1.18 -> 1.19 include/acpi/acglobal.h (moved) # arch/i386/kernel/process.c 1.43 -> 1.44 # arch/sparc/Kconfig 1.7 -> 1.8 # drivers/hotplug/cpqphp_core.c 1.12 -> 1.14 # fs/nfs/read.c 1.29 -> 1.30 # drivers/s390/cio/Makefile 1.6 -> 1.7 # fs/binfmt_flat.c 1.1 -> 1.2 # fs/jfs/inode.c 1.26 -> 1.28 # arch/arm/kernel/irq.c 1.23 -> 1.24 # drivers/usb/media/Makefile 1.8 -> 1.9 # drivers/acorn/scsi/oak.c 1.14 -> 1.15 # drivers/hotplug/ibmphp_pci.c 1.3 -> 1.5 # arch/ppc64/kernel/signal.c 1.22 -> 1.25 # drivers/acpi/include/acpixf.h 1.15 -> 1.16 include/acpi/acpixf.h (moved) # drivers/scsi/megaraid.c 1.30 -> 1.34 # arch/m68k/sun3/Makefile 1.6 -> 1.7 # arch/mips64/mm/Makefile 1.5 -> 1.6 # sound/pci/emu10k1/emu10k1.c 1.8 -> 1.10 # include/linux/isdnif.h 1.12 -> 1.13 # include/asm-alpha/pci.h 1.9 -> 1.10 # drivers/scsi/aic7xxx/aic79xx_core.c 1.6 -> 1.10 # include/linux/acpi.h 1.19 -> 1.22 # arch/arm/mach-sa1100/sa1111-pcibuf.c 1.8 -> 1.9 arch/arm/common/sa1111-pcibuf.c (moved) # arch/sparc64/kernel/signal32.c 1.24 -> 1.26 # drivers/block/paride/Kconfig 1.1 -> 1.2 # include/net/route.h 1.17 -> 1.19 # sound/sound_firmware.c 1.4 -> 1.6 # drivers/pnp/isapnp/Makefile 1.5 -> 1.6 # arch/ppc64/lib/Makefile 1.7 -> 1.8 # arch/um/kernel/tt/syscall_kern.c 1.3 -> 1.4 # arch/mips/baget/time.c 1.2 -> 1.3 # drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped 1.3 -> 1.4 # drivers/usb/media/Kconfig 1.2 -> 1.3 # include/asm-mips64/topology.h 1.2 -> 1.3 # arch/sh/kernel/time.c 1.5 -> 1.6 # arch/ppc/boot/simple/Makefile 1.12 -> 1.13 # drivers/input/joystick/Kconfig 1.1 -> 1.2 # sound/core/seq/oss/seq_oss_midi.c 1.5 -> 1.6 # drivers/scsi/ips.c 1.38 -> 1.43 # drivers/net/pcmcia/Makefile 1.12 -> 1.13 # drivers/pnp/Makefile 1.10 -> 1.11 # drivers/scsi/sim710.scr 1.2 -> (deleted) # include/asm-arm/arch-ebsa110/param.h 1.2 -> 1.3 # include/asm-ia64/topology.h 1.5 -> 1.6 # drivers/scsi/scsi_error.c 1.27 -> 1.33 # fs/sysfs/Makefile 1.3 -> 1.4 # drivers/input/gameport/Makefile 1.4 -> 1.5 # arch/arm/kernel/via82c505.c 1.8 -> 1.9 arch/arm/common/via82c505.c (moved) # Documentation/tipar.txt 1.1 -> 1.2 # drivers/net/skfp/smtdef.c 1.1 -> 1.2 # arch/s390/kernel/time.c 1.10 -> 1.11 # sound/i2c/cs8427.c 1.4 -> 1.5 # sound/core/seq/seq_midi_event.c 1.7 -> 1.8 # drivers/media/video/bt856.c 1.6 -> 1.7 # drivers/acpi/include/acutils.h 1.22 -> 1.23 include/acpi/acutils.h (moved) # arch/ia64/kernel/palinfo.c 1.9 -> 1.10 # crypto/digest.c 1.11 -> 1.12 # arch/um/drivers/daemon_kern.c 1.2 -> 1.3 # sound/pci/emu10k1/emupcm.c 1.9 -> 1.11 # arch/mips/philips/nino/time.c 1.1 -> 1.2 # include/linux/mmzone.h 1.35 -> 1.36 # drivers/scsi/aic7xxx/aic79xx_osm.c 1.11 -> 1.17 # fs/nfsd/nfssvc.c 1.30 -> 1.32 # sound/drivers/opl3/Makefile 1.10 -> 1.11 # net/lapb/Makefile 1.4 -> 1.5 # arch/um/kernel/tt/include/tt.h 1.1 -> 1.2 # arch/um/drivers/mcast_kern.c 1.3 -> 1.4 # include/asm-parisc/bitops.h 1.2 -> 1.3 # include/asm-s390/kmap_types.h 1.3 -> 1.4 # sound/pci/korg1212/korg1212.c 1.14 -> 1.16 # kernel/ksyms.c 1.178 -> 1.181 # drivers/net/e1000/e1000.h 1.22 -> 1.23 # include/asm-ppc64/unistd.h 1.15 -> 1.16 # drivers/char/n_tty.c 1.9 -> 1.10 # drivers/acorn/scsi/Makefile 1.7 -> 1.8 # drivers/sgi/char/Makefile 1.5 -> 1.6 # net/irda/ircomm/Kconfig 1.1 -> 1.2 # arch/mips/Makefile 1.12 -> 1.13 # arch/m68k/math-emu/fp_decode.h 1.2 -> 1.3 # arch/ppc64/kernel/entry.S 1.16 -> 1.19 # drivers/acpi/include/acpiosxf.h 1.18 -> 1.20 include/acpi/acpiosxf.h (moved) # drivers/ieee1394/Kconfig 1.2 -> 1.3 # drivers/mtd/nand/Makefile 1.5 -> 1.6 # crypto/internal.h 1.13 -> 1.14 # include/asm-x86_64/signal.h 1.4 -> 1.5 # arch/um/sys-i386/util/mk_thread_kern.c 1.2 -> 1.3 # drivers/char/ip2/i2ellis.c 1.3 -> 1.4 # net/rxrpc/krxiod.c 1.2 -> 1.3 # mm/fremap.c 1.2 -> 1.3 # drivers/i2c/Makefile 1.7 -> 1.8 # arch/arm/kernel/signal.c 1.18 -> 1.19 # drivers/usb/serial/ipaq.h 1.5 -> 1.6 # arch/um/drivers/chan_user.c 1.4 -> 1.5 # arch/um/sys-i386/sigcontext.c 1.2 -> 1.3 # drivers/input/gameport/Kconfig 1.1 -> 1.2 # sound/ppc/tumbler.c 1.8 -> 1.9 # include/asm-arm/bug.h 1.1 -> 1.2 # arch/arm/mm/proc-arm920.S 1.16 -> 1.17 # drivers/net/tulip/de4x5.c 1.20 -> 1.21 # arch/ia64/ia32/ia32_signal.c 1.10 -> 1.14 # drivers/scsi/pci2220i.c 1.13 -> 1.15 # arch/um/drivers/mconsole_kern.c 1.5 -> 1.6 # include/linux/jiffies.h 1.3 -> 1.5 # Documentation/modules.txt 1.3 -> 1.4 # sound/synth/Makefile 1.11 -> 1.12 # fs/fat/Makefile 1.5 -> 1.6 # drivers/parport/Makefile 1.6 -> 1.7 # arch/i386/kernel/cpu/mtrr/Makefile 1.2 -> 1.3 # fs/xfs/xfs_buf_item.c 1.6 -> 1.7 # fs/lockd/clntproc.c 1.7 -> 1.8 # drivers/char/Kconfig 1.6 -> 1.8 # include/asm-i386/edd.h 1.3 -> 1.4 # drivers/video/Kconfig 1.11 -> 1.12 # Documentation/DocBook/journal-api.tmpl 1.4 -> 1.5 # include/linux/buffer_head.h 1.36 -> 1.37 # drivers/net/e1000/Makefile 1.7 -> 1.8 # drivers/scsi/eata_dma.c 1.7 -> 1.9 # include/asm-arm/arch-sa1100/ide.h 1.5 -> 1.6 # net/ax25/Makefile 1.5 -> 1.6 # drivers/net/appletalk/Makefile 1.4 -> 1.5 # arch/um/kernel/tt/tracer.c 1.2 -> 1.3 # Documentation/sound/alsa/CMIPCI.txt 1.1 -> 1.3 # drivers/net/3c509.c 1.29 -> 1.30 # fs/xfs/pagebuf/page_buf.c 1.35 -> 1.37 # net/sunrpc/auth_gss/gss_krb5_crypto.c 1.1 -> 1.2 # drivers/mtd/devices/blkmtd.c 1.23 -> 1.24 # arch/ia64/Makefile 1.32 -> 1.37 # drivers/atm/Makefile 1.15 -> 1.16 # arch/arm/mach-adifcc/Makefile 1.4 -> 1.5 # drivers/media/video/saa7185.c 1.8 -> 1.9 # fs/freevxfs/vxfs_fshead.c 1.6 -> 1.7 # arch/ia64/kernel/efi.c 1.17 -> 1.19 # drivers/message/i2o/Kconfig 1.1 -> 1.2 # drivers/scsi/53c7,8xx.c 1.14 -> (deleted) # include/linux/mm.h 1.105 -> 1.107 # drivers/acpi/button.c 1.15 -> 1.16 # arch/um/os-Linux/drivers/ethertap_kern.c 1.2 -> 1.3 # fs/jfs/jfs_btree.h 1.3 -> 1.4 # include/asm-generic/vmlinux.lds.h 1.4 -> 1.7 # drivers/scsi/fcal.c 1.8 -> 1.9 # sound/pci/ice1712/ice1712.h 1.5 -> 1.6 # arch/um/kernel/ksyms.c 1.6 -> 1.8 # drivers/scsi/scsiiom.c 1.2 -> 1.3 # drivers/net/skfp/pcmplc.c 1.2 -> 1.3 # Documentation/arm/SA1100/CERF 1.1 -> 1.2 # net/sunrpc/Makefile 1.9 -> 1.10 # drivers/scsi/hosts.c 1.45 -> 1.51 # arch/i386/kernel/apm.c 1.42 -> 1.43 # lib/Makefile 1.17 -> 1.18 # sound/isa/gus/gus_mixer.c 1.5 -> 1.6 # include/sound/gus.h 1.2 -> 1.3 # arch/ppc/Makefile 1.34 -> 1.36 # fs/devfs/Makefile 1.4 -> 1.5 # net/Kconfig 1.6 -> 1.7 # arch/um/drivers/xterm.c 1.4.1.1 -> 1.11 # arch/ppc/lib/Makefile 1.10 -> 1.11 # net/sctp/input.c 1.14 -> 1.15 # drivers/net/skfp/skfddi.c 1.9 -> 1.10 # sound/core/hwdep.c 1.7 -> 1.10 # sound/core/memory.c 1.15 -> 1.16 # include/asm-um/processor-i386.h 1.1 -> 1.2 # include/asm-i386/pgalloc.h 1.18 -> 1.19 # fs/proc/Makefile 1.5 -> 1.6 # drivers/scsi/cpqfcTSinit.c 1.25.1.1 -> 1.30 # drivers/usb/class/Kconfig 1.5 -> 1.6 # drivers/scsi/aic7xxx/aic7xxx_pci.c 1.8 -> 1.9 # drivers/acpi/toshiba_acpi.c 1.4 -> 1.5 # arch/um/drivers/port_kern.c 1.7.1.1 -> 1.15 # fs/xfs/xfs_trans_buf.c 1.5 -> 1.6 # drivers/acpi/fan.c 1.9 -> 1.10 # net/irda/ircomm/Makefile 1.6 -> 1.7 # drivers/input/serio/Makefile 1.6 -> 1.7 # arch/um/kernel/trap_kern.c 1.5 -> 1.7 # drivers/scsi/aic7xxx/aiclib.h 1.4 -> 1.5 # sound/core/oss/Makefile 1.5 -> 1.6 # drivers/net/hamradio/Kconfig 1.2 -> 1.3 # arch/um/kernel/skas/sys-i386/sigcontext.c 1.1 -> 1.2 # fs/nfs/mount_clnt.c 1.6 -> 1.7 # arch/ppc/syslib/Makefile 1.3 -> 1.4 # drivers/net/pcmcia/aironet4500_cs.c 1.11 -> 1.12 # arch/um/kernel/tt/tlb.c 1.3 -> 1.4 # arch/i386/kernel/irq.c 1.24 -> 1.25 # mm/page_alloc.c 1.145 -> 1.148 # mm/readahead.c 1.26 -> 1.28 # fs/ext2/inode.c 1.60 -> 1.61 # drivers/scsi/aic7xxx/aic7xxx_osm.c 1.11 -> 1.16 # drivers/acpi/include/acexcep.h 1.12 -> 1.13 include/acpi/acexcep.h (moved) # drivers/scsi/scsi_proc.c 1.12 -> 1.16 # fs/jfs/jfs_inode.c 1.5 -> 1.6 # include/asm-ppc64/processor.h 1.22 -> 1.23 # sound/core/seq/oss/seq_oss_init.c 1.4 -> 1.5 # include/asm-um/current.h 1.1 -> 1.3 # include/linux/times.h 1.2 -> 1.3 # arch/ia64/ia32/ia32_support.c 1.5 -> 1.6 # arch/alpha/kernel/alpha_ksyms.c 1.30 -> 1.31 # sound/pci/cs46xx/cs46xx_lib.c 1.19 -> 1.23 # drivers/video/vesafb.c 1.28 -> 1.29 # include/asm-ia64/spinlock.h 1.5 -> 1.6 # include/asm-ppc/signal.h 1.4 -> 1.5 # drivers/net/hamradio/Makefile 1.6 -> 1.7 # include/linux/ext3_jbd.h 1.7 -> 1.8 # drivers/usb/host/ohci-hcd.c 1.35 -> 1.36 # arch/sparc/kernel/sparc_ksyms.c 1.12 -> 1.13 # fs/ext3/Makefile 1.7 -> 1.8 # fs/lockd/Makefile 1.3 -> 1.4 # arch/arm/mach-shark/Makefile 1.7 -> 1.8 # drivers/char/drm/i830_dma.c 1.9 -> 1.10 # arch/alpha/kernel/core_marvel.c 1.4 -> 1.6 # Documentation/sound/alsa/ALSA-Configuration.txt 1.1 -> 1.3 # drivers/acorn/scsi/cumana_1.c 1.13 -> 1.14 # drivers/net/pcmcia/nmclan_cs.c 1.9 -> 1.10 # sound/drivers/opl3/opl3_oss.c 1.4 -> 1.5 # drivers/acpi/include/acstruct.h 1.12 -> 1.13 include/acpi/acstruct.h (moved) # drivers/usb/image/Kconfig 1.2 -> 1.3 # sound/isa/gus/gus_main.c 1.7 -> 1.8 # include/linux/init_task.h 1.20 -> 1.21 # drivers/net/tokenring/tmsisa.c 1.6 -> 1.7 # arch/um/drivers/null.c 1.2 -> 1.3 # sound/drivers/serial-u16550.c 1.11 -> 1.12 # include/asm-generic/topology.h 1.3 -> 1.4 # include/linux/sched.h 1.121 -> 1.127 # kernel/fork.c 1.100 -> 1.104 # include/linux/ptrace.h 1.5 -> 1.7 # drivers/net/Space.c 1.15 -> 1.16 # drivers/block/ll_rw_blk.c 1.147 -> 1.149 # arch/i386/kernel/vm86.c 1.18 -> 1.19 # fs/jffs2/os-linux.h 1.8 -> 1.9 # kernel/sys.c 1.38 -> 1.40 # drivers/input/Kconfig 1.3 -> 1.4 # Makefile 1.357 -> 1.369 # sound/pci/cmipci.c 1.16 -> 1.19 # arch/um/drivers/slirp_user.c 1.1 -> 1.2 # drivers/net/wireless/airo.c 1.30 -> 1.31 # arch/um/include/sysdep-i386/frame.h 1.1 -> 1.2 # drivers/video/Makefile 1.70 -> 1.71 # drivers/acpi/include/acnamesp.h 1.16 -> 1.17 include/acpi/acnamesp.h (moved) # include/asm-ia64/unistd.h 1.22 -> 1.23 # net/wanrouter/Makefile 1.5 -> 1.6 # arch/i386/mach-voyager/Makefile 1.2 -> 1.3 # include/asm-ppc64/thread_info.h 1.6 -> 1.7 # drivers/md/Kconfig 1.1 -> 1.2 # drivers/media/video/bt819.c 1.5 -> 1.6 # drivers/net/wan/lmc/lmc_ioctl.h 1.2 -> 1.3 # include/asm-ia64/mmu_context.h 1.10 -> 1.12 # include/net/tcp.h 1.27 -> 1.29 # drivers/acpi/include/acresrc.h 1.10 -> 1.11 include/acpi/acresrc.h (moved) # drivers/acpi/hardware/hwtimer.c 1.11 -> 1.12 # drivers/acpi/include/acobject.h 1.15 -> 1.16 include/acpi/acobject.h (moved) # arch/um/os-Linux/process.c 1.4 -> 1.5 # net/rxrpc/krxtimod.c 1.2 -> 1.3 # fs/befs/ChangeLog 1.1 -> 1.2 # drivers/s390/net/lcs.c 1.8 -> 1.9 # sound/isa/cs423x/cs4236.c 1.11 -> 1.12 # drivers/char/ftape/Kconfig 1.1 -> 1.2 # sound/core/seq/seq_clientmgr.c 1.12 -> 1.14 # include/asm-ia64/signal.h 1.7 -> 1.8 # drivers/net/lasi_82596.c 1.16 -> 1.17 # drivers/ieee1394/sbp2.c 1.20 -> 1.22 # arch/um/include/user_util.h 1.9 -> 1.11 # fs/dcache.c 1.37 -> 1.38 # sound/pci/ac97/ak4531_codec.c 1.3 -> 1.5 # mm/vmscan.c 1.143 -> 1.146 # arch/ia64/kernel/setup.c 1.34 -> 1.36 # net/atm/Makefile 1.6 -> 1.7 # sound/oss/ac97_codec.c 1.12 -> 1.13 # arch/um/kernel/tt/gdb.c 1.2 -> 1.5 # sound/pci/rme9652/hammerfall_mem.c 1.9 -> 1.11 # arch/um/drivers/mmapper_kern.c 1.2 -> 1.3 # fs/proc/proc_misc.c 1.62 -> 1.64 # arch/um/kernel/ptrace.c 1.5.1.1 -> 1.11 # sound/core/ioctl32/ioctl32.c 1.13 -> 1.16 # drivers/s390/char/sclp_tty.c 1.3 -> 1.4 # arch/ppc64/Makefile 1.21 -> 1.22 # sound/isa/cmi8330.c 1.8 -> 1.12 # arch/sparc/Makefile 1.17 -> 1.19 # arch/ia64/sn/kernel/Makefile 1.9 -> 1.10 # drivers/block/cpqarray.c 1.68 -> 1.69 # arch/um/kernel/skas/include/ptrace-skas.h 1.1 -> 1.2 # drivers/acorn/scsi/scsi.h 1.2 -> 1.3 # arch/um/include/sysdep-i386/syscalls.h 1.1 -> 1.2 # arch/x86_64/kernel/apic.c 1.8 -> 1.9 # drivers/acpi/include/amlresrc.h 1.6 -> (deleted) # drivers/acpi/include/actbl1.h 1.9 -> 1.10 include/acpi/actbl1.h (moved) # drivers/i2c/i2c-core.c 1.14 -> 1.15 # sound/isa/gus/gus_reset.c 1.3 -> 1.4 # arch/ia64/hp/common/sba_iommu.c 1.9 -> 1.10 # fs/xfs/xfs_dquot_item.c 1.1 -> 1.2 # drivers/net/wan/lmc/lmc_ver.h 1.2 -> 1.3 # arch/i386/Kconfig 1.34 -> 1.36 # include/asm-parisc/module.h 1.2 -> 1.3 # sound/core/rawmidi.c 1.19 -> 1.22 # drivers/block/floppy.c 1.65 -> 1.67 # drivers/media/dvb/frontends/Kconfig 1.2 -> 1.3 # drivers/sbus/char/aurora.c 1.17 -> 1.18 # arch/ia64/kernel/ivt.S 1.11 -> 1.13 # arch/um/util/mk_task_kern.c 1.1 -> 1.2 # drivers/base/node.c 1.7 -> 1.8 # drivers/parisc/Makefile 1.2 -> 1.3 # include/linux/elf.h 1.17 -> 1.18 # drivers/scsi/53c700.c 1.22 -> 1.24 # sound/core/control.c 1.15 -> 1.18 # drivers/net/tokenring/Makefile 1.7 -> 1.8 # drivers/usb/serial/Makefile 1.16 -> 1.17 # drivers/hotplug/ibmphp_ebda.c 1.7 -> 1.9 # arch/um/include/sysdep-i386/ptrace.h 1.2 -> 1.5 # net/bridge/br.c 1.8 -> 1.9 # net/ipv4/netfilter/ip_nat_helper.c 1.9 -> 1.10 # drivers/acpi/include/acdebug.h 1.15 -> 1.17 include/acpi/acdebug.h (moved) # arch/um/sys-i386/Makefile 1.8.1.1 -> 1.15 # fs/jfs/jfs_imap.c 1.18 -> 1.19 # arch/x86_64/lib/Makefile 1.9 -> 1.10 # sound/isa/opti9xx/opti92x-ad1848.c 1.9 -> 1.10 # fs/jbd/journal.c 1.23 -> 1.25 # include/asm-sparc64/unistd.h 1.18 -> 1.19 # include/asm-i386/signal.h 1.4 -> 1.5 # Documentation/isdn/HiSax.cert 1.2 -> 1.3 # include/asm-i386/topology.h 1.4 -> 1.5 # arch/i386/kernel/traps.c 1.42 -> 1.43 # net/bluetooth/Makefile 1.12 -> 1.13 # arch/um/kernel/user_util.c 1.3 -> 1.6 # drivers/net/hamradio/6pack.c 1.9 -> 1.10 # arch/alpha/kernel/setup.c 1.27 -> 1.30 # drivers/parisc/ccio-dma.c 1.8 -> 1.10 # drivers/scsi/g_NCR5380.c 1.12 -> 1.13 # arch/i386/kernel/Makefile 1.32 -> 1.33 # fs/nls/Makefile 1.6 -> 1.7 # include/asm-m68k/signal.h 1.3 -> 1.4 # include/asm-mips/isadep.h 1.2 -> 1.3 # include/linux/signal.h 1.6 -> 1.7 # sound/core/init.c 1.11 -> 1.15 # fs/stat.c 1.16 -> 1.17 # include/asm-um/processor-generic.h 1.4 -> 1.6 # drivers/usb/Kconfig 1.1 -> 1.2 # arch/arm/mach-sa1100/leds.c 1.9 -> 1.10 # drivers/video/skeletonfb.c 1.20 -> 1.22 # drivers/net/tg3.h 1.20 -> 1.23 # arch/sparc64/kernel/Makefile 1.18 -> 1.19 # drivers/isdn/hisax/isdnl2.c 1.10 -> 1.11 # arch/s390/Makefile 1.20 -> 1.22 # arch/i386/kernel/acpi_wakeup.S 1.10 -> 1.11 # arch/arm/mach-arc/Makefile 1.5 -> 1.6 # arch/um/include/time_user.h 1.3 -> 1.4 # fs/xfs/xfs_vfsops.c 1.23 -> 1.24 # drivers/scsi/scsi_sysfs.c 1.5 -> 1.6 # arch/mips64/mips-boards/generic/time.c 1.3 -> 1.4 # fs/autofs/waitq.c 1.5 -> 1.7 # arch/um/include/sysdep-i386/frame_kern.h 1.2 -> 1.3 # net/irda/irlan/Kconfig 1.1 -> 1.2 # kernel/Makefile 1.25 -> 1.26 # arch/um/kernel/time.c 1.4 -> 1.6 # Documentation/kbuild/00-INDEX 1.2 -> 1.3 # drivers/telephony/Kconfig 1.1 -> 1.2 # Documentation/kbuild/bug-list.txt 1.1 -> (deleted) # fs/ioctl.c 1.7 -> 1.8 # net/sctp/Kconfig 1.1 -> 1.2 # arch/alpha/kernel/proto.h 1.10 -> 1.13 # arch/parisc/kernel/entry.S 1.8 -> 1.9 # arch/parisc/kernel/signal32.c 1.2 -> 1.3 # security/dummy.c 1.14 -> 1.19 # drivers/i2c/Kconfig 1.3 -> 1.5 # sound/core/seq/seq_device.c 1.7 -> 1.9 # sound/isa/cs423x/cs4231_lib.c 1.10 -> 1.12 # arch/cris/drivers/Kconfig 1.1 -> 1.2 # arch/ia64/kernel/time.c 1.11 -> 1.13 # include/sound/pcm_params.h 1.5 -> 1.6 # sound/oss/dmasound/Makefile 1.5 -> 1.6 # arch/um/include/os.h 1.2 -> 1.3 # arch/arm/kernel/plx90x0.c 1.4 -> 1.5 arch/arm/common/plx90x0.c (moved) # include/linux/xfrm.h 1.2 -> 1.3 # include/asm-sparc/kmap_types.h 1.11 -> 1.12 # drivers/acpi/include/platform/acenv.h 1.13 -> 1.14 include/acpi/platform/acenv.h (moved) # drivers/isdn/hisax/l3ni1.c 1.8 -> 1.9 # net/ipv4/netfilter/Makefile 1.16 -> 1.17 # drivers/scsi/aacraid/aacraid.h 1.3 -> 1.4 # include/linux/blkdev.h 1.94 -> 1.97 # kernel/time.c 1.8 -> 1.9 # drivers/block/Kconfig 1.1 -> 1.2 # drivers/acpi/tables/tbinstal.c 1.15 -> 1.16 # arch/um/kernel/smp.c 1.5 -> 1.6 # drivers/block/nbd.c 1.47 -> 1.49 # drivers/usb/serial/safe_serial.c 1.12 -> 1.13 # drivers/input/joystick/iforce/Kconfig 1.1 -> 1.2 # include/asm-ia64/sn/sv.h 1.2 -> 1.3 # drivers/char/rio/cmdpkt.h 1.1 -> 1.2 # drivers/parisc/ccio-rm-dma.c 1.5 -> 1.6 # drivers/video/console/Kconfig 1.15 -> 1.16 # drivers/scsi/ips.h 1.18 -> 1.22 # drivers/net/e1000/e1000_osdep.h 1.9 -> 1.10 # net/rxrpc/krxsecd.c 1.3 -> 1.4 # sound/pci/ice1712/ews.c 1.6 -> 1.7 # drivers/net/pcmcia/3c574_cs.c 1.12 -> 1.13 # net/ipv4/devinet.c 1.11 -> 1.12 # include/asm-ia64/asmmacro.h 1.3 -> 1.9 # drivers/net/rrunner.c 1.12 -> 1.13 # include/asm-ppc64/compat.h 1.5 -> 1.6 # fs/mpage.c 1.37 -> 1.39 # arch/ppc64/kernel/init_task.c 1.3 -> 1.4 # drivers/usb/core/message.c 1.18 -> 1.20 # include/asm-sparc/smp.h 1.4 -> 1.5 # drivers/net/wireless/Kconfig 1.2 -> 1.3 # arch/ia64/kernel/smpboot.c 1.24 -> 1.27 # drivers/scsi/NCR5380.c 1.11 -> 1.13 # arch/um/drivers/stdio_console.c 1.6 -> 1.7 # arch/m68k/kernel/time.c 1.5 -> 1.6 # drivers/mtd/maps/sa1100-flash.c 1.4 -> 1.5 # drivers/char/ftape/lowlevel/fdc-io.c 1.6 -> 1.7 # drivers/net/wan/Kconfig 1.2 -> 1.3 # arch/ia64/sn/io/Makefile 1.8 -> 1.9 # arch/arm/mach-tbox/Makefile 1.4 -> 1.5 # arch/um/kernel/tt/include/mode_kern.h 1.3 -> 1.5 # arch/um/kernel/skas/process_kern.c 1.2 -> 1.3 # drivers/media/Kconfig 1.2 -> 1.3 # drivers/net/wan/dscc4.c 1.31 -> 1.32 # kernel/suspend.c 1.30 -> 1.33 # drivers/scsi/scsi.h 1.54 -> 1.60 # include/linux/gfp.h 1.10 -> 1.11 # include/asm-sparc64/signal.h 1.4 -> 1.6 # arch/v850/kernel/rte_mb_a_pci.c 1.2 -> 1.3 # fs/jfs/jfs_metapage.c 1.21 -> 1.22 # include/linux/fs.h 1.213 -> 1.217 # drivers/video/sa1100fb.c 1.23 -> 1.24 # drivers/usb/misc/atmsar.c 1.3 -> 1.6 # arch/ia64/kernel/entry.S 1.29 -> 1.30 # drivers/usb/storage/usb.c 1.51 -> 1.56 # arch/i386/mm/Makefile 1.8 -> 1.9 # drivers/scsi/ini9100u.c 1.10 -> 1.12 # drivers/atm/lanai.c 1.6 -> 1.7 # fs/jfs/jfs_mount.c 1.12 -> 1.13 # arch/mips64/Makefile 1.14 -> 1.15 # fs/jfs/jfs_debug.h 1.4 -> 1.5 # arch/ia64/dig/setup.c 1.6 -> 1.7 # include/asm-alpha/topology.h 1.4 -> 1.6 # drivers/tc/Makefile 1.7 -> 1.8 # include/sound/emu10k1.h 1.9 -> 1.11 # arch/i386/kernel/entry.S 1.53 -> 1.54 # drivers/net/tokenring/Kconfig 1.3 -> 1.4 # Documentation/networking/bonding.txt 1.5 -> 1.6 # drivers/mtd/chips/Makefile 1.5 -> 1.6 # drivers/video/matrox/Makefile 1.7 -> 1.8 # net/rxrpc/internal.h 1.2 -> 1.3 # sound/core/seq/seq_queue.h 1.8 -> 1.9 # include/sound/ak4531_codec.h 1.1 -> 1.2 # include/asm-m68k/mac_psc.h 1.2 -> 1.3 # drivers/net/skfp/ecm.c 1.1 -> 1.2 # drivers/usb/image/scanner.c 1.45 -> 1.48 # arch/ppc64/defconfig 1.22 -> 1.24 # include/asm-arm/arch-ebsa110/time.h 1.5 -> 1.6 # include/asm-i386/node.h 1.2 -> 1.3 # drivers/isdn/eicon/eicon.h 1.9 -> 1.10 # arch/ia64/mm/extable.c 1.4 -> 1.6 # drivers/char/n_hdlc.c 1.9 -> 1.10 # Documentation/scsi/aic7xxx.txt 1.5 -> 1.6 # include/linux/crypto.h 1.24 -> 1.25 # Documentation/sparc/sbus_drivers.txt 1.1 -> 1.2 # arch/m68knommu/kernel/Makefile 1.3 -> 1.4 # Documentation/filesystems/proc.txt 1.11 -> 1.12 # drivers/acpi/include/actables.h 1.13 -> 1.14 include/acpi/actables.h (moved) # include/asm-arm/mach/irq.h 1.5 -> 1.6 # net/ipv6/netfilter/ip6_queue.c 1.4 -> 1.5 # sound/core/oss/pcm_plugin.c 1.4 -> 1.5 # arch/alpha/kernel/smp.c 1.30 -> 1.31 # net/irda/iriap.c 1.11 -> 1.12 # include/net/xfrm.h 1.11 -> 1.12 # drivers/net/Makefile 1.51 -> 1.53 # sound/oss/Makefile 1.20 -> 1.21 # kernel/timer.c 1.38 -> 1.40 # sound/pci/via82xx.c 1.20 -> 1.24 # drivers/net/wireless/airo_cs.c 1.5 -> 1.6 # arch/ppc/platforms/pmac_time.c 1.10 -> 1.11 # include/asm-sparc/delay.h 1.1 -> 1.2 # arch/alpha/kernel/core_titan.c 1.12 -> 1.13 # drivers/md/md.c 1.133 -> 1.134 # arch/mips64/Kconfig 1.8 -> 1.9 # arch/x86_64/ia32/Makefile 1.10 -> 1.11 # drivers/scsi/ncr53c8xx.c 1.19 -> 1.20 # sound/Makefile 1.14 -> 1.15 # arch/um/kernel/skas/include/skas.h 1.2 -> 1.3 # drivers/scsi/advansys.c 1.23 -> 1.26 # drivers/net/e100/e100.h 1.20 -> 1.21 # drivers/char/ftape/lowlevel/Makefile 1.6 -> 1.7 # drivers/scsi/inia100.c 1.16 -> 1.18 # kernel/kmod.c 1.18 -> 1.20 # drivers/net/wireless/orinoco.h 1.10 -> 1.11 # arch/ppc/ocp/Makefile 1.1 -> 1.2 # fs/jbd/transaction.c 1.23 -> 1.25 # sound/usb/usbmixer.c 1.10 -> 1.11 # fs/exportfs/Makefile 1.3 -> 1.4 # Documentation/usb/hiddev.txt 1.3 -> 1.4 # drivers/scsi/u14-34f.c 1.19 -> 1.22 # arch/ppc64/kernel/rtasd.c 1.7 -> 1.8 # arch/parisc/kernel/Makefile 1.8 -> 1.9 # include/sound/sndmagic.h 1.8 -> 1.10 # sound/isa/cs423x/cs4236_lib.c 1.4 -> 1.5 # arch/um/drivers/harddog_user.c 1.1 -> 1.2 # include/asm-ia64/uaccess.h 1.5 -> 1.8 # drivers/scsi/hosts.h 1.48 -> 1.52 # drivers/char/agp/Makefile 1.14 -> 1.15 # arch/mips/dec/Makefile 1.8 -> 1.9 # include/sound/cs46xx.h 1.10 -> 1.11 # arch/um/kernel/tt/uaccess_user.c 1.2 -> 1.3 # drivers/net/wan/lmc/lmc_main.c 1.10 -> 1.11 # drivers/base/cpu.c 1.5 -> 1.6 # drivers/isdn/i4l/Makefile 1.12 -> 1.13 # include/sound/ad1848.h 1.2 -> 1.4 # arch/cris/kernel/ptrace.c 1.9 -> 1.10 # drivers/zorro/Makefile 1.8 -> 1.9 # drivers/isdn/eicon/Makefile 1.6 -> 1.7 # net/ipv4/tcp_ipv4.c 1.40 -> 1.43 # fs/reiserfs/inode.c 1.71 -> 1.72 # include/asm-mips/signal.h 1.1 -> 1.2 # arch/i386/kernel/io_apic.c 1.40 -> 1.41 # drivers/hotplug/acpiphp_glue.c 1.4 -> 1.5 # drivers/usb/core/hcd.h 1.22 -> 1.23 # include/asm-sparc64/elf.h 1.12 -> 1.13 # fs/char_dev.c 1.6 -> 1.7 # include/asm-v850/pci.h 1.1 -> 1.2 # arch/parisc/kernel/sys_parisc32.c 1.5 -> 1.7 # include/asm-arm/io.h 1.14 -> 1.15 # sound/core/pcm_native.c 1.22 -> 1.26 # drivers/usb/media/vicam.c 1.29 -> 1.30 # sound/isa/ad1848/Makefile 1.7 -> 1.8 # sound/pci/ice1712/ice1712.c 1.6 -> 1.8 # sound/pci/rme9652/hdsp.c 1.10 -> 1.13 # include/asm-alpha/core_irongate.h 1.3 -> 1.4 # mm/filemap.c 1.173 -> 1.176 # arch/i386/kernel/edd.c 1.10.1.2 -> 1.15 # drivers/scsi/aic7xxx/Kconfig.aic7xxx 1.8 -> 1.9 # drivers/scsi/pluto.c 1.8 -> 1.9 # drivers/acpi/acpi_ksyms.c 1.19 -> 1.20 # sound/synth/emux/emux_oss.c 1.4 -> 1.5 # fs/namei.c 1.63 -> 1.64 # arch/um/kernel/frame.c 1.3 -> 1.5 # sound/isa/sb/emu8000.c 1.8 -> 1.9 # net/decnet/dn_nsp_in.c 1.6 -> 1.7 # arch/um/include/umid.h 1.1 -> 1.2 # arch/um/kernel/skas/mem_user.c 1.1 -> 1.2 # arch/mips/au1000/common/time.c 1.2 -> 1.3 # drivers/hotplug/cpqphp_ctrl.c 1.6 -> 1.8 # drivers/pci/pci.h 1.1 -> 1.2 # arch/i386/Makefile 1.41 -> 1.43 # net/socket.c 1.41 -> 1.42 # include/asm-ia64/processor.h 1.29 -> 1.30 # sound/pci/Kconfig 1.2 -> 1.4 # arch/um/include/frame.h 1.2 -> 1.3 # sound/pci/emu10k1/emuproc.c 1.6 -> 1.7 # Documentation/usb/silverlink.txt 1.1 -> 1.2 # drivers/char/synclink.c 1.23 -> 1.24 # drivers/acpi/include/acoutput.h 1.13 -> 1.14 include/acpi/acoutput.h (moved) # sound/pci/rme96.c 1.13 -> 1.15 # security/capability.c 1.11 -> 1.14 # arch/um/include/kern_util.h 1.6 -> 1.7 # arch/sparc/kernel/sys_sparc.c 1.7 -> 1.8 # drivers/scsi/aic7xxx/aic7xxx_osm.h 1.23 -> 1.28 # drivers/media/video/Makefile 1.16 -> 1.17 # arch/um/drivers/tty.c 1.2 -> 1.3 # drivers/isdn/sc/Kconfig 1.1 -> 1.2 # fs/ncpfs/sock.c 1.12 -> 1.13 # drivers/net/e1000/e1000_main.c 1.43 -> 1.46 # arch/arm/Makefile 1.32 -> 1.35 # arch/mips64/sgi-ip27/ip27-timer.c 1.4 -> 1.5 # include/sound/version.h 1.43 -> 1.50 # sound/pci/ac97/ac97_codec.c 1.22 -> 1.26 # drivers/hotplug/pci_hotplug.h 1.4 -> 1.7 # drivers/scsi/53c8xx_d.h_shipped 1.2 -> (deleted) # include/linux/sysfs.h 1.22 -> 1.23 # include/asm-sparc64/ide.h 1.13 -> 1.14 # sound/drivers/mpu401/mpu401_uart.c 1.10 -> 1.12 # fs/partitions/ldm.c 1.10 -> 1.11 # drivers/fc4/Kconfig 1.1 -> 1.2 # arch/i386/kernel/dmi_scan.c 1.25 -> 1.26 # fs/exec.c 1.63 -> 1.69 # init/do_mounts.c 1.33 -> 1.34 # fs/ext2/balloc.c 1.24 -> 1.26 # arch/mips64/kernel/Makefile 1.7 -> 1.8 # drivers/mtd/mtdblock.c 1.35 -> 1.36 # drivers/scsi/nsp32.c 1.4 -> 1.6 # fs/binfmt_som.c 1.2 -> 1.3 # drivers/net/e100/e100_proc.c 1.12 -> (deleted) # sound/core/seq/seq_instr.c 1.3 -> 1.4 # drivers/char/rio/riotty.c 1.3 -> 1.4 # drivers/acorn/scsi/fas216.c 1.12 -> 1.14 # include/asm-parisc/dma-mapping.h 1.2 -> 1.3 # net/sunrpc/clnt.c 1.29 -> 1.30 # drivers/usb/storage/transport.c 1.61 -> 1.62 # sound/pci/ice1712/Makefile 1.3 -> 1.4 # drivers/scsi/aacraid/linit.c 1.7 -> 1.8 # arch/alpha/kernel/sys_nautilus.c 1.9 -> 1.10 # include/asm-v850/signal.h 1.1 -> 1.2 # arch/ia64/kernel/perfmon_generic.h 1.1 -> 1.3 # drivers/net/pcmcia/xirc2ps_cs.c 1.12 -> 1.13 # drivers/net/pcmcia/ray_cs.c 1.13 -> 1.14 # drivers/char/ftape/zftape/zftape-init.c 1.15 -> 1.16 # sound/isa/wavefront/wavefront_synth.c 1.9 -> 1.11 # fs/eventpoll.c 1.12 -> 1.13 # arch/s390x/kernel/Makefile 1.14 -> 1.15 # drivers/s390/net/Makefile 1.9 -> 1.10 # Documentation/filesystems/ext3.txt 1.1 -> 1.2 # arch/ia64/kernel/entry.h 1.4 -> 1.5 # arch/parisc/kernel/irq.c 1.8 -> 1.10 # arch/um/drivers/slip_kern.c 1.3 -> 1.4 # drivers/char/nvram.c 1.15 -> 1.16 # drivers/acpi/tables.c 1.10 -> 1.11 # arch/ia64/kernel/irq_ia64.c 1.10 -> 1.11 # drivers/isdn/hisax/Makefile 1.21 -> 1.22 # drivers/usb/image/scanner.h 1.26 -> 1.28 # drivers/usb/storage/transport.h 1.18 -> 1.19 # drivers/serial/uart00.c 1.10 -> 1.11 # arch/m68k/mac/via.c 1.3 -> 1.4 # kernel/signal.c 1.57 -> 1.65 # arch/um/drivers/daemon_user.c 1.1 -> 1.3 # arch/sh/kernel/io.c 1.2 -> 1.3 # arch/parisc/kernel/time.c 1.4 -> 1.5 # arch/um/kernel/mem.c 1.7.2.1 -> 1.12 # drivers/acpi/acpi_bus.h 1.12 -> 1.14 include/acpi/acpi_bus.h (moved) # drivers/message/fusion/mptscsih.c 1.16 -> 1.18 # drivers/char/rtc.c 1.19 -> 1.21 # sound/pci/emu10k1/Makefile 1.5 -> 1.8 # arch/m68k/sun3x/Makefile 1.5 -> 1.6 # drivers/char/keyboard.c 1.23 -> 1.24 # drivers/scsi/atp870u.c 1.15 -> 1.17 # scripts/Makefile.modver 1.6 -> 1.11 # fs/afs/internal.h 1.2 -> 1.3 # drivers/bluetooth/Kconfig 1.1 -> 1.2 # drivers/scsi/sim710_d.h_shipped 1.3 -> (deleted) # drivers/scsi/aic7xxx/scsi_iu.h 1.1 -> 1.2 # net/netsyms.c 1.44 -> 1.46 # drivers/usb/serial/usb-serial.c 1.69 -> 1.70 # include/linux/pci_ids.h 1.78 -> 1.80 # drivers/acpi/scan.c 1.13 -> 1.14 # drivers/isdn/hisax/l3dss1.c 1.8 -> 1.9 # sound/synth/emux/emux_seq.c 1.5 -> 1.7 # drivers/scsi/aic7xxx_old.c 1.38 -> 1.42 # fs/partitions/Makefile 1.9 -> 1.10 # net/802/Makefile 1.10 -> 1.11 # sound/core/seq/oss/Makefile 1.7 -> 1.8 # sound/core/pcm_lib.c 1.12 -> 1.15 # arch/sparc/kernel/sys_sunos.c 1.20 -> 1.22 # drivers/hotplug/Kconfig 1.5 -> 1.6 # drivers/sbus/char/bbc_envctrl.c 1.2 -> 1.3 # arch/mips/ite-boards/generic/time.c 1.3 -> 1.4 # sound/pci/trident/trident_synth.c 1.3 -> 1.4 # include/asm-ia64/system.h 1.28 -> 1.31 # drivers/acpi/ac.c 1.12 -> 1.13 # include/asm-ppc/system.h 1.15 -> 1.16 # sound/core/ioctl32/ioctl32.h 1.7 -> 1.8 # include/asm-ia64/tlb.h 1.12 -> 1.13 # sound/isa/sb/Makefile 1.10 -> 1.13 # arch/mips/kernel/Makefile 1.9 -> 1.10 # sound/usb/usbquirks.h 1.7 -> 1.10 # sound/isa/es18xx.c 1.11 -> 1.13 # arch/arm/kernel/traps.c 1.21 -> 1.22 # arch/um/include/mconsole.h 1.2 -> 1.3 # sound/isa/gus/gus_pcm.c 1.6 -> 1.7 # include/asm-ppc64/signal.h 1.2 -> 1.3 # drivers/isdn/hysdn/hysdn_boot.c 1.5 -> 1.6 # arch/alpha/kernel/Makefile 1.21 -> 1.23 # drivers/char/agp/agp.h 1.37 -> 1.38 # arch/ia64/mm/init.c 1.30 -> 1.32 # drivers/acpi/utilities/utcopy.c 1.19 -> 1.20 # net/Makefile 1.18 -> 1.19 # arch/ppc/amiga/Makefile 1.8 -> 1.9 # arch/sparc64/kernel/systbls.S 1.28 -> 1.29 # sound/isa/ad1816a/Makefile 1.4 -> 1.5 # drivers/mtd/Makefile 1.9 -> 1.10 # arch/um/kernel/skas/include/uaccess.h 1.4 -> 1.5 # drivers/input/misc/Kconfig 1.2 -> 1.3 # arch/um/kernel/tt/mem.c 1.1 -> 1.2 # Documentation/networking/ip-sysctl.txt 1.13 -> 1.14 # sound/isa/gus/gus_mem.c 1.3 -> 1.5 # include/linux/usb.h 1.67 -> 1.68 # arch/um/kernel/irq_user.c 1.7 -> 1.9 # drivers/net/sis900.c 1.29 -> 1.30 # sound/isa/sb/sb_mixer.c 1.7 -> 1.9 # drivers/hotplug/cpci_hotplug_core.c 1.2 -> 1.3 # arch/um/kernel/skas/trap_user.c 1.2 -> 1.4 # arch/mips/kernel/time.c 1.6 -> 1.7 # arch/ia64/hp/zx1/hpzx1_misc.c 1.12 -> 1.13 # drivers/scsi/aacraid/aachba.c 1.6 -> 1.9 # drivers/usb/storage/protocol.h 1.4 -> 1.5 # sound/core/seq/instr/ainstr_fm.c 1.2 -> 1.3 # arch/sparc/math-emu/math.c 1.1 -> 1.2 # arch/i386/kernel/cpu/cpufreq/Makefile 1.3 -> 1.4 # include/asm-ppc64/ppc32.h 1.10 -> 1.11 # include/asm-generic/rtc.h 1.2 -> 1.3 # drivers/input/mouse/rpcmouse.c 1.11 -> 1.12 # sound/isa/sb/sb8_main.c 1.3 -> 1.4 # drivers/usb/misc/atmsar.h 1.2 -> 1.3 # fs/super.c 1.93 -> 1.95 # sound/pci/rme9652/rme9652.c 1.13 -> 1.15 # arch/ia64/hp/sim/simscsi.c 1.10 -> 1.11 # drivers/atm/Kconfig 1.1 -> 1.3 # net/sunrpc/auth_gss/Makefile 1.2 -> 1.3 # drivers/net/appletalk/Kconfig 1.2 -> 1.3 # drivers/acpi/include/actbl71.h 1.9 -> 1.10 include/acpi/actbl71.h (moved) # fs/jbd/Makefile 1.3 -> 1.4 # fs/binfmt_elf.c 1.34 -> 1.37 # arch/um/uml.lds.S 1.9.1.2 -> 1.16 # arch/i386/kernel/signal.c 1.26 -> 1.27 # mm/memory.c 1.107 -> 1.111 # drivers/net/irda/Makefile 1.13 -> 1.14 # include/sound/sb.h 1.4 -> 1.6 # drivers/isdn/hardware/avm/Makefile 1.4 -> 1.5 # arch/s390x/kernel/signal32.c 1.12 -> 1.13 # drivers/scsi/sg.c 1.45 -> 1.47 # drivers/scsi/aic7xxx/aic7xxx_core.c 1.17 -> 1.20 # drivers/usb/serial/pl2303.c 1.33 -> 1.34 # fs/jfs/super.c 1.32 -> 1.33 # arch/v850/Kconfig 1.5 -> 1.6 # drivers/cdrom/Makefile 1.4 -> 1.5 # drivers/s390/char/Makefile 1.11 -> 1.12 # arch/ia64/kernel/ia64_ksyms.c 1.18 -> 1.19 # fs/xfs/xfs_trans.c 1.2 -> 1.4 # arch/sparc64/kernel/winfixup.S 1.3 -> 1.4 # drivers/net/e1000/e1000_ethtool.c 1.17 -> 1.19 # drivers/video/console/Makefile 1.14 -> 1.15 # arch/sparc/kernel/entry.S 1.8 -> 1.10 # drivers/char/ip2/i2os.h 1.1 -> 1.2 # drivers/ide/Kconfig 1.5 -> 1.7 # drivers/fc4/Makefile 1.5 -> 1.6 # arch/um/kernel/trap_user.c 1.8 -> 1.9 # drivers/net/pcmcia/com20020_cs.c 1.5 -> 1.6 # arch/ppc/kernel/pci.c 1.21 -> 1.22 # fs/afs/cmservice.c 1.2 -> 1.3 # drivers/net/acenic.c 1.25 -> 1.26 # arch/ppc64/kernel/rtas-proc.c 1.3 -> 1.4 # drivers/net/e100/e100_main.c 1.37 -> 1.41 # include/linux/pci.h 1.60 -> 1.61 # drivers/scsi/aic7xxx/aic79xx_inline.h 1.3 -> 1.5 # sound/isa/sb/sb16_main.c 1.7 -> 1.9 # arch/um/drivers/net_kern.c 1.8 -> 1.9 # arch/ia64/kernel/mca.c 1.16 -> 1.17 # drivers/isdn/capi/Makefile 1.10 -> 1.11 # arch/ia64/kernel/iosapic.c 1.16 -> 1.18 # drivers/scsi/osst.c 1.38 -> 1.39 # arch/i386/kernel/setup.c 1.65 -> 1.67 # arch/ia64/kernel/process.c 1.21 -> 1.25 # arch/alpha/kernel/signal.c 1.14 -> 1.15 # include/asm-arm/signal.h 1.4 -> 1.5 # arch/mips/Kconfig 1.7 -> 1.8 # include/sound/pcm.h 1.9 -> 1.11 # drivers/scsi/gdth_proc.c 1.7 -> 1.11 # include/asm-sparc64/mman.h 1.3 -> 1.4 # drivers/input/touchscreen/Kconfig 1.1 -> 1.2 # net/ipv4/fib_hash.c 1.9 -> 1.10 # arch/um/drivers/ubd_kern.c 1.19.1.1 -> 1.26 # arch/um/kernel/helper.c 1.3.1.1 -> 1.8 # sound/synth/emux/Makefile 1.6 -> 1.9 # drivers/scsi/AM53C974.c 1.8 -> 1.10 # sound/i2c/tea6330t.c 1.4 -> 1.5 # include/sound/cs46xx_dsp_scb_types.h 1.1 -> 1.2 # arch/ia64/lib/memcpy_mck.S 1.2 -> 1.3 # arch/ia64/lib/memset.S 1.5 -> 1.6 # arch/um/Kconfig 1.3.1.1 -> 1.8 # drivers/serial/Makefile 1.12 -> 1.13 # arch/arm/mach-ebsa110/Makefile 1.5 -> 1.7 # arch/arm/mach-footbridge/Makefile 1.8 -> 1.9 # fs/jfs/jfs_xtree.c 1.7 -> 1.8 # arch/ia64/hp/sim/simserial.c 1.9 -> 1.10 # arch/ia64/kernel/acpi.c 1.24 -> 1.27 # drivers/mtd/maps/elan-104nc.c 1.3 -> 1.4 # include/linux/sdla_x25.h 1.2 -> 1.3 # arch/i386/kernel/time.c 1.24 -> 1.26 # arch/arm/mach-rpc/Makefile 1.4 -> 1.5 # include/linux/hugetlb.h 1.6 -> 1.10 # arch/um/kernel/skas/include/mode_kern.h 1.3 -> 1.5 # include/asm-ia64/kmap_types.h 1.3 -> 1.4 # include/asm-ppc64/kmap_types.h 1.3 -> 1.4 # arch/ia64/kernel/machvec.c 1.2 -> 1.3 # include/linux/spinlock.h 1.20 -> 1.21 # drivers/scsi/scsi_syms.c 1.24 -> 1.26 # drivers/media/video/zr36120.c 1.16 -> 1.17 # drivers/ide/pci/sis5513.c 1.9 -> 1.10 # drivers/usb/storage/isd200.c 1.26 -> 1.27 # sound/core/seq/instr/ainstr_iw.c 1.2 -> 1.3 # drivers/usb/storage/scsiglue.c 1.33.1.2 -> 1.37 # drivers/scsi/scsi_lib.c 1.61 -> 1.68 # scripts/Makefile.lib 1.10 -> 1.13 # arch/sparc64/kernel/time.c 1.19 -> 1.20 # sound/core/ioctl32/rawmidi32.c 1.7 -> 1.8 # sound/pci/ice1712/amp.c 1.1 -> 1.3 # sound/i2c/l3/uda1341.c 1.4 -> 1.5 # drivers/net/skfp/cfm.c 1.1 -> 1.2 # arch/x86_64/kernel/mtrr/Makefile 1.1 -> 1.2 # drivers/scsi/sim710.h 1.8 -> (deleted) # drivers/base/fs/Makefile 1.7 -> 1.8 # drivers/pnp/Kconfig 1.2 -> 1.3 # drivers/acpi/include/actbl.h 1.10 -> 1.12 include/acpi/actbl.h (moved) # drivers/acpi/include/acpi.h 1.6 -> 1.7 include/acpi/acpi.h (moved) # net/netlink/af_netlink.c 1.15 -> 1.16 # arch/um/drivers/ssl.c 1.6 -> 1.7 # include/asm-alpha/elf.h 1.2 -> 1.3 # include/asm-i386/mmzone.h 1.6 -> 1.7 # arch/um/os-Linux/drivers/ethertap_user.c 1.1 -> 1.2 # drivers/ide/Makefile 1.8 -> 1.9 # arch/mips64/sgi-ip22/ip22-timer.c 1.3 -> 1.4 # drivers/eisa/Makefile 1.1 -> 1.2 # drivers/usb/core/usb.c 1.113 -> 1.114 # fs/jfs/jfs_logmgr.c 1.41 -> 1.43 # include/asm-sparc/ide.h 1.12 -> 1.13 # drivers/scsi/scsi.c 1.82 -> 1.90 # arch/s390x/Makefile 1.20 -> 1.22 # arch/ppc64/kernel/traps.c 1.11 -> 1.12 # arch/um/sys-i386/fault.c 1.1 -> 1.2 # include/asm-alpha/signal.h 1.4 -> 1.5 # arch/alpha/kernel/time.c 1.12 -> 1.14 # arch/ppc64/kernel/head.S 1.19 -> 1.22 # net/irda/Kconfig 1.1 -> 1.2 # drivers/i2c/i2c-proc.c 1.13 -> 1.14 # arch/ia64/mm/hugetlbpage.c 1.4 -> 1.7 # arch/arm/mach-pxa/Makefile 1.5 -> 1.6 # fs/jfs/jfs_umount.c 1.8 -> 1.9 # arch/um/kernel/tt/Makefile 1.10 -> 1.12 # arch/ia64/tools/Makefile 1.11 -> 1.12 # drivers/acorn/scsi/acornscsi.c 1.22 -> 1.23 # drivers/acorn/scsi/arxescsi.c 1.14 -> 1.16 # crypto/cipher.c 1.10 -> 1.11 # drivers/acpi/power.c 1.13 -> 1.14 # Documentation/sysctl/kernel.txt 1.5 -> 1.6 # sound/pci/emu10k1/emufx.c 1.14 -> 1.15 # include/asm-ppc64/uaccess.h 1.4 -> 1.5 # drivers/scsi/pcmcia/qlogic_stub.c 1.9 -> 1.11 # arch/x86_64/mm/hugetlbpage.c 1.2 -> 1.5 # drivers/mca/Makefile 1.5 -> 1.6 # drivers/s390/char/sclp_tty.h 1.2 -> 1.3 # sound/isa/gus/gus_synth.c 1.4 -> 1.5 # drivers/scsi/aic7xxx/aic7xxx_reg_print.c_shipped 1.3 -> 1.4 # drivers/scsi/aic7xxx/aiclib.c 1.2 -> 1.3 # arch/um/kernel/process_kern.c 1.13 -> 1.15 # drivers/net/pcmcia/ibmtr_cs.c 1.9 -> 1.10 # arch/um/drivers/mcast_user.c 1.1 -> 1.2 # drivers/net/sk98lin/skgeinit.c 1.3 -> 1.4 # mm/oom_kill.c 1.18 -> 1.19 # include/sound/ac97_codec.h 1.13 -> 1.14 # arch/arm/mm/proc-arm926.S 1.13 -> 1.14 # drivers/scsi/aic7xxx/aic7xxx.h 1.7 -> 1.8 # drivers/acpi/resources/rscalc.c 1.13 -> 1.14 # arch/arm/Kconfig 1.7 -> 1.8 # arch/m68k/atari/hades-pci.c 1.5 -> 1.6 # net/bluetooth/rfcomm/Kconfig 1.1 -> 1.2 # arch/sparc/kernel/pcic.c 1.16 -> 1.17 # include/sound/timer.h 1.2 -> 1.4 # arch/m68k/math-emu/fp_scan.S 1.2 -> 1.3 # drivers/input/serio/Kconfig 1.5 -> 1.6 # arch/arm/kernel/setup.c 1.27 -> 1.28 # include/asm-ia64/intrinsics.h 1.1 -> 1.3 # fs/xfs/support/move.c 1.3 -> 1.4 # include/asm-m68knommu/signal.h 1.1 -> 1.2 # sound/isa/gus/interwave.c 1.8 -> 1.9 # drivers/usb/storage/scsiglue.h 1.4 -> 1.5 # include/asm-i386/apicdef.h 1.6 -> 1.7 # drivers/net/mac8390.c 1.9 -> 1.10 # drivers/usb/serial/pl2303.h 1.6 -> 1.7 # arch/um/kernel/skas/tlb.c 1.2 -> 1.5 # net/sunrpc/sched.c 1.20 -> 1.21 # include/linux/apm_bios.h 1.6 -> 1.7 # drivers/acpi/include/acmacros.h 1.18 -> 1.19 include/acpi/acmacros.h (moved) # drivers/acpi/ec.c 1.18 -> 1.19 # mm/mremap.c 1.27 -> 1.28 # arch/ppc64/Kconfig 1.9 -> 1.11 # kernel/acct.c 1.16 -> 1.17 # arch/um/kernel/tempfile.c 1.3 -> 1.4 # arch/um/kernel/skas/include/mode.h 1.1 -> 1.2 # drivers/scsi/eata_generic.h 1.3 -> 1.4 # drivers/i2c/chips/Kconfig 1.3 -> 1.4 # include/linux/sysctl.h 1.38 -> 1.39 # drivers/md/Makefile 1.10 -> 1.11 # sound/core/ioctl32/timer32.c 1.7 -> 1.8 # arch/ia64/ia32/ia32_entry.S 1.15 -> 1.18 # drivers/net/tg3.c 1.42 -> 1.58 # include/asm-sh/signal.h 1.2 -> 1.3 # include/asm-i386/memblk.h 1.2 -> 1.3 # drivers/net/pcmcia/axnet_cs.c 1.7 -> 1.8 # sound/i2c/Makefile 1.8 -> 1.9 # arch/arm/mach-clps7500/Makefile 1.4 -> 1.5 # sound/pci/ice1712/ak4524.c 1.6 -> 1.7 # include/sound/mixer_oss.h 1.5 -> 1.6 # net/ipv6/tcp_ipv6.c 1.32 -> 1.36 # drivers/net/arlan.h 1.3 -> 1.4 # arch/um/kernel/signal_kern.c 1.5.1.1 -> 1.12 # include/asm-ia64/perfmon.h 1.9 -> 1.11 # fs/Kconfig 1.17 -> 1.18 # arch/ia64/kernel/sys_ia64.c 1.18 -> 1.20 # arch/sparc64/kernel/signal.c 1.22 -> 1.24 # arch/um/drivers/Makefile 1.9 -> 1.10 # drivers/telephony/Makefile 1.4 -> 1.5 # arch/arm/mach-anakin/Makefile 1.4 -> 1.5 # include/asm-um/page.h 1.3 -> 1.4 # arch/um/kernel/tt/trap_user.c 1.1 -> 1.2 # net/ipv4/xfrm_user.c 1.6 -> 1.8 # drivers/fc4/fc.c 1.10 -> 1.11 # arch/sparc/kernel/time.c 1.11 -> 1.12 # fs/direct-io.c 1.26 -> 1.27 # drivers/pci/proc.c 1.23 -> 1.24 # drivers/char/agp/Kconfig 1.7 -> 1.8 # fs/buffer.c 1.179 -> 1.182 # arch/ia64/kernel/signal.c 1.18 -> 1.19 # fs/Makefile 1.55 -> 1.56 # drivers/media/radio/Makefile 1.8 -> 1.9 # drivers/net/wan/Makefile 1.14 -> 1.15 # drivers/block/loop.c 1.78 -> 1.80 # drivers/usb/core/hcd.c 1.52 -> 1.54 # drivers/usb/input/hid-core.c 1.46 -> 1.47 # include/sound/trident.h 1.4 -> 1.5 # net/ipv4/esp.c 1.7 -> 1.12 # fs/jffs/intrep.c 1.19 -> 1.21 # drivers/pcmcia/sa1100_trizeps.c 1.3 -> 1.4 # drivers/acpi/include/acevents.h 1.11 -> 1.12 include/acpi/acevents.h (moved) # drivers/acpi/include/actypes.h 1.19 -> 1.20 include/acpi/actypes.h (moved) # arch/ppc64/kernel/htab.c 1.28 -> 1.29 # arch/um/include/mode.h 1.1 -> 1.2 # drivers/net/sk98lin/skvpd.c 1.3 -> 1.4 # drivers/net/declance.c 1.12 -> 1.13 # net/ipv6/netfilter/Makefile 1.9 -> 1.10 # arch/cris/kernel/Makefile 1.12 -> 1.13 # arch/arm/mach-ebsa110/time.c 1.2 -> (deleted) # fs/afs/kafstimod.c 1.2 -> 1.3 # drivers/scsi/pcmcia/fdomain_stub.c 1.9 -> 1.11 # arch/m68k/Kconfig 1.8 -> 1.9 # drivers/char/tty_io.c 1.55 -> 1.56 # arch/sh/kernel/Makefile 1.9 -> 1.10 # include/sound/cs46xx_dsp_spos.h 1.7 -> 1.8 # include/asm-sparc/signal.h 1.2 -> 1.3 # drivers/mtd/chips/jedec.c 1.5 -> 1.6 # arch/ppc64/kernel/process.c 1.25 -> 1.26 # fs/proc/array.c 1.38 -> 1.41 # drivers/acpi/include/achware.h 1.10 -> 1.11 include/acpi/achware.h (moved) # fs/jfs/jfs_txnmgr.c 1.34 -> 1.37 # include/asm-arm/arch-rpc/io.h 1.5 -> 1.6 # sound/i2c/l3/Makefile 1.3 -> 1.4 # sound/pci/maestro3.c 1.13 -> 1.15 # MAINTAINERS 1.116 -> 1.117 # arch/parisc/Kconfig 1.9 -> 1.10 # sound/pci/intel8x0.c 1.21 -> 1.25 # arch/um/kernel/tt/ptproxy/proxy.c 1.4 -> 1.5 # sound/isa/es1688/es1688_lib.c 1.6 -> 1.7 # drivers/isdn/hardware/eicon/diva_didd.c 1.2 -> 1.3 # include/asm-um/ptrace-i386.h 1.1 -> 1.2 # include/asm-generic/rmap.h 1.3 -> 1.4 # arch/sparc64/math-emu/math.c 1.7 -> 1.8 # drivers/scsi/scsi_debug.c 1.25.1.1 -> 1.28 # drivers/acpi/include/actbl2.h 1.13 -> 1.14 include/acpi/actbl2.h (moved) # arch/sparc64/kernel/sys_sunos32.c 1.25 -> 1.27 # arch/ia64/ia32/sys_ia32.c 1.36 -> 1.42 # sound/core/ioctl32/pcm32.c 1.9 -> 1.10 # drivers/scsi/aic7xxx/aic79xx_osm.h 1.11 -> 1.16 # drivers/scsi/aic7xxx/aic7xxx_reg.h_shipped 1.9 -> 1.10 # drivers/acpi/include/aclocal.h 1.23 -> 1.24 include/acpi/aclocal.h (moved) # sound/pci/rme9652/Makefile 1.5 -> 1.6 # sound/core/device.c 1.8 -> 1.10 # arch/um/kernel/skas/syscall_kern.c 1.1 -> 1.2 # include/asm-s390x/signal.h 1.4 -> 1.5 # mm/mmap.c 1.63 -> 1.69 # arch/um/Makefile 1.16.1.1 -> 1.25 # net/bridge/netfilter/Makefile 1.2 -> 1.3 # net/rxrpc/Makefile 1.3 -> 1.4 # sound/pci/ac97/Makefile 1.10 -> 1.11 # arch/mips/mm/Makefile 1.6 -> 1.7 # sound/usb/usbaudio.h 1.9 -> 1.12 # drivers/media/radio/Kconfig 1.1 -> 1.2 # arch/ia64/hp/sim/simeth.c 1.3 -> 1.4 # arch/alpha/Makefile 1.21 -> 1.23 # include/asm-sparc64/compat.h 1.6 -> 1.7 # drivers/scsi/gdth.c 1.17 -> 1.20 # sound/core/timer.c 1.12 -> 1.14 # sound/drivers/opl3/opl3_seq.c 1.8 -> 1.9 # arch/um/drivers/port_user.c 1.3.1.1 -> 1.9 # mm/highmem.c 1.39 -> 1.40 # arch/s390x/kernel/signal.c 1.15 -> 1.16 # arch/um/kernel/time_kern.c 1.5 -> 1.8 # arch/um/include/irq_user.h 1.2 -> 1.3 # net/unix/af_unix.c 1.34 -> 1.35 # scripts/ver_linux 1.7 -> 1.8 # fs/read_write.c 1.25 -> 1.28 # include/linux/time.h 1.7 -> 1.8 # mm/Makefile 1.21 -> 1.23 # fs/lockd/svc.c 1.18 -> 1.19 # net/sched/sch_htb.c 1.5 -> 1.6 # arch/um/os-Linux/drivers/tuntap_kern.c 1.2 -> 1.3 # Documentation/filesystems/jfs.txt 1.3 -> 1.4 # drivers/scsi/53c8xx_u.h_shipped 1.2 -> (deleted) # arch/sparc64/kernel/sys_sparc32.c 1.59 -> 1.61 # net/irda/irnet/Kconfig 1.1 -> 1.2 # arch/um/drivers/harddog_kern.c 1.2 -> 1.3 # drivers/net/arlan.c 1.10 -> 1.12 # drivers/usb/class/cdc-acm.c 1.31 -> 1.33 # sound/isa/wavefront/wavefront_fx.c 1.6 -> 1.8 # drivers/hotplug/cpci_hotplug_pci.c 1.3 -> 1.5 # sound/pci/trident/trident_main.c 1.9 -> 1.13 # sound/isa/ad1816a/ad1816a_lib.c 1.6 -> 1.7 # arch/m68knommu/kernel/signal.c 1.3 -> 1.4 # drivers/scsi/ide-scsi.c 1.21 -> 1.23 # arch/v850/kernel/time.c 1.2 -> 1.3 # arch/um/kernel/tt/include/mode.h 1.1 -> 1.2 # include/asm-i386/unistd.h 1.22 -> 1.23 # sound/core/oss/mixer_oss.c 1.13 -> 1.15 # drivers/usb/storage/usb.h 1.23 -> 1.25 # drivers/scsi/eata_pio.c 1.10 -> 1.12 # arch/um/kernel/tt/include/uaccess.h 1.2 -> 1.3 # arch/mips/mips-boards/generic/time.c 1.4 -> 1.5 # arch/sh/Makefile 1.13 -> 1.15 # drivers/acorn/scsi/powertec.c 1.19 -> 1.21 # drivers/acpi/include/acparser.h 1.13 -> 1.14 include/acpi/acparser.h (moved) # drivers/scsi/sr_ioctl.c 1.27 -> 1.29 # net/appletalk/Makefile 1.6 -> 1.7 # fs/namespace.c 1.33 -> 1.34 # drivers/scsi/pcmcia/Kconfig 1.2 -> 1.3 # net/8021q/vlan.h 1.2 -> 1.3 # drivers/acpi/include/amlcode.h 1.14 -> 1.15 include/acpi/amlcode.h (moved) # drivers/usb/host/ohci-mem.c 1.13 -> 1.14 # drivers/usb/host/ehci-hcd.c 1.42 -> 1.43 # fs/ext2/super.c 1.43 -> 1.44 # arch/um/kernel/tt/syscall_user.c 1.1 -> 1.2 # include/asm-arm/module.h 1.3 -> 1.4 # fs/smbfs/smbiod.c 1.5 -> 1.6 # arch/um/defconfig 1.6 -> 1.7 # include/sound/asound.h 1.10 -> 1.12 # include/asm-ia64/ptrace.h 1.5 -> 1.8 # include/asm-um/module.h 1.1 -> 1.2 # drivers/net/tulip/de4x5.h 1.4 -> 1.5 # drivers/char/watchdog/Kconfig 1.3 -> 1.5 # drivers/message/fusion/Makefile 1.11 -> 1.12 # arch/ia64/sn/io/sn1/pcibr.c 1.11 -> 1.12 # drivers/scsi/pci2000.c 1.10 -> 1.12 # arch/m68knommu/kernel/time.c 1.1 -> 1.2 # sound/isa/gus/gus_mem_proc.c 1.5 -> 1.6 # fs/ext3/inode.c 1.58 -> 1.59 # arch/sparc64/mm/hugetlbpage.c 1.3 -> 1.5 # lib/zlib_deflate/Makefile 1.3 -> 1.4 # drivers/hotplug/pci_hotplug_util.c 1.6 -> (deleted) # arch/ia64/kernel/head.S 1.7 -> 1.8 # drivers/scsi/sym53c8xx.c 1.21 -> 1.23 # include/asm-i386/cpu.h 1.2 -> 1.3 # drivers/net/irda/irport.c 1.12 -> 1.13 # arch/cris/drivers/serial.c 1.9 -> 1.10 # Documentation/md.txt 1.1 -> 1.2 # arch/um/kernel/Makefile 1.16 -> 1.19 # arch/m68k/mvme16x/Makefile 1.3 -> 1.4 # include/asm-sparc64/delay.h 1.4 -> 1.5 # mm/page-writeback.c 1.54 -> 1.55 # fs/dquot.c 1.56 -> 1.58 # arch/arm/mach-sa1100/pcipool.c 1.4 -> 1.5 arch/arm/common/sa1111-pcipool.c (moved) # arch/m68k/atari/Makefile 1.5 -> 1.6 # sound/core/sound.c 1.17 -> 1.20 # drivers/scsi/qlogicpti.c 1.15 -> 1.16 # drivers/acpi/processor.c 1.27 -> 1.32 # include/net/ip.h 1.13 -> 1.14 # arch/x86_64/kernel/time.c 1.7 -> 1.10 # net/ipv4/tcp_output.c 1.19 -> 1.21 # sound/core/pcm_memory.c 1.5 -> 1.8 # sound/pci/trident/trident_memory.c 1.4 -> 1.5 # net/irda/irnet/irnet.h 1.14 -> 1.15 # sound/pci/es1938.c 1.12 -> 1.15 # fs/xfs/xfs_inode_item.c 1.5 -> 1.6 # include/asm-ia64/elf.h 1.5 -> 1.7 # security/Kconfig 1.4 -> 1.5 # sound/pci/trident/Makefile 1.4 -> 1.7 # drivers/net/arcnet/Makefile 1.5 -> 1.6 # arch/um/include/choose-mode.h 1.1 -> 1.2 # Documentation/s390/s390dbf.txt 1.2 -> 1.3 # include/asm-mips/ng1hw.h 1.1 -> 1.2 # drivers/video/aty/atyfb_base.c 1.48 -> 1.50 # arch/m68knommu/Kconfig 1.4 -> 1.5 # arch/x86_64/kernel/signal.c 1.11 -> 1.12 # sound/core/Makefile 1.22 -> 1.23 # drivers/message/i2o/Makefile 1.5 -> 1.6 # Documentation/scsi/ibmmca.txt 1.4 -> 1.6 # sound/core/seq/seq_timer.h 1.3 -> 1.4 # sound/isa/es1688/Makefile 1.4 -> 1.5 # arch/m68knommu/Makefile 1.3 -> 1.5 # include/linux/page-flags.h 1.34 -> 1.36 # arch/arm/mach-sa1100/stork.c 1.6 -> 1.7 # arch/alpha/kernel/core_irongate.c 1.8 -> 1.9 # arch/ppc64/kernel/sys_ppc32.c 1.44 -> 1.45 # arch/arm/kernel/time.c 1.12 -> 1.13 # sound/core/seq/seq_ports.c 1.7 -> 1.8 # arch/sparc/kernel/signal.c 1.18 -> 1.19 # fs/xfs/Makefile 1.8 -> 1.9 # sound/pci/es1968.c 1.14 -> 1.16 # drivers/net/fealnx.c 1.23 -> 1.24 # sound/drivers/mpu401/mpu401.c 1.6 -> 1.7 # Documentation/SubmittingDrivers 1.6 -> 1.7 # drivers/video/riva/fbdev.c 1.32 -> 1.33 # drivers/scsi/fdomain.c 1.15 -> 1.16 # arch/um/kernel/syscall_kern.c 1.5.1.1 -> 1.10 # drivers/hotplug/Makefile 1.11 -> 1.13 # arch/um/include/sysdep-i386/sigcontext.h 1.2 -> 1.3 # fs/jfs/jfs_dtree.c 1.18 -> 1.20 # sound/pci/sonicvibes.c 1.9 -> 1.12 # security/Makefile 1.4 -> 1.5 # drivers/scsi/constants.c 1.8 -> 1.10 # fs/seq_file.c 1.5 -> 1.6 # include/asm-x86_64/compat.h 1.4 -> 1.5 # arch/um/drivers/xterm_kern.c 1.3 -> 1.4 # arch/arm/mach-integrator/pci_v3.c 1.13 -> 1.15 # include/asm-ppc/kmap_types.h 1.13 -> 1.14 # sound/core/seq/instr/ainstr_gf1.c 1.2 -> 1.3 # drivers/acorn/scsi/cumana_2.c 1.20 -> 1.22 # drivers/acpi/acpi_drivers.h 1.12 -> 1.13 include/acpi/acpi_drivers.h (moved) # drivers/serial/8250_gsc.c 1.2 -> 1.3 # include/asm-i386/kmap_types.h 1.12 -> 1.13 # drivers/net/skfp/h/supern_2.h 1.1 -> 1.2 # kernel/module.c 1.51 -> 1.62 # arch/s390x/kernel/linux32.c 1.33 -> 1.34 # include/linux/security.h 1.9 -> 1.14 # drivers/usb/storage/dpcm.c 1.5 -> 1.6 # drivers/acpi/include/acdispat.h 1.11 -> 1.12 include/acpi/acdispat.h (moved) # drivers/net/e1000/e1000_proc.c 1.9 -> (deleted) # include/linux/quota.h 1.20 -> 1.21 # sound/usb/usbaudio.c 1.24 -> 1.30 # drivers/usb/serial/Kconfig 1.4 -> 1.5 # drivers/scsi/in2000.c 1.14 -> 1.16 # drivers/scsi/qlogicfc.c 1.22 -> 1.25 # include/net/sock.h 1.29 -> 1.30 # include/asm-ppc64/elf.h 1.4 -> 1.7 # include/asm-x86_64/kmap_types.h 1.6 -> 1.7 # include/asm-s390/signal.h 1.3 -> 1.4 # Documentation/scsi/aic79xx.txt 1.6 -> 1.7 # net/ipv4/sysctl_net_ipv4.c 1.6 -> 1.7 # sound/synth/emux/soundfont.c 1.3 -> 1.4 # drivers/input/power.c 1.3 -> 1.4 # arch/ia64/kernel/perfmon_mckinley.h 1.2 -> 1.5 # arch/ia64/lib/swiotlb.c 1.11 -> 1.12 # drivers/ide/pci/pdc202xx_new.c 1.9 -> 1.10 # arch/ppc64/kernel/smp.c 1.27 -> 1.28 # drivers/usb/net/Kconfig 1.2 -> 1.3 # include/asm-cris/io.h 1.6 -> 1.7 # arch/x86_64/kernel/Makefile 1.14 -> 1.15 # fs/nfs/write.c 1.37 -> 1.38 # fs/ext2/Makefile 1.6 -> 1.7 # fs/xfs/xfs_trans.h 1.3 -> 1.4 # include/asm-um/ptrace-generic.h 1.2 -> 1.3 # drivers/net/pcmcia/Kconfig 1.1 -> 1.2 # arch/um/kernel/unmap.c 1.1 -> 1.2 arch/um/kernel/tt/unmap.c (moved) # include/asm-mips64/signal.h 1.2 -> 1.3 # drivers/net/tokenring/smctr_firmware.h 1.2 -> 1.3 # arch/x86_64/mm/Makefile 1.6 -> 1.7 # Documentation/kbuild/makefiles.txt 1.5 -> 1.6 # drivers/scsi/53c7,8xx.h 1.5 -> (deleted) # include/asm-i386/pgtable.h 1.22 -> 1.24 # drivers/net/irda/Kconfig 1.2 -> 1.3 # drivers/net/hamradio/yam.c 1.11 -> 1.12 # arch/ia64/ia32/ia32_ioctl.c 1.5 -> 1.6 # drivers/acpi/include/acconfig.h 1.29 -> 1.31 include/acpi/acconfig.h (moved) # fs/nfs/nfs4proc.c 1.11 -> 1.12 # drivers/media/video/saa5249.c 1.10 -> 1.11 # arch/um/kernel/tlb.c 1.7 -> 1.8 # include/sound/info.h 1.6 -> 1.8 # net/ipv6/route.c 1.15 -> 1.16 # drivers/pcmcia/Kconfig 1.1 -> 1.2 # drivers/serial/mux.c 1.3 -> 1.4 # drivers/net/tulip/Kconfig 1.1 -> 1.2 # drivers/usb/storage/datafab.h 1.4 -> 1.5 # drivers/parisc/sba_iommu.c 1.6 -> 1.8 # arch/i386/mm/init.c 1.41 -> 1.43 # drivers/acpi/battery.c 1.13 -> 1.14 # arch/ppc/kernel/time.c 1.18 -> 1.19 # net/ipv4/tcp_minisocks.c 1.21 -> 1.22 # drivers/usb/input/Kconfig 1.2 -> 1.3 # arch/sparc/mm/sun4c.c 1.23 -> 1.24 # arch/arm/mach-sa1100/leds.h 1.6 -> 1.7 # drivers/media/video/bttv-driver.c 1.24 -> 1.25 # net/ipv6/Makefile 1.6 -> 1.7 # drivers/char/ftape/zftape/Makefile 1.4 -> 1.5 # sound/oss/i810_audio.c 1.31 -> 1.32 # sound/oss/trident.c 1.28 -> 1.29 # arch/alpha/Kconfig 1.13 -> 1.15 # arch/arm/kernel/ecard.c 1.18 -> 1.19 # arch/m68k/kernel/Makefile 1.7 -> 1.8 # fs/jfs/namei.c 1.23 -> 1.24 # drivers/s390/char/tape_char.c 1.1 -> 1.2 # drivers/block/DAC960.c 1.50 -> 1.51 # drivers/block/DAC960.h 1.16 -> 1.17 # Documentation/scsi/ChangeLog.sym53c8xx 1.4 -> 1.5 # sound/core/seq/seq_timer.c 1.7 -> 1.8 # sound/core/seq/instr/ainstr_simple.c 1.2 -> 1.3 # drivers/usb/storage/unusual_devs.h 1.23 -> 1.24 # drivers/acpi/include/platform/aclinux.h 1.16 -> 1.17 include/acpi/platform/aclinux.h (moved) # arch/um/kernel/tt/gdb_kern.c 1.1 -> 1.2 # sound/core/pcm_misc.c 1.5 -> 1.7 # arch/ia64/kernel/brl_emu.c 1.4 -> 1.5 # include/linux/module.h 1.42 -> 1.49 # arch/alpha/kernel/irq.c 1.17 -> 1.18 # mm/slab.c 1.56 -> 1.60 # include/sound/pcm_sgbuf.h 1.3 -> 1.5 # arch/um/sys-i386/bugs.c 1.2 -> 1.3 # drivers/net/skfp/h/osdef1st.h 1.1 -> 1.2 # drivers/usb/serial/ftdi_sio.c 1.40 -> 1.41 # fs/xfs/xfsidbg.c 1.17 -> 1.18 # arch/s390/kernel/signal.c 1.16 -> 1.17 # drivers/pcmcia/Makefile 1.20 -> 1.21 # arch/um/main.c 1.4 -> 1.6 # drivers/net/skfp/smt.c 1.1 -> 1.2 # arch/x86_64/Kconfig 1.12 -> 1.13 # drivers/scsi/aic7xxx/aic7xxx.seq 1.8 -> 1.9 # drivers/scsi/scsi_scan.c 1.52 -> 1.58 # sound/pci/fm801.c 1.11 -> 1.13 # arch/um/kernel/um_arch.c 1.8 -> 1.11 # kernel/sched.c 1.151 -> 1.155 # include/linux/agp_backend.h 1.22 -> 1.23 # include/asm-parisc/smp.h 1.2 -> 1.3 # arch/ppc/boot/simple/misc.c 1.9 -> 1.10 # crypto/tcrypt.c 1.20 -> 1.21 # sound/drivers/mtpav.c 1.12 -> 1.13 # sound/isa/sb/sb16.c 1.11 -> 1.12 # drivers/net/irda/sir_kthread.c 1.2 -> 1.3 # sound/core/seq/seq_queue.c 1.10 -> 1.11 # fs/jbd/recovery.c 1.8 -> 1.9 # drivers/usb/host/ehci-dbg.c 1.16 -> 1.17 # drivers/usb/host/ehci-q.c 1.42 -> 1.43 # drivers/scsi/Makefile 1.34 -> 1.37 # fs/quota_v2.c 1.8 -> 1.9 # arch/cris/lib/old_checksum.c 1.4 -> 1.5 # fs/xfs/xfs_extfree_item.c 1.1 -> 1.2 # init/Kconfig 1.8 -> 1.10 # include/linux/jbd.h 1.14 -> 1.15 # drivers/acpi/osl.c 1.21 -> 1.22 # lib/zlib_inflate/Makefile 1.3 -> 1.4 # drivers/block/Makefile 1.13 -> 1.14 # drivers/sbus/char/Makefile 1.11 -> 1.12 # include/asm-um/archparam-i386.h 1.1 -> 1.2 # include/asm-i386/pgtable-3level.h 1.8 -> 1.10 # scripts/Makefile.build 1.17 -> 1.27 # arch/um/kernel/irq.c 1.3.1.1 -> 1.6 # arch/mips/dec/time.c 1.4 -> 1.5 # drivers/char/pcmcia/Kconfig 1.1 -> 1.2 # drivers/scsi/sim710.c 1.6 -> 1.8 # arch/ia64/kernel/gate.S 1.9 -> 1.13 # drivers/scsi/dpt_i2o.c 1.20.1.1 -> 1.24 # kernel/params.c 1.3 -> 1.4 # sound/pci/ens1370.c 1.20 -> 1.24 # sound/core/rtctimer.c 1.11 -> 1.13 # include/asm-cris/signal.h 1.1 -> 1.2 # drivers/hotplug/pci_hotplug_core.c 1.31 -> 1.35 # include/asm-ppc/io.h 1.11 -> 1.12 # drivers/usb/serial/ipaq.c 1.25 -> 1.26 # sound/core/seq/instr/Makefile 1.11 -> 1.14 # drivers/base/Makefile 1.17 -> 1.18 # drivers/mtd/ftl.c 1.42 -> 1.43 # net/ipv4/netfilter/Kconfig 1.1 -> 1.2 # sound/oss/Kconfig 1.3 -> 1.4 # arch/um/kernel/tt/process_kern.c 1.4 -> 1.6 # arch/s390x/kernel/time.c 1.9 -> 1.10 # drivers/input/mouse/Kconfig 1.3 -> 1.4 # fs/sysfs/inode.c 1.78 -> 1.80 # arch/um/kernel/sys_call_table.c 1.13.1.1 -> 1.19 # arch/m68k/mac/macints.c 1.7 -> 1.8 # sound/pci/cs46xx/dsp_spos.c 1.11 -> 1.12 # drivers/cdrom/Kconfig 1.1 -> 1.2 # drivers/isdn/hysdn/Kconfig 1.1 -> 1.2 # drivers/isdn/hardware/eicon/Makefile 1.2 -> 1.3 # sound/core/seq/seq_midi.c 1.7 -> 1.8 # fs/vfat/Makefile 1.3 -> 1.4 # fs/jfs/jfs_unicode.c 1.3 -> 1.4 # arch/um/include/signal_kern.h 1.1 -> 1.2 # arch/ia64/vmlinux.lds.S 1.22 -> 1.27 # arch/i386/kernel/timers/timer_pit.c 1.7 -> 1.8 # drivers/scsi/aic7xxx/aic79xx.seq 1.3 -> 1.4 # arch/ia64/hp/common/Makefile 1.6 -> 1.7 # drivers/pnp/pnpbios/Makefile 1.2 -> 1.3 # scripts/per-cpu-check.awk 1.2 -> 1.3 # drivers/char/ftape/lowlevel/ftape-init.c 1.3 -> 1.4 # drivers/usb/host/ehci.h 1.15 -> 1.17 # sound/isa/cs423x/Makefile 1.7 -> 1.8 # drivers/net/hamradio/scc.c 1.18 -> 1.19 # arch/ia64/kernel/minstate.h 1.8 -> 1.9 # include/asm-mips64/r10kcache.h 1.2 -> 1.3 # include/asm-arm/ecard.h 1.5 -> 1.6 # drivers/char/ftape/compressor/zftape-compress.c 1.7 -> 1.8 # drivers/net/Kconfig 1.10 -> 1.12 # drivers/i2c/busses/Kconfig 1.3 -> 1.4 # arch/ppc64/kernel/pci.c 1.21 -> 1.22 # arch/um/kernel/process.c 1.7 -> 1.10 # fs/jfs/jfs_dmap.c 1.12 -> 1.13 # drivers/usb/serial/ftdi_sio.h 1.4 -> 1.5 # sound/core/oss/pcm_oss.c 1.16 -> 1.19 # drivers/scsi/eata.c 1.23 -> 1.26 # net/bluetooth/Kconfig 1.1 -> 1.2 # drivers/char/drm/Kconfig 1.1 -> 1.2 # arch/ia64/mm/discontig.c 1.1 -> 1.2 # sound/pci/nm256/nm256.c 1.11 -> 1.13 # arch/i386/kernel/acpi.c 1.17 -> 1.19 # net/llc/Makefile 1.6 -> 1.7 # drivers/s390/Kconfig 1.8 -> 1.9 # drivers/net/tokenring/tmspci.c 1.10 -> 1.11 # sound/pci/ymfpci/ymfpci_main.c 1.11 -> 1.15 # drivers/telephony/ixj_pcmcia.c 1.2 -> 1.3 # arch/ppc64/kernel/misc.S 1.41 -> 1.44 # arch/sparc64/Kconfig 1.10 -> 1.11 # drivers/acpi/thermal.c 1.17 -> 1.19 # arch/sparc/kernel/Makefile 1.13 -> 1.14 # drivers/macintosh/Makefile 1.10 -> 1.11 # arch/um/drivers/pcap_user.c 1.1 -> 1.2 # kernel/exit.c 1.80 -> 1.88 # arch/arm/mm/proc-arm922.S 1.11 -> 1.12 # net/ipv4/ah.c 1.9 -> 1.11 # include/linux/types.h 1.7 -> 1.8 # sound/oss/maestro.c 1.15 -> 1.17 # arch/alpha/kernel/process.c 1.24 -> 1.25 # arch/um/drivers/pty.c 1.3 -> 1.5 # arch/um/kernel/skas/include/skas_ptrace.h 1.1 -> 1.3 arch/um/include/skas_ptrace.h (moved) # drivers/parport/parport_gsc.c 1.7 -> 1.8 # arch/um/drivers/slip_user.c 1.2 -> 1.3 # arch/ia64/kernel/irq.c 1.16 -> 1.17 # arch/x86_64/Makefile 1.21 -> 1.22 # include/asm-x86_64/proto.h 1.5 -> 1.6 # drivers/usb/input/pid.c 1.5 -> 1.6 # net/sched/Kconfig 1.1 -> 1.2 # arch/ppc/platforms/4xx/Makefile 1.6 -> 1.7 # drivers/usb/host/uhci-hcd.c 1.29 -> 1.30 # arch/um/drivers/line.c 1.8 -> 1.12 # net/irda/Makefile 1.7 -> 1.8 # drivers/hotplug/cpqphp_nvram.c 1.6 -> 1.7 # arch/sparc64/kernel/power.c 1.8 -> 1.9 # net/ax25/Kconfig 1.1 -> 1.2 # drivers/acpi/include/acinterp.h 1.19 -> 1.20 include/acpi/acinterp.h (moved) # sound/usb/usbmidi.c 1.17 -> 1.21 # arch/arm/mach-epxa10db/Makefile 1.4 -> 1.5 # arch/um/kernel/skas/mem.c 1.1 -> 1.2 # arch/alpha/kernel/ptrace.c 1.11 -> 1.12 # sound/pci/emu10k1/memory.c 1.5 -> 1.6 # drivers/scsi/pcmcia/aha152x_stub.c 1.9 -> 1.11 # fs/hugetlbfs/inode.c 1.12 -> 1.18 # arch/ppc/kernel/Makefile 1.32 -> 1.33 # include/asm-ia64/tlbflush.h 1.6 -> 1.7 # drivers/scsi/aic7xxx_old/aic7xxx_proc.c 1.7 -> 1.8 # arch/arm/boot/compressed/head.S 1.17 -> 1.18 # fs/xfs/linux/xfs_aops.c 1.22 -> 1.23 # drivers/scsi/Kconfig 1.9 -> 1.12 # include/asm-ia64/bitops.h 1.9 -> 1.10 # sound/core/seq/Makefile 1.20 -> 1.24 # drivers/net/wireless/orinoco_cs.c 1.16 -> 1.17 # arch/arm/kernel/Makefile 1.13 -> 1.15 # arch/ia64/kernel/unaligned.c 1.8 -> 1.11 # arch/ia64/tools/print_offsets.c 1.10 -> 1.13 # arch/parisc/Makefile 1.14 -> 1.17 # drivers/media/video/stradis.c 1.12 -> 1.13 # sound/drivers/dummy.c 1.12 -> 1.13 # fs/partitions/sun.c 1.5 -> 1.6 # arch/alpha/kernel/pci_impl.h 1.9 -> 1.10 # arch/ppc64/kernel/signal32.c 1.31 -> 1.35 # drivers/pci/Makefile 1.20 -> 1.22 # net/irda/irlmp.c 1.20 -> 1.21 # arch/um/kernel/user_syms.c 1.1 -> 1.3 # arch/cris/Kconfig 1.4 -> 1.5 # arch/arm/mach-sa1100/sa1111.c 1.19 -> 1.20 arch/arm/common/sa1111.c (moved) # drivers/scsi/pci2000.h 1.5 -> 1.6 # include/asm-sparc64/kmap_types.h 1.3 -> 1.4 # Documentation/ia64/README 1.1 -> 1.2 # drivers/net/sgiseeq.c 1.12 -> 1.13 # drivers/pci/hotplug.c 1.8 -> 1.10 # arch/mips/kernel/sysirix.c 1.9 -> 1.10 # arch/m68k/Makefile 1.9 -> 1.11 # drivers/serial/Kconfig 1.4 -> 1.5 # sound/isa/gus/gus_irq.c 1.2 -> 1.3 # Documentation/Changes 1.31 -> 1.32 # drivers/acpi/namespace/nsload.c 1.15 -> 1.16 # arch/i386/mm/hugetlbpage.c 1.22 -> 1.29 # drivers/scsi/aic7xxx/aic79xx.reg 1.3 -> 1.4 # fs/msdos/Makefile 1.3 -> 1.4 # drivers/net/e100/Makefile 1.5 -> 1.6 # sound/pci/cs46xx/dsp_spos_scb_lib.c 1.10 -> 1.11 # sound/pci/ac97/ac97_patch.c 1.6 -> 1.8 # arch/um/kernel/umid.c 1.3 -> 1.5 # sound/core/seq/seq_midi_emul.c 1.3 -> 1.5 # net/sunrpc/svc.c 1.19 -> 1.20 # drivers/acpi/dispatcher/dsinit.c 1.5 -> 1.6 # drivers/acorn/char/pcf8583.c 1.6 -> 1.7 # arch/ppc64/kernel/time.c 1.15 -> 1.16 # drivers/nubus/Makefile 1.3 -> 1.4 # arch/arm/mach-iop310/Makefile 1.4 -> 1.5 # fs/xfs/xfs_bmap.c 1.5 -> 1.6 # arch/ia64/ia32/binfmt_elf32.c 1.10 -> 1.11 # drivers/media/video/Kconfig 1.2 -> 1.5 # drivers/char/ipmi/Makefile 1.1 -> 1.2 # drivers/net/arcnet/Kconfig 1.2 -> 1.3 # drivers/usb/host/ehci-mem.c 1.12 -> 1.13 # drivers/block/paride/Makefile 1.7 -> 1.8 # sound/pci/ali5451/ali5451.c 1.17 -> 1.20 # drivers/usb/host/ohci-q.c 1.33 -> 1.34 # drivers/input/Makefile 1.10 -> 1.11 # arch/ia64/kernel/perfmon.c 1.30 -> 1.35 # drivers/scsi/3w-xxxx.c 1.20 -> 1.22 # drivers/hotplug/cpqphp_pci.c 1.9 -> 1.12 # include/asm-ia64/bugs.h 1.1 -> 1.2 # include/asm-ia64/compat.h 1.5 -> 1.8 # drivers/net/ppp_generic.c 1.21 -> 1.22 # sound/core/pcm_sgbuf.c 1.6 -> 1.9 # arch/um/include/sysdep-i386/frame_user.h 1.1 -> 1.2 # drivers/net/tokenring/madgemc.c 1.9 -> 1.10 # fs/autofs4/waitq.c 1.5 -> 1.6 # arch/ia64/Kconfig 1.12 -> 1.14 # drivers/scsi/BusLogic.c 1.13 -> 1.15 # drivers/net/pcmcia/3c589_cs.c 1.12 -> 1.13 # drivers/hotplug/cpqphp_proc.c 1.5 -> 1.6 # drivers/char/Makefile 1.52 -> 1.54 # drivers/acpi/Makefile 1.26 -> 1.29 # arch/ia64/lib/Makefile 1.15 -> 1.16 # sound/pci/cs4281.c 1.18 -> 1.21 # mm/truncate.c 1.6 -> 1.8 # arch/um/kernel/skas/syscall_user.c 1.1 -> 1.2 # drivers/usb/host/Kconfig 1.2 -> 1.3 # drivers/usb/storage/Kconfig 1.1 -> 1.2 # arch/um/drivers/fd.c 1.2.1.1 -> 1.8 # net/bridge/Makefile 1.5 -> 1.6 # arch/arm/mach-ftvpci/Makefile 1.4 -> 1.5 # arch/um/kernel/tt/include/ptrace-tt.h 1.1 -> 1.2 # drivers/input/keyboard/Kconfig 1.3 -> 1.4 # arch/m68knommu/platform/68360/uCquicc/crt0_rom.S 1.1 -> 1.2 # include/sound/sb16_csp.h 1.1 -> 1.2 # drivers/video/acornfb.c 1.21 -> 1.22 # sound/core/info.c 1.18 -> 1.22 # arch/um/kernel/skas/process.c 1.3 -> 1.5 # fs/afs/kafsasyncd.c 1.2 -> 1.3 # sound/ppc/keywest.c 1.7 -> 1.8 # drivers/net/skfp/rmt.c 1.1 -> 1.2 # arch/ia64/kernel/sal.c 1.4 -> 1.5 # drivers/usb/misc/Kconfig 1.3 -> 1.4 # include/asm-sparc/mman.h 1.3 -> 1.4 # arch/ia64/kernel/traps.c 1.20 -> 1.25 # include/sound/seq_kernel.h 1.3 -> 1.4 # crypto/Makefile 1.15 -> 1.16 # arch/mips/au1000/common/Makefile 1.7 -> 1.8 # include/asm-arm/proc-armv/processor.h 1.5 -> 1.6 # include/asm-parisc/signal.h 1.1 -> 1.2 # fs/quota.c 1.11 -> 1.12 # arch/ia64/mm/fault.c 1.9 -> 1.10 # arch/s390/kernel/Makefile 1.15 -> 1.16 # arch/um/kernel/sigio_user.c 1.3 -> 1.6 # arch/um/drivers/pcap_kern.c 1.1 -> 1.2 # arch/i386/kernel/init_task.c 1.6 -> 1.7 # drivers/parport/parport_pc.c 1.31 -> 1.32 # sound/isa/ad1848/ad1848_lib.c 1.9 -> 1.12 # arch/um/drivers/hostaudio_kern.c 1.2 -> 1.3 # drivers/net/sk98lin/skxmac2.c 1.3 -> 1.4 # arch/x86_64/ia32/ia32_signal.c 1.8 -> 1.9 # drivers/video/sis/Makefile 1.7 -> 1.8 # arch/um/kernel/tt/sys-i386/sigcontext.c 1.1 -> 1.2 # drivers/net/wireless/netwave_cs.c 1.12 -> 1.13 # sound/pci/emu10k1/emu10k1_main.c 1.9 -> 1.11 # arch/um/drivers/slirp_kern.c 1.1 -> 1.2 # drivers/parport/Kconfig 1.3 -> 1.4 # drivers/usb/core/devices.c 1.19 -> 1.20 # include/asm-ppc64/topology.h 1.4 -> 1.5 # arch/arm/mach-l7200/Makefile 1.4 -> 1.5 # drivers/mtd/maps/Kconfig 1.2 -> 1.3 # arch/ppc64/kernel/module.c 1.1 -> 1.2 # arch/ppc64/kernel/Makefile 1.17 -> 1.19 # arch/parisc/kernel/signal.c 1.6 -> 1.7 # drivers/ide/pci/pdc202xx_old.c 1.9 -> 1.10 # drivers/acpi/include/platform/acgcc.h 1.14 -> 1.15 include/acpi/platform/acgcc.h (moved) # sound/isa/sb/emu8000_pcm.c 1.3 -> 1.4 # sound/isa/sb/sb16_csp.c 1.5 -> 1.6 # arch/ppc/8xx_io/Makefile 1.8 -> 1.9 # arch/ppc/kernel/signal.c 1.19 -> 1.20 # drivers/scsi/qlogicisp.c 1.15 -> 1.17 # arch/um/drivers/chan_kern.c 1.4 -> 1.5 # drivers/scsi/esp.c 1.21 -> 1.22 # arch/ppc/Kconfig 1.16 -> 1.17 # net/ipv4/ip_output.c 1.25 -> 1.26 # drivers/scsi/aic7xxx/aic79xx_seq.h_shipped 1.3 -> 1.4 # arch/ia64/kernel/ptrace.c 1.17 -> 1.18 # sound/isa/sb/sb_common.c 1.8 -> 1.9 # arch/sparc64/Makefile 1.22 -> 1.24 # include/scsi/scsi.h 1.8 -> 1.9 # drivers/ieee1394/Makefile 1.14 -> 1.15 # sound/isa/gus/Makefile 1.7 -> 1.10 # arch/m68k/mac/Makefile 1.3 -> 1.4 # drivers/parport/parport_cs.c 1.5 -> 1.6 # kernel/workqueue.c 1.3 -> 1.5 # arch/ia64/kernel/pal.S 1.5 -> 1.6 # drivers/acorn/scsi/eesox.c 1.20 -> 1.22 # fs/inode.c 1.79 -> 1.81 # include/asm-ia64/ia32.h 1.14 -> 1.17 # arch/sh/Kconfig 1.6 -> 1.7 # arch/um/os-Linux/file.c 1.5 -> 1.7 # net/bridge/br_if.c 1.5 -> 1.6 # drivers/hotplug/acpiphp.h 1.2 -> 1.4 # net/ipv4/route.c 1.37 -> 1.38 # drivers/usb/image/hpusbscsi.c 1.24 -> 1.25 # drivers/scsi/aic7xxx/aic79xx_reg.h_shipped 1.3 -> 1.4 # drivers/media/dvb/dvb-core/Makefile 1.2 -> 1.3 # sound/pci/rme32.c 1.11 -> 1.15 # drivers/acorn/scsi/fas216.h 1.3 -> 1.4 # drivers/bluetooth/bt3c_cs.c 1.6 -> 1.7 # arch/v850/kernel/mach.h 1.1 -> 1.2 # net/bluetooth/bnep/Kconfig 1.1 -> 1.2 # arch/i386/kernel/i386_ksyms.c 1.42 -> 1.43 # include/linux/slab.h 1.15 -> 1.17 # arch/ia64/kernel/Makefile 1.12 -> 1.14 # include/asm-ppc64/system.h 1.13 -> 1.16 # drivers/usb/storage/freecom.c 1.22 -> 1.23 # sound/core/ioctl32/seq32.c 1.6 -> 1.7 # drivers/base/memblk.c 1.3 -> 1.4 # include/sound/core.h 1.18 -> 1.21 # arch/parisc/kernel/syscall.S 1.5 -> 1.6 # drivers/acpi/Kconfig 1.3 -> 1.4 # drivers/scsi/sym53c8xx_2/sym_glue.h 1.7 -> 1.8 # drivers/isdn/hardware/eicon/io.h 1.1 -> 1.2 # drivers/net/hamachi.c 1.21 -> 1.22 # drivers/ide/pci/amd74xx.c 1.10 -> 1.11 # kernel/printk.c 1.21 -> 1.22 # drivers/media/radio/radio-zoltrix.c 1.9 -> 1.10 # include/asm-alpha/kmap_types.h 1.3 -> 1.4 # arch/um/os-Linux/drivers/tuntap_user.c 1.1 -> 1.2 # include/asm-arm/arch-rpc/hardware.h 1.2 -> 1.3 # arch/parisc/kernel/parisc_ksyms.c 1.6 -> 1.7 # sound/drivers/mpu401/Makefile 1.10 -> 1.11 # drivers/s390/block/Makefile 1.9 -> 1.10 # drivers/scsi/qla1280.c 1.24 -> 1.30 # arch/sparc64/kernel/sbus.c 1.10 -> 1.11 # drivers/usb/misc/speedtouch.c 1.28 -> 1.44 # arch/v850/kernel/signal.c 1.5 -> 1.6 # drivers/scsi/aic7xxx/aic7xxx_inline.h 1.6 -> 1.7 # sound/core/pcm.c 1.10 -> 1.12 # drivers/scsi/qlogicfas.c 1.16 -> 1.17 # sound/ppc/powermac.c 1.6 -> 1.8 # arch/ppc/platforms/Makefile 1.12 -> 1.13 # drivers/usb/media/usbvideo.c 1.32 -> 1.33 # arch/v850/kernel/Makefile 1.4 -> 1.5 # fs/xfs/xfs_log.c 1.8 -> 1.9 # drivers/macintosh/adb.c 1.14 -> 1.15 # drivers/scsi/53c7,8xx.scr 1.1 -> (deleted) # kernel/ptrace.c 1.23 -> 1.25 # arch/arm/mach-sa1100/Makefile 1.20 -> 1.24 # drivers/usb/core/Makefile 1.13 -> 1.14 # arch/um/kernel/init_task.c 1.2 -> 1.3 # arch/ia64/kernel/perfmon_itanium.h 1.2 -> 1.4 # fs/fs-writeback.c 1.27 -> 1.32 # arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c 1.3 -> 1.4 # sound/core/isadma.c 1.4 -> 1.6 # sound/ppc/pmac.c 1.9 -> 1.11 # arch/v850/Makefile 1.4 -> 1.5 # drivers/hotplug/ibmphp_core.c 1.15 -> 1.17 # drivers/usb/image/microtek.c 1.27 -> 1.28 # arch/arm/mach-sa1100/Kconfig 1.1 -> 1.3 # arch/parisc/kernel/traps.c 1.6 -> 1.7 # drivers/char/ip2main.c 1.21 -> 1.23 # arch/arm/mm/Makefile 1.16 -> 1.17 # arch/m68k/amiga/Makefile 1.3 -> 1.4 # arch/m68knommu/platform/68360/uCquicc/crt0_ram.S 1.1 -> 1.2 # drivers/message/fusion/Kconfig 1.1 -> 1.2 # arch/sparc64/solaris/signal.c 1.4 -> 1.5 # net/core/rtnetlink.c 1.7 -> 1.8 # arch/parisc/kernel/module.c 1.1 -> 1.2 # arch/mips/baget/Makefile 1.6 -> 1.7 # mm/pdflush.c 1.14 -> 1.15 # drivers/usb/host/hc_simple.c 1.5 -> 1.6 # Documentation/kernel-parameters.txt 1.12 -> 1.14 # arch/i386/mm/pgtable.c 1.5 -> 1.7 # net/ipv4/netfilter/ip_queue.c 1.8 -> 1.9 # arch/ia64/kernel/unwind.c 1.9 -> 1.11 # include/asm-parisc/compat.h 1.1 -> 1.2 # drivers/scsi/aic7xxx/aic7xxx_seq.h_shipped 1.9 -> 1.10 # drivers/net/wireless/Makefile 1.8 -> 1.9 # include/asm-um/pgtable.h 1.5 -> 1.6 # arch/um/kernel/frame_kern.c 1.6 -> 1.7 # drivers/scsi/sym53c8xx_2/sym_glue.c 1.10 -> 1.13 # drivers/scsi/tmscsim.c 1.14 -> 1.16 # sound/isa/sgalaxy.c 1.8 -> 1.10 # fs/xfs/xfs_log.h 1.1 -> 1.2 # (new) -> 1.1 arch/um/vmlinux.lds.S # (new) -> 1.5 arch/ia64/kernel/fsys.S # (new) -> 1.1 arch/arm/def-configs/trizeps # (new) -> 1.2 arch/i386/kernel/cpu/cpufreq/acpi.c # (new) -> 1.1 arch/um/include/uml_uaccess.h # (new) -> 1.1 include/asm-um/ucontext.h # (new) -> 1.2 Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl # (new) -> 1.2 include/asm-um/common.lds.S # (new) -> 1.2 arch/um/kernel/tt/mem_user.c # (new) -> 1.1 arch/arm/mach-sa1100/leds-hackkit.c # (new) -> 1.3 Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl # (new) -> 1.1 mm/fadvise.c # (new) -> 1.1 drivers/char/hangcheck-timer.c # (new) -> 1.1 include/acpi/processor.h # (new) -> 1.2 arch/arm/common/Makefile # (new) -> 1.2 include/linux/seqlock.h # (new) -> 1.2 arch/um/Makefile-skas # (new) -> 1.1 include/asm-um/bug.h # (new) -> 1.3 arch/um/dyn.lds.S # (new) -> 1.1 include/asm-x86_64/dma-mapping.h # (new) -> 1.3 drivers/pci/pci-sysfs.c # (new) -> 1.4 Documentation/ia64/fsys.txt # (new) -> 1.2 Documentation/sound/alsa/OSS-Emulation.txt # (new) -> 1.1 arch/ia64/scripts/check-gas-asm.S # (new) -> 1.1 arch/um/kernel/uaccess_user.c # (new) -> 1.1 arch/um/Makefile-tt # (new) -> 1.1 drivers/usb/net/Makefile.mii # (new) -> 1.1 arch/ia64/scripts/check-gas # (new) -> 1.1 include/linux/fadvise.h # (new) -> 1.1 include/asm-arm/arch-sa1100/trizeps.h # (new) -> 1.1 arch/ia64/scripts/unwcheck.sh # (new) -> 1.1 include/asm-arm/arch-sa1100/mftb2.h # (new) -> 1.1 arch/alpha/kernel/srmcons.c # (new) -> 1.1 arch/um/sys-i386/extable.c # (new) -> 1.2 arch/arm/mach-sa1100/trizeps.c # (new) -> 1.1 arch/arm/mach-sa1100/hackkit.c # (new) -> 1.1 arch/arm/def-configs/hackkit # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/01/16 torvalds@penguin.transmeta.com 1.925.6.4 # Linux v2.5.59 # -------------------------------------------- # 03/01/17 anton@samba.org 1.925.8.1 # ppc64: SO_TIMESTAMP fix from sparc64 # -------------------------------------------- # 03/01/17 anton@samba.org 1.925.8.2 # ppc64: compat layer updates from Stephen Rothwell # -------------------------------------------- # 03/01/16 scott.feldman@intel.com 1.925.6.5 # [netdrvr e100] udelay a better way # # * Bug Fix: TCO workaround after hard reset of controller to wait for TCO # traffic to settle. Workaround requires issuing a CU load base command # after hard reset, followed by a wait for scb and finally a wait for # TCO traffic bit to clear. Affects 82559s and above wired to SMBus. # -------------------------------------------- # 03/01/16 scott.feldman@intel.com 1.925.6.6 # [netdrvr e100] fix TxDescriptor bit setting # -------------------------------------------- # 03/01/16 scott.feldman@intel.com 1.925.6.7 # [netdrvr e100] standardize nic-specific stats support # # * Removed /proc/net/PRO_LAN_Adapters # * Added ethtool GSTATS support # -------------------------------------------- # 03/01/16 jgarzik@redhat.com 1.925.6.8 # [netdrvr tg3] s/spin_lock/spin_lock_irqsave/ in tg3_poll and tg3_timer # # The tg3_timer one is very likely superfluous, and will hopefully be # removed after extended testing. # -------------------------------------------- # 03/01/16 jgarzik@redhat.com 1.925.6.9 # [netdrvr tg3] Better interrupt masking # # The bcm570x chips provide a register that disables (masks) or enables # interrupts, and as a side effect, each write to this register regardless # of value clears various PCI and internal interrupt-pending flags. This # register, intr-mbox-0, provides a superset of the function provided # by the mask-pci-int and clear-pci-int bits in the misc-host-ctrl register. # # Furthermore, the documentation clearly implies use of this register, # as an indicator that the host [tg3 driver] is in its interrupt handler. # # The new tg3 logic, taking this knowledge into account, masks-and-clears # irqs using intr-mbox-0 [only] when a hard irq is received, and # unmasks-and-clears irqs at the end of tg3_poll after all NAPI events # have been exhausted. # # The old logic twiddled the misc-host-ctrl irq masking bits separately # from intr-mbox-0 bits, which was not only inconsistent but also # a few additional I/Os that were not needed. # -------------------------------------------- # 03/01/17 jgarzik@redhat.com 1.925.6.10 # [netdrvr tg3] flush irq-mask reg write before checking hw status block, # in tg3_enable_ints. # -------------------------------------------- # 03/01/17 jgarzik@redhat.com 1.925.6.11 # [netdrvr tg3] manage jumbo flag on MTU change when interface is down # -------------------------------------------- # 03/01/17 jgarzik@redhat.com 1.925.6.12 # [netdrvr e100] remove e100_proc.c. should have been in prior cset. # -------------------------------------------- # 03/01/17 anton@samba.org 1.925.9.1 # Merge samba.org:/scratch/anton/linux-2.5 # into samba.org:/scratch/anton/for-alan # -------------------------------------------- # 03/01/17 anton@samba.org 1.927 # Merge samba.org:/scratch/anton/export into samba.org:/scratch/anton/sfr # -------------------------------------------- # 03/01/17 sfr@canb.auug.org.au 1.925.10.1 # [COMPAT]: compat_{old_}sigset_t sparc64. # -------------------------------------------- # 03/01/17 shaggy@shaggy.austin.ibm.com 1.925.11.1 # Merge jfs@jfs.bkbits.net:linux-2.5 # into shaggy.austin.ibm.com:/shaggy/bk/jfs-2.5 # -------------------------------------------- # 03/01/17 Matt_Domsch@dell.com 1.925.5.3 # Merge dell.com:/home/mdomsch/bk/linux-2.5 # into dell.com:/home/mdomsch/bk/edd/linux-2.5-edd # -------------------------------------------- # 03/01/17 kai@tp1.ruhr-uni-bochum.de 1.925.12.1 # kbuild: Fix __start_SECTION, __stop_SECTION # # In a discussion with Sam Ravnborg, the following problem became apparent: # Most vmlinux.lds.S (but the ARM ones) used the following construct: # # __start___ksymtab = .; # __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { # *(__ksymtab) # } # __stop___ksymtab = .; # # However, the link will align the beginning of the section __ksymtab # according to the requirements for the input sections. If '.' (current # location counter) wasn't sufficiently aligned before, it's possible # that __ksymtab actually starts at an address after the one # __start___ksymtab points to, which will confuse the users of # __start___ksymtab badly. The fix is to follow what the ARM Makefiles # did for this case, ie # # __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { # __start___ksymtab = .; # *(__ksymtab) # __stop___ksymtab = .; # } # -------------------------------------------- # 03/01/17 jdike@uml.karaya.com 1.925.13.1 # Merged the vmlinux.lds.h changes. # -------------------------------------------- # 03/01/17 jdike@uml.karaya.com 1.925.14.1 # Merge uml.karaya.com:/home/jdike/linux/2.5/linus-2.5 # into uml.karaya.com:/home/jdike/linux/2.5/fixes-2.5 # -------------------------------------------- # 03/01/17 jdike@uml.karaya.com 1.925.15.1 # Merged the vmlinux.lds.h changes. # -------------------------------------------- # 03/01/17 jdike@uml.karaya.com 1.925.16.1 # Merge uml.karaya.com:/home/jdike/linux/2.5/linus-2.5 # into uml.karaya.com:/home/jdike/linux/2.5/skas-2.5 # -------------------------------------------- # 03/01/17 jdike@uml.karaya.com 1.925.17.1 # Merge uml.karaya.com:/home/jdike/linux/2.5/linus-2.5 # into uml.karaya.com:/home/jdike/linux/2.5/stack-2.5 # -------------------------------------------- # 03/01/17 jdike@uml.karaya.com 1.925.18.1 # Merge uml.karaya.com:/home/jdike/linux/2.5/linus-2.5 # into uml.karaya.com:/home/jdike/linux/2.5/updates-2.5 # -------------------------------------------- # 03/01/17 ink@jurassic.park.msu.ru 1.925.19.1 # [PATCH] alpha_agpgart_size # # This allows to set the AGP aperture size from command line. # Default is 64Mb. # # Ivan. # -------------------------------------------- # 03/01/17 Jeff.Wiedemeier@hp.com 1.925.19.2 # [PATCH] NODE_BALANCE_RATE (numa) # # This defines NODE_BALANCE_RATE in include/asm-alpha/topology.h. Value is # pulled from asm-generic/topology.h. # # /jeff # -------------------------------------------- # 03/01/17 agrover@groveronline.com 1.925.1.25 # Merge groveronline.com:/root/bk/linux-2.5 # into groveronline.com:/root/bk/linux-acpi # -------------------------------------------- # 03/01/17 greg@kroah.com 1.925.20.1 # Merge kroah.com:/home/greg/linux/BK/bleeding_edge-2.5 # into kroah.com:/home/greg/linux/BK/gregkh-2.5 # -------------------------------------------- # 03/01/17 gibbs@overdrive.btc.adaptec.com 1.925.4.7 # Aic7xxx and Aic79xx DV Fix: # Don't bother with DV if the device can only do async # -------------------------------------------- # 03/01/17 gibbs@overdrive.btc.adaptec.com 1.925.4.8 # Aic79xx Driver Update # Enable abort and bus device reset handlers for both legacy # and packetized connections. # -------------------------------------------- # 03/01/17 david-b@pacbell.net 1.925.20.2 # [PATCH] usb root hub strings # # Someone changed the "get string" logic to use short reads, # not long ones, a while back. That broke many root hub # string accesses (not through tools like "lsusb"!) because # that logic didn't handle short reads quite right. # -------------------------------------------- # 03/01/17 baldrick@wanadoo.fr 1.925.20.3 # [PATCH] export speedtouch usb info # # speedtouch: restore use of MODULE_DEVICE_TABLE to export usb info. There may have # been a problem with older 2.4 kernels, but there is none now. # -------------------------------------------- # 03/01/17 davidm@wailua.hpl.hp.com 1.838.49.15 # ia64: Fix ia64_fls() so it works for all possible 64-bit values. # Reported by Dan Magenheimer (note: the bug didn't affect # the existing kernel, since the possible values passed to # the routine were always "safe"). # -------------------------------------------- # 03/01/17 jdike@uml.karaya.com 1.925.18.2 # Fixed asm/modules.h to update UML to 2.5.59. # -------------------------------------------- # 03/01/17 ganesh@tuxtop.vxindia.veritas.com 1.925.20.4 # [PATCH] USB ipaq driver ids # # Added ids for the Dell Axim and Toshiba E740. # # Thanks to Ian Molton and B.I. # -------------------------------------------- # 03/01/17 shaggy@shaggy.austin.ibm.com 1.925.11.2 # JFS: replace ugly JFS debug macros with simpler ones. # # JFS has always used ugly debug macros, jFYI, jEVENT, & jERROR. I have # replaced them with simpler jfs_info(), jfs_warn(), & jfs_err(). # -------------------------------------------- # 03/01/17 gibbs@overdrive.btc.adaptec.com 1.925.4.9 # Aic7xxx Driver Update: # o Determine more conclusively that a BIOS has initialized the # adapter before using "left over BIOS settings". # o Adapt to upcoming removal of cmd->target/channel/lun/host in 2.5.X # o Fix a memory leak on driver unload. # o Enable the pci_parity command line option and default to pci parity # error detection *disabled*. There are just too many broken VIA # chipsets out there. # o Move more functionality into aiclib to share with the aic79xx driver. # o Correct a few negotiation regressions. # o Don't bother doing full DV on devices that only support async transfers. # This should fix a few more of the reported problems with DV. # # Aic79xx Driver Update # o Add abort and bus device reset handlers. # o Fix a memory leak on driver unload. # o Adapt to upcoming removal of cmd->target/channel/lun/host in 2.5.X. # o Correct a few negotiation regressions. # -------------------------------------------- # 03/01/17 gibbs@overdrive.btc.adaptec.com 1.925.4.10 # Bump aic7xxx driver version to 6.2.27. # -------------------------------------------- # 03/01/17 gibbs@overdrive.btc.adaptec.com 1.925.4.11 # Aic7xxx and Aic79xx Driver Update # Force an SDTR after a rejected WDTR if the syncrate is unkonwn. # -------------------------------------------- # 03/01/17 agrover@groveronline.com 1.925.1.26 # ACPI: Move drivers/acpi/include directory to include/acpi # -------------------------------------------- # 03/01/17 davidm@tiger.hpl.hp.com 1.838.49.16 # ia64: Add unwcheck.sh script contributed by Harish Patil. It checks # the unwind info for consistency (well, just the obvious # stuff, but it's a start). # Fix the couple of bugs that this script uncovered (and work # around one false positive). # -------------------------------------------- # 03/01/17 jdike@uml.karaya.com 1.925.13.2 # Some build changes for 2.5.59 and SMP. Also cleanup of the linker # scripts and Kconfig. # -------------------------------------------- # 03/01/17 jdike@uml.karaya.com 1.925.15.2 # Correctly check the mmap return value. # -------------------------------------------- # 03/01/17 jdike@uml.karaya.com 1.925.14.2 # Some SMP fixes from Oleg. # -------------------------------------------- # 03/01/17 bjorn_helgaas@hp.com 1.838.49.17 # [PATCH] irq cleanups # # Cleanup the irq handling macros. # -------------------------------------------- # 03/01/17 jdike@uml.karaya.com 1.925.18.3 # Some SMP fixes. # -------------------------------------------- # 03/01/17 davidm@tiger.hpl.hp.com 1.838.49.18 # ia64: Fix Makefiles so that "make clean" removes the files generated # in the tools directory. Patch by Yu, Fenghua. # -------------------------------------------- # 03/01/17 jdike@uml.karaya.com 1.925.13.3 # Fixed dyn.lds.S to include common.lds.S. # -------------------------------------------- # 03/01/17 rohit.seth@intel.com 1.838.49.19 # [PATCH] ia64: Update to hugetlb # # Please find attached a patch that brings in the support of hugetlb # inline with the ia32 tree. This removes the syscall interface and gets # the hugetlbfs support (using mmap and shmat). I might be sending you # couple of more small updates a little later. At least wanted to get # this out first. # -------------------------------------------- # 03/01/17 davidm@tiger.hpl.hp.com 1.838.49.20 # Remove last vestiges of hugepage system calls (they have been replaced by hugetlbfs). # -------------------------------------------- # 03/01/17 eranian@hpl.hp.com 1.838.49.21 # [PATCH] ia64: perfmon update # # Here is the patch. It is rather big because there is some renaming and # cleanups. This patch bring 2.5 in line with 2.4.20: perfmon-1.3 # # It adds: # - idle task exclusion # - less ctxsw overhead in system wide # - cleanups most of the inline asm # - don't use PAL anymore to determine PMU features # - added temporary hooks for custom overflow handlers (VTUNE/Oprofile) # - renaming of the perfmon init functions # # Thanks. # -------------------------------------------- # 03/01/17 kochi@hpc.bs1.fc.nec.co.jp 1.838.49.22 # [PATCH] ia64: skip _PRT entry for non-existent IOSAPICs # # On some machines that support I/O hot-plugging, # it happens that after boottime one or more IO SAPICs appear # after hot-plug event. Even in that case, ACPI _PRT entries # can exist for devices behind those IO SAPICs at boottime # for future use. # # Currently iosapic.c will give up parsing _PRT entries # once one of them hits such a non-existent IO SAPIC. # # This patch fixes the problem on 2.5 ia64 bk tree. # For 2.4, we don't have this problem now. # -------------------------------------------- # 03/01/17 alex_williamson@hp.com 1.838.49.23 # [PATCH] ia64: fix typo in ia32_support.c # # Happened to notice the attached redundancy. # -------------------------------------------- # 03/01/17 davidm@tiger.hpl.hp.com 1.838.49.24 # ia64: Don't risk running past the end of the unwind-table. Based on a patch by # Suresh Siddha. # -------------------------------------------- # 03/01/18 jdike@uml.karaya.com 1.925.15.3 # Ported a cleanup from 2.4. # -------------------------------------------- # 03/01/18 jdike@uml.karaya.com 1.925.14.3 # Ported a uml-config.h change from 2.4. # -------------------------------------------- # 03/01/18 jdike@uml.karaya.com 1.925.17.2 # Ported a cleanup from 2.4. # -------------------------------------------- # 03/01/18 jdike@uml.karaya.com 1.925.18.4 # Changed some CONFIG_* names to UML_CONFIG_* names. # -------------------------------------------- # 03/01/18 rmk@flint.arm.linux.org.uk 1.925.21.1 # [ARM] Fix printk in rpcmouse.c # # printk was missing a new line, and displaying the (fixed) IRQ number # is rather meaningless. # -------------------------------------------- # 03/01/18 rmk@flint.arm.linux.org.uk 1.925.21.2 # [ARM] Fix buffer overflow in fas216-based SCSI drivers. # # 100 characters is too small for the SCSI "info" string buffer; the # last few characters appear to get stomped on. Make the buffer 150 # characters long. # -------------------------------------------- # 03/01/18 rmk@flint.arm.linux.org.uk 1.925.21.3 # [ARM] Fix fas216-based data-phase lockups # # Ensure SCpnt->request_bufflen is initialised correctly when we # request sense information. # -------------------------------------------- # 03/01/18 rmk@flint.arm.linux.org.uk 1.925.21.4 # [ARM] Add soft-cursor support to acornfb and sa1100fb. # -------------------------------------------- # 03/01/18 rmk@flint.arm.linux.org.uk 1.925.21.5 # [ARM] Make oops dump reasonble again without kallsyms support enabled. # # print_symbol() becomes a NOP when CONFIG_KALLSYMS=n, so we loose # the new line character as well. Explicitly call printk("\n"). # -------------------------------------------- # 03/01/18 jdike@uml.karaya.com 1.925.15.4 # A bunch of minor changes ported up from 2.4. # All userspace uses of CONFIG_* have been changed to UML_CONFIG_* # to avoid conflicts with the host's config. # os_open_file now has FD_CLOEXEC support. # -------------------------------------------- # 03/01/18 jdike@uml.karaya.com 1.925.14.4 # Fixed the time locking bug. # The mconsole and switch protocols are now 64-bit clean. # Fixed some smaller bugs. # -------------------------------------------- # 03/01/18 jdike@uml.karaya.com 1.925.17.3 # Changed CONFIG_KERNEL_STACK_ORDER to UML_CONFIG_KERNEL_STACK_ORDER. # -------------------------------------------- # 03/01/18 drow@nevyn.them.org 1.925.22.1 # Tweak has_stopped_jobs for use with debugging # -------------------------------------------- # 03/01/18 jdike@uml.karaya.com 1.925.15.5 # Replaced some CONFIG_* with UML_CONFIG_*. # -------------------------------------------- # 03/01/18 jdike@uml.karaya.com 1.925.16.2 # Replaced a CONFIG_* name with a UML_CONFIG_* name. # -------------------------------------------- # 03/01/18 jdike@uml.karaya.com 1.925.14.5 # Changed some CONFIG_* symbols to UML_CONFIG_*. # -------------------------------------------- # 03/01/18 jdike@jdike.wstearns.org 1.925.23.1 # Merge jdike.wstearns.org:/home/jdike/linux/linus-2.5 # into jdike.wstearns.org:/home/jdike/linux/fixes-2.5 # -------------------------------------------- # 03/01/18 drow@nevyn.them.org 1.925.22.2 # Add PTRACE_GETSIGINFO and PTRACE_SETSIGINFO # # These new ptrace commands allow a debugger to control signals more precisely; # for instance, store a signal and deliver it later, as if it had come from the # original outside process or in response to the same faulting memory access. # -------------------------------------------- # 03/01/18 jdike@jdike.wstearns.org 1.925.24.1 # Merge jdike.wstearns.org:/home/jdike/linux/linus-2.5 # into jdike.wstearns.org:/home/jdike/linux/skas-2.5 # -------------------------------------------- # 03/01/18 jdike@jdike.wstearns.org 1.925.25.1 # Merge jdike.wstearns.org:/home/jdike/linux/linus-2.5 # into jdike.wstearns.org:/home/jdike/linux/stack-2.5 # -------------------------------------------- # 03/01/18 jdike@jdike.wstearns.org 1.925.26.1 # Merge jdike.wstearns.org:/home/jdike/linux/linus-2.5 # into jdike.wstearns.org:/home/jdike/linux/updates-2.5 # -------------------------------------------- # 03/01/18 jdike@jdike.wstearns.org 1.925.27.1 # Fixed a conflict in the linker script. # -------------------------------------------- # 03/01/18 jdike@uml.karaya.com 1.925.18.5 # Merge jdike.stearns.org:linux/updates-2.5 # into uml.karaya.com:/home/jdike/linux/2.5/updates-2.5 # -------------------------------------------- # 03/01/18 jdike@uml.karaya.com 1.925.17.4 # Merge jdike.stearns.org:linux/stack-2.5/ # into uml.karaya.com:/home/jdike/linux/2.5/stack-2.5 # -------------------------------------------- # 03/01/18 jdike@uml.karaya.com 1.925.16.3 # Merge jdike.stearns.org:linux/skas-2.5/ # into uml.karaya.com:/home/jdike/linux/2.5/skas-2.5 # -------------------------------------------- # 03/01/18 jdike@uml.karaya.com 1.925.14.6 # Merge jdike.stearns.org:linux/fixes-2.5/ # into uml.karaya.com:/home/jdike/linux/2.5/fixes-2.5 # -------------------------------------------- # 03/01/18 jdike@jdike.wstearns.org 1.925.28.1 # Fixed a conflict in the linker script. # -------------------------------------------- # 03/01/18 jdike@uml.karaya.com 1.925.13.4 # Merge # -------------------------------------------- # 03/01/18 jdike@uml.karaya.com 1.925.15.6 # Merge jdike.stearns.org:linux/cleanup-2.5/ # into uml.karaya.com:/home/jdike/linux/2.5/cleanup-2.5 # -------------------------------------------- # 03/01/19 akpm@digeo.com 1.925.10.2 # [SPARC64]: Handle unchanging _TIF_32BIT properly in SET_PERSONALITY. # -------------------------------------------- # 03/01/19 jamie@shareable.org 1.925.10.3 # [SPARC64]: Fix MAP_GROWSDOWN value, cannot be the same as MAP_LOCKED. # -------------------------------------------- # 03/01/19 jdike@uml.karaya.com 1.925.18.6 # Added vmlinux.lds.S which is now necessary for linking the vmlinux # object file. # -------------------------------------------- # 03/01/20 anton@samba.org 1.925.29.1 # ppc64: defer change of 32/64bit mode, from Andrew Morton # -------------------------------------------- # 03/01/20 anton@samba.org 1.928 # Merge samba.org:/scratch/anton/linux-2.5_ppc64 # into samba.org:/scratch/anton/sfr # -------------------------------------------- # 03/01/20 anton@samba.org 1.925.29.2 # ppc64: now make it compile # -------------------------------------------- # 03/01/20 anton@samba.org 1.929 # Merge samba.org:/scratch/anton/linux-2.5_ppc64 # into samba.org:/scratch/anton/sfr # -------------------------------------------- # 03/01/19 Jeff.Wiedemeier@hp.com 1.925.19.3 # [PATCH] mark boot_cpu online in smp_prepare_boot_cpu # # Mark the boot cpu online in smp_prepare_boot_cpu instead of # smp_prepare_cpus so that early printks (srmcons) work with alpha smp # kernels. # # /jeff # -------------------------------------------- # 03/01/20 rth@kanga.twiddle.net 1.925.19.4 # [ALPHA] Add debugging access (core and ptrace) to the # PAL unique value. Support threaded core dumps. # -------------------------------------------- # 03/01/20 rth@kanga.twiddle.net 1.925.19.5 # [ALPHA] New SRM console driver. # # From Jeff Wiedemeier: # # How about this.. This version no longer piggy backs on ttyS0 (it # actually doesn't touch any files outside arch/alpha/kernel at all). It # does use a dynamic major for the tty piece of the driver. From # userspace, /dev/console is ok for most uses, but because of the 'noctty # = 1' at tty_tio.c:1329 (in the IS_SYSCONS_DEV section) using # /dev/console cannot result in a controlling tty so some things, like # 'resize' and bash job control don't work. For those uses, however, it's # easy enough to parse /proc/devices on the way up to get the major number # and create the specific device for the tty side of the driver. # # I made a distinction in kernel options as well. "srmcons" specifically # requests the early prints (as before) and "console=srm" requests the # full driver, including the early prints. The two options can be # combined with "console=srm" behavior resulting. The other change is that # if "console=srm" is specified, I don't unregister_srm_console before # console_init any more - that only happens in the "srmcons" case. That # way preferred console selection remains stable and "console=srm" doesn't # result in the early messages being repeated when the driver # re-registers. The use of "srmcons_allowed" is also eliminated due to the # "srmcons" vs. "console=srm" distinction. # -------------------------------------------- # 03/01/20 Jeff.Wiedemeier@hp.com 1.925.19.6 # [PATCH] remove srmcons_allowed implementation from marvel # # Remove unused marvel_srmcons_allowed implementation. # # /jeff # -------------------------------------------- # 03/01/20 Jeff.Wiedemeier@hp.com 1.925.19.7 # [PATCH] use CONFIG_EARLY_PRINTK to turn off "srmcons" prints # # Use CONFIG_EARLY_PRINTK to trigger disable_early_printk() call in # console_init (tty_io.c) to turn off "srmcons" prints rather than the # existing code in time.c. # # /jeff # -------------------------------------------- # 03/01/20 agrover@groveronline.com 1.925.1.27 # ACPI: Move more headers to include/acpi, and delete an unused header. # -------------------------------------------- # 03/01/20 agrover@groveronline.com 1.925.1.28 # CPUFREQ: Break out ACPI Perf code into its own module, under cpufreq # (Dominik Brodowski) # -------------------------------------------- # 03/01/20 agrover@groveronline.com 1.925.1.29 # ACPI: acpiphp.h includes both linux/acpi.h and acpi_bus.h. Since the # former now also includes the latter, acpiphp.h only needs the one, now. # -------------------------------------------- # 03/01/20 gibbs@overdrive.btc.adaptec.com 1.925.4.12 # Aic7xxx Driver Update 6.2.28 # o Add some more DV diagnostic code # o Fix bug that cause sequencer debug code to be # downloaded always. # # Aic79xx Driver Update 1.3.0.RC2 # o Correct a bug that effectively limited DV to just ID 0. # o Add some more DV diagnostic code # o Misc code cleanups. # -------------------------------------------- # 03/01/20 agrover@groveronline.com 1.925.1.30 # ACPI: Remove include of unused header (Adrian Bunk) # -------------------------------------------- # 03/01/20 agrover@groveronline.com 1.925.1.31 # ACPI: Properly init/clean up in cpufreq/acpi (Dominik Brodowski) # -------------------------------------------- # 03/01/20 agrover@groveronline.com 1.925.1.32 # ACPI: Make proc write interfaces work (Pavel Machek) # -------------------------------------------- # 03/01/20 agrover@groveronline.com 1.925.1.33 # ACPI: This makes it possible to select method of bios restoring after S3 # resume. [=> no more ugly ifdefs] (Pavel Machek) # -------------------------------------------- # 03/01/21 baldrick@wanadoo.fr 1.925.20.5 # [PATCH] USB: trivial speedtouch changes # # speedtouch: trivial whitespace and debug message changes. # -------------------------------------------- # 03/01/21 baldrick@wanadoo.fr 1.925.20.6 # [PATCH] USB: move udsl_atm_set_mac into speedtouch probe function # # speedtouch: roll udsl_atm_set_mac into udsl_usb_probe. # -------------------------------------------- # 03/01/21 baldrick@wanadoo.fr 1.925.20.7 # [PATCH] USB: eliminate pointless dynamic allocation in speedtouch # # speedtouch: use an array for rcvbufs rather than a pointer and dynamic allocation. # -------------------------------------------- # 03/01/21 baldrick@wanadoo.fr 1.925.20.8 # [PATCH] USB: move udsl_atm_startdevice into speedtouch probe function # # speedtouch: roll udsl_atm_startdevice into udsl_usb_probe. # -------------------------------------------- # 03/01/21 baldrick@wanadoo.fr 1.925.20.9 # [PATCH] USB: rework error handling in speedtouch probe function # # speedtouch: rework udsl_usb_probe error handling (for example, handle failure of # atm_dev_register). Do some trivial cleaning up while we're at it. # -------------------------------------------- # 03/01/21 baldrick@wanadoo.fr 1.925.20.10 # [PATCH] USB: turn speedtouch micro race into a nano race # # speedtouch: turn a micro race into a nano race. The race is that an ATM device can # be used the moment atm_dev_register returns, but you only get to fill out the # atm_dev structure after atm_dev_register returns (this is a design flaw in the # ATM layer). Thus there is a small window during which you can be called with an # incompletely set up data structure. Workaround this by causing all ATM callbacks # to fail if the dev_data field has not been set. There is still a nano race if # writing/reading the dev_data field is not atomic. Is it atomic on all architectures? # -------------------------------------------- # 03/01/21 baldrick@wanadoo.fr 1.925.20.11 # [PATCH] USB: simplify speedtouch receive urb lifecycle # # speedtouch: simplify the receive urb lifecycle: allocate them in the usb probe function, # free them on disconnect. # -------------------------------------------- # 03/01/21 henning@meier-geinitz.de 1.925.20.12 # [PATCH] USB scanner.h, scanner.c: New vendor/product ids # # This patch adds vendor/product ids for Artec, Canon, Compaq, Epson, # HP, and Microtek scanners. Further more, the device list was cleaned # up, sorted and duplicated entries have been removed. # -------------------------------------------- # 03/01/21 sri@us.ibm.com 1.925.30.1 # [IPV{4,6}]: Add ipfragok arg to ip_queue_xmit. # -------------------------------------------- # 03/01/21 davem@nuts.ninka.net 1.925.30.2 # [TCP]: Named struct initializers and tabbing fixes. # -------------------------------------------- # 03/01/21 davem@nuts.ninka.net 1.925.30.3 # [IPSEC]: Clear SKB checksum state when mangling. # -------------------------------------------- # 03/01/21 thomas@bender.thinknerd.de 1.925.30.4 # [IPSEC]: Fix some buglets in xfrm_user.c # -------------------------------------------- # 03/01/21 kaber@trash.net 1.925.30.5 # [PPP]: Handle filtering drops correctly. # -------------------------------------------- # 03/01/21 Jeff.Wiedemeier@hp.com 1.925.19.8 # [PATCH] fix /proc/interrupts on smp alpha kernels # # alpha show_interrupts was using irq as the cpu index and cpu as the irq # index fpr the kstat_cpu(cpu).irqs[irq] lookup. # # /jeff # -------------------------------------------- # 03/01/21 agrover@groveronline.com 1.925.1.34 # ACPI: Handle P_BLK lengths shorter than 6 more gracefully # -------------------------------------------- # 03/01/21 davidm@tiger.hpl.hp.com 1.925.31.1 # ia64: Merge with 2.5.59. # -------------------------------------------- # 03/01/21 Matt_Domsch@dell.com 1.925.5.4 # EDD: until SCSI layer sysfs is fixed, don't use it for raw_data either. # -------------------------------------------- # 03/01/21 Matt_Domsch@dell.com 1.925.5.5 # EDD: don't over-allocate EDD data block # # Found by Kevin Lawton. # -------------------------------------------- # 03/01/21 sfr@canb.auug.org.au 1.925.31.2 # [PATCH] ia64: [COMPAT] Eliminate the rest of the __kernel_..._t32 typedefs # # -------------------------------------------- # 03/01/21 sfr@canb.auug.org.au 1.925.31.3 # [PATCH] ia64: [COMPAT] {get,put}_compat_timspec 5/8 # # -------------------------------------------- # 03/01/21 sfr@canb.auug.org.au 1.925.31.4 # [PATCH] ia64: [COMPAT] compat_{old_}sigset_t # # -------------------------------------------- # 03/01/21 sfr@canb.auug.org.au 1.925.31.5 # [PATCH] ia64: [COMPAT] compat_sys_sigpending and compat_sys_sigprocmask # # -------------------------------------------- # 03/01/21 davidm@tiger.hpl.hp.com 1.925.31.6 # ia64: asm-ia64/system.h: Remove include of . # -------------------------------------------- # 03/01/21 sfr@canb.auug.org.au 1.925.31.7 # [PATCH] ia64: [COMPAT] compat_sys_[f]statfs # # -------------------------------------------- # 03/01/22 gibbs@overdrive.btc.adaptec.com 1.925.4.13 # Update Aic7xxx and Aic79xx driver documentation. # -------------------------------------------- # 03/01/22 gibbs@overdrive.btc.adaptec.com 1.925.4.14 # Bump aic79xx driver version number to 1.3.0, now that it has # passed functional test. # -------------------------------------------- # 03/01/23 dougg@torque.net 1.925.32.1 # [PATCH] SAM-3 status codes # # The perverse CHECK_CONDITION in include/scsi/scsi.h seems # to have struck again (see "Can't burn DVD under 2.5.59 with # ide-cd" thread on the linux kernel list). Most users of # CHECK_CONDITION found out to their surprise that it is # shifted 1 bit (right) from those values found in the # standards. # # The attachment marks the orginal list of SCSI status codes # as deprecated and supplies defines taken from the most # recent SAM-3 draft. # -------------------------------------------- # 03/01/23 ink@jurassic.park.msu.ru 1.925.19.9 # [PATCH] nautilus update # # - make irongate_ioremap() use generic __alpha_remap_area_pages(); # - remove huge debugging printk; # - AGP remapping hardware disabled for now. Any attempt to use it # would result in corrupted memory; # - albacore (UP1500) support: # - handle differences between AMD-761 (UP1500) and AMD-751 (UP1000/1100) # chipsets, namely ECC mode/status and pci_mem registers; # - customized nautilus_init_pci() to minimize amount of system memory # consumed by PCI MMIO for 4Gb configuration. # # Ivan. # -------------------------------------------- # 03/01/23 agrover@groveronline.com 1.925.1.35 # ACPI: update to 20030122 # -------------------------------------------- # 03/01/23 adam@yggdrasil.com 1.925.32.2 # | The following changes to ide-scsi.c are a recovery of the # | changes that I had in ide-scsi.c in the stock kernel's before # | Martin Dalecki's IDE tree was reverted and a few other changes. # | # | The principal change is that each ATAPI device is a Scsi_host # | (which reflects reality), instead of having one fake Scsi_Host with # | that appears to have all of the ATAPI devices on one bus regardless of # | actual hardware topology. This way it is much easier for software to # | tell that, for example, a scsi copy command will not work between two # | ATAPI devices. More importantly, hot plugging should theoretically # | work now, since Scsi_hosts are allocated and deallocated as ATAPI # | devices are added or removed. # | # | This change eliminates the idescsi_drives[] array and the # | ide_driver_t.id field that was used to index it. # | # | The idescsi_scsi_t data structure is now allocated at # | the end of the struct Scsi_Host rather than being a separate # | memory allocation. The calculation of various private pointers # | are changed slightly as a result. # | # | Other minor nits include making all global routines # | static and adding some missing error branches in # | init_idescsi_module. # | # | I've verified that I can at least read raw data # | from a DVD-ROM with with this change. # | # | When I unload this ide-scsi module, the stock ide-scsi module # | or the stock ide-cd modules in 2.5.56, I get what appears to be the # | same kernel bad memory reference, apparently due to some generic # | device device added to drivers/ide/ide.c. It does not appear to # | be due to this patch. # | # | The patch is a net deletion of one line. # | # -------------------------------------------- # 03/01/24 warlord@mit.edu 1.925.30.6 # [IPSEC]: Block on connect for IPSEC keying. # -------------------------------------------- # 03/01/24 kai@tp1.ruhr-uni-bochum.de 1.925.12.2 # kbuild: Remove -DEXPORT_SYMTAB switch # # rusty's module rewrite removed the reference to EXPORT_SYMTAB # from linux/module.h, and it's not used anywhere else, either. # -------------------------------------------- # 03/01/24 kai@tp1.ruhr-uni-bochum.de 1.925.12.3 # kbuild: Remove obsolete CONFIG_MODVERSIONS cruft # # Though the CONFIG_MODVERSIONS option was removed with rusty's module # rewrite and the associated code broken, a lot of that code was still # living on here and there. Now it's gone for good. # -------------------------------------------- # 03/01/24 davidm@tiger.hpl.hp.com 1.925.31.8 # ia64: Sync up with 2.5.59. # Add light-weight version of set_tid_address() system call. # -------------------------------------------- # 03/01/24 kai@tp1.ruhr-uni-bochum.de 1.925.12.4 # kbuild: Add CONFIG_MODVERSIONING and __kcrctab # # This patch adds the new config option CONFIG_MODVERSIONING which will # be the new way of checking for ABI changes between kernel and module # code. # # This and the following patches are in part based on an initial # implementation by Rusty Russell and I believe some of the ideas go back # to discussions on linux-kbuild, Keith Owens and Rusty. # # though I'm not sure I think credit for the basic idea of # storing version info in sections goes to Keith Owens and Rusty. # # o Rename __gpl_ksymtab to __ksymtab_gpl since that looks more consistent # and appending _gpl instead of putting it into the middle simplifies # sharing code for EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL() # o Add CONFIG_MODVERSIONING # o If CONFIG_MODVERSIONING is set, add a section __kcrctab{,_gpl}, which # contains the ABI checksums for the exported symbols listed in # __ksymtab{,_crc} Since we don't know the checksums yet at compilation # time, just make them an unresolved symbol which gets filled in by the # linker later. # -------------------------------------------- # 03/01/24 davidm@tiger.hpl.hp.com 1.925.31.9 # ia64: More vmlinux.lds.S cleanups. # -------------------------------------------- # 03/01/24 manish@Zambeel.com 1.925.6.13 # [netdrvr tg3] add support for another 5704 board, fix up 5704 phy init # -------------------------------------------- # 03/01/24 jgarzik@redhat.com 1.925.6.14 # [netdrvr tg3] more verbose failures, during initialization # -------------------------------------------- # 03/01/24 davidm@tiger.hpl.hp.com 1.925.31.10 # ia64: Switch over to using place-relative ("ip"-relative) entries in # the exception table. # -------------------------------------------- # 03/01/24 scott.feldman@intel.com 1.925.6.15 # [netdrvr e1000] ethtool eeprom buffer dynamic allocation, # rather than large static allocation on the stack # -------------------------------------------- # 03/01/24 scott.feldman@intel.com 1.925.6.16 # [netdrvr e1000] remove /proc support (superceded by ETHTOOL_GSTATS) # -------------------------------------------- # 03/01/24 scott.feldman@intel.com 1.925.6.17 # [netdrvr e1000] add ETHTOOL_GSTATS support # -------------------------------------------- # 03/01/24 scott.feldman@intel.com 1.925.6.18 # [netdrvr e1000] TSO fixes and cleanups: # # * Bug fix: TSO s/w workaround for premature desc write-back by h/w. h/w # was indicating desc done before DMA is complete, causing resources to # be returned to OS too early. Bad things happen then. # * Bug fix: Not time-stamping descriptors for fragmented sends. Could # cause false hang-detection. # * Removed unecessary #ifdefs # -------------------------------------------- # 03/01/24 robert.olsson@data.slu.se 1.925.6.19 # [netdrvr e1000] NAPI fixes: # # * e1000_irq_disable was used to disable irqs which called # synchronize_irq which in turn caused a solid hang on SMP # systems. # -------------------------------------------- # 03/01/24 kai@tp1.ruhr-uni-bochum.de 1.925.12.5 # kbuild: Generate versions for exported symbols # # Up to now, we had a way to store the checksums associated with the # exported symbols, but they were not filled in yet. This is done # with this patch, using the linker to actually do that for us. # # The comment added with this patch explains what magic exactly is going # on. # -------------------------------------------- # 03/01/24 davidm@tiger.hpl.hp.com 1.925.31.11 # ia64: Check for acceptable version of gas before trying to build # the kernel. Old gas versions will result in buggy kernels # that will bugcheck all over the place (usually mount() is # the first one to fail). # -------------------------------------------- # 03/01/24 kai@tp1.ruhr-uni-bochum.de 1.925.12.6 # kbuild/modules: Check __vermagic for validity # # modprobe --force allows to load modules without a matching version # magic string. This invalidation is done by clearing the SHF_ALLOC # flag, so check it in the kernel. Also, clear the SHF_ALLOC flag # unconditionally, since we don't need to store the __vermagic section # in the kernel, it's only checked once at load time. # -------------------------------------------- # 03/01/24 kai@tp1.ruhr-uni-bochum.de 1.925.12.7 # kbuild/modules: Don't save the license string # # Again, the license string is only used at load time, so no need # to store it permanently in kernel memory. # -------------------------------------------- # 03/01/24 kai@tp1.ruhr-uni-bochum.de 1.925.12.8 # kbuild/modules: Track versions of exported symbols # # Store the information on the checksum alongside the rest of the # information on exported symbols. To actually use them, we need # something to check them against first, though ;) # # Also, fix some conditional debug code to actually compile. # -------------------------------------------- # 03/01/24 kai@tp1.ruhr-uni-bochum.de 1.925.12.9 # kbuild: Always link module (.ko) from associated (.o) # # For extracting the versions and finding the unresolved symbols, we # need multi-part modules to be linked together already, so this # patch separates the building of the modules as a .o file from generating # the .ko in the next step. # -------------------------------------------- # 03/01/24 kai@tp1.ruhr-uni-bochum.de 1.925.12.10 # kbuild: Don't build final .ko yet when descending with CONFIG_MODVERSIONING # # With CONFIG_MODVERSIONING, we need to record the versions of the unresolved # symbols in the final .ko, which we only know after we finished # the descending build. So we only build .o in that case. # # Also, keep track of the modules we built, the post-processing step needs # a list of all modules. Keeping track is done by touching # .tmp_versions/path/to/module.ko # -------------------------------------------- # 03/01/24 kai@tp1.ruhr-uni-bochum.de 1.925.12.11 # kbuild/modules: Record versions for unresolved symbols # # In the case of CONFIG_MODVERSIONING, the build step will only # generate preliminary .o objects, and an additional # postprocessing step is necessary to record the versions of the unresolved # symbols and add them into the final .ko # # The version information for unresolved symbols is again recorded into # a special section, "__versions", which contains an array of symbol # name strings and checksum (struct modversion_info). Size is here not # an issue, since this section will not be stored permanently in kernel # memory. # # Makefile.modver takes care of the following steps: # o Collect the version information for all exported symbols from vmlinux # and all modules which export symbols. # o For each module, generate a C file which contains the modversion # information for all unresolved symbols in that module. # o For each module, compile that C file to an object file # o Finally, link the .ko using the preliminary + the # version information above. # # The first two steps are currently done by not very efficient scripting, # so there's room for performance improvement using some helper C code. # -------------------------------------------- # 03/01/24 kai@tp1.ruhr-uni-bochum.de 1.925.12.12 # kbuild/modules: Return the index of the symbol from __find_symbol() # # We'll need that index to find the version checksum for the symbol in # a bit. # -------------------------------------------- # 03/01/24 kai@tp1.ruhr-uni-bochum.de 1.925.12.13 # kbuild/modules: Check module symbol versions on insmod # # Yeah, the final step! # # Now that we've got the checksums for the exported symbols and the # checksums of the unresolved symbols for the module we're loading, # let's compare and see. # # Again, we allow to load a module which has the version info stripped, # but taint the kernel in that case. # -------------------------------------------- # 03/01/25 rmk@flint.arm.linux.org.uk 1.925.21.6 # [ARM] Drop "alloc" flag for the .stack segment. # # Some linkers obey the linker script and make .stack unallocatable, # others obey the flags from the object files. Dropping "a" should # make the end result deterministic in all cases. # -------------------------------------------- # 03/01/25 rmk@flint.arm.linux.org.uk 1.925.21.7 # [ARM] Add one CPU device to the driver model. # # Since CPUFreq now uses the driver model, we need to register a CPU # device with the driver model. # -------------------------------------------- # 03/01/25 rmk@flint.arm.linux.org.uk 1.925.21.8 # [ARM] Kill build warnings for Integrator PCI V3 driver. # -------------------------------------------- # 03/01/25 rmk@flint.arm.linux.org.uk 1.925.21.9 # [ARM] Fix KSTK_EIP and KSTK_ESP macros # # These two macros got missed when converting from the task-struct on # stack to thread_info-struct on stack. # -------------------------------------------- # 03/01/25 rmk@flint.arm.linux.org.uk 1.925.21.10 # [ARM] Add extra IO functionality. # # Add {read,write}[bwl] functionality to Acorn RISC PC. Add # {read,write}s[bwl] functionality for all. # -------------------------------------------- # 03/01/25 kai@tp1.ruhr-uni-bochum.de 1.925.12.14 # kbuild: Add cscope support to Makefile # # We support tags and TAGS already, so... # # by Louis Zhuang # -------------------------------------------- # 03/01/25 kai@tp1.ruhr-uni-bochum.de 1.925.12.15 # kbuild: gcc-3.3 warns about 2.5.59 EXPORT_SYMBOL # # When building linux-2.5.59 with gcc-3.3 (on s390, if that matters), # I get a warning like "warning: `__ksymtab___foo' defined but # not used" each time that EXPORT_SYMBOL is used. # # by Arnd Bergmann # -------------------------------------------- # 03/01/25 kai@tp1.ruhr-uni-bochum.de 1.925.12.16 # kbuild: Move the definition of MODVERDIR # # MODVERDIR was defined in the build-only section, but it's needed for # "make mrproper" as well. # -------------------------------------------- # 03/01/26 sam@mars.ravnborg.org 1.925.33.1 # kbuild: arch{mrproper,clean} no longer mandatory # # archmrproper and archclean is declared .PHONY in top-level Makefile, # therefore they are no longer mandatory in arch/$(ARCH)/Makefile. # -------------------------------------------- # 03/01/26 sam@mars.ravnborg.org 1.925.33.2 # kbuild/all archs: Removed unused arch{clean,rproper} targets # # The recent change in the top level makefile allowed this clean-up in all # the architecture specific Makefiles. # No functional changes, just deleted the now optional targets # -------------------------------------------- # 03/01/26 rmk@flint.arm.linux.org.uk 1.925.21.11 # [ARM] Convert ecard to allow use of ioremap + {read,write}[bwl] # -------------------------------------------- # 03/01/26 jejb@mulgrave.(none) 1.925.32.3 # [SCSI] make echo scsi add-single-device x x x x > /proc/scsi/scsi work again # # Correct the logic error making it fail # -------------------------------------------- # 03/01/26 sam@mars.ravnborg.org 1.925.33.3 # kbuild: HEAD replaced with head-y # # In arch/$(ARCH)/Makefile the objects to be linked as the very first are specified with HEAD. # To make more consistent naming, and to allow smarter kbuild style declarations # HEAD is replaced with head-y. # Support for the old notaion is kept for now. # Only i386 updated. # -------------------------------------------- # 03/01/26 sam@mars.ravnborg.org 1.925.33.4 # kbuild/all archs: Replace HEAD with head-y # # Replace done for all archs except mips* and cris. # These architectures are lacking too much behind that it made sense # -------------------------------------------- # 03/01/26 sam@mars.ravnborg.org 1.925.33.5 # kbuild: Update Documentation/kbuild/makefiles.txt # # makefiles.txt brought up-to-date with the changes that has occured # in kbuild within the last couple of months. # Restructured to present relevant info earlier, and rewritten the # architecture specific section to a certain degree. # # One change in style is that makefiles used throughout the kernel tree is called # "kbuild makefiles", because they follow the kbuild syntax. # Old notation was "subdirectory makefiles". # # There is added a TODO section, if anyone feel tempted to add a bit more text. # -------------------------------------------- # 03/01/26 sam@mars.ravnborg.org 1.925.33.6 # Documentation/modules.txt: How to compile modules outside the kernel tree # # Updated documentation/modules.txt with the following: # o Default config target is menuconfig # o Documented INSTLL_MOD_PATH # o Referenced to kernel 2.4 # o How to compile modules outside the kernel tree # # There is a lot of stuff in need for updating, this is first step # -------------------------------------------- # 03/01/26 sam@mars.ravnborg.org 1.925.33.7 # kbuild: Removed Documentation/kbuild/bug-list.txt # # The bugs listed was no longer relevant. # Also updated OO-INDEX # -------------------------------------------- # 03/01/26 rmk@flint.arm.linux.org.uk 1.925.21.12 # [ARM] Update Acorn SCSI drivers # # - Add scsi devclass support. # - Convert to use ioremap and friends. # - Fix oops which can occur when driver claims interrupt, and there's # an interrupt pending - move to a two-level fas driver initialisation. # -------------------------------------------- # 03/01/26 sam@mars.ravnborg.org 1.925.33.8 # kbuild: Enable the syntax "make dir/" # # "make dir/" is used to build a subsystem without going through the # full kernel tree, neither completing the build. # This is solely useful during development, when focus is on a # single subsystem. # This is the counterpart to "make dir/module.ko" # -------------------------------------------- # 03/01/26 sam@mars.ravnborg.org 1.925.33.9 # kbuild: Made cmd_link_multi readable # # Introduced ld_flags, and separated out the common parts of link_multi # for normal and module objects. # Added a bit of a comment as well # -------------------------------------------- # 03/01/26 sam@mars.ravnborg.org 1.925.33.10 # kbuild: ld_flags used consistently in Makefile.build # -------------------------------------------- # 03/01/26 rmk@flint.arm.linux.org.uk 1.925.21.13 # [ARM] Add linux/errno.h include to allow pcf8583.c to build. # -------------------------------------------- # 03/01/27 rmk@flint.arm.linux.org.uk 1.925.21.14 # [ARM] Remove 200Hz -> 100Hz conversion for ebsa110 timer. # # We now really run the ebsa110 kernel timer at 200Hz, and convert # where necessary to 100Hz for user space. # -------------------------------------------- # 03/01/27 rmk@flint.arm.linux.org.uk 1.925.21.15 # [ARM] Include ARM architecture version in module "version" string # -------------------------------------------- # 03/01/27 petkan@users.sourceforge.net 1.925.20.13 # [PATCH] USB: pegasus & mii cset # # Some ethernet drivers other than those in .../drivers/net need generic # MII code too and this cset shows how we do it for .../drivers/usb/net; # For now only pegasus.c is using this feature, but as soon as we find # more MII compliant controllers we'll put them in Makefile.mii too. # Note: drivers which use the generic mii routines should bracket the # code with #ifdef CONFIG_MII #endif since CONFIG_MII may not be present. # See pegasus.c for more details. # -------------------------------------------- # 03/01/27 david-b@pacbell.net 1.925.20.14 # [PATCH] USB ohci-hcd, don't force SLAB_ATOMIC allocations # # This is a minor cleanup to let per-request memory allocations block, # when the caller allows (it provided the bitmask). The driver used # to work that way until something like 2.4.3; an update (a few months # back) to how the "dma_addr_t" hashes to a "struct ohci_td *" lets us # simplify things again. Another benfit: it blocks irqs for less time # on the submit path. (The ehci driver already acts this way.) # -------------------------------------------- # 03/01/27 david-b@pacbell.net 1.925.20.15 # [PATCH] USB: usbcore misc cleanup (notably for non-dma hcds) # # The support for non-dma HCDs is likely the most interesting bit here. # # - makes dma calls behave sensibly when used with host controllers # that don't use dma (including sl811). usb_buffer_map() is a nop # while scatterlist dma mappings fail (as they must). # # - make usb_sg_init() behave sensibly when used with non-dma hcs. # the urbs are initted with transfer_buffer, not transfer_dma. # this is the higher level analogue to usb_buffer_map(), so it # needs to succeed unless there's a Real Error (tm). # # - moves two compatibility inlines from ehci.h into hcd.h so # it'll be more practical to have the other hcds work in other # environments (notably lk 2.4) too # # - remove URB_TIMEOUT_KILLED flag ... no device driver tests it; # hcds don't really (uhci sets it, never reads it; sl811 doesn't # enable the path that might set it), and it's not well defined. # if any hcd needs such state, keep it in hc-private storage. # # - in usb_sg_wait(), use yield() instead of schedule() to let # other activities free resources needed to continue. (This # was noted recently by Oliver.) # -------------------------------------------- # 03/01/27 andmike@us.ibm.com 1.925.32.4 # [SCSI] fix scsi_find_device() # -------------------------------------------- # 03/01/27 perex@suse.cz 1.925.34.1 # ALSA update # - removed some 2.2 code # - PCM - fixed memory leak for 24-bit samples # - gameport cleanups (CS4231, ENS1370/1371, SonicVibes, Trident) # - VIA82xx - fixed current pointer calculation # - sound_firmware - fixed errno problem # - USB - moved out compatibility code # # -------------------------------------------- # 03/01/27 shaggy@shaggy.austin.ibm.com 1.925.11.3 # JFS: Minor update in Documentation/filesystems/jfs.txt # # linuxjfs email address is obsolete. Updating todo list # -------------------------------------------- # 03/01/27 perex@suse.cz 1.925.34.2 # ALSA update # - added DocBook documentation # - added many source comments # - simplified proc style interface (per card) # - updated PCM scatter-gather routines # - moved PM locking outside callbacks # -------------------------------------------- # 03/01/27 zaitcev@redhat.com 1.925.10.4 # [SUN PARTITION]: Advance slot properly while scanning. # -------------------------------------------- # 03/01/27 zaitcev@redhat.com 1.925.10.5 # [SPARC]: Kill smp_found_cpus declaration. # -------------------------------------------- # 03/01/27 perex@suse.cz 1.925.34.3 # ALSA update # - added documentation for OSS emulation # - CMI8330 - duplex/mixer cleanups # - via82xx - rewritten for 8233+ (multiple playback, S/PDIF, secondary capture) # - USB - quirk code update # -------------------------------------------- # 03/01/27 davidm@tiger.hpl.hp.com 1.925.31.12 # ia64: Fix typo. # -------------------------------------------- # 03/01/27 perex@suse.cz 1.925.34.4 # ALSA update # - updated programmer's documentation # - recoded PCM scatter-gather memory management # - MPU401 - cleanups # - CMI8330 - cleanups # - EMU10K1 - Audigy2 update # - ENS1371 - added surround support # - USB - added more quirks and improved PCM constraint definitions # -------------------------------------------- # 03/01/27 davem@nuts.ninka.net 1.925.30.7 # [TCP]: Add tcp_low_latency sysctl. # Currently it turns of prequeue processing, but more decisions # may be guided by it in the future. # Based upon a patch from Andi Kleen. # -------------------------------------------- # 03/01/28 vojtech@suse.cz 1.925.20.16 # [PATCH] USB: Add an entry in cdc-acm.c for devices with ACM class (some Motorola phones) # # Normally the CDC ACM devices have an subclass of 0, and the ACM subclass is # only applied to their first interface. But some have the subclass set on # the device itself, namely Motorola mobile phones. This patch takes those # devices into account. # -------------------------------------------- # 03/01/28 vojtech@suse.cz 1.925.20.17 # [PATCH] USB: additions to hid-core.c blacklist # -------------------------------------------- # 03/01/28 jejb@raven.il.steeleye.com 1.925.4.15 # Merge # -------------------------------------------- # 03/01/28 luben@splentec.com 1.838.181.3 # cmd_alloc54-3.patch [3/3] # # this patch implements the new command allocation scheme for SCSI # Core, using the slab cache and a free_list for each host for a # backup store of one command (or many). # # o The three (3) subversion means that it has been updated to use # ISA DMA and PCI DMA memory for scsi command allocation, # i.e. there's two scsi command caches now. # # o The interface is, of course, unchanged; and this is the whole # point of making this allocation scheme -- i.e. the allocator # is abstracted. # # -------------------------------------------- # 03/01/28 jejb@raven.il.steeleye.com 1.925.35.1 # Merge raven.il.steeleye.com:/home/jejb/BK/scsi-cmd-changes-old-2.5 # into raven.il.steeleye.com:/home/jejb/BK/scsi-cmd-changes-2.5 # -------------------------------------------- # 03/01/28 jejb@raven.il.steeleye.com 1.925.35.2 # Merge raven.il.steeleye.com:/home/jejb/BK/scsi-cmd-changes-2.5.54 # into raven.il.steeleye.com:/home/jejb/BK/scsi-cmd-changes-2.5 # -------------------------------------------- # 03/01/28 perex@suse.cz 1.925.34.5 # ALSA update # - fixed makefiles for sequencer modules: # when CONFIG_SND_SEQUENCER is m, then synth modules should be m, too # -------------------------------------------- # 03/01/28 jejb@raven.il.steeleye.com 1.925.4.16 # Merge raven.il.steeleye.com:/home/jejb/BK/scsi-aic-2.5 # into raven.il.steeleye.com:/home/jejb/BK/scsi-combine-2.5 # -------------------------------------------- # 03/01/28 jejb@raven.il.steeleye.com 1.925.4.17 # Merge by hand # -------------------------------------------- # 03/01/28 davem@nuts.ninka.net 1.925.10.6 # [SPARC64]: Kill references to hugepage syscalls. # -------------------------------------------- # 03/01/28 eranian@hpl.hp.com 1.925.31.13 # [PATCH] ia64: fix PSR bug in perfmon code and switch to C99 initializers # # Please apply this small patch to your 2.5.59. # It fixes the psr problem reported by the NEC guy and also cleans # up the structure intializations in the model specific files. # -------------------------------------------- # 03/01/28 arun.sharma@intel.com 1.925.31.14 # [PATCH] ia64: make hugetlb support work again # # -------------------------------------------- # 03/01/28 jejb@mulgrave.(none) 1.925.4.18 # [SCSI] Correct command leaks in the prep_fn # -------------------------------------------- # 03/01/28 eranian@hpl.hp.com 1.925.31.15 # [PATCH] ia64: fix return type of sys_perfmonctl() # # -------------------------------------------- # 03/01/28 kuznet@ms2.inr.ac.ru 1.925.30.8 # [TCP]: Do not forget data copy while collapsing retransmission queue. # -------------------------------------------- # 03/01/29 anton@samba.org 1.930 # ppc64: some small optimisations # -------------------------------------------- # 03/01/29 anton@samba.org 1.931 # ppc64: restore non rt signals, we need to verify that older 64bit glibcs dont use them # -------------------------------------------- # 03/01/29 anton@samba.org 1.932 # ppc64: Preparation work for minimal register save/restore exception paths # -------------------------------------------- # 03/01/29 anton@samba.org 1.933 # ppc64: Fix compile with CONFIG_DEBUG_KERNEL disabled, from David Altobelli # -------------------------------------------- # 03/01/29 anton@samba.org 1.934 # ppc64: rtas proc fixes from David Altobelli # -------------------------------------------- # 03/01/29 anton@samba.org 1.935 # ppc64: defconfig update # -------------------------------------------- # 03/01/29 shaggy@shaggy.austin.ibm.com 1.925.11.4 # JFS: Implement get_index_page to replace some uses of read_index_page # # A recent change added the function read_index_page to replace calls to # read_metapage() when accessing the directory index table. However, we # replaced both calls to read_metapage() and get_metapage() with the same # function, but we really need two. In addition to unnecesary disk reads, # this problem caused an oops in __get_metapage(). # -------------------------------------------- # 03/01/29 rmk@flint.arm.linux.org.uk 1.925.21.16 # [ARM PATCH] 1361/1: EPXA10DB: Correct some typos in uart00.c # # Patch from Dirk Behme # # Patch some typos in uart00.c. frame is selected with FE_MSK and for OE_MSK rds # must be used. # -------------------------------------------- # 03/01/29 rmk@flint.arm.linux.org.uk 1.925.21.17 # [ARM PATCH] 1348/1: Add support for the HackKit board # # Patch from Stefan Eletzhofer # # This patch adds basic support for the HackKit Core CPU Board. # -------------------------------------------- # 03/01/29 davidm@tiger.hpl.hp.com 1.925.31.16 # ia64: Fix ARCH_DLINFO. # -------------------------------------------- # 03/01/29 davidm@tiger.hpl.hp.com 1.925.31.17 # ia64: Add light-weight version of getppid(). Detect at boottime whether the # McKinley Erratum 9 workaround is needed and, if not, patch the workaround # bundles with NOPs. # -------------------------------------------- # 03/01/30 dougg@torque.net 1.925.32.5 # [SCSI] Add length checking to sprintf in sg # -------------------------------------------- # 03/01/31 david-b@pacbell.net 1.925.20.18 # [PATCH] USB: ehci-hcd updates # # This should apply to 2.5.59 too. It seems to get rid of some pesky # hangs, on at least some hardware, but I won't have time to test it # on either VIA version ... maybe someone else will make the time? :) # # New QH state prevents a re-activation race # - nobody can un-halt a qh before its cleanup is done # - resubmit-from-completion had this race (some usbtest cases) # as could some normal submit paths on busy endpoints (storage) # - faster controllers would trip on this more consistently # # Queues of qtds # - work harder to avoid ever modifing any qh in software # - short reads block queue advance much less often # - be more cautious with large (>~19KB) unaligned buffers # # Unlinking urbs # - if qtd unlinked is at queue head, use its latest status # (main effect is reporting bytes from partial transfers) # - another new qh state: defer qh unlink if IAA is busy # (eliminates a busy-wait loop in a rare scenario) # # Enable features to improve bus utilization # - PCI MWI ... can produce better write throughput; and by # using right cacheline size, sometimes read throughput too # - USB NAK throttle ... sometimes reduces PCI access rates # # Other # - async dump shows more funky qh+qtd states, and NAK count # - cope with with some of the sprintf wierdness # - periodic dump is usually smaller (so is that schedule) # - minor cleanups # -------------------------------------------- # 03/01/31 baldrick@wanadoo.fr 1.925.20.19 # [PATCH] USB speedtouch: add a new speedtouch encoding function # # speedtouch: add a new encoding function, atmsar_encode. Calling it amounts to doing # atmsar_encode_aal5 followed by atmsar_encode_rawcell in one fell swoop. It eliminates # the need for intermediate buffers and reduces memory movement. The following patches # use it to simplify the send logic (and get rid of those annoying little oopsen). # -------------------------------------------- # 03/01/30 davem@nuts.ninka.net 1.925.30.9 # [TCP]: In tcp_check_req, handle ACKless packets properly. # -------------------------------------------- # 03/01/31 anton@samba.org 1.936 # ppc64: Fix my overoptimisation of zeroing RESULT. Yes Linus, it # was all my fault. # -------------------------------------------- # 03/01/31 akpm@digeo.com 1.925.30.10 # [IPV4]: Kill bogus semicolon in fib_get_next. # -------------------------------------------- # 03/02/01 rmk@flint.arm.linux.org.uk 1.925.21.18 # [ARM PATCH] 1097/3: trizeps IDE support # # Patch from Guennadi Liakhovetski # # The enclosed patch includes trizeps-specific IDE code. It adds a # Trizeps-specific section to asm/arch/ide.h. The patch is built # against 2.5.44-rmk1. # -------------------------------------------- # 03/02/01 rmk@flint.arm.linux.org.uk 1.925.21.19 # [ARM PATCH] 1096/4: trizeps PCMCIA support # # Patch from Guennadi Liakhovetski # # A minor update, trizeps.h has to be included explicitely now, since # platform-specific headers are commented out in hardware.h # -------------------------------------------- # 03/02/01 rmk@flint.arm.linux.org.uk 1.925.21.20 # [ARM PATCH] 1091/3: support for trizeps board (SA1110-based) # # Patch from Guennadi Liakhovetski # # The enclosed patch includes support for the trizeps board, based on the # StrongARM-1110 CPU, machine number 74. The patch is built against # 2.5.44-rmk1. Only the core files - from arch/arm and # include/asm-arm directories. # -------------------------------------------- # 03/02/01 rmk@flint.arm.linux.org.uk 1.925.21.21 # [ARM] Make trizeps_map_io static. # -------------------------------------------- # 03/02/01 rmk@flint.arm.linux.org.uk 1.925.21.22 # [ARM] Ensure GCC uses frame pointers when we want them. # # ARM GCC 2.95 generates frame pointers by default. GCC 3.2.x seems # to require some persuasion to generate them, despite being required # for debugging. # -------------------------------------------- # 03/02/01 rmk@flint.arm.linux.org.uk 1.925.21.23 # [ARM] Add missing #endif # -------------------------------------------- # 03/02/01 rmk@flint.arm.linux.org.uk 1.925.21.24 # [ARM] Remove IRQ desc->enabled in favour of testing disable_depth # -------------------------------------------- # 03/02/01 davem@nuts.ninka.net 1.925.6.20 # [TG3]: Let chip do pseudo-header csum on rx. # -------------------------------------------- # 03/02/01 davem@nuts.ninka.net 1.925.6.21 # [TG3]: Add device IDs for 5704S/5702a3/5703a3. # -------------------------------------------- # 03/02/01 davem@nuts.ninka.net 1.925.6.22 # [TG3]: Prevent dropped frames when flow-control is enabled. # -------------------------------------------- # 03/02/01 davem@nuts.ninka.net 1.925.6.23 # [TG3]: Correct MIN_DMA and ONE_DMA settings in dma_rwctrl. # -------------------------------------------- # 03/02/01 davem@nuts.ninka.net 1.925.6.24 # [TG3]: Workaround 5701 back-to-back register write bug. # -------------------------------------------- # 03/02/01 davem@nuts.ninka.net 1.925.6.25 # [TG3]: Add workaround for third-party phy issues. # -------------------------------------------- # 03/02/01 davem@nuts.ninka.net 1.925.6.26 # [TG3]: Remove anal grc_misc_cfg board IDs check. # -------------------------------------------- # 03/02/01 davem@nuts.ninka.net 1.925.6.27 # [TG3]: Fix typos in previous changes. # -------------------------------------------- # 03/02/01 jgarzik@redhat.com 1.925.6.28 # [netdrvr tg3] bump version, tidy comments # # No code changes in this patch, just cleanup and version bump. # -------------------------------------------- # 03/02/01 scott.feldman@intel.com 1.925.6.29 # [netdrvr e100] math fixes and a cleanup: # * Use correct math to calc timeout value passed to schedule_timeout # * Change "walkaround" to "workaround" # -------------------------------------------- # 03/02/02 wriede@riede.org 1.925.32.6 # [osst] fix bugzilla 244 (SRpnt initialisation problem) # # see http://bugzilla.kernel.org/show_bug.cgi?id=244 # -------------------------------------------- # 03/02/02 torvalds@home.transmeta.com 1.925.10.7 # Merge bk://kernel.bkbits.net/davem/sparc-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/02 torvalds@home.transmeta.com 1.925.10.8 # Make threaded core-dump names use the tgid instead of the pid. Makes # sense now that we can dump all threads in one core-dump. # # Fix from MAEDA Naoaki # -------------------------------------------- # 03/02/02 torvalds@home.transmeta.com 1.925.10.9 # Atyfb_base compile fix from Andres Salomon # -------------------------------------------- # 03/02/02 torvalds@home.transmeta.com 1.925.10.10 # Merge http://linux-sound.bkbits.net/linux-sound # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/02 rmk@flint.arm.linux.org.uk 1.925.21.25 # [ARM] Add arch/arm/common # # Certain support files are shared between various ARM machine classes. # In other to sanely support these, we place the shared files in # arch/arm/common instead of the individual machine class directories. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.1 # [PATCH] Fix data loss problem due to sys_sync # # In 2.5.52 I broke sys_sync() for ext2 in subtle ways. # # sys_sync() will set mapping->dirtied_when non-zero against a clean inode. # Later, in (say) __iget(), that inode gets moved over to inode_unused or # inode_in_use. But because it has non-zero ->dirtied_when, # __mark_inode_dirty() thinks that the inode must still be on sb->s_dirty. # # But it isn't. It's on inode_in_use. It (and its pages) never get written # out and the data gets thrown away on unmount. # # The patch ceases to use ->dirtied_when as an indicator of inode dirtiness. # Not sure why I even did that :( # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.2 # [PATCH] direct-IO: fix i_size handling on ENOSPC # # When an appending O_DIRECT write hits ENOSPC we're returning a short write # which is _too_ short. The file ends up with an undersized i_size and fsck # complains. # # So update the return value with the partial result before bailing out. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.3 # [PATCH] Fix inode size accounting race # # Since Jan removed the lock_kernel()s in inode_add_bytes() and # inode_sub_bytes(), these functions have been racy. # # One problematic workload has been discovered in which concurrent writepage # and truncate on SMP quickly causes i_blocks to go negative. writepage() does # not take i_sem, and it seems that for ext2, there are no other locks in # force when inode_add_bytes() is called. # # Putting the BKL back in there is not acceptable. To fix this race I have # added a new spinlock "i_lock" to the inode. # # That lock is presently used to protect i_bytes and i_blocks. We could use it # to protect i_size as well. # # The splitting of the used disk space into i_blocks and i_bytes is silly - we # should nuke all that and just have a bare loff_t i_usedbytes. Later. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.4 # [PATCH] vmlinux fix # # Patch from: "H. J. Lu" # # Fixes a commonly-reported insmod oops. # # Move the ksymtab labels definitions inside the liker section, so they get the # right addresses. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.5 # [PATCH] Compile fix in sound/oss/maestro.c # # Patch from "Ph. Marek" # # Compile fix in sound/oss/maestro.c # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.6 # [PATCH] remove lock_kernel() from exec of setuid apps # # Patch from Manfred Spraul # # exec of setuid apps and ptrace must be synchronized, to ensure that a normal # user cannot ptrace a setuid app across exec. ptrace_attach acquires the # task_lock around the uid checks, compute_creds acquires the BLK. The patch # converts compute_creds to the task_lock. Additionally, it removes the # do_unlock variable: the task_lock is not heaviliy used, there is no need to # avoid the spinlock by adding branches. # # The patch is a cleanup patch, not a fix for a security problem: AFAICS the # sys_ptrace in every arch acquires the BKL before calling ptrace_attach. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.7 # [PATCH] properly handle too long pathnames in d_path # # Forward port of a 2.4 patch by Christoph Hellwig. # # See http://cert.uni-stuttgart.de/archive/bugtraq/2002/03/msg00384.html # for the security implications. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.8 # [PATCH] fix handling of ext2 allocation failures # # Patch from: Hugh Dickins # # For almost a year (since 2.5.4) ext2_new_block has tended to set err 0 # instead of -ENOSPC or -EIO. This manifested variously (typically depends on # what's stale in ext2_get_block's chain[4] array): sometimes __brelse free # free buffer backtraces, sometimes release_pages oops, usually # generic_make_request beyond end of device messages, followed by further ext2 # errors. # # [Insert lecture on dangers of using goto for unwind :-] # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.9 # [PATCH] ext2_new_block cleanups and fixes # # The general error logic handling in there is: # # *errp = -EFOO; # # if (some_error) # goto out; # # this is fragile and unmaintainable, because the setting of the error code is # "far away" from the site where the error was detected. # # And the code was actually wrong - we're returning ENOSPC in places where fs # metadata inconsistency was detected. We traditionally return -EIO in this # case. # # So change it all to do, effectively: # # if (some_error) { # *errp = -EFOO; # goto out; # } # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.10 # [PATCH] ext3: fix scheduling storm and lockups # # There have been sporadic sightings of ext3 causing little blips of 100,000 # context switches per second when under load. # # At the start of do_get_write_access() we have this logic: # # repeat: # lock_buffer(jh->bh); # ... # unlock_buffer(jh->bh); # ... # if (jh->j_list == BJ_Shadow) { # sleep_on_buffer(jh->bh); # goto repeat; # } # # The problem is that the unlock_buffer() will wake up anyone who is sleeping # in the sleep_on_buffer(). # # So if task A is asleep in sleep_on_buffer() and task B now runs # do_get_write_access(), task B will wake task A by accident. Task B will then # sleep on the buffer and task A will loop, will run unlock_buffer() and then # wake task B. # # This state will continue until I/O completes against the buffer and kjournal # changes jh->j_list. # # Unless task A and task B happen to both have realtime scheduling policy - if # they do then kjournald will never run. The state is never cleared and your # box locks up. # # # The fix is to not do the `goto repeat;' until the buffer has been taken of # the shadow list. So we don't go and wake up the other waiter(s) until they # can actually proceed to use the buffer. # # The patch removes the exported sleep_on_buffer() function and simply exports # an existing function which provides access to a buffer_head's waitqueue # pointer. Which is a better interface anyway, because it permits the use of # wait_event(). # # This bug was introduced introduced into 2.4.20-pre5 and was faithfully ported # up. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.11 # [PATCH] slab poison checking fix # # Spotted by Andries Brouwer. There's one place where slab is calling # check_poison_obj() but not reporting on any detected failure. # # We used to go BUG() in there. Convert it over to the kinder, gentler # slab_error() regime. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.12 # [PATCH] quota locking fix # # Quota locking fix from Jan Kara. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.13 # [PATCH] quota semaphore fix # # The second quota locking fix. Sorry, I seem to have misplaced the # changelog. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.14 # [PATCH] preempt spinlock efficiency fix # # Patch from: jak@rudolph.ccur.com (Joe Korty) # # The new, preemptable spin_lock() spins on an atomic bus-locking read/write # instead of an ordinary read, as the original spin_lock implementation did. # Perhaps that is the source of the inefficiency being seen. # # Attached sample code compiles but is untested and incomplete (present # only to illustrate the idea). # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.15 # [PATCH] Make fix sync_filesystems() actually do something # # Random semicolon makes the whole thing a no-op. # # It _did_ work. I must have broken it between testing and sending :( # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.16 # [PATCH] stack overflow checking fix # # Patch from William Lee Irwin III # # struct thread_info is shared with the stack, not struct task_struct. # False positives have been seen. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.17 # [PATCH] slab IRQ fix # # Patch from Manfred Spraul # # cache_alloc_refill() forgets to disable interrupts again on an error path. # This exposes us to slab corruption and it makes slab debugging go BUG (it # expects local irqs to be disabled). # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.18 # [PATCH] blkdev.h fixes # # Patch from William Lee Irwin III # # BLK_BOUNCE_HIGH and BLK_BOUNCE_ANY are compared against 64-bit quantities. # Cast these unsigned long quantities to avoid overflow. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.19 # [PATCH] symbol_get linkage fix # # Patch from Rusty Russell # # Make symbol_get() use undefined weak symbols if !CONFIG_MODULE. # Many thanks to RTH for introducing undef weak symbols to me. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.20 # [PATCH] i386 pgd_index() doesn't parenthesize its arg # # Patch from William Lee Irwin III # # pgd_index() doesn't parenthesize its argument. This is a bad idea for # macros, since it's legitimate to pass expressions to them that will get # misinterpreted given operator precedence and the shift. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.21 # [PATCH] kernel param and KBUILD_MODNAME name-munging mess # # Patch from: Rusty Russell # # Mikael Pettersson points out that "-s" gets mangled to "_s" on the # kernel command line, even though it turns out not to be a # parameter. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.22 # [PATCH] i386 pgd_index() doesn't parenthesize its arg # # Patch from William Lee Irwin III # # PAE's pte_none() and pte_pfn() evaluate their arguments twice; # analogous fixes have been made to other things; c.f. pgtable.h's long # list of one-line inlines with parentheses still around their args. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.23 # [PATCH] pcmcia timer initialisation fixes # # pcmcia timer initialisation fixes from Anton Blanchard # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.24 # [PATCH] correct wait accounting in wait_on_buffer() # # __wait_on_buffer() needs to use io_schedule(), so processes in there are # accounted as being in I/O wait. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.25 # [PATCH] atyfb compilation fix # # Patch from "Andres Salomon" # # Fix compilation of atyfb_base.c # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.26 # [PATCH] floppy locking fix # # redo_fd_request() needs to take the queue lock around the call to # elv_next_request(). # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.27 # [PATCH] soundcore.c referenced non-existent errno variable # # Patch from: Petr Vandrovec # # soundcore is trying to perform kernel syscalls to load firmware, but falls # afoul of missing `errno'. Convert it to use VFS API functions. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.28 # [PATCH] Fix generic_file_readonly_mmap() # # We cannot clear VM_MAYWRITE in there - it turns writeable MAP_PRIVATE # mappings into readonly ones. # # So change it back to the 2.4 form - disallow a writeable MAP_SHARED mapping # against filesystems which do not implement ->writepage(). # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.29 # [PATCH] exit_mmap fix for 64bit->32bit execs # # The recent exit_mmap() changes broke PPC64 when 64-bit applications exec # 32-bit ones. ia32-on-ia64 was broken as well # # What is happening is that load_elf_binary() sets TIF_32BIT (via # SET_PERSONALITY) _before_ running exit_mmap(). So when we're unmapping the # vma's of the old image, we are running under the new image's personality. # # This causes PPC64 to pass a 32-bit TASK_SIZE to unmap_vmas(), even when the # execing process had a 64-bit image. Because unmap_vmas() is not provided # with the correct virtual address span it does not unmap all the old image's # vma's and we go BUG_ON(mm->map_count) in exit_mmap(). # # The early SET_PERSONALITY() is required before we look up the interpreter # because the lookup of the executable has to happen under the alternate root # which SET_PERSONALITY() may set. # # Unfortunately this means that we're running flush_old_exec() under the new # exec's personality. Hence this bug. # # So what the patch does is to simply pass ~0UL into unmap_vmas(), which tells # it to unmap everything regardless of current personality. Which is what the # old open-coded VMA killer was doing. # # There remains the problem that some architectures are sometimes passing the # incorrect TASK_SIZE into tlb_finish_mmu(). They've always been doing that. # -------------------------------------------- # 03/02/02 akpm@digeo.com 1.925.36.30 # [PATCH] fix show_task oops # # Patch from Russell King # # show_task() attempts to calculate the amount of free space which hasn't been # written to on the kernel stack by reading from the base of the kernel stack # upwards. # # However, it mistakenly uses the task_struct pointer as the base of the stack, # which it isn't, and this can cause an oops. # # Here is a patch which uses the task thread pointer instead, which should be # located at the bottom of the kernel stack. It appears this was missed when # the thread structure was introduced. # -------------------------------------------- # 03/02/02 torvalds@home.transmeta.com 1.925.10.11 # Merge # -------------------------------------------- # 03/02/02 torvalds@home.transmeta.com 1.925.10.12 # Merge bk://bk.arm.linux.org.uk # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/02 jmorris@intercode.com.au 1.925.30.11 # [IPSEC]: remove trailer_len from esp and xfrm properties. # -------------------------------------------- # 03/02/02 jmorris@intercode.com.au 1.925.30.12 # [IPSEC]: Update ah documentation. # -------------------------------------------- # 03/02/02 jmorris@intercode.com.au 1.925.30.13 # [IPSEC] Convert esp auth to use proper crypto api calls. # -------------------------------------------- # 03/02/02 jmorris@intercode.com.au 1.925.30.14 # [IPSEC] Generic ICV handling for ESP. # -------------------------------------------- # 03/02/03 jgarzik@redhat.com 1.925.6.30 # Merge kernel.bkbits.net:net-drivers-2.5 # into redhat.com:/garz/repo/net-drivers-2.5 # -------------------------------------------- # 03/02/02 jmorris@intercode.com.au 1.925.30.15 # [CRYPTO]: in/out scatterlist support for ciphers. # - Merge scatterwalk patch from Adam J. Richter # API change: cipher methods now take in/out scatterlists and nbytes # params. # - Merge gss_krb5_crypto update from Adam J. Richter # - Add KM_SOFTIRQn (instead of KM_CRYPTO_IN etc). # - Add asm/kmap_types.h to crypto/internal.h # - Update cipher.c credits. # - Update cipher.c documentation. # -------------------------------------------- # 03/02/03 James.Bottomley@steeleye.com 1.925.6.31 # 3c509 fixes: correct MCA probing, add back ISA probe to Space.c # -------------------------------------------- # 03/02/02 cw@f00f.org 1.925.30.16 # [IPV6]: Fix tcp_v6_xmit prototype. # -------------------------------------------- # 03/02/03 devik@cdi.cz 1.925.30.17 # [NET_SCHED]: HTB scheduler updates from Devik. # - repaired htb_debug_dump call in htb_dequeue # - removed performance counter macros # - error report text fixes, new more precise mindelay error reporting # - minor fixes and cleanup # -------------------------------------------- # 03/02/03 ak@muc.de 1.925.30.18 # [IPV4]: Better behavior for NETDEV_CHANGENAME requests. # -------------------------------------------- # 03/02/03 davem@nuts.ninka.net 1.925.30.19 # [IPSEC]: Revert previous change to ip_route_connect. # -------------------------------------------- # 03/02/03 kunihiro@ipinfusion.com 1.925.30.20 # [XFRM]: Add family member to xfrm_usersa_id. # -------------------------------------------- # 03/02/03 Matt_Domsch@dell.com 1.925.5.6 # Merge dell.com:/home/mdomsch/bk/linux-2.5 # into dell.com:/home/mdomsch/bk/edd/linux-2.5-edd # -------------------------------------------- # 03/02/03 jejb@raven.il.steeleye.com 1.925.4.19 # Merge raven.il.steeleye.com:/home/jejb/BK/scsi-combined-2.5 # into raven.il.steeleye.com:/home/jejb/BK/scsi-for-linus-2.5 # -------------------------------------------- # 03/02/03 jejb@raven.il.steeleye.com 1.925.4.20 # Merge raven.il.steeleye.com:/home/jejb/BK/scsi-misc-2.5 # into raven.il.steeleye.com:/home/jejb/BK/scsi-for-linus-2.5 # -------------------------------------------- # 03/02/03 torvalds@home.transmeta.com 1.925.4.21 # Merge http://linux-scsi.bkbits.net/scsi-for-linus-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/03 rddunlap@osdl.org 1.925.4.22 # [PATCH] fix references to discarded sections # # After disabling files that wouldn't build, there were 2 (in-kernel) # modules that referenced _init or _exit code sections when they # shouldn't. # # This fixes those modules. # -------------------------------------------- # 03/02/03 lord@sgi.com 1.925.10.13 # [XFS] Transaction A is in callback processing unpinning a buffer, # Transaction B is in the process of marking the buffer stale. # Between transaction A dropping its reference and checking # the stale state, transaction B gets a reference and stales # the buffer. A ends up freeing the log item and releasing # the buffer. End result is we have a reference to free memory # and an unlocked buffer. # # SGI Modid: 2.5.x-xfs:slinx:137748a # -------------------------------------------- # 03/02/03 lord@sgi.com 1.925.10.14 # [XFS] Do not release the last iclog of a transaction before we get our # callbacks attached to it. Otherwise we can end up executing the # callback out of order. # # SGI Modid: 2.5.x-xfs:slinx:137750a # -------------------------------------------- # 03/02/03 hch@sgi.com 1.925.10.15 # [XFS] remove a dead codepath in xfs_syncsub # # SGI Modid: 2.5.x-xfs:slinx:138037a # -------------------------------------------- # 03/02/03 lord@sgi.com 1.925.10.16 # [XFS] fix initialization of bio in end case where we are dealing with sub page # sized requests. # # SGI Modid: 2.5.x-xfs:slinx:138201a # -------------------------------------------- # 03/02/03 agrover@groveronline.com 1.925.1.36 # Merge groveronline.com:/root/bk/linux-2.5 # into groveronline.com:/root/bk/linux-acpi # -------------------------------------------- # 03/02/03 kai@tp1.ruhr-uni-bochum.de 1.925.12.17 # kbuild: Rename CONFIG_MODVERSIONING -> CONFIG_MODVERSIONS # # CONFIG_MODVERSIONING was a temporary name introduced to distinguish # between the old and new module version implementation. Since the # traces of the old implementation are now gone from the build system, # we rename the config option back in order to not confuse users more # than necessary in 2.6. # # Also, remove some historic modversions cruft throughout the tree. # -------------------------------------------- # 03/02/03 kai@tp1.ruhr-uni-bochum.de 1.925.12.18 # kbuild: Generate module versions in the normal object directories # # We generated the intermediate files that contain checksums for # unresolved symbols in .tmp_versions, which had the disadvantage # that is obscured what's going on during the build. Just # generate them as .ver.[co] right next to the actual objects in the # object tree. # -------------------------------------------- # 03/02/03 rusty@rustcorp.com.au 1.925.12.19 # kbuild: Modversions fixes # # Fix the case where no CRCs are supplied (OK, but taints kernel), and # only print one tainted message (otherwise --force gives hundreds of them). # -------------------------------------------- # 03/02/03 rusty@rustcorp.com.au 1.925.12.20 # kbuild: Ignore kernel version part of vermagic if CONFIG_MODVERSIONS # # Skip over the first part of __vermagic in modversioning is on: otherwise # you'll have to force it when changing from 2.6.0 to 2.6.1. # -------------------------------------------- # 03/02/03 kai@tp1.ruhr-uni-bochum.de 1.925.4.23 # Hand merged # -------------------------------------------- # 03/02/03 kai@tp1.ruhr-uni-bochum.de 1.925.4.24 # Merge tp1.ruhr-uni-bochum.de:/scratch/kai/kernel/v2.5/linux-2.5.make-sam # into tp1.ruhr-uni-bochum.de:/scratch/kai/kernel/v2.5/linux-2.5.make # -------------------------------------------- # 03/02/03 kai@tp1.ruhr-uni-bochum.de 1.925.4.25 # kbuild: Assorted fixlets # # o Build modules with CONFIG_MODVERSIONS when just saying "make" # o Ignore generated *.ver.c files # o Fix a typo (Sam Ravnborg) # o Fix another typo (Paul Marinceu) # -------------------------------------------- # 03/02/03 kai@tp1.ruhr-uni-bochum.de 1.925.4.26 # kbuild: Remove export-objs := ... statements # # One of the goals of the whole new modversions implementation: # export-objs is gone for good! # -------------------------------------------- # 03/02/03 jfs.adm@hostme.bitkeeper.com 1.925.37.1 # Merge bk://linux.bkbits.net/linux-2.5 # into hostme.bitkeeper.com:/ua/repos/j/jfs/linux-2.5 # -------------------------------------------- # 03/02/03 shaggy@shaggy.austin.ibm.com 1.925.37.2 # Merge jfs@jfs.bkbits.net:linux-2.5 # into shaggy.austin.ibm.com:/shaggy/bk/jfs-2.5 # -------------------------------------------- # 03/02/03 torvalds@penguin.transmeta.com 1.925.4.27 # Merge http://jfs.bkbits.net/linux-2.5 # into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux # -------------------------------------------- # 03/02/03 agrover@groveronline.com 1.925.1.37 # ACPI: It is OK to not have a _PPC, so don't error out if it's not found # -------------------------------------------- # 03/02/04 greg@kroah.com 1.925.20.20 # [PATCH] USB: add a blank line between each device in usbfs/devices # -------------------------------------------- # 03/02/04 greg@kroah.com 1.925.20.21 # [PATCH] USB: fix to get usb-storage code to work again. # # Thanks to Matt Dharm and David Brownell for tracking this bug down. # -------------------------------------------- # 03/02/04 mdharm-usb@one-eyed-alien.net 1.925.20.22 # [PATCH] usb-storage: move to SCSI hotplugging # # The attached patch is my first implementation of SCSI hotplugging. # # It's only been tested that it compiles, as I can't get the current # linux-2.5 tree from linuxusb to boot. It dies _very_ early. Greg, I'm not # sure if you'll want to apply this. Linus seemed to want this very much, # and it is 2.5.x... I say go for it, but I can understand if you have # reservations. # # I would definately like to see this tested by anyone who can get a kernel # to boot. # # This patch is quite large. Lots of things had to be changed. Among them: # # (o) The proc interface now uses the host number to look up the SCSI host # structure, and then finds the usb-storage structure from that. # (o) The SCSI interface has been changed. The code flow is now much # clearer, as more work is done from the USB probe/detach functions than # from auxillary functions. # (o) Names have been changed for newer conventions # (o) GUIDs have been removed # (o) The linked-list of devices has been removed, and it's associated # semaphore # (o) All code dealing with re-attaching a device to it's old association has # been removed # (o) Some spaces changed to tabs # (o) usb-storage now takes one directory under /proc/scsi instead of # one per virtual-HBA # (o) All control threads now have the same name. This could be changed back # to the old behavior, if enough people want it. # # Known problems: # (o) Testing, testing, testing # (o) More dead code needs to be cut # (o) It's a unclear how a LLD is supposed to cut off the flow of # commands, so that the unregister() call always succeeds. SCSI folks # need to work on this. # (o) Probing needs to be broken down into smaller functions, probably. # -------------------------------------------- # 03/02/04 mdharm-scsi@one-eyed-alien.net 1.925.20.23 # [PATCH] usb-storage: fix typo # # This patch goes on top of the last one. It fixes a typo in the test for # scsi_register() failure. # # -- reversed the logic of failure test for scsi_register() # -------------------------------------------- # 03/02/04 mdharm-scsi@one-eyed-alien.net 1.925.20.24 # [PATCH] usb-storage: fix oops # # It should fix the OOPS on attach. # # This fixes a silly error where I fail to initialize a pointer early enough # for the scanning code. If this isn't a perfect example of why # scsi_register() and scsi_add_host() aren't two separate functions, I don't # know what is. :) # # Oh, and I added a couple of comments, too. # # - Fix an OOPS by moving the setting of the hostdata[] pointer to _before_ # the device scan starts. # -------------------------------------------- # 03/02/04 mdharm-usb@one-eyed-alien.net 1.925.20.25 # [PATCH] usb-storage: comments, cleanup # # This patch does the following: # (o) Add comments showing what needs to be done to complete the hot-unplug # system. # (o) Add a BUG_ON() for (what is now) a critical failure case. # (o) Make certain that a debug print happens even if a usb_get_intfdata() # crashes. # (o) Add an un-necessary up() to balance a down, for the auto-code-checkers. # -------------------------------------------- # 03/02/04 mdharm-usb@one-eyed-alien.net 1.925.20.26 # [PATCH] usb-storage: remove US_FL_DEV_ATTACHED # # This patch removes the US_FL_DEV_ATTACHED flag, which is now rendered # obsolete by the new hotplug system. # # It also adds a comment or two about areas of code that need to be # re-examined. # -------------------------------------------- # 03/02/04 mdharm-usb@one-eyed-alien.net 1.925.20.27 # [PATCH] usb-storage: convert spaces to tabs # # This is a minor cleanup to convert 8 spaces into tabs. There is no # functional change here. # -------------------------------------------- # 03/02/04 mdharm-usb@one-eyed-alien.net 1.925.20.28 # [PATCH] Replace a line of code that shouldn't have been removed. # -------------------------------------------- # 03/02/04 henning@meier-geinitz.de 1.925.20.29 # [PATCH] USB scanner.h, scanner.c: maintainer change # # This patch changes the maintainer from Brian Beattie to Henning # Meier-Geinitz and adds a link to the documentation and website. # -------------------------------------------- # 03/02/04 henning@meier-geinitz.de 1.925.20.30 # [PATCH] USB scanner.c: Adjust syslog output # # This patch prints the vendor + product ids of the scanner after it has # been successfully detected. # # Also the annoying error message about "Scanner device is already open" # was downgraded to a dbg. Scanning for devices while one scanner device # was open produced several 100 error messages in syslog. # -------------------------------------------- # 03/02/04 anton@samba.org 1.937 # Merge samba.org:/scratch/anton/linux-2.5 # into samba.org:/scratch/anton/sfr # -------------------------------------------- # 03/02/04 baldrick@wanadoo.fr 1.925.20.31 # [PATCH] USB speedtouch: let the tasklet do all processing of speedtouch receive urbs # # speedtouch: move all processing of receive urbs to udsl_atm_processqueue. This has # several advantages, as will be seen in the next few patches. The most important is # that it makes it easy to reuse of the urb's buffer (right now a new buffer is # allocated every time the urb completes). By the way, this patch is much smaller than # it looks: most of the bulk is due to indentation changes. # -------------------------------------------- # 03/02/04 baldrick@wanadoo.fr 1.925.20.32 # [PATCH] USB speedtouch: re-recycle speedtouch receive buffers # # Rediffed version of the original patch - no sk_buff on the stack this time. # # speedtouch: recycle the receive urb's buffer. Currently, every time a receive urb # completes, its old buffer is thrown away and replaced with a new one. This patch # performs the minor changes needed to reuse the old buffer. # -------------------------------------------- # 03/02/04 baldrick@wanadoo.fr 1.925.20.33 # [PATCH] USB speedtouch: re-recycle failed speedtouch receive urbs # # speedtouch: more robust handling of receive urb failure: retry failed urbs whenever # a new connection is opened. This should work well with pppd's persist option. # -------------------------------------------- # 03/02/04 baldrick@wanadoo.fr 1.925.20.34 # [PATCH] USB speedtouch: re-wait for speedtouch completion handlers after usb_unlink_urb # # speedtouch: wait for receive urb completion handlers to finish after calling # usb_unlink_urb. # -------------------------------------------- # 03/02/04 baldrick@wanadoo.fr 1.925.20.35 # [PATCH] USB speedtouch: re-cosmetic speedtouch changes # # speedtouch: a pile of cosmetic changes to make me feel happier (no code changes). # -------------------------------------------- # 03/02/04 baldrick@wanadoo.fr 1.925.20.36 # [PATCH] USB speedtouch: tweak speedtouch status logic # # speedtouch: change data_started to firmware_loaded, which is what it actually # means, plus some minor related changes. # -------------------------------------------- # 03/02/04 baldrick@wanadoo.fr 1.925.20.37 # [PATCH] USB speedtouch: allocate speedtouch send urbs in the USB probe routine # # speedtouch: allocate send urbs in udsl_usb_probe rather than in udsl_usb_data_init. # Since this diminishes udsl_usb_data_init down to almost nothing, roll it into the one # place it was used. Get rid of the semaphore Oliver put it - it is no longer needed. # # # speedtouch.c | 86 ++++++++++++++++++++++++++--------------------------------- # 1 files changed, 38 insertions(+), 48 deletions(-) # -------------------------------------------- # 03/02/04 baldrick@wanadoo.fr 1.925.20.38 # [PATCH] USB speedtouch: earlier rejection of outgoing speedtouch packets # # speedtouch: reject outgoing packets earlier when the firmware is not loaded. # -------------------------------------------- # 03/02/04 mdharm-usb@one-eyed-alien.net 1.925.20.39 # [PATCH] USB usb-storage: host a host refcount a little bit longer # # This patch makes us hold the host reference count a little bit longer in # the /proc interface code. We were releasing it too early before. # -------------------------------------------- # 03/02/04 mdharm-usb@one-eyed-alien.net 1.925.20.40 # [PATCH] USB usb-storage: implement device-offline code # # This code implements the setting of devices offline during the removal # phase. # -------------------------------------------- # 03/02/04 mdharm-usb@one-eyed-alien.net 1.925.20.41 # [PATCH] USB usb-storage: implement clearing of device queue # # This patch clears out the device queue when a unit is removed. # -------------------------------------------- # 03/02/04 p.guehring@futureware.at 1.925.20.42 # [PATCH] USB: FTDI driver, new id added # -------------------------------------------- # 03/02/04 greg@kroah.com 1.925.20.43 # [PATCH] USB: added tripp device id's to pl2303 driver. # # Thanks to John Moses for the information. # -------------------------------------------- # 03/02/04 anton@samba.org 1.938 # ppc64: fix UP compile # -------------------------------------------- # 03/02/04 anton@samba.org 1.937.1.1 # ppc64: module updates from Rusty # -------------------------------------------- # 03/02/04 anton@samba.org 1.939 # Merge samba.org:/scratch/anton/linux-2.5_ppc64_up # into samba.org:/scratch/anton/sfr # -------------------------------------------- # 03/02/04 davem@kernel.bkbits.net 1.925.4.28 # Merge davem@nuts.ninka.net:/home/davem/src/BK/net-2.5 # into kernel.bkbits.net:/home/davem/net-2.5 # -------------------------------------------- # 03/02/04 davem@nuts.ninka.net 1.925.38.1 # [SPARC]: Add ndelay. # -------------------------------------------- # 03/02/04 davem@nuts.ninka.net 1.925.38.2 # [FC4]: Update for scsi_cmnd changes. # -------------------------------------------- # 03/02/04 davem@nuts.ninka.net 1.925.38.3 # [SCSI ESP]: Update for scsi_cmnd changes. # -------------------------------------------- # 03/02/04 davem@nuts.ninka.net 1.925.38.4 # [SCSI QLOGICPTI]: Update for scsi_cmnd changes. # -------------------------------------------- # 03/02/04 davem@nuts.ninka.net 1.925.38.5 # [SCSI PLUTO/FCAL]: Update for scsi_cmnd changes. # -------------------------------------------- # 03/02/04 Matt_Domsch@dell.com 1.925.39.1 # Merge dell.com:/home/mdomsch/bk/linux-2.5 # into dell.com:/home/mdomsch/bk/edd/linux-2.5-edd # -------------------------------------------- # 03/02/04 nlaredo@transmeta.com 1.925.40.1 # [PATCH] stradis.c "proper" port to 2.5.x # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.41.1 # [PATCH] qlogic fix # # Linus's current BK tree needs the following build fix: # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.2 # [PATCH] implement posix_fadvise64() # # An implementation of posix_fadvise64(). It adds 368 bytes to my vmlinux and # is worth it. # # I didn't bother doing posix_fadvise(), as userspace can implement that by # calling fadvise64(). # # The main reason for wanting this syscall is to provide userspace with the # ability to explicitly shoot down pagecache when streaming large files. This # is what O_STEAMING does, only posix_fadvise() is standards-based, and harder # to use. # # posix_fadvise() also subsumes sys_readahead(). # # POSIX_FADV_WILLNEED will generally provide asynchronous readahead semantics # for small amounts of I/O. As long as things like indirect blocks are aready # in core. # # POSIX_FADV_RANDOM gives unprivileged applications a way of disabling # readahead on a per-fd basis, which may provide some benefit for super-seeky # access patterns such as databases. # # # # The POSIX_FADV_* values are already implemented in glibc, and this patch # ensures that they are in sync. # # A test app (fadvise.c) is available in ext3 CVS. See # # http://www.zip.com.au/~akpm/linux/ext3/ # # for CVS details. # # Ulrich has reviewed this patch (thanks). # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.3 # [PATCH] fix agp compile warning # # A static function in a header where presumably a static inline was intended. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.4 # [PATCH] add stats for page reclaim via inode freeing # # pagecache can be reclaimed via the page LRU and via prune_icache. We # currently don't know how much reclaim is happening via each. # # The patch adds instrumentation to display the number of pages which were # freed via prune_icache. This is displayed in /proc/vmstat:pginodesteal and # /proc/vmstat:kswapd_inodesteal. # # Turns out that under some workloads (well, dbench at least), fully half of # page reclaim is via the unused inode list. Which seems quite OK to me. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.5 # [PATCH] file-backed vma merging # # Implements merging of file-backed VMA's. Based on Andrea's 2.4 patch. # # It's only done for mmap(). mprotect() and mremap() still will not merge # VMA's. # # It works for hugetlbfs mappings also. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.6 # [PATCH] mm/mmap.c whitespace cleanups # # - Don't require a 160-col xterm # # - Coding style consistency # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.7 # [PATCH] cleanup in read_cache_pages() # # Patch from Nikita Danilov # # read_cache_pages() is passed a bunch of pages to start I/O against and it is # supposed to consume all those pages. But if there is an I/O error, someone # need to throw away the unused pages. # # At present the single user of read_cache_pages() (nfs_readpages) does that # cleanup by hand. But it should be done in the core kernel. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.8 # [PATCH] remove __GFP_HIGHIO # # Patch From: Hugh Dickins # # Recently noticed that __GFP_HIGHIO has played no real part since bounce # buffering was converted to mempool in 2.5.12: so this patch (over 2.5.58-mm1) # removes it and GFP_NOHIGHIO and SLAB_NOHIGHIO. # # Also removes GFP_KSWAPD, in 2.5 same as GFP_KERNEL; leaves GFP_USER, which # can be a useful comment, even though in 2.5 same as GFP_KERNEL. # # One anomaly needs comment: strictly, if there's no __GFP_HIGHIO, then # GFP_NOHIGHIO translates to GFP_NOFS; but GFP_NOFS looks wrong in the block # layer, and if you follow them down, you find that GFP_NOFS and GFP_NOIO # behave the same way in mempool_alloc - so I've used the less surprising # GFP_NOIO to replace GFP_NOHIGHIO. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.9 # [PATCH] Use a slab cache for pgd and pmd pages # # From Bill Irwin # # This allocates pgd's and pmd's using the slab and slab ctors. It has a # benefit beyond preconstruction in that PAE pmd's are accounted via # /proc/slabinfo # # Profiling of kernel builds by Martin Bligh shows a 30-40% drop in CPU load # due to pgd_alloc()'s page clearing activity. But this was already a tiny # fraction of the overall CPU time. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.10 # [PATCH] pgd_ctor update # # From wli # # A moment's reflection on the subject suggests to me it's worthwhile to # generalize pgd_ctor support so it works (without #ifdefs!) on both PAE # and non-PAE. This tiny tweak is actually more noticeably beneficial # on non-PAE systems but only really because pgd_alloc() is more visible; # the most likely reason it's less visible on PAE is "other overhead". # It looks particularly nice since it removes more code than it adds. # # Touch tested on NUMA-Q (PAE). OFTC #kn testers testing the non-PAE case. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.11 # [PATCH] Avoid losing timer ticks when slab debug is enabled. # # Patch from Manfred Spraul # # When slab debugging is enabled we're holding off interrupts for too long # (more than a jiffy), so reduce the alloc/free batching size when slab debug # is enabled. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.12 # [PATCH] remove unneeded locking in do_syslog() # # Lots of nonsensical locking in there. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.13 # [PATCH] hangcheck-timer # # Patch from: Joel Becker # # This kernel module will detect long durations when jiffies has failed to # increment, and will reboot the machine in response. # # Joel says: # # # "Here's why Oracle wants such a thing. We run clusters. Imagine a two node # cluster. Node1 pauses completely for some reason. There are multiple # reasons this can happen. A bad driver can udelay() for 90 seconds (qla used # to do this). zVM on S/390 can page Linux out for minutes at a time. # Anything that causes the box to freeze. Jiffies does *not* count during # this, so when Node1 returns it feels that no time has passed. # # Node2, however, has been counting time. When Node1 goes away, the Oracle # cluster manager starts looking for it. After a timeout, it gives up. It # then recovers any in-progress transactions from Node1. After that, it # starts new operations, modifying the data in ways that Node1 has no idea # about (it's still out to lunch). # # When Node1 finally returns (udelay() ends, zVM pages it in, whatever), any # I/O that it has queued or is about to queue will get sent to the disk. # Oops, you've just corrupted your shared data. # # hangcheck-timer should catch this and reboot the box. # # This is why Oracle wants this driver. We figure that such functionality # would be beneficial to others as well, so we posted to l-k. We'd all hope # that driver writers don't udelay() for 90s, but S/390 with zVM is still # around. Some folks might want to notice when it happens. I am sure other # things exist that trigger the same symptoms." # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.14 # [PATCH] Restore LSM hook calls to sendfile # # Patch from "Stephen D. Smalley" # # This patch restores the LSM hook calls in sendfile to 2.5.59. The hook was # previously added as of 2.5.29 but the hook calls in sendfile were # subsequently lost as a result of the sendfile rewrite as of 2.5.30. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.15 # [PATCH] asm-i386/mmzone.h macro paren/eval fixes # # Patch from William Lee Irwin III # # Okay, this one looks ugly because we're missing some of the definitions # available with which to convert to inline functions (esp. struct page). # A lot of these introduce temporaries and sort of hope names won't clash, # which might be important to whoever cares about -Wshadow. # # - node_end_pfn() evaluates nid twice # - local_mapnr() evaluates kvaddr twice # - kern_addr_valid() evaluates kaddr twice # - pfn_to_page() evaluates pfn multiple times # - page_to_pfn() evaluates page thrice # - pfn_valid() doesn't parenthesize its argument # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.16 # [PATCH] remove spaces from slab names # # From Anton Blanchard: remove spaces from slab cache identifiers. Simplifies # parsing of /proc/slabinfo. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.17 # [PATCH] remove will_become_orphaned_pgrp() # # Patch from William Lee Irwin III # # will_become_orphaned_pgrp()'s sole use is is_orphaned_pgrp(). Fold its body # into is_orphaned_pgrp(), rename __will_become_orphaned_pgrp(), and adjust # callers. Code shrinkage plus some relief from underscore-itis. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.18 # [PATCH] MAX_IO_APICS #ifdef'd wrongly # # Patch from William Lee Irwin III # # CONFIG_X86_NUMA no longer exists. This changes the MAX_IO_APICS definition # to 32, where it is required to be so large on NUMA-Q in order to boot. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.19 # [PATCH] patch to DAC960 driver for error retry # # Patch from Dave Olien # # The following patch implements retry on media errors for the DAC960 driver. # On such media errors, the DAC960 apparently doesn't report how much of the # transfer may have been successful before the error was encountered. # # This type of error should be rare on healthy hardware, especially if the # disks are stripped or mirrored. But, when large transfers are submitted to # the controller, it's especially bad to have to fail the entire transfer # because one disk sector may have been bad. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.20 # [PATCH] Remove __ from topology macros # # Patch from Matthew Dobson # # When I originally wrote the patches implementing the in-kernel topology # macros, they were meant to be called as a second layer of functions, # sans underbars. This additional layer was deemed unnecessary and # summarily dropped. As such, carrying around (and typing!) all these # extra underbars is quite pointless. Here's a patch to nip this in the # (sorta) bud. The macros only appear in 16 files so far, most of them # being the definitions themselves. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.21 # [PATCH] put_user() warning fix # # Patch from Russell King # # Have a couple of extra warnings: # # fs/binfmt_elf.c: In function `create_elf_tables': # fs/binfmt_elf.c:239: warning: initialization makes integer from pointer without a cast # fs/binfmt_elf.c:249: warning: initialization makes integer from pointer without a cast # # #ifndef elf_addr_t # #define elf_addr_t unsigned long # #endif # # elf_addr_t *argv, *envp; # # __put_user(NULL, argv); # __put_user(NULL, envp); # # It would therefore appear that x86 __put_user is not properly type-checking # the arguments to __put_user(). # # Here's a patch which fixes the warning (but doesn't fix x86's type-check # challenged __put_user implementation). # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.22 # [PATCH] fix #warnings # # Patch from "Randy.Dunlap" # # This fixes a few #warning's that gcc 2.96 complains about having # unmatched single-quote marks. (warnings on #warnings) # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.23 # [PATCH] ia32 Lost tick compensation # # Patch from john stultz # # Adds some lost-tick compensation code, which handles the case where time # accounting goes wrong due to interrupts being disabled for longer than two # ticks. # # This patch solves the problem by checking when an interrupt occurs if # timer->get_offset() is a value greater then 2 ticks. If so, it increments # jiffies appropriately. # # I was concerned that we'd be better off finding and fixing the misbehaving # drivers, but it turns out that the main culprits are system management cards # over which the kernel has no control. # # However John has added some debug code which will drop a backtrace on the # first five occurrences which will allow us to find-and-fix bad drivers if # overruns _are_ due to Linux software. (I disabled this - it was irritating # me. Dave Hansen has a patch which allows it to be turned on via a kernel # boot parameter, like the x86_64 equiv). # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.24 # [PATCH] Include in fs/seq_file.c, as it uses # # Patch from miles@lsi.nec.co.jp (Miles Bader) # # Otherwise it won't compile. I guesss this used to work because # was included somewhere to get the BUG macros, but now with the advent of # that's changed. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.25 # [PATCH] scsi_eh_* needs to run even during suspend # # Patch from Pavel Machek # # scsi_eh_* needs to run even during suspend because suspend does not prevent a # hard disk from reporting an error. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.26 # [PATCH] misc fixes # # - Fix dead comment in load_elf_interp() (Dave Airlie) # # - Add some (hard-won) commentary around the early SET_PERSONALITY() in # load_elf_binary(). # # - Remove dead hugetlb prototype. # # - Fix some silliness in hugetlbpage.c # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.27 # [PATCH] Remove unneeded code in fs/fs-writeback.c # # We do not need to pass the `wait' argument down to __sync_single_inode(). # That information is now present at wbc->sync_mode. # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.28 # [PATCH] Fix latencies during writeback # # When a throttled writer is performing writeback, and it encounters an inode # which is already under writeback it is forced to wait on the inode. So that # process sleeps until whoever is writing it out finishes the writeout. # # Which is OK - we want to throttle that process, and another process is # currently pumping data at the disk anyway. # # But in one situations the delays are excessive. If one process is performing # a huge linear write, other processes end up waiting for a very long time # indeed. It appears that this is because the writing process just keeps on # hogging the CPU, returning to userspace, generating more dirty data, writing # it out, sleeping in get_request_wait, etc. All other throttled dirtiers get # starved. # # So just remove the wait altogether if it is just a memory-cleansing writeout. # The calling process will then throttle in balance_dirty_pages()'s call to # blk_congestion_wait(). # -------------------------------------------- # 03/02/04 akpm@digeo.com 1.925.40.29 # [PATCH] fix i_sem contention in sys_unlink() # # Truncates can take a very long time. Especially if there is a lot of # writeout happening, because truncate must wait on in-progress I/O. # # And sys_unlink() is performing that truncate while holding the parent # directory's i_sem. This basically shuts down new accesses to the entire # directory until the synchronous I/O completes. # # In the testing I've been doing, that directory is /tmp, and this hurts. # # So change sys_unlink() to perform the actual truncate outside i_sem. # # When there is a continuous streaming write to the same disk, this patch # reduces the time for `make -j4 bzImage' from 370 seconds to 220. # -------------------------------------------- # 03/02/04 torvalds@home.transmeta.com 1.925.40.30 # Merge # -------------------------------------------- # 03/02/04 hch@hera.kernel.org 1.925.42.1 # Merge # -------------------------------------------- # 03/02/04 torvalds@home.transmeta.com 1.925.40.31 # Fix up manual merge error in usb/storage/scsiglue.c # -------------------------------------------- # 03/02/04 torvalds@home.transmeta.com 1.925.40.32 # Fix Makefile syntax error for (deprecated) "make dep" # -------------------------------------------- # 03/02/04 torvalds@home.transmeta.com 1.925.40.33 # Merge master.kernel.org:/home/hch/BK/xfs/linux-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/04 torvalds@home.transmeta.com 1.925.4.29 # Merge bk://kernel.bkbits.net/davem/net-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/04 torvalds@home.transmeta.com 1.925.4.30 # Merge bk://kernel.bkbits.net/davem/sparc-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/04 willy@debian.org 1.925.4.31 # [PATCH] PA-RISC updates for 2.5.59 # # - conversion of remaining drivers to generic device model # - more of sfr's compat stuff # - eliminate some bogus syscalls # - update for MUX driver # - beginnings of new module code # - tell the keyboard driver about CONFIG_PARISC # -------------------------------------------- # 03/02/04 tim@physik3.uni-rostock.de 1.925.4.32 # [PATCH] use 64 bit jiffies: infrastructure # # Provide a sane way to avoid unneccessary locking on 64 bit platforms, # and a 64 bit analogous to "jiffies_to_clock_t()". # -------------------------------------------- # 03/02/04 tim@physik3.uni-rostock.de 1.925.4.33 # [PATCH] use 64 bit jiffies: fix utime wrap # # Use 64 bit jiffies for reporting uptime. # -------------------------------------------- # 03/02/04 tim@physik3.uni-rostock.de 1.925.4.34 # [PATCH] use 64 bit jiffies: 64-bit process start time # # This prevents reporting processes as having started in the future, after # 32 bit jiffies wrap. # -------------------------------------------- # 03/02/04 Matt_Domsch@dell.com 1.925.4.35 # Merge dell.com:/home/mdomsch/bk/linux-2.5 # into dell.com:/home/mdomsch/bk/edd/linux-2.5-edd # -------------------------------------------- # 03/02/04 hch@lst.de 1.925.41.2 # [PATCH] remove __scsi_add_host # # now that scsi_add_host accepts a NMULL dev argument we don't need it # anymore. # -------------------------------------------- # 03/02/04 drow@nevyn.them.org 1.925.22.3 # Use force_sig_specific to send SIGSTOP to newly-created CLONE_PTRACE processes. # -------------------------------------------- # 03/02/05 greg@kroah.com 1.925.43.1 # USB: fix up drivers the scsi people missed # -------------------------------------------- # 03/02/04 hch@lst.de 1.925.41.3 # [PATCH] fixes and cleanups for the new command allocation code # # On Tue, Feb 04, 2003 at 12:33:23PM -0600, James Bottomley wrote: # > I agree with this. It is a guarantee the mid-layer makes to the LLD # > (and there are some LLDs with static issue queues for which this is a # > hard requirement). I think (once the dust has settled and we've agreed # > which field holds the current queue depth) what's needed is a check in # > the scsi_request_fn() to see if we're over the LLD's current depth for # > the device and plug the queue and exit if we are. The next returning # > command will unplug and send. # > # > This way of doing things means that we're free to prep as many commands # > as we can, but we guarantee only to have the correct number outstanding # > to the LLD. # # Okay, here's a new versin of the patch. Changes: # # * throttel on number of inflight command blocks # * rename scsi_cmnd->new_queue_depth to scsi_cmnd->queue_depth # * remove scsi_do_cmd # * serialize pool handling # -------------------------------------------- # 03/02/04 agrover@groveronline.com 1.925.1.38 # ACPI: Optimize for space # -------------------------------------------- # 03/02/04 davidm@wailua.hpl.hp.com 1.925.31.18 # ia64: Use printk severity-levels where appropriate. # Triggered by analysis done by Philipp Marek. # -------------------------------------------- # 03/02/04 davidm@tiger.hpl.hp.com 1.925.31.19 # ia64: Fix potential perfmon deadlock. Patch by Stephane Eranian. # -------------------------------------------- # 03/02/05 greg@kroah.com 1.925.44.1 # [PATCH] PCI Hotplug: dereference null variable cleanup patches. # # These were pointed out by "dan carpenter" # from his smatch tool. # -------------------------------------------- # 03/02/05 greg@kroah.com 1.925.44.2 # [PATCH] IBM PCI Hotplug driver: Clean up the slot filename generation logic a lot. # -------------------------------------------- # 03/02/05 stanley.wang@linux.co.intel.com 1.925.44.3 # [PATCH] PCI Hotplug: Replace pcihpfs with sysfs. # -------------------------------------------- # 03/02/05 stanley.wang@linux.co.intel.com 1.925.44.4 # [PATCH] PCI Hotplug: Remove procfs stuff from pci_hotplug_core # # Here is a little patch that remove procfs stuff in pci_hotplug_core.c # Remove /proc entry for pci_hotplug_core. # -------------------------------------------- # 03/02/05 greg@kroah.com 1.925.44.5 # [PATCH] PCI Hotplug: change pci_hp_change_slot_info() to take a hotplug_slot and not a string. # -------------------------------------------- # 03/02/05 greg@kroah.com 1.925.44.6 # [PATCH] sysfs: add sysfs_update_file() function. # -------------------------------------------- # 03/02/05 greg@kroah.com 1.925.44.7 # [PATCH] PCI Hotplug: Make pci_hp_change_slot_info() work again # # Relies on sysfs_update_file() to be present in the kernel. # -------------------------------------------- # 03/02/05 greg@kroah.com 1.925.44.8 # [PATCH] PCI Hotplug: moved the some stuff into the pci core # # Moved functions from drivers/hotplug/pci_hotplug_util.c to # drivers/pci/hotplug.c, which is a better place for them. # -------------------------------------------- # 03/02/05 rddunlap@osdl.org 1.925.44.9 # [PATCH] PCI Hotplug: checker patches # # Fixes problems found by the CHECKER program in the pci hotplug drivers # -------------------------------------------- # 03/02/05 jdike@uml.karaya.com 1.925.14.7 # Merged a conflict in ptrace.h. # -------------------------------------------- # 03/02/05 riel@conectiva.com.br 1.925.41.4 # [PATCH] Re: [CHECKER] 112 potential memory leaks in 2.5.48 # # On Wed, 5 Feb 2003, Rik van Riel wrote: # > On Tue, 4 Feb 2003, Andy Chou wrote: # # Thanks for the checker output. First patch below... # # > > [BUG] # > > u1/acc/linux/2.5.48/drivers/scsi/sr_ioctl.c:188:sr_do_ioctl: # > > ERROR:LEAK:85:188:Memory leak [Allocated from: # > > /u1/acc/linux/2.5.48/drivers/scsi/sr_ioctl.c:85:scsi_allocate_request] # > # > Bug indeed, I've created a patch to fix the possible leak of # > a scsi request, but can't figure out the bounce buffer logic... # # The patch below fixes the scsi request leak. I'm not sure # how the bounce buffer thing is supposed to work (Christoph? # James?) so I'm not touching that at the moment. # # Linus, could you please apply this patch (against today's # bk tree) ? # # thank you, # # Rik # -- # Bravely reimplemented by the knights who say "NIH". # http://www.surriel.com/ http://guru.conectiva.com/ # Current spamtrap: october@surriel.com # # # ===== drivers/scsi/sr_ioctl.c 1.27 vs edited ===== # -------------------------------------------- # 03/02/05 jejb@raven.il.steeleye.com 1.925.41.5 # Correct compiler warnings with use of likely() on pointers # -------------------------------------------- # 03/02/05 jejb@raven.il.steeleye.com 1.925.41.6 # Fix sr_ioctl.c bounce buffer usage # # Make sure all DMAs come from kmalloc'd memory with the correct # GFP_ flags # -------------------------------------------- # 03/02/05 jejb@raven.il.steeleye.com 1.925.41.7 # move queue_depth check from scsi_prep_fn to scsi_request_fn # -------------------------------------------- # 03/02/05 jdike@uml.karaya.com 1.925.13.5 # Merge # -------------------------------------------- # 03/02/05 green@namesys.com 1.925.45.1 # [PATCH] fix HZ=100 case with 64 bit jiffies # # The updates to use 64-bit jiffies broke fs/proc/proc_misc.c for # architectures still using a 100 Hz clocktick (e.g. UML) # -------------------------------------------- # 03/02/05 torvalds@home.transmeta.com 1.925.43.2 # Merge penguin:v2.5/linux # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/05 rth@are.twiddle.net 1.925.46.1 # Merge # -------------------------------------------- # 03/02/05 torvalds@home.transmeta.com 1.925.43.3 # Merge bk://are.twiddle.net/axp-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/05 agrover@groveronline.com 1.925.1.39 # Merge groveronline.com:/root/bk/linux-2.5 # into groveronline.com:/root/bk/linux-acpi # -------------------------------------------- # 03/02/05 kai@tp1.ruhr-uni-bochum.de 1.925.47.1 # kbuild: Don't default to building modules when not selected # # Defaulting to building modules together with vmlinux when just doing # "make" or "make all" is only a good choice when "CONFIG_MODULES" is set. # -------------------------------------------- # 03/02/06 stekloff@w-stekloff.beaverton.ibm.com 1.925.44.10 # [PATCH] pci patch for sysfs files # # The patch is modeled after your method for creating files for usb. It # makes a single file for pci sysfs files (except for pool, which I haven't # touched yet). It also exposes more pci information to User Space # through sysfs. Finally, it removes the dependence on the proc pci code # for sysfs files. # -------------------------------------------- # 03/02/06 greg@kroah.com 1.925.44.11 # [PATCH] PCI: put proper field sizes on sysfs files, and add class file. # -------------------------------------------- # 03/02/05 torvalds@penguin.transmeta.com 1.925.43.4 # Merge http://linux-isdn.bkbits.net/linux-2.5.make # into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux # -------------------------------------------- # 03/02/06 randy.dunlap@verizon.net 1.925.44.12 # [PATCH] PCI Hotplug: memory leaks in acpiphp_glue # # Here's the memory leaks patch for acpiphp_glue.c. # -------------------------------------------- # 03/02/05 randy.dunlap@verizon.net 1.925.43.5 # [PATCH] do_mounts memory leak # # The Stanford Checker identified a memory leak in init/do_mounts.c. # # This corrects it. # -------------------------------------------- # 03/02/05 shemminger@osdl.org 1.925.43.6 # [PATCH] x86_64 gettimeofday bug. # # Found by inspection of of the x86_64 gettimeofday. # # The problem is that the code always records the maximum value # but it is not reset on the next clock tick. As written, I see it # keeping the maximum number of microseconds since the last clock tick. # -------------------------------------------- # 03/02/05 chris@wirex.com 1.925.43.7 # [PATCH] 2.5-bk trivial LSM cleanup # # Trivial patch from Randy Dunlap removes some useless # error/retval assignments. # -------------------------------------------- # 03/02/05 shemminger@osdl.org 1.925.43.8 # [PATCH] seqlock for xtime # # Add "seqlock" infrastructure for doing low-overhead optimistic reader # locks (writer increments a sequence number, reader verifies that no # writers came in during the critical region, and lots of careful memory # barriers to take care of business). # # Make xtime/get_jiffies_64() use this new locking. # -------------------------------------------- # 03/02/05 torvalds@penguin.transmeta.com 1.925.1.40 # Merge http://linux-acpi.bkbits.net/linux-acpi # into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux # -------------------------------------------- # 03/02/05 rmk@arm.linux.org.uk 1.925.1.41 # [PATCH] disassociate_ctty SMP fix # # Ok, here's my proposed fix, which appears to work with preempt. I haven't # tested on non-preempt, nor (obviously since its from me) SMP. However, # I forsee no problems caused by this change. # # release_dev() sets filp->private_data to NULL when the tty layer has # done with the file descriptor. However, it remains on the tty_files # list until __fput completes. # -------------------------------------------- # 03/02/05 torvalds@penguin.transmeta.com 1.925.1.42 # Merge http://mdomsch.bkbits.net/linux-2.5-edd # into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux # -------------------------------------------- # 03/02/06 anton@samba.org 1.940 # Merge samba.org:/scratch/anton/linux-2.5 # into samba.org:/scratch/anton/sfr # -------------------------------------------- # 03/02/06 greg@kroah.com 1.925.44.13 # [PATCH] Compaq PCI Hotplug: fix checker memory leak bugs. # -------------------------------------------- # 03/02/06 greg@kroah.com 1.925.44.14 # [PATCH] IBM PCI Hotplug: fix memory leak found by checker project. # -------------------------------------------- # 03/02/05 akpm@digeo.com 1.925.1.43 # [PATCH] seqlock fix: read_seqretry_irqrestore() # -------------------------------------------- # 03/02/06 anton@samba.org 1.941 # Merge samba.org:/scratch/anton/linux-2.5 # into samba.org:/scratch/anton/sfr # -------------------------------------------- # 03/02/06 anton@samba.org 1.942 # Merge samba.org:/scratch/anton/linux-2.5 # into samba.org:/scratch/anton/sfr # -------------------------------------------- # 03/02/05 patmans@us.ibm.com 1.925.41.8 # [PATCH] add back single_lun support # # On Wed, Feb 05, 2003 at 05:14:00PM -0600, James Bottomley wrote: # # > I don't see device_active getting set anywhere. # > # > shouldn't we just dump device_active in favour of a non-zero check of # > device_busy (it's all done under the queue lock, anyway). # > # > James # # OK - once more. # # This patch against the current scsi-misc-2.5 adds back the check for the # single_lun case and removes the unused device_active field. # # I compiled and booted with this applied but don't have any devices (i.e. # CD ROM changer) for testing. # -------------------------------------------- # 03/02/06 greg@kroah.com 1.925.44.15 # [PATCH] IBM PCI Hotplug: fix a load of memory leak errors found by the checker project. # -------------------------------------------- # 03/02/06 anton@samba.org 1.936.1.1 # ppc64: Add ppc64 relocations to asm/elf.h. I am the example of good taste. # -------------------------------------------- # 03/02/06 anton@samba.org 1.943 # Merge samba.org:/scratch/anton/linux-2.5_ppc64 # into samba.org:/scratch/anton/sfr # -------------------------------------------- # 03/02/06 greg@kroah.com 1.925.1.44 # Merge kroah.com:/home/greg/linux/BK/bleed-2.5 # into kroah.com:/home/greg/linux/BK/pci-hp-2.5 # -------------------------------------------- # 03/02/06 greg@kroah.com 1.925.1.45 # sysfs: remember to add EXPORT_SYMBOL() for sysfs_update_file. # -------------------------------------------- # 03/02/05 torvalds@home.transmeta.com 1.925.1.46 # Merge http://jdike.stearns.org:5000/updates-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/05 torvalds@home.transmeta.com 1.925.1.47 # Merge http://jdike.stearns.org:5000/skas-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/05 torvalds@home.transmeta.com 1.925.1.48 # Merge http://jdike.stearns.org:5000/stack-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/05 torvalds@home.transmeta.com 1.925.1.49 # Merge http://jdike.stearns.org:5000/fixes-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/06 anton@samba.org 1.944 # Merge samba.org:/scratch/anton/linux-2.5 # into samba.org:/scratch/anton/sfr # -------------------------------------------- # 03/02/06 rem@osdl.org 1.925.1.50 # [NETFILTER]: Delete un-used stack variable in ip_nat_helper.c # -------------------------------------------- # 03/02/06 elenstev@mesatop.com 1.925.1.51 # [NETFILTER]: Update Kconfig help text to match 2.4.x # -------------------------------------------- # 03/02/06 vojtech@suse.cz 1.925.48.1 # x86-64: Minor fixes to make the kernel compile and remove warnings. # -------------------------------------------- # 03/02/06 hch@lst.de 1.925.41.9 # [SCSI] Remove host_active # # It isn't used anywhere anymore # -------------------------------------------- # 03/02/06 rusty@rustcorp.com.au 1.925.41.10 # [PATCH] [patch, 2.5] scsi_qla1280.c free on error path # # From: Marcus Alanen # # Remove check_region in favour of request_region. Free resources # properly on error path. Horribly subtle ioremap/iounmap lurks here I # think, in qla1280_pci_config(), which the below patch should take care # of. # # I'm wondering if there couldn't / shouldn't be a better way to # allocate resources. Obviously lots of drivers have broken error paths. # Is this even necessary? # # Marcus # # # # # # create_patch: qla1280_release_on_error_path-2002-12-08-A.patch # # Date: Sun Dec 8 22:32:33 EET 2002 # # # -------------------------------------------- # 03/02/06 rusty@rustcorp.com.au 1.925.41.11 # [PATCH] 2.5.59 add two help texts to drivers_scsi_Kconfig # # From: Steven Cole # # Here are some help texts from 2.4.21-pre3 Configure.help which are # needed in 2.5.59 drivers/scsi/Kconfig. # # Steven # -------------------------------------------- # 03/02/06 hch@lst.de 1.925.41.12 # [PATCH] coding style updates for scsi_lib.c # # I just couldn't see the mess anymore.. Nuke the ifdefs and use sane # variable names. Some more small nitpicks but no behaviour changes at # all. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.1 # [PATCH] BTTV build fix # # Patch from Gerd Knorr # # bttv requires CONFIG_SOUND. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.2 # [PATCH] reiserfs v3 readpages support # # Patch from Chris Mason # # The patch below is against 2.5.59, various forms have been floating # around for a while, and Andrew recently included this fixed version in # 2.5.55-mm. The end result is faster reads and writes for reiserfs. # # This adds reiserfs support for readpages, along with a support func in # fs/mpage.c to deal with the reiserfs_get_block call sending back up to # date buffers with packed tails copied into them. # # Most of the changes are to reiserfs_writepage, which still had many # 2.4isms in the way it started io, dealt with errors and handled the bh # state bits. I've also added an optimization so it only starts # transactions when we need to copy a packed tail into the btree or fill a # hole, instead of any time reiserfs_writepage hits an unmapped buffer. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.3 # [PATCH] self-unplugging request queues # # The patch teaches a queue to unplug itself: # # a) if is has four requests OR # b) if it has had plugged requests for 3 milliseconds. # # These numbers may need to be tuned, although doing so doesn't seem to # make much difference. 10 msecs works OK, so HZ=100 machines will be # fine. # # Instrumentation shows that about 5-10% of requests were started due to # the three millisecond timeout (during a kernel compile). That's # somewhat significant. It means that the kernel is leaving stuff in the # queue, plugged, for too long. This testing was with a uniprocessor # preemptible kernel, which is particularly vulnerable to unplug latency # (submit some IO, get preempted before the unplug). # # This patch permits the removal of a lot of rather lame unplugging in # page reclaim and in the writeback code, which kicks the queues # (globally!) every four megabytes to get writeback underway. # # This patch doesn't use blk_run_queues(). It is able to kick just the # particular queue. # # The patch is not expected to make much difference really, except for # AIO. AIO needs a blk_run_queues() in its io_submit() call. For each # request. This means that AIO has to disable plugging altogether, # unless something like this patch does it for it. It means that AIO # will unplug *all* queues in the machine for every io_submit(). Even # against a socket! # # This patch was tested by disabling blk_run_queues() completely. The # system ran OK. # # The 3 milliseconds may be too long. It's OK for the heavy writeback # code, but AIO may want less. Or maybe AIO really wants zero (ie: # disable plugging). If that is so, we need new code paths by which AIO # can communicate the "immediate unplug" information - a global unplug is # not good. # # # To minimise unplug latency due to user CPU load, this patch gives keventd # `nice -10'. This is of course completely arbitrary. Really, I think keventd # should be SCHED_RR/MAX_RT_PRIO-1, as it has been in -aa kernels for ages. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.4 # [PATCH] Remove most of the blk_run_queues() calls # # We don't need these with self-unplugging queues. # # The patch also contains a couple of microopts suggested by Andrea: we # don't need to run sync_page() if the page just came unlocked. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.5 # [PATCH] Updated Documentation/kernel-parameters.txt # # Patch from Petr Baudis # # this patch (against 2.5.59) updates Documentation/kernel-parameters.txt to # the (more-or-less; I certainly missed some parameters) current state of # kernel. Note also that I will probably send up another update after few # further kernel releases.. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.6 # [PATCH] JBD Documentation # # Patch from Roger Gammans # # Adds lots of API documentation to the JBD layer. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.7 # [PATCH] Restore LSM hook calls to sendfile # # Patch from "Stephen D. Smalley" # # This patch restores the LSM hook calls in sendfile to 2.5.59. The hook was # previously added as of 2.5.29 but the hook calls in sendfile were # subsequently lost as a result of the sendfile rewrite as of 2.5.30. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.8 # [PATCH] Fix SMP race betwen __sync_single_inode and # # Patch from Mikulas Patocka # # there's a SMP race condition between __sync_single_inode (or __sync_one on # 2.4.20) and __mark_inode_dirty. __mark_inode_dirty doesn't take inode # spinlock. As we know -- unless you take a spinlock or use barrier, # processor can change order of instructions. # # CPU 1 # # modify inode # (but modifications are in cpu-local # buffer and do not go to bus) # # calls # __mark_inode_dirty # it sees I_DIRTY and exits immediatelly # CPU 2 # takes spinlock # calls __sync_single_inode # inode->i_state &= ~I_DIRTY # writes the inode (but does not see # modifications by CPU 1 yet) # # CPU 1 flushes its write buffer to the bus # inode is already written, clean, modifications # done by CPU1 are lost # # The easiest fix would be to move the test inside spinlock in # __mark_inode_dirty; if you do not want to suffer from performance loss, # use the attached patches that use memory barriers to ensure ordering of # reads and writes. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.9 # [PATCH] ia32 IRQ distribution rework # # Patch from "Kamble, Nitin A" # # Hello All, # # We were looking at the performance impact of the IRQ routing from # the 2.5.52 Linux kernel. This email includes some of our findings # about the way the interrupts are getting moved in the 2.5.52 kernel. # Also there is discussion and a patch for a new implementation. Let # me know what you think at nitin.a.kamble@intel.com # # Current implementation: # ====================== # We have found that the existing implementation works well on IA32 # SMP systems with light load of interrupts. Also we noticed that it # is not working that well under heavy interrupt load conditions on # these SMP systems. The observations are: # # * Interrupt load of each IRQ is getting balanced on CPUs independent # of load of other IRQs. Also the current implementation moves the # IRQs randomly. This works well when the interrupt load is light. But # we start seeing imbalance of interrupt load with existence of # multiple heavy interrupt sources. Frequently multiple heavily loaded # IRQs gets moved to a single CPU while other CPUs stay very lightly # loaded. To achieve a good interrupts load balance, it is important to # consider the load of all the interrupts together. # This further can be explained with an example of 4 CPUs and 4 # heavy interrupt sources. With the existing random movement approach, # the chance of each of these heavy interrupt sources moving to separate # CPUs is: (4/4)*(3/4)*(2/4)*(1/4) = 3/16. It means 13/16 = 81.25% of # the time the situation is, some CPUs are very lightly loaded and some # are loaded with multiple heavy interrupts. This causes the interrupt # load imbalance and results in less performance. In a case of 2 CPUs # and 2 heavily loaded interrupt sources, this imbalance happens # 1/2 = 50% of the times. This issue becomes more and more severe with # increasing number of heavy interrupt sources. # # * Another interesting observation is: We cannot see the imbalance # of the interrupt load from /proc/interrupts. (/proc/interrupts shows # the cumulative load of interrupts on all CPUs.) If the interrupt load # is imbalanced and this imbalance is getting rotated among CPUs # continuously, then /proc/interrupts will still show that the interrupt # load is going to processors very evenly. Currently at the frequency # (HZ/50) at which IRQs are moved across CPUs, it is not possible to # see any interrupt load imbalance happening. # # * We have also found that, in certain cases the static IRQ binding # performs better than the existing kernel distribution of interrupt # load. The reason is, in a well-balanced interrupt load situations, # these interrupts are unnecessarily getting frequently moved across # CPUs. This adds an extra overhead; also it takes off the CPU cache # warmth benefits. # This came out from the performance measurements done on a 4-way HT # (8 logical processors) Pentium 4 Xeon system running 8 copies of # netperf. The 4 NICs in the system taking different IRQs generated # sizable interrupt load with the help of connected clients. # # Here the netperf transactions/sec throughput numbers observed are: # # IRQs nicely manually bound to CPUs: 56.20K # The current kernel implementation of IRQ movement: 50.05K # ----------------------- # The static binding of IRQs has performed 12.28% better than the # current IRQ movement implemented in the kernel. # # * The current implementation does not distinguish siblings from the # HT (Hyper-Threading(tm)) enabled CPUs. It will be beneficial to # balance the interrupt load with respect to processor packages first, # and then among logical CPUs inside processor packages. # For example if we have 2 heavy interrupt sources and 2 processor # packages (4 logical CPUs); Assigning both the heavy interrupt sources # in different processor packages is better, it will use different # execution resources from the different processor packages. # # # # New revised implementation: # ========================== # We also have been working on a new implementation. The following # points are in main focus. # # * At any moment heavily loaded IRQs are distributed to different # CPUs to achieve as much balance as possible. # # * Lightly loaded interrupt sources are ignored from the load # balancing, as they do not cause considerable imbalance. # # * When the heavy interrupt sources are balanced, they are not moved # around. This also helps in keeping the CPU caches warm. # # * It has been made HT aware. While distributing the load, the load # on a processor package to which the logical CPUs belong to is also # considered. # # * In the situations of few (lesser than num_cpus) heavy interrupt # sources, it is not possible to balance them evenly. In such case # the existing code has been reused to move the interrupts. The # randomness from the original code has been removed. # # * The time interval for redistribution has been made flexible. It # varies as the system interrupt load changes. # # * A new kernel_thread is introduced to do the load balancing # calculations for all the interrupt sources. It keeps the balanace_maps # ready for interrupt handlers, keeping the overhead in the interrupt # handling to minimum. # # * It allows the disabling of the IRQ distribution from the boot loader # command line, if anybody wants to do it for any reason. # # * The algorithm also takes into account the static binding of # interrupts to CPUs that user imposes from the # /proc/irq/{n}/smp_affinity interface. # # # Throughput numbers with the netperf setup for the new implementation: # # Current kernel IRQ balance implementation: 50.02K transactions/sec # The new IRQ balance implementation: 56.01K transactions/sec # --------------------- # The performance improvement on P4 Xeon of 11.9% is observed. # # The new IRQ balance implementation also shows little performance # improvement on P6 (Pentium II, III) systems. # # On a P6 system the netperf throughput numbers are: # Current kernel IRQ balance implementation: 36.96K transactions/sec # The new IRQ balance implementation: 37.65K transactions/sec # --------------------- # Here the performance improvement on P6 system of about 2% is observed. # # # --------------------- # # Andrew Theurer did some testing of this patch on a quad # P4: # # # I got a chance to run the NetBench benchmark with your patch on 2.5.54-mjb2 # kernel. NetBench measures SMB/CIFS performance by using several SMB # clients (in this case 44 Windows 2000 systems), sending SMB requests to a # Linux server running Samba 2.2.3a+sendfile. Result is in throughput, # Mbps. Generally the network traffic on the server is 60% recv, 40% tx. # # I believe we have very similar systems. Mine is a 4 x 1.6 GHz, 1 MB L3 P4 # Xeon with 4 GB DDR memory (3.2 GB/sec I believe). The chipset is "Summit". # I also have more than one Intel e1000 adapters. # # I decided to run a few configurations, first with just one adapter, with # and without HT support in the kernel (acpi=off), then add another adapter # and test again with/without HT. # # Here are the results: # # 4P, no HT, 1 x e1000, no kirq: 1214 Mbps, 4% idle # 4P, no HT, 1 x e1000, kirq: 1223 Mbps, 4% idle, +0.74% # # I suppose we didn't see much of an improvement here because we never run # into the situation where more than one interrupt with a high rate is # routed to a single CPU on irq_balance. # # 4P, HT, 1 x e1000, no kirq: 1214 Mbps, 25% idle # 4P, HT, 1 x e1000, kirq: 1220 Mbps, 30% idle, +0.49% # # Again, not much of a difference just yet, but lots of idle time. We may # have reached the limit at which one logical CPU can process interrupts for # an e1000 adapter. There are other things I can probably do to help this, # like int delay, and NAPI, which I will get to eventually. # # 4P, HT, 2 x e1000, no kirq: 1269 Mbps, 23% idle # 4P, HT, 2 x e1000, kirq: 1329 Mbps, 18% idle +4.7% # # OK, almost 5% better! Probably has to do with a couple of things; the fact # that your code does not route two different interrupts to the same # core/different logical cpus (quite obvious by looking at /proc/interrupts), # and that more than one interrupt does not go to the same cpu if possible. # I suspect irq_balance did some of those [bad] things some of the time, and # we observed a bottleneck in int processing that was lower than with kirq. # # I don't think all of the idle time is because of a int processing # bottleneck. I'm just not sure what it is yet :) Hopefully something will # become obvious to me... # # Overall I like the way it works, and I believe it can be tweaked to work # with NUMA when necessary. I hope to have access to a specweb system on a # NUMA box soon, so we can verify that. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.10 # [PATCH] Fix futexes in huge pages # # Using a futex in a large page causes a kernel lockup in __pin_page() - # because __pin_page's page revalidation uses follow_page(), and follow_page() # doesn't work for hugepages. # # The patch fixes up follow_page() to return the appropriate 4k page for # hugepages. # # This incurs a vma lookup for each follow_page(), which is considerable # overhead in some situations. We only _need_ to do this if the architecture # cannot determin a page's hugeness from the contents of the PMD. # # So this patch is a "reference" implementation for, say, PPC BAT-based # hugepages. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.11 # [PATCH] Optimise follow_page() for page-table-based hugepages # # ia32 and others can determine a page's hugeness by inspecting the pmd's value # directly. No need to perform a VMA lookup against the user's virtual # address. # # This patch ifdef's away the VMA-based implementation of # hugepage-aware-follow_page for ia32 and replaces it with a pmd-based # implementation. # # The intent is that architectures will implement one or the other. So the architecture either: # # 1: Implements hugepage_vma()/follow_huge_addr(), and stubs out # pmd_huge()/follow_huge_pmd() or # # 2: Implements pmd_huge()/follow_huge_pmd(), and stubs out # hugepage_vma()/follow_huge_addr() # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.12 # [PATCH] default_idle micro-optimisation # # Patch from rwhron@earthlink.net # # Micro-optimization of default_idle from -aa. current_cpu_data.hlt_works_ok # is only false for some old 386/486 pcs. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.13 # [PATCH] loop inefficiency fix # # Patch from Hugh Dickins # # The loop driver's loop over elements of bi_io_vec is in lo_send and # lo_receive: iterating that same transfer bi_vcnt times at the level above is, # er, excessive. (And no need to increment bi_idx here.) # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.14 # [PATCH] pte_chain_alloc fixes # # There are several places in which the return value from pte_chain_alloc() is # not being checked, and one place in which a GFP_KERNEL allocatiopn is # happening inside spinlock. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.15 # [PATCH] give hugetlbfs a set_page_dirty a_op # # Seems that nobody has tested direct IO into hugetlb pages yet. The VFS gets # upset about running set_page_dirty() against a non-uptodate page. # # So give hugetlbfs inodes a private no-op ->set_page_dirty() to isolate them # from all that. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.16 # [PATCH] Infrastructure for correct hugepage refcounting # # We currently have a problem when things like ptrace, futexes and direct-io # try to pin user pages. If the user's address is in a huge page we're # elevting the refcount of a constituent 4k page, not the head page of the # high-order allocation unit. # # To solve this, a generic way of handling higher-order pages has been # implemented: # # - A higher-order page is called a "compound page". Chose this because # "huge page", "large page", "super page", etc all seem to mean different # things to different people. # # - The first (controlling) 4k page of a compound page is referred to as the # "head" page. # # - The remaining pages are tail pages. # # All pages have PG_compound set. All pages have their lru.next pointing at # the head page (even the head page has this). # # The head page's lru.prev, if non-zero, holds the address of the compound # page's put_page() function. # # The order of the allocation is stored in the first tail page's lru.prev. # This is only for debug at present. This usage means that zero-order pages # may not be compound. # # The above relationships are established for _all_ higher-order pages in the # page allocator. Which has some cost, but not much - another atomic op during # fork(), mainly. # # This functionality is only enabled if CONFIG_HUGETLB_PAGE, although it could # be turned on permanently. There's a little extra cost in get_page/put_page. # # These changes do not preclude adding compound pages to the LRU in the future # - we can add a new page flag to the head page and then move all the # additional data to the first tail page's lru.next, lru.prev, list.next, # list.prev, index, private, etc. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.17 # [PATCH] convert hugetlb code to use compound pages # # The odd thing about hugetlb is that it maintains its own freelist of pages. # And it has to do that, else it would trivially run out of pages due to buddy # fragmetation. # # So we we don't want callers of put_page() to be passing those pages # to __free_pages_ok() on the final put(). # # So hugetlb installs a destructor in the compound pages to point at # free_huge_page(), which knows how to put these pages back onto the free list. # # Also, don't mark hugepages as all PageReserved any more. That's preenting # callers from doing proper refcounting. Any code which does a user pagetable # walk and hits part of a hugepage will now handle it transparently. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.18 # [PATCH] get_unmapped_area for hugetlbfs # # Having to specify the mapping address is a pain. Give hugetlbfs files a # file_operations.get_unmapped_area(). # # The implementation is in hugetlbfs rather than in arch code because it's # probably common to several architectures. If the architecture has special # needs it can define HAVE_ARCH_HUGETLB_UNMAPPED_AREA and go it alone. Just # like HAVE_ARCH_UNMAPPED_AREA. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.19 # [PATCH] hugetlbfs: fix truncate # # - Opening a hugetlbfs file O_TRUNC calls the generic vmtruncate() functions # and nukes the kernel. # # Give S_ISREG hugetlbfs files a inode_operations, and hence a setattr # which know how to handle these files. # # - Don't permit the user to truncate hugetlbfs files to sizes which are not # a multiple of HPAGE_SIZE. # # - We don't support expanding in ftruncate(), so remove that code. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.20 # [PATCH] hugetlbfs i_size fixes # # We're expanding hugetlbfs i_size in the wrong place. If someone attempts to # mmap more pages than are available, i_size is updated to reflect the # attempted mapping size. # # So set i_size only when pages are successfully added to the mapping. # # i_size handling at truncate time is still a bit wrong - if the mapping has # pages at (say) page offset 100-200 and the mappng is truncated to (say) page # offset 50, i_size should be set to zero. But it is instead set to # 50*HPAGE_SIZE. That's harmless. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.21 # [PATCH] hugetlbfs cleanups # # - Remove quota code. # # - Remove extraneous copy-n-paste code from truncate: that's only for # physically-backed filesystems. # # - Whitespace changes. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.22 # [PATCH] Give all architectures a hugetlb_nopage(). # # If someone maps a hugetlbfs file, then truncates it, then references the part # of the mapping outside the truncation point, they take a pagefault and we end # up hitting hugetlb_nopage(). # # We want to prevent this from ever happening. This patch just makes sure that # all architectures have a goes-BUG hugetlb_nopage() to trap it. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.23 # [PATCH] Fix hugetlbfs faults # # If the underlying mapping was truncated and someone references the # now-unmapped memory the kernel will enter handle_mm_fault() and will start # instantiating PAGE_SIZE pte's inside the hugepage VMA. Everything goes # generally pear-shaped. # # So trap this in handle_mm_fault(). It adds no overhead to non-hugepage # builds. # # Another possible fix would be to not unmap the huge pages at all in truncate # - just anonymise them. # # But I think we want full ftruncate semantics for hugepages for management # purposes. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.24 # [PATCH] ia32 hugetlb cleanup # # - whitespace # # - remove unneeded spinlocking no-op. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.25 # [PATCH] Fix hugetlb_vmtruncate_list() # # This function is quite wrong - has an "=" where it should have a "-" and # confuses PAGE_SIZE and HPAGE_SIZE in its address and file offset arithmetic. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.26 # [PATCH] hugetlb mremap fix # # If you attempt to perform a relocating 4k-aligned mremap and the new address # for the map lands on top of a hugepage VMA, do_mremap() will attempt to # perform a 4k-aligned unmap inside the hugetlb VMA. The hugetlb layer goes # BUG. # # Fix that by trapping the poorly-aligned unmap attempt in do_munmap(). # do_remap() will then fall through without having done anything to the place # where it tests for a hugetlb VMA. # # It would be neater to perform these checks on entry to do_mremap(), but that # would incur another VMA lookup. # # Also, if you attempt to perform a 4k-aligned and/or sized munmap() inside a # hugepage VMA the same BUG happens. This patch fixes that too. # # This all means that an mremap attempt against a hugetlb area will fail, but # only after having unmapped the source pages. That's a bit messy, but # supporting hugetlb mremap doesn't seem worth it, and completely disallowing # it will add overhead to normal mremaps. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.27 # [PATCH] mm/mremap.c whitespace cleanup # # - Not everyone uses 160-column xterms. # # - Coding style consistency # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.28 # [PATCH] spinlock debugging on uniprocessors # # Patch from Manfred Spraul # # This enables spinlock debuggng on uniprocessor builds, under # CONFIG_DEBUG_SPINLOCK. # # The reason I want this is that one day we'll need to pull out the debugging # support from the timer code which detects uninitialised timers. And once # that has gone, uniprocessor developers and testers have no way of detecting # uninitialised timers - there will be mysterious deadlocks on SMP machines. # And there will surely be more uninitialised timers # # The patch also removes the last pieces of the support for including # directly. Doesn't work since (IIRC) 2.3.x # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.29 # [PATCH] CPU Hotplug mm/slab.c CPU_UP_CANCELED fix # # Patch from Manfred Spraul. # # Fixes a bug which was exposed by Zwane's hotplug CPU work. The # cache_cache.array pointer is initially given a temp bootstrap area, which is # later converted over to the final value after the CPU is brought up. # # But if slab is enhanced to permit cancellation of a CPU bringup, this pointer # ends up pointing at stale memory. So reinitialise it by hand when # kmem_cache_init() is run. # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.49.30 # [PATCH] Fix signed use of i_blocks in ext3 truncate # # Patch from "Stephen C. Tweedie" # # Fix "h_buffer_credits<0" assert failure during truncate. # # The bug occurs when the "i_blocks" count in the file's inode overflows # past 2^31. That works fine most of the time, because i_blocks is an # unsigned long, and should go up to 2^32; but there's a place in truncate # where ext3 calculates the size of the next transaction chunk for the # delete, and that mistakenly uses a signed long instead. Because the # huge i_blocks gets cast to a negative value, ext3 does not reserve # enough credits for the transaction and the above error results. # # This is usually only possible on filesystems corrupted for other # reasons, but it is reproducible if you create a single, non-sparse file # larger than 1TB on ext3 and then try to delete it. # -------------------------------------------- # 03/02/06 torvalds@home.transmeta.com 1.925.48.2 # Merge bk://kernel.bkbits.net/vojtech/x86-64 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/06 randy.dunlap@verizon.net 1.925.48.3 # [PATCH] quota memleak # # The Stanford Checker found a memleak. # -------------------------------------------- # 03/02/06 jejb@raven.il.steeleye.com 1.925.48.4 # Merge raven.il.steeleye.com:/home/jejb/BK/scsi-misc-2.5 # into raven.il.steeleye.com:/home/jejb/BK/scsi-for-linus-2.5 # -------------------------------------------- # 03/02/06 agrover@groveronline.com 1.925.50.1 # ACPI: Enable compilation w/o cpufreq # -------------------------------------------- # 03/02/06 torvalds@home.transmeta.com 1.925.51.1 # Merge http://linux-acpi.bkbits.net/linux-acpi # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/06 torvalds@home.transmeta.com 1.925.48.5 # Merge http://linux-scsi.bkbits.net/scsi-for-linus-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/06 David_Jeffery@adaptec.com 1.925.48.6 # [PATCH] ips driver 1/4: fix struct length and remove dead code # # This small patch fixes the length of the IPS_ENQ # struct. It was too short which can cause the adapter # to write beyond the the end of the struct during # driver initialization and corrupt part of memory. # -------------------------------------------- # 03/02/06 David_Jeffery@adaptec.com 1.925.48.7 # [PATCH] ips driver 2/4: initialization reordering # # This large patch reworks much of the adapter initialization # code. # # It splits the scsi initialization code from the pci # initialization. It adds support for working with some # future cards. It also removes the use of multiple pci_driver # registrations and instead does its own adapter ordering. # -------------------------------------------- # 03/02/06 David_Jeffery@adaptec.com 1.925.48.8 # [PATCH] ips driver 3/4: 64bit dma addressing # # This large patch adds support for using 64bit addressing. # # Special thanks goes to Mike Anderson who did the initial # versions of this patch. # -------------------------------------------- # 03/02/06 David_Jeffery@adaptec.com 1.925.48.9 # [PATCH] ips driver 4/4: error messages # # This small patch does 2 things. It reworks the firmware/driver # versioning messages to make them more understandable, and it # fixes one case where the 64bit addressing changes caused # error/success to not be properly reported to the serveraid tools. # -------------------------------------------- # 03/02/06 drow@nevyn.them.org 1.925.22.4 # Add PTRACE_O_TRACEVFORKDONE and PTRACE_O_TRACEEXIT facilities. # -------------------------------------------- # 03/02/06 mingo@elte.hu 1.925.48.10 # [PATCH] signal-fixes-2.5.59-A4 # # this is the current threading patchset, which accumulated up during the # past two weeks. It consists of a biggest set of changes from Roland, to # make threaded signals work. There were still tons of testcases and # boundary conditions (mostly in the signal/exit/ptrace area) that we did # not handle correctly. # # Roland's thread-signal semantics/behavior/ptrace fixes: # # - fix signal delivery race with do_exit() => signals are re-queued to the # 'process' if do_exit() finds pending unhandled ones. This prevents # signals getting lost upon thread-sys_exit(). # # - a non-main thread has died on one processor and gone to TASK_ZOMBIE, # but before it's gotten to release_task a sys_wait4 on the other # processor reaps it. It's only because it's ptraced that this gets # through eligible_child. Somewhere in there the main thread is also # dying so it reparents the child thread to hit that case. This means # that there is a race where P might be totally invalid. # # - forget_original_parent is not doing the right thing when the group # leader dies, i.e. reparenting threads to init when there is a zombie # group leader. Perhaps it doesn't matter for any practical purpose # without ptrace, though it makes for ppid=1 for each thread in core # dumps, which looks funny. Incidentally, SIGCHLD here really should be # p->exit_signal. # # - one of the gdb tests makes a questionable assumption about what kill # will do when it has some threads stopped by ptrace and others running. # # exit races: # # 1. Processor A is in sys_wait4 case TASK_STOPPED considering task P. # Processor B is about to resume P and then switch to it. # # While A is inside that case block, B starts running P and it clears # P->exit_code, or takes a pending fatal signal and sets it to a new # value. Depending on the interleaving, the possible failure modes are: # a. A gets to its put_user after B has cleared P->exit_code # => returns with WIFSTOPPED, WSTOPSIG==0 # b. A gets to its put_user after B has set P->exit_code anew # => returns with e.g. WIFSTOPPED, WSTOPSIG==SIGKILL # # A can spend an arbitrarily long time in that case block, because # there's getrusage and put_user that can take page faults, and # write_lock'ing of the tasklist_lock that can block. But even if it's # short the race is there in principle. # # 2. This is new with NPTL, i.e. CLONE_THREAD. # Two processors A and B are both in sys_wait4 case TASK_STOPPED # considering task P. # # Both get through their tests and fetches of P->exit_code before either # gets to P->exit_code = 0. => two threads return the same pid from # waitpid. # # In other interleavings where one processor gets to its put_user after # the other has cleared P->exit_code, it's like case 1(a). # # # 3. SMP races with stop/cont signals # # First, take: # # kill(pid, SIGSTOP); # kill(pid, SIGCONT); # # or: # # kill(pid, SIGSTOP); # kill(pid, SIGKILL); # # It's possible for this to leave the process stopped with a pending # SIGCONT/SIGKILL. That's a state that should never be possible. # Moreover, kill(pid, SIGKILL) without any repetition should always be # enough to kill a process. (Likewise SIGCONT when you know it's # sequenced after the last stop signal, must be sufficient to resume a # process.) # # 4. take: # # kill(pid, SIGKILL); // or any fatal signal # kill(pid, SIGCONT); // or SIGKILL # # it's possible for this to cause pid to be reaped with status 0 # instead of its true termination status. The equivalent scenario # happens when the process being killed is in an _exit call or a # trap-induced fatal signal before the kills. # # plus i've done stability fixes for bugs that popped up during # beta-testing, and minor tidying of Roland's changes: # # - a rare tasklist corruption during exec, causing some very spurious and # colorful crashes. # # - a copy_process()-related dereference of already freed thread structure # if hit with a SIGKILL in the wrong moment. # # - SMP spinlock deadlocks in the signal code # # this patchset has been tested quite well in the 2.4 backport of the # threading changes - and i've done some stresstesting on 2.5.59 SMP as # well, and did an x86 UP testcompile + testboot as well. # -------------------------------------------- # 03/02/06 markh@osdl.org 1.925.48.11 # [PATCH] fix megaraid driver compile error # # This moves access of the host element to device since host has been # removed from struct scsi_cmnd. # -------------------------------------------- # 03/02/06 drow@nevyn.them.org 1.925.22.5 # Signal handling bugs for thread exit + ptrace # -------------------------------------------- # 03/02/06 colpatch@us.ibm.com 1.925.48.12 # [PATCH] Broken CLEAR_BITMAP() macro # # The CLEAR_BITMAP() macro in include/linux/types.h is broken and doesn't # round the bitmap size to the proper 'long' boundary. # # This fixes it by creating a macro BITS_TO_LONGS that just rounds a # number of bits up to the closest number of unsigned longs. This makes # the DECLARE & CLEAR _BITMAP macros more readable and fixes the bug. # -------------------------------------------- # 03/02/06 drow@nevyn.them.org 1.925.52.1 # Hand-merge with Ingo's changes # -------------------------------------------- # 03/02/06 elenstev@mesatop.com 1.925.48.13 # [PATCH] Spelling fixes # # OK, here is the diff against 2.5.59-bk2, now up to 880 lines due to an # additional misspelling which crept in the -bk2 snapshot. # # Fixes 'seperate' -> 'separate' and 'definate' -> 'definite'. # # Kernal codrs cna't spel. # -------------------------------------------- # 03/02/06 roland@redhat.com 1.925.48.14 # [PATCH] Make sys_wait4() more readable # # I cleaned up sys_wait4; it was straightforward and I think a definite # improvement. While at it, I noticed that one of the races I fixed in the # TASK_STOPPED case actually can happen earlier. Between read_unlock and # write_lock_irq, another thread could reap the process and make P invalid, # so now I do get_task_struct before read_unlock and then the existing race # checks catch all scenarios. # # Aside from the aforementioned race tweak, the code should be the same as # in the previous patch (that Ingo and I have tested more thoroughly) # modulo being moved into functions and some reformatting and comment # changes. # # Oh, my old patch had one case where it failed to retake the read lock after # a race bailout that I just noticed reading over it. That's fixed too. # # These exit fixes were something I noticed incidentally and spent less time # on than the signals changes. Another few passes of eyeballs over them are # certainly warranted. (In particular, there are code paths like that one # that check for specific races that have probably never been seen in # practice, so those code paths have never run once.) # -------------------------------------------- # 03/02/06 akpm@digeo.com 1.925.48.15 # [PATCH] revert extra sendfile security hook patch # # hm. It seems that I sent this patch twice. # # After resyncing with your tree I go through and try to reapply all the sent # patches, throwing out the ones which get a lot of rejects. Just to make sure # that everything got through OK. # # But it appears that that particular patch happily applied on top of itself, # so I assumed it was not applied... # -------------------------------------------- # 03/02/06 Andries.Brouwer@cwi.nl 1.925.48.16 # [PATCH] Remove dead code # # In struct char_dev the fields openers and sem are unused. # The file char_dev.c claims that it is called differently. # -------------------------------------------- # 03/02/06 Andries.Brouwer@cwi.nl 1.925.48.17 # [PATCH] Doc fix # -------------------------------------------- # 03/02/06 hch@sgi.com 1.925.48.18 # [PATCH] fix leaks in vxfs_read_fshead() # # The Stanford checker disclose that vxfs_read_fshead was missing any # unwinding in the error cases.. # -------------------------------------------- # 03/02/06 fdavis@si.rr.com 1.925.48.19 # [PATCH] 2.5.59 : drivers/media/video/bt856.c # # This fixes a bt856.c compile error. The driver now compiles. Its a # straightforward patch and have emailed l-k and no objections have been # reported. # -------------------------------------------- # 03/02/06 drow@nevyn.them.org 1.925.53.1 # Merge # -------------------------------------------- # 03/02/06 fdavis@si.rr.com 1.925.48.20 # [PATCH] 2.5.59 : drivers/media/video/saa7185.c # # This patch to saa7185 to resolves buzilla bug #168 (compile error). It # has been sent to l-k and has received no objections. # -------------------------------------------- # 03/02/06 fdavis@si.rr.com 1.925.48.21 # [PATCH] 2.5.59 : drivers/media/video/bt819.c # # This patch for bt819.c addresses buzilla bug #169 (compile error). # -------------------------------------------- # 03/02/06 anton@samba.org 1.925.48.22 # [PATCH] missing include in pci-sysfs.c # # Add a missing include for those pesky S_IRUGO thingys. # -------------------------------------------- # 03/02/06 roland@redhat.com 1.925.48.23 # [PATCH] exit_notify/do_exit cleanup # # Here is a cleanup moving the new pending thread signal check into # exit_notify. # # I also made exit_notify and do_exit consistent in using the saved tsk # variable instead of current, as most of do_exit already does. # -------------------------------------------- # 03/02/06 torvalds@home.transmeta.com 1.925.48.24 # Merge # -------------------------------------------- # 03/02/07 bdschuym@pandora.be 1.925.1.52 # [BRIDGE]: update to new module scheme. # -------------------------------------------- # 03/02/07 jmorris@intercode.com.au 1.925.1.53 # [IPV4]: Fix skb leak in inet_rtm_getroute. # -------------------------------------------- # 03/02/07 jmorris@intercode.com.au 1.925.1.54 # [IPV6]: Fix skb leak in inet6_rtm_getroute. # -------------------------------------------- # 03/02/07 buytenh@gnu.org 1.925.1.55 # [BRIDGE]: Update maintainership status. # -------------------------------------------- # 03/02/07 buytenh@gnu.org 1.925.1.56 # [BRIDGE]: handle out-of-ports corner case. # -------------------------------------------- # 03/02/07 jmorris@intercode.com.au 1.925.1.57 # [LSM]: networking hooks, kconfig bits. # -------------------------------------------- # 03/02/07 jmorris@intercode.com.au 1.925.1.58 # [LSM]: Networking top-level socket operation hooks. # -------------------------------------------- # 03/02/07 jmorris@intercode.com.au 1.925.1.59 # [LSM]: Networking socket SKB receive hook. # -------------------------------------------- # 03/02/07 jmorris@intercode.com.au 1.925.1.60 # [LSM]: Networking AF_UNIX hooks. # -------------------------------------------- # 03/02/07 jmorris@intercode.com.au 1.925.1.61 # [LSM]: Networking netlink socket capability hooks. # -------------------------------------------- # 03/02/07 elenstev@mesatop.com 1.925.48.25 # [PATCH] Spelling fixes for consistent, dependent, persistent # # This fixes the following common misspellings and their variants. # # consistant -> consistent # dependant -> dependent # persistant -> persistent # -------------------------------------------- # 03/02/07 roland@redhat.com 1.925.48.26 # [PATCH] SA_NOCLDWAIT now supported - update comments # # This patch removes all the comments on the SA_NOCLDWAIT definitions, # since SA_NOCLDWAIT is fully supported now. # -------------------------------------------- # 03/02/07 roland@redhat.com 1.925.48.27 # [PATCH] do_sigaction locking cleanup # # This changes do_sigaction to avoid read_lock(&tasklist_lock) on every # call. Only in the fairly uncommon cases where it's really needed will # it take that lock (which requires unlocking and relocking the siglock # for locking order). # # I also changed the ERESTARTSYS added in my earlier patch to ERESTARTNOINTR. # That is an "instantaneous" case, and there is no reason to have it possibly # return EINTR if !SA_RESTART (which AFAIK sigaction never could before, and # it might not be kosher by POSIX); rollback is always better. # -------------------------------------------- # 03/02/07 akpm@digeo.com 1.925.48.28 # [PATCH] Fix possible uninitialised variable in vma merging code # # Spotted by davem. Strange that it ever worked. Don't know why the compiler # didn't warn... # -------------------------------------------- # 03/02/07 torvalds@home.transmeta.com 1.925.48.29 # Don't special-case SIGKILL/SIGSTOP - the blocking masks should # already take care of it. # # This fixes kernel threads that _do_ block SIGKILL/STOP. # -------------------------------------------- # 03/02/07 torvalds@home.transmeta.com 1.925.48.30 # Split up "struct signal_struct" into "signal" and "sighand" parts. # # This is required to get make the old LinuxThread semantics work # together with the fixed-for-POSIX full signal sharing. A traditional # CLONE_SIGHAND thread (LinuxThread) will not see any other shared # signal state, while a new-style CLONE_THREAD thread will share all # of it. # # This way the two methods don't confuse each other. # -------------------------------------------- # 03/02/07 drow@nevyn.them.org 1.925.48.31 # Hand merge # -------------------------------------------- # 03/02/07 cw@f00f.org 1.925.48.32 # [PATCH] signal locking update # # Accomodate the signal locking moving from "tsk->sig" to "tsk->sighand". # -------------------------------------------- # 03/02/07 roland@redhat.com 1.925.48.33 # [PATCH] TASK_STOPPED wakeup cleanup # # For handle_stop_signal to do the special case for SIGKILL and have it # work right in all SMP cases (without changing all the existing ptrace # stops), it needs to at least set TIF_SIGPENDING on each thread before # resuming it. # # handle_stop_signal addresses a related race for SIGCONT by setting # TIF_SIGPENDING already, so having SIGKILL handled the same way makes # sense. # # Now it seems pretty clean to have handle_stop_signal resume threads for # SIGKILL, and have on SIGKILL special case in group_send_sig_info. # # There is also an SMP race issue with cases like do_syscall_trace, i.e. # TASK_STOPPED state set without holding the siglock. So I think # handle_stop_signal should call wake_up_process unconditionally. # -------------------------------------------- # 03/02/08 anton@samba.org 1.945 # resolve conflicts # -------------------------------------------- # 03/02/08 kai@tp1.ruhr-uni-bochum.de 1.925.48.34 # kbuild: Handle external SUBDIRS with modversions # # We need to collect a list of all modules during the recursive build. I used # a "touch .tmp_versions/" to do so, which however doesn't # work so well, when path/to isn't inside the kernel tree. # # The best way to build external modules is currently using kbuild by saying # "make SUBDIRS=/some/external/dir modules", which was thus broken. While this # way is not all that optimal and I hope to come up with something better # before 2.6, it works and should keep working, so this patch fixes the usage # above. # # Instead of touching files with the entire path added, we just create a # .mod file in $(MODVERDIR) now, and save the path to the module.ko # in it. Since module names are unique, a flat hierarchy is actually fine here. # -------------------------------------------- # 03/02/08 kai@tp1.ruhr-uni-bochum.de 1.925.48.35 # kbuild: Warn on obsolete export-objs use # # Setting export-objs is not necessary anymore, so warn on encountering it # to prevent it from creeping back in ;) # # Also, make the error when we find someone still using O_TARGET non-fatal, # so that people sharing stuff between 2.4 and 2.5 don't have more hassle # than necessary. # -------------------------------------------- # 03/02/08 perex@suse.cz 1.925.54.1 # ALSA update # - cmipci driver cleanups (ac3 & surround) # - replaced snd_dma_residue() with snd_dma_pointer() # - GCC 3.3 warnings removal # - timer interface # - recoded using tasklet # - improved slave timer locking (should be much faster) # - added async support # - improved ioctl32 wrapper functions # - fixed Makefile problems (synth modules were build for not selected driver) # - AC97 codec # - improved SPSA control # - moved reset function outside the main init code # - improved ALC650 initialization # - USB driver # - added quirk for Roland XV-2020 # # -------------------------------------------- # 03/02/08 kai@tp1.ruhr-uni-bochum.de 1.925.48.36 # kbuild: Modversions fix # # We're still using the old genksyms binary, that's why we have to # postprocess the output to convert it into a linker script - that # postprocessing got confused by "__verify_write". # # Kick out the grep, do it all and correctly within sed. # # Bug reported by Thomas Molina. # -------------------------------------------- # 03/02/08 kai@tp1.ruhr-uni-bochum.de 1.925.48.37 # kbuild: Add a bug trap for people playing with SUBDIRS too much # # If SUBDIRS is set manually on the command line, the contents of # .tmp_versions are not deleted before descending and can accumulate # stale entries. Print a warning if that case is detected, but deal with # it gracefully. # -------------------------------------------- # 03/02/08 perex@suse.cz 1.925.54.2 # ALSA update # - emu10k1 - fixed makefile to not build synth module when emu10k1 is not selected # -------------------------------------------- # 03/02/08 cw@f00f.org 1.925.54.3 # [PATCH] missing sound include file # # Sound drivers need for tasklets # -------------------------------------------- # 03/02/08 torvalds@home.transmeta.com 1.925.54.4 # More signal handling fixups for the threaded signal fix upheavals. # # This fixes the signal code to not wake up threads with blocked signals, # especially noticeable with kernel threads that may not be able to handle # signals at all. # # We also don't unnecessarily wake processes in TASK_UNINTERRUPTIBLE. # -------------------------------------------- # 03/02/09 anton@samba.org 1.946 # Merge samba.org:/scratch/anton/linux-2.5 # into samba.org:/scratch/anton/sfr # -------------------------------------------- # 03/02/09 rmk@arm.linux.org.uk 1.925.54.5 # [PATCH] Fix Alt-SysRQ-T status, and comment # # Fix wrong order of process status. It's # # #define TASK_RUNNING 0 # #define TASK_INTERRUPTIBLE 1 # #define TASK_UNINTERRUPTIBLE 2 # #define TASK_STOPPED 4 # #define TASK_ZOMBIE 8 # #define TASK_DEAD 16 # # but SysRQ printout routines switch stopped and zombie around. # # So, for one more time, here's another mailing of the same patch to fix # this brokenness. In addition, fix the wrong comment in fs/proc/array.c # -------------------------------------------- # 03/02/09 akpm@digeo.com 1.925.54.6 # [PATCH] Fix compile warning for 'sys_exit_group' # # sys_exit_group() doesn't return any value, and obviously cannot. # # So don't make the compiler unhappy about it by claiming it does. # -------------------------------------------- # 03/02/09 jamie@shareable.org 1.925.54.7 # [PATCH] CONFIG_PREEMPT fix of do_debug() # # If CONFIG_PREEMPT is enabled, and the kernel is preempted just before # do_debug() has a chance to save the debug register values, DR6 could be # read from the wrong CPU. # # It is exactly the same problem as reading %cr2 in the page fault # handler. Same fix: make the handler a interrupt gate, and enable # interrupts only once safe. # -------------------------------------------- # 03/02/09 davem@kernel.bkbits.net 1.925.1.62 # Merge davem@nuts.ninka.net:/home/davem/src/BK/net-2.5 # into kernel.bkbits.net:/home/davem/net-2.5 # -------------------------------------------- # 03/02/09 jejb@raven.il.steeleye.com 1.925.54.8 # Restore device command queue functionality # # The recent slab allocation changes mean that we no longer keep a # permanent list of commands on the device_queue list. However, # certain pieces of SCSI code relied on being able to traverse this # list to find details of all outstanding commands (the error handler # being the prime example). This code adds back a new dynamic cmd_list # which keeps the list of commands currently allocated to the device. # Since the list is dynamic, it is protected by a lock (list_lock). # -------------------------------------------- # 03/02/09 jejb@raven.il.steeleye.com 1.925.54.9 # [SCSI] Migrate sim710 to 53c700 chip driver # # This should add synchronous support and Tagged Command Queueing. # At the moment, it cuts down on the number of command line options, # but we can add those back in later. # # This patch also migrates the driver to the new device model for # both MCA and EISA. # -------------------------------------------- # 03/02/09 luben@splentec.com 1.925.54.10 # [SCSI] add commands at the tail of cmd_list # # It's probably going to be a fifo, so it should be more efficient # for taking them off again # -------------------------------------------- # 03/02/09 jejb@raven.il.steeleye.com 1.925.54.11 # [SCSI] Remove 53c7,8xx since we have plenty of alternatives. # # We have 53c700.c and 53c7xx for the 7xx series and # ncr53c8xx for the 720. The sym53c8xx_2 covers all the 8xx chips. # -------------------------------------------- # 03/02/09 jejb@mulgrave.(none) 1.925.54.12 # [SCSI] Add missing list head init of cmd_list # -------------------------------------------- # 03/02/09 perex@suse.cz 1.925.55.1 # ALSA update # - moved inclusion of from to # - pmac driver - removed beep stuff for 2.5 kernels # - USB driver - fixed compilation # -------------------------------------------- # 03/02/10 anton@samba.org 1.947 # Merge samba.org:/scratch/anton/linux-2.5 # into samba.org:/scratch/anton/sfr # -------------------------------------------- # 03/02/10 anton@samba.org 1.948 # ppc64: update for signal changes # -------------------------------------------- # 03/02/10 anton@samba.org 1.949 # ppc64: Fix nasty bug in cmpxchg where we would sign extend the old value. # -------------------------------------------- # 03/02/09 torvalds@home.transmeta.com 1.950 # Merge http://linux-sound.bkbits.net/linux-sound # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/09 torvalds@home.transmeta.com 1.951 # Merge http://linux-scsi.bkbits.net/scsi-for-linus-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/09 mingo@elte.hu 1.952 # [PATCH] Lock session and group ID setting # # - session-IDs and group-IDs are set outside the tasklist lock. This # causes breakage in the USB code. The correct fix is to do this: # # I introduced the bug with the new pidhash. # -------------------------------------------- # 03/02/09 mingo@elte.hu 1.953 # [PATCH] lock group_send_sig_info() properly # # - a read_lock(&tasklist_lock) is missing around the group_send_sig_info() # in send_sig_info(). # -------------------------------------------- # 03/02/09 torvalds@home.transmeta.com 1.954 # Merge bk://kernel.bkbits.net/davem/net-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/09 roland@redhat.com 1.955 # [PATCH] zap_other_threads() needs tasklist_lock held # -------------------------------------------- # 03/02/09 mikulas@artax.karlin.mff.cuni.cz 1.956 # [PATCH] simple EXT2 patch # # Do not crash on null pointer dereference, if cannot reread superblock. # -------------------------------------------- # 03/02/09 torvalds@home.transmeta.com 1.957 # Make sigprocmask() available to kernel threads too, since a lot of # them do want to temporarily block signals. # # Kernel users can also block signals that are normally unblockable # to user space, ie SIGKILL and SIGSTOP. # # Make nfsd and autofs use the new interface, as an example to others. # -------------------------------------------- # 03/02/09 torvalds@home.transmeta.com 1.958 # Fix missing break, causing sigprocmask(SIG_SETMASK ...) to always # return an error. # # Interestingly, nobody much seems to care. Apparently few programs # check the error value. # -------------------------------------------- # 03/02/09 torvalds@home.transmeta.com 1.959 # Merge http://linux-isdn.bkbits.net/linux-2.5.make # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.960 # [PATCH] Documentation_Changes # # From: Frank Davis # # this was already mentioned on l-k by ramune@net-ronin.org, but isn't in # 2.5.59. Placing on the trivial queue for inclusion. # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.961 # [PATCH] Remove superflous 'either' # # From: John Bradford # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.962 # [PATCH] fix comment in module.c # # From: John Levon # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.963 # [PATCH] remove check_region from drivers_net_irda_irport.c # # From: william stinson # # this patch for drivers/net/irda/irport.c IRDA driver removes one call # to check_region using request_region instead. The patch also moves # the call to request_region to before the allocation of the driver # instance. # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.964 # [PATCH] parport_pc and !CONFIG_PNP # # From: Geert Uytterhoeven # # parport_pc_pnp_driver is const if !CONFIG_PNP, while pnp_register_driver() # takes a non-const pointer as parameter. # # An alternative fix is to change the prototype of the dummy # pnp_register_driver(), but this may affect other drivers. # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.965 # [PATCH] Change "char _version" to "char in drivers_lcs.c # # From: Pablo Menichini # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.966 # [PATCH] add one help text to drivers_atm_Kconfig # # From: Steven Cole # # Here is a help text from 2.4.21-pre4 Configure.help which is # needed in 2.5.59 drivers/atm/Kconfig. # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.967 # [PATCH] scripts_ver_linux # # From: Frank Davis # # The ver_linux script is still using rmmod to determine # module-init-tools version. The following patch uses depmod, # which produces the appropriate result. # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.968 # [PATCH] Change "char _version" to "char in drivers_net_mac8390.c # # From: Pablo Menichini # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.969 # [PATCH] add two help texts to drivers_i2c_Kconfig # # From: Steven Cole # # Here are some help texts from 2.4.21-pre3 Configure.help which are # needed in 2.5.59 drivers/i2c/Kconfig. # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.970 # [PATCH] Remove compile warning from fs_xfs_support_move.c # # From: Bob Miller # # Include string.h to remove a compiler warning. # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.971 # [PATCH] make i2c-core driver_lock static # # From: Muli Ben-Yehuda # # The i2c driver_lock is needlessly exported. # This makes it static. # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.972 # [PATCH] Memory leak in drivers_net_arlan.c (1) # # From: Pablo Menichini # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.973 # [PATCH] RTC alarm and wildcards # # (Included in 2.4) # From: Paul Gortmaker # # Summary: Wildcards in RTC alarm settings failed to work # # Description: # The RTC has provision for wildcards when setting the alarm; to # use them you have to write a value higher than 0xc0 to the # appropriate hr/min/sec entry. The driver used 0xff, which is # fine, but it mistakenly fed the 0xff through BIN_TO_BCD before # writing them (which is < 0xc0) and so wildcards didn't work. # (Thanks to Gerhard Kurz for reporting the bug.) # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.974 # [PATCH] fix typo of members name in drivers_mtd_ftl.c # # From: Pablo Menichini # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.975 # [PATCH] Fix return code of init_module in drivers_net_arlan.c (2) # # From: Pablo Menichini # # This patch returns correct error codes if init_modules fail. # Because of this, we can take the printks indicating the error as these # corrected error codes return miningfull information. # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.976 # [PATCH] Kill unused code # # From: Pavel Machek # # Second part of this patch never got in (and I was told it was not bug # in ASUS but in linux), so it is useless junk... Please apply, # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.977 # [PATCH] remove LinuxVersionCode from de4x5.h # # From: Adrian Bunk # # drivers/net/tulip/de4x5.h in 2.5.54 contains a definition of # LinuxVersionCode. LinuxVersionCode isn't used and it's anyway obsoleted # by KERNEL_VERSION in version.h. # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.978 # [PATCH] nfs_write.c warning # # From: William Lee Irwin III # # This trivially corrects an unused variable warning in nfs/write.c: # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.979 # [PATCH] Squash unused function in fs_nfs_mount_clnt.c # # From: David Gibson # # is never used, so this patch removes it. # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.980 # [PATCH] fix spelling of kernel in arch_v850_kernel_mach.h # # From: Steven Cole # # This fixes the only instance of "kernal" in 2.5.59. # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.981 # [PATCH] fix linewrap in Documentation_arm_SA1100_CERF # # [ Verified that no text changed with tr and cmp --RR ] # From: ookhoi@humilis.net # # With this patch I tried to make Documentation/arm/SA1100/CERF more # readible by fixing the linewrap. # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.982 # [PATCH] swsusp: do not panic on bad signature with noresume # # From: Pavel Machek # # This patch makes kernel ignore bad signature on suspend device when # "noresume" is given, and cleans things up a little bit. Please apply, # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.983 # [PATCH] add six help texts to drivers_ide_Kconfig # # From: Steven Cole # # Here are some help texts from 2.4.21-pre3 Configure.help which are # needed in 2.5.59 drivers/ide/Kconfig. # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.984 # [PATCH] add four help texts to drivers_char_watchdog_Kconfig # # From: Steven Cole # # Here are some help texts from 2.4.21-pre3 Configure.help which are # needed in 2.5.59 drivers/char/watchdog/Kconfig. # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.985 # [PATCH] Change "char version" to initdata in drivers_net_tulip_de4x5.c # # From: Pablo Menichini # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.986 # [PATCH] add two help texts to drivers_media_video_Kconfig # # From: Steven Cole # # Here are some help texts from 2.4.21-pre3 Configure.help which are # needed in 2.5.59 drivers/media/video/Kconfig. # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.987 # [PATCH] Write with buffer>2GB returns broken errno (2) # # [ Acked by AKPM --RR ] # From: Kazuto MIYOSHI # # On 64-bit platforms, issuing write(2) with buffer larger than # 2GB will return -1 and broken errno (such as 2147483640) # Requested data itself is written correctly. # # That is because generic_file_write() and other relating functions # store 'ssize_t written' into 'int err'. Written byte is trimmed to # int and then sign-extended to a negative ssize_t value, which # wrongly indicates an error. # # (On 64bit platform, current glibc defines SSIZE_MAX as 'LONG_MAX') # -------------------------------------------- # 03/02/09 rusty@rustcorp.com.au 1.988 # [PATCH] Change all .o to .ko in Kconfig files # # From: GertJan Spoelman # # OK, here is a new patch, I edited the old patch and took out the .ko's # so now the extension is trimmed instead. # -------------------------------------------- # diff -Nru a/Documentation/Changes b/Documentation/Changes --- a/Documentation/Changes Sun Feb 9 21:13:36 2003 +++ b/Documentation/Changes Sun Feb 9 21:13:36 2003 @@ -52,7 +52,7 @@ o Gnu make 3.78 # make --version o binutils 2.9.5.0.25 # ld -v o util-linux 2.10o # fdformat --version -o module-init-tools 0.9.8 # rmmod -V +o module-init-tools 0.9.9 # depmod -V o e2fsprogs 1.29 # tune2fs o jfsutils 1.0.14 # fsck.jfs -V o reiserfsprogs 3.6.3 # reiserfsck -V 2>&1|grep reiserfsprogs diff -Nru a/Documentation/DocBook/journal-api.tmpl b/Documentation/DocBook/journal-api.tmpl --- a/Documentation/DocBook/journal-api.tmpl Sun Feb 9 21:13:28 2003 +++ b/Documentation/DocBook/journal-api.tmpl Sun Feb 9 21:13:28 2003 @@ -141,17 +141,14 @@ Or if you've asked for access to a buffer you now know is now longer required to be pushed back on the device you can call journal_forget() in much the same way as you might have used bforget() in the past. - - - A journal_flush() may be called at any time to commit and checkpoint all your transactions. - + Then at umount time , in your put_super() (2.4) or write_super() (2.5) you can then call journal_destroy() to clean up your in-core journal object. @@ -168,8 +165,8 @@ across differing journals, and another filesystem other than yours (say ext3) may be modified in a later syscall. - + The second case to bear in mind is that journal_start() can block if there isn't enough space in the journal for your transaction (based on the passed nblocks param) - when it blocks it merely(!) needs to @@ -180,10 +177,14 @@ deadlocks. Note that journal_extend() has similar blocking behaviour to journal_start() so you can deadlock here just as easily as on journal_start(). - -Try to reserve the right number of blocks the first time. ;-). + +Try to reserve the right number of blocks the first time. ;-). This will +be the maximum number of blocks you are going to touch in this transaction. +I advise having a look at at least ext3_jbd.h to see the basis on which +ext3 uses to make these decisions. + Another wriggle to watch out for is your on-disk block allocation strategy. why? Because, if you undo a delete, you need to ensure you haven't reused any @@ -211,6 +212,30 @@ if you allow unprivileged userspace to trigger codepaths containing these calls. + + +A new feature of jbd since 2.5.25 is commit callbacks with the new +journal_callback_set() function you can now ask the journalling layer +to call you back when the transaction is finally commited to disk, so that +you can do some of your own management. The key to this is the journal_callback +struct, this maintains the internal callback information but you can +extend it like this:- + + + struct myfs_callback_s { + //Data structure element required by jbd.. + struct journal_callback for_jbd; + // Stuff for myfs allocated together. + myfs_inode* i_commited; + + } + + + +this would be useful if you needed to know when data was commited to a +particular inode. + + diff -Nru a/Documentation/SubmittingDrivers b/Documentation/SubmittingDrivers --- a/Documentation/SubmittingDrivers Sun Feb 9 21:13:34 2003 +++ b/Documentation/SubmittingDrivers Sun Feb 9 21:13:34 2003 @@ -62,7 +62,7 @@ in Documentation/CodingStyle. If you have sections of code that need to be in other formats, for example because they are shared with a windows driver kit and you want to - maintain them just once seperate them out nicely and note + maintain them just once separate them out nicely and note this fact. Portability: Pointers are not always 32bits, not all computers are little diff -Nru a/Documentation/arm/SA1100/CERF b/Documentation/arm/SA1100/CERF --- a/Documentation/arm/SA1100/CERF Sun Feb 9 21:13:28 2003 +++ b/Documentation/arm/SA1100/CERF Sun Feb 9 21:13:28 2003 @@ -1,23 +1,28 @@ -The Intrinsyc CerfBoard is a StrongARM 1110-based computer on a board that measures -approximately 2" square. It includes an Ethernet controller, an RS232-compatible serial port, a -USB function port, and one CompactFlash+ slot on the back. Pictures can be found at the +The Intrinsyc CerfBoard is a StrongARM 1110-based computer on a board +that measures approximately 2" square. It includes an Ethernet +controller, an RS232-compatible serial port, a USB function port, and +one CompactFlash+ slot on the back. Pictures can be found at the Intrinsyc website, http://www.intrinsyc.com. -This document describes the support in the Linux kernel for the Intrinsyc CerfBoard as of -version 2.4.0-test4-np1. +This document describes the support in the Linux kernel for the +Intrinsyc CerfBoard as of version 2.4.0-test4-np1. Supported in this version: - - CompactFlash+ slot (select PCMCIA in General Setup and any options that may be required) - - Onboard Crystal CS8900 Ethernet controller (Cerf CS8900A support in Network Devices) + - CompactFlash+ slot (select PCMCIA in General Setup and any options + that may be required) + - Onboard Crystal CS8900 Ethernet controller (Cerf CS8900A support in + Network Devices) - Serial ports with a serial console (hardcoded to 38400 8N1) Not supported in this version (yet): - LCD driver/touchscreen interface - - UDC (a driver exists right now, but is unstable and slow and only works with the Linux USB) + - UDC (a driver exists right now, but is unstable and slow and only + works with the Linux USB) -In order to get this kernel onto your Cerf, you need a server that runs both BOOTP and -TFTP. Detailed instructions should have come with your evaluation kit on how to use the -bootloader. This series of commands will suffice: +In order to get this kernel onto your Cerf, you need a server that runs +both BOOTP and TFTP. Detailed instructions should have come with your +evaluation kit on how to use the bootloader. This series of commands +will suffice: make cerf_config make xconfig @@ -25,10 +30,9 @@ make zImage cp arch/arm/boot/zImage -The default config uses a 4MB RAM disk located at 0xc0500000 as root. Setting the board to -mount root from a NFS partition works, too. +The default config uses a 4MB RAM disk located at 0xc0500000 as root. +Setting the board to mount root from a NFS partition works, too. I-Gene Leong, Intrinsyc Software Inc. ileong@intrinsyc.com - diff -Nru a/Documentation/filesystems/ext3.txt b/Documentation/filesystems/ext3.txt --- a/Documentation/filesystems/ext3.txt Sun Feb 9 21:13:31 2003 +++ b/Documentation/filesystems/ext3.txt Sun Feb 9 21:13:31 2003 @@ -78,7 +78,7 @@ filesystem code will inform the JBD of modifications it is performing (Call a transaction). the journal support the transactions start and stop, and in case of crash, the journal can replayed the transactions -to put the partition on a consistant state fastly. +to put the partition on a consistent state fastly. handles represent a single atomic update to a filesystem. JBD can handle external journal on a block device. diff -Nru a/Documentation/filesystems/jfs.txt b/Documentation/filesystems/jfs.txt --- a/Documentation/filesystems/jfs.txt Sun Feb 9 21:13:33 2003 +++ b/Documentation/filesystems/jfs.txt Sun Feb 9 21:13:33 2003 @@ -28,8 +28,6 @@ Plans for our near term development items - enhance support for logfile on dedicated partition - - get access control list functionality operational - - get extended attributes functionality operational Longer term work items @@ -37,7 +35,7 @@ - add quota support - add support for block sizes (512,1024,2048) -Please send bugs, comments, cards and letters to linuxjfs@us.ibm.com. +Please send bugs, comments, cards and letters to shaggy@austin.ibm.com. The JFS mailing list can be subscribed to by using the link labeled "Mail list Subscribe" at our web page http://oss.software.ibm.com/jfs/. diff -Nru a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt --- a/Documentation/filesystems/proc.txt Sun Feb 9 21:13:30 2003 +++ b/Documentation/filesystems/proc.txt Sun Feb 9 21:13:30 2003 @@ -911,7 +911,7 @@ The four values in printk denote * console_loglevel, * default_message_loglevel, -* minimum_console_level and +* minimum_console_loglevel and * default_console_loglevel respectively. diff -Nru a/Documentation/ia64/README b/Documentation/ia64/README --- a/Documentation/ia64/README Sun Feb 9 21:13:36 2003 +++ b/Documentation/ia64/README Sun Feb 9 21:13:36 2003 @@ -4,40 +4,40 @@ platform. This document provides information specific to IA-64 ONLY, to get additional information about the Linux kernel also read the original Linux README provided with the kernel. - + INSTALLING the kernel: - IA-64 kernel installation is the same as the other platforms, see original README for details. - - + + SOFTWARE REQUIREMENTS Compiling and running this kernel requires an IA-64 compliant GCC compiler. And various software packages also compiled with an IA-64 compliant GCC compiler. - + CONFIGURING the kernel: Configuration is the same, see original README for details. - - + + COMPILING the kernel: - Compiling this kernel doesn't differ from other platform so read the original README for details BUT make sure you have an IA-64 compliant GCC compiler. - + IA-64 SPECIFICS - General issues: - + o Hardly any performance tuning has been done. Obvious targets include the library routines (IP checksum, etc.). Less obvious targets include making sure we don't flush the TLB needlessly, etc. - + o SMP locks cleanup/optimization - + o IA32 support. Currently experimental. It mostly works. diff -Nru a/Documentation/ia64/fsys.txt b/Documentation/ia64/fsys.txt --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/Documentation/ia64/fsys.txt Sun Feb 9 21:13:38 2003 @@ -0,0 +1,231 @@ +-*-Mode: outline-*- + + Light-weight System Calls for IA-64 + ----------------------------------- + + Started: 13-Jan-2003 + Last update: 24-Jan-2003 + + David Mosberger-Tang + + +Using the "epc" instruction effectively introduces a new mode of +execution to the ia64 linux kernel. We call this mode the +"fsys-mode". To recap, the normal states of execution are: + + - kernel mode: + Both the register stack and the memory stack have been + switched over to kernel memory. The user-level state is saved + in a pt-regs structure at the top of the kernel memory stack. + + - user mode: + Both the register stack and the kernel stack are in + user memory. The user-level state is contained in the + CPU registers. + + - bank 0 interruption-handling mode: + This is the non-interruptible state which all + interruption-handlers start execution in. The user-level + state remains in the CPU registers and some kernel state may + be stored in bank 0 of registers r16-r31. + +In contrast, fsys-mode has the following special properties: + + - execution is at privilege level 0 (most-privileged) + + - CPU registers may contain a mixture of user-level and kernel-level + state (it is the responsibility of the kernel to ensure that no + security-sensitive kernel-level state is leaked back to + user-level) + + - execution is interruptible and preemptible (an fsys-mode handler + can disable interrupts and avoid all other interruption-sources + to avoid preemption) + + - neither the memory nor the register stack can be trusted while + in fsys-mode (they point to the user-level stacks, which may + be invalid) + +In summary, fsys-mode is much more similar to running in user-mode +than it is to running in kernel-mode. Of course, given that the +privilege level is at level 0, this means that fsys-mode requires some +care (see below). + + +* How to tell fsys-mode + +Linux operates in fsys-mode when (a) the privilege level is 0 (most +privileged) and (b) the stacks have NOT been switched to kernel memory +yet. For convenience, the header file provides +three macros: + + user_mode(regs) + user_stack(task,regs) + fsys_mode(task,regs) + +The "regs" argument is a pointer to a pt_regs structure. The "task" +argument is a pointer to the task structure to which the "regs" +pointer belongs to. user_mode() returns TRUE if the CPU state pointed +to by "regs" was executing in user mode (privilege level 3). +user_stack() returns TRUE if the state pointed to by "regs" was +executing on the user-level stack(s). Finally, fsys_mode() returns +TRUE if the CPU state pointed to by "regs" was executing in fsys-mode. +The fsys_mode() macro is equivalent to the expression: + + !user_mode(regs) && user_stack(task,regs) + +* How to write an fsyscall handler + +The file arch/ia64/kernel/fsys.S contains a table of fsyscall-handlers +(fsyscall_table). This table contains one entry for each system call. +By default, a system call is handled by fsys_fallback_syscall(). This +routine takes care of entering (full) kernel mode and calling the +normal Linux system call handler. For performance-critical system +calls, it is possible to write a hand-tuned fsyscall_handler. For +example, fsys.S contains fsys_getpid(), which is a hand-tuned version +of the getpid() system call. + +The entry and exit-state of an fsyscall handler is as follows: + +** Machine state on entry to fsyscall handler: + + - r10 = 0 + - r11 = saved ar.pfs (a user-level value) + - r15 = system call number + - r16 = "current" task pointer (in normal kernel-mode, this is in r13) + - r32-r39 = system call arguments + - b6 = return address (a user-level value) + - ar.pfs = previous frame-state (a user-level value) + - PSR.be = cleared to zero (i.e., little-endian byte order is in effect) + - all other registers may contain values passed in from user-mode + +** Required machine state on exit to fsyscall handler: + + - r11 = saved ar.pfs (as passed into the fsyscall handler) + - r15 = system call number (as passed into the fsyscall handler) + - r32-r39 = system call arguments (as passed into the fsyscall handler) + - b6 = return address (as passed into the fsyscall handler) + - ar.pfs = previous frame-state (as passed into the fsyscall handler) + +Fsyscall handlers can execute with very little overhead, but with that +speed comes a set of restrictions: + + o Fsyscall-handlers MUST check for any pending work in the flags + member of the thread-info structure and if any of the + TIF_ALLWORK_MASK flags are set, the handler needs to fall back on + doing a full system call (by calling fsys_fallback_syscall). + + o Fsyscall-handlers MUST preserve incoming arguments (r32-r39, r11, + r15, b6, and ar.pfs) because they will be needed in case of a + system call restart. Of course, all "preserved" registers also + must be preserved, in accordance to the normal calling conventions. + + o Fsyscall-handlers MUST check argument registers for containing a + NaT value before using them in any way that could trigger a + NaT-consumption fault. If a system call argument is found to + contain a NaT value, an fsyscall-handler may return immediately + with r8=EINVAL, r10=-1. + + o Fsyscall-handlers MUST NOT use the "alloc" instruction or perform + any other operation that would trigger mandatory RSE + (register-stack engine) traffic. + + o Fsyscall-handlers MUST NOT write to any stacked registers because + it is not safe to assume that user-level called a handler with the + proper number of arguments. + + o Fsyscall-handlers need to be careful when accessing per-CPU variables: + unless proper safe-guards are taken (e.g., interruptions are avoided), + execution may be pre-empted and resumed on another CPU at any given + time. + + o Fsyscall-handlers must be careful not to leak sensitive kernel' + information back to user-level. In particular, before returning to + user-level, care needs to be taken to clear any scratch registers + that could contain sensitive information (note that the current + task pointer is not considered sensitive: it's already exposed + through ar.k6). + +The above restrictions may seem draconian, but remember that it's +possible to trade off some of the restrictions by paying a slightly +higher overhead. For example, if an fsyscall-handler could benefit +from the shadow register bank, it could temporarily disable PSR.i and +PSR.ic, switch to bank 0 (bsw.0) and then use the shadow registers as +needed. In other words, following the above rules yields extremely +fast system call execution (while fully preserving system call +semantics), but there is also a lot of flexibility in handling more +complicated cases. + +* Signal handling + +The delivery of (asynchronous) signals must be delayed until fsys-mode +is exited. This is acomplished with the help of the lower-privilege +transfer trap: arch/ia64/kernel/process.c:do_notify_resume_user() +checks whether the interrupted task was in fsys-mode and, if so, sets +PSR.lp and returns immediately. When fsys-mode is exited via the +"br.ret" instruction that lowers the privilege level, a trap will +occur. The trap handler clears PSR.lp again and returns immediately. +The kernel exit path then checks for and delivers any pending signals. + +* PSR Handling + +The "epc" instruction doesn't change the contents of PSR at all. This +is in contrast to a regular interruption, which clears almost all +bits. Because of that, some care needs to be taken to ensure things +work as expected. The following discussion describes how each PSR bit +is handled. + +PSR.be Cleared when entering fsys-mode. A srlz.d instruction is used + to ensure the CPU is in little-endian mode before the first + load/store instruction is executed. PSR.be is normally NOT + restored upon return from an fsys-mode handler. In other + words, user-level code must not rely on PSR.be being preserved + across a system call. +PSR.up Unchanged. +PSR.ac Unchanged. +PSR.mfl Unchanged. Note: fsys-mode handlers must not write-registers! +PSR.mfh Unchanged. Note: fsys-mode handlers must not write-registers! +PSR.ic Unchanged. Note: fsys-mode handlers can clear the bit, if needed. +PSR.i Unchanged. Note: fsys-mode handlers can clear the bit, if needed. +PSR.pk Unchanged. +PSR.dt Unchanged. +PSR.dfl Unchanged. Note: fsys-mode handlers must not write-registers! +PSR.dfh Unchanged. Note: fsys-mode handlers must not write-registers! +PSR.sp Unchanged. +PSR.pp Unchanged. +PSR.di Unchanged. +PSR.si Unchanged. +PSR.db Unchanged. The kernel prevents user-level from setting a hardware + breakpoint that triggers at any privilege level other than 3 (user-mode). +PSR.lp Unchanged. +PSR.tb Lazy redirect. If a taken-branch trap occurs while in + fsys-mode, the trap-handler modifies the saved machine state + such that execution resumes in the gate page at + syscall_via_break(), with privilege level 3. Note: the + taken branch would occur on the branch invoking the + fsyscall-handler, at which point, by definition, a syscall + restart is still safe. If the system call number is invalid, + the fsys-mode handler will return directly to user-level. This + return will trigger a taken-branch trap, but since the trap is + taken _after_ restoring the privilege level, the CPU has already + left fsys-mode, so no special treatment is needed. +PSR.rt Unchanged. +PSR.cpl Cleared to 0. +PSR.is Unchanged (guaranteed to be 0 on entry to the gate page). +PSR.mc Unchanged. +PSR.it Unchanged (guaranteed to be 1). +PSR.id Unchanged. Note: the ia64 linux kernel never sets this bit. +PSR.da Unchanged. Note: the ia64 linux kernel never sets this bit. +PSR.dd Unchanged. Note: the ia64 linux kernel never sets this bit. +PSR.ss Lazy redirect. If set, "epc" will cause a Single Step Trap to + be taken. The trap handler then modifies the saved machine + state such that execution resumes in the gate page at + syscall_via_break(), with privilege level 3. +PSR.ri Unchanged. +PSR.ed Unchanged. Note: This bit could only have an effect if an fsys-mode + handler performed a speculative load that gets NaTted. If so, this + would be the normal & expected behavior, so no special treatment is + needed. +PSR.bn Unchanged. Note: fsys-mode handlers may clear the bit, if needed. + Doing so requires clearing PSR.i and PSR.ic as well. +PSR.ia Unchanged. Note: the ia64 linux kernel never sets this bit. diff -Nru a/Documentation/isdn/HiSax.cert b/Documentation/isdn/HiSax.cert --- a/Documentation/isdn/HiSax.cert Sun Feb 9 21:13:29 2003 +++ b/Documentation/isdn/HiSax.cert Sun Feb 9 21:13:29 2003 @@ -27,7 +27,7 @@ the layer 1. Because all hardware based on these chips are complete ISDN solutions in one chip all cards and USB-TAs using these chips are to be regarded as approved for those tests. Some additional electrical tests -of the layer 1 which are independant of the driver and related to a +of the layer 1 which are independent of the driver and related to a special hardware used will be regarded as approved if at least one solution has been tested including those electrical tests. So if cards or tas have been completely approved for any other os, the approval diff -Nru a/Documentation/kbuild/00-INDEX b/Documentation/kbuild/00-INDEX --- a/Documentation/kbuild/00-INDEX Sun Feb 9 21:13:29 2003 +++ b/Documentation/kbuild/00-INDEX Sun Feb 9 21:13:29 2003 @@ -1,10 +1,10 @@ 00-INDEX - this file: info on the kernel build process -bug-list.txt - - known bugs in kbuild programs commands.txt - overview of kbuild commands kconfig-language.txt - specification of Config Language, the language in Kconfig files +random.txt + - description of generic config targets makefiles.txt - developer information for linux kernel makefiles diff -Nru a/Documentation/kbuild/bug-list.txt b/Documentation/kbuild/bug-list.txt --- a/Documentation/kbuild/bug-list.txt Sun Feb 9 21:13:29 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,22 +0,0 @@ -Bug List -21 January 1999 -Michael Elizabeth Chastain, - -- If a variable has a value of "m" in the previous .config file, - and a type of bool in the Config script, then all the interpreters - get confused. This happens frequently when someone changes a - tristate option to a bool option and people in the field have - .config files with a value of 'm'. For example: CONFIG_PSMOUSE. - -- CONFIG_MODVERSIONS has incorrect dependencies. If you have a - problem building the kernel, and you have CONFIG_MODVERSIONS turned - on, do a 'make dep' followed by 'make clean' before you try anything - else. - -- 'make dep' uses multistage dependencies, so the .hdepend file contains - 'touch' commands. As a result, building a kernel often touches files - in include/linux/*.h. This messes up CVS and other systems which like - to rely on file dates. - -- 'make dep' fails for C files which include other C files, such as - drivers/cdrom/sbpcd2.c. diff -Nru a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt --- a/Documentation/kbuild/makefiles.txt Sun Feb 9 21:13:34 2003 +++ b/Documentation/kbuild/makefiles.txt Sun Feb 9 21:13:34 2003 @@ -1,74 +1,76 @@ Linux Kernel Makefiles -2000-September-14 -Michael Elizabeth Chastain, - - - -=== Table of Contents This document describes the Linux kernel Makefiles. - 1 Overview - 2 Who does what - 3 Makefile language - 4 Variables passed down from the top - 5 The structure of an arch Makefile - 5.1 Architecture-specific variables - 5.2 Vmlinux build variables - 5.3 Post-vmlinux goals - 5.4 Mandatory arch-specific goals - 6 The structure of a subdirectory Makefile - 6.1 Comments - 6.2 Goal definitions - 6.3 Adapter section - 6.4 Rules.make section - 6.5 Special rules - 7 Rules.make variables - 7.1 Subdirectories - 7.2 Object file goals - 7.3 Library file goals - 7.4 Loadable module goals - 7.5 Multi-part modules - 7.6 Compilation flags - 7.7 Miscellaneous variables - 8 New-style variables - 8.1 New variables - 8.2 Converting to old-style - 9 Credits +=== Table of Contents + === 1 Overview + === 2 Who does what + === 3 The kbuild Makefiles + --- 3.1 Goal definitions + --- 3.2 Built-in object goals - obj-y + --- 3.3 Loadable module goals - obj-m + --- 3.4 Objects which export symbols - export-objs + --- 3.5 Library file goals - L_TARGET + --- 3.6 Descending down in directories + --- 3.7 Compilation flags + --- 3.8 Command line dependency + --- 3.9 Dependency tracking + --- 3.10 Special Rules + + === 4 Host Program support + --- 4.1 Simple Host Program + --- 4.2 Composite Host Programs + --- 4.3 Defining shared libraries + --- 4.4 Using C++ for host programs + --- 4.5 Controlling compiler options for host programs + --- 4.6 When host programs are actually built + + === 5 Kbuild clean infrastructure + + === 6 Architecture Makefiles + --- 6.1 Set variables to tweak the build to the architecture + --- 6.2 Add prerequisites to prepare: + --- 6.3 List directories to visit when descending + --- 6.4 Architecture specific boot images + --- 6.5 Building non-kbuild targets + --- 6.6 Commands useful for building a boot image + --- 6.7 Custom kbuild commands + + === 7 Kbuild Variables + === 8 Makefile language + === 9 Credits + === 10 TODO === 1 Overview The Makefiles have five parts: - Makefile: the top Makefile. - .config: the kernel configuration file. - arch/*/Makefile: the arch Makefiles. - Subdirectory Makefiles: there are about 300 of these. - Rules.make: the common rules for all subdirectory Makefiles. + Makefile the top Makefile. + .config the kernel configuration file. + arch/$(ARCH)/Makefile the arch Makefile. + scripts/Makefile.* common rules etc. for all kbuild Makefiles. + kbuild Makefiles there are about 500 of these. -The top Makefile reads the .config file, which comes from the -kernel configuration process. +The top Makefile reads the .config file, which comes from the kernel +configuration process. The top Makefile is responsible for building two major products: vmlinux -(the resident kernel image) and modules (any module files). It builds -these goals by recursively descending into the subdirectories of the -kernel source tree. The list of subdirectories which are visited depends -upon the kernel configuration. - -The top Makefile textually includes an arch Makefile with the name -arch/$(ARCH)/Makefile. The arch Makefile supplies architecture-specific -information to the top Makefile. - -Each subdirectory has a Makefile which carries out the commands passed -down from above. The subdirectory Makefile uses information from the -.config file to construct various file lists, and then it textually -includes the common rules in Rules.make. - -Rules.make defines rules which are common to all the subdirectory -Makefiles. It has a public interface in the form of certain variable -lists. It then declares rules based on those lists. +(the resident kernel image) and modules (any module files). +It builds these goals by recursively descending into the subdirectories of +the kernel source tree. +The list of subdirectories which are visited depends upon the kernel +configuration. The top Makefile textually includes an arch Makefile +with the name arch/$(ARCH)/Makefile. The arch Makefile supplies +architecture-specific information to the top Makefile. + +Each subdirectory has a kbuild Makefile which carries out the commands +passed down from above. The kbuild Makefile uses information from the +.config file to construct various file lists used by kbuild to build +any built-in or modular targets. +scripts/Makefile.* contains all the definitions/rules etc. that +are used to build the kernel based on the kbuild makefiles. === 2 Who does what @@ -76,19 +78,19 @@ People have four different relationships with the kernel Makefiles. *Users* are people who build kernels. These people type commands such as -"make menuconfig" or "make bzImage". They usually do not read or edit +"make menuconfig" or "make". They usually do not read or edit any kernel Makefiles (or any other source files). *Normal developers* are people who work on features such as device drivers, file systems, and network protocols. These people need to -maintain the subdirectory Makefiles for the subsystem that they are +maintain the kbuild Makefiles for the subsystem that they are working on. In order to do this effectively, they need some overall knowledge about the kernel Makefiles, plus detailed knowledge about the -public interface for Rules.make. +public interface for kbuild. *Arch developers* are people who work on an entire architecture, such -as sparc or ia64. Arch developers need to know about the arch Makefiles -as well as subdirectory Makefiles. +as sparc or ia64. Arch developers need to know about the arch Makefile +as well as kbuild Makefiles. *Kbuild developers* are people who work on the kernel build system itself. These people need to know about all aspects of the kernel Makefiles. @@ -96,883 +98,895 @@ This document is aimed towards normal developers and arch developers. +=== 3 The kbuild Makefiles -=== 3 Makefile language - -The kernel Makefiles are designed to run with GNU Make. The Makefiles -use only the documented features of GNU Make, but they do use many -GNU extensions. - -GNU Make supports elementary list-processing functions. The kernel -Makefiles use a novel style of list building and manipulation with few -"if" statements. - -GNU Make has two assignment operators, ":=" and "=". ":=" performs -immediate evaluation of the right-hand side and stores an actual string -into the left-hand side. "=" is like a formula definition; it stores the -right-hand side in an unevaluated form and then evaluates this form each -time the left-hand side is used. - -There are some cases where "=" is appropriate. Usually, though, ":=" -is the right choice. - -All of the examples in this document were drawn from actual kernel -sources. The examples have been reformatted (white space changed, lines -split), but are otherwise exactly the same. - - - -=== 4 Variables passed down from the top - -The top Makefile exports the following variables: - - VERSION, PATCHLEVEL, SUBLEVEL, EXTRAVERSION - - These variables define the current kernel version. A few arch - Makefiles actually use these values directly; they should use - $(KERNELRELEASE) instead. - - $(VERSION), $(PATCHLEVEL), and $(SUBLEVEL) define the basic - three-part version number, such as "2", "4", and "0". These three - values are always numeric. - - $(EXTRAVERSION) defines an even tinier sublevel for pre-patches - or additional patches. It is usually some non-numeric string - such as "-pre4", and is often blank. - - KERNELRELEASE - - $(KERNELRELEASE) is a single string such as "2.4.0-pre4", suitable - for constructing installation directory names or showing in - version strings. Some arch Makefiles use it for this purpose. - - ARCH - - This variable defines the target architecture, such as "i386", - "arm", or "sparc". Many subdirectory Makefiles test $(ARCH) - to determine which files to compile. - - By default, the top Makefile sets $(ARCH) to be the same as the - host system system architecture. For a cross build, a user may - override the value of $(ARCH) on the command line: - - make ARCH=m68k ... - - TOPDIR, HPATH - - $(TOPDIR) is the path to the top of the kernel source tree. - Subdirectory Makefiles need this so that they can include - $(TOPDIR)/Rules.make. - - $(HPATH) is equal to $(TOPDIR)/include. A few arch Makefiles - need to use this to do special things using include files. - - SUBDIRS - - $(SUBDIRS) is a list of directories which the top Makefile - enters in order to build either vmlinux or modules. The actual - directories in $(SUBDIRS) depend on the kernel configuration. - The top Makefile defines this variable, and the arch Makefile - extends it. - - HEAD, CORE_FILES, NETWORKS, DRIVERS, LIBS - LINKFLAGS - - $(HEAD), $(CORE_FILES), $(NETWORKS), $(DRIVERS), and $(LIBS) - specify lists of object files and libraries to be linked into - vmlinux. - - The files in $(HEAD) are linked first in vmlinux. - - $(LINKFLAGS) specifies the flags to build vmlinux. - - The top Makefile and the arch Makefile jointly define these - variables. The top Makefile defines $(CORE_FILES), $(NETWORKS), - $(DRIVERS), and $(LIBS). The arch Makefile defines $(HEAD) - and $(LINKFLAGS), and extends $(CORE_FILES) and $(LIBS). - - Note: there are more variables here than necessary. $(NETWORKS), - $(DRIVERS), and even $(LIBS) could be subsumed into $(CORE_FILES). - - CPP, CC, AS, LD, AR, NM, STRIP, OBJCOPY, OBJDUMP - CPPFLAGS, CFLAGS, CFLAGS_KERNEL, MODFLAGS, AFLAGS, LDFLAGS - PERL - GENKSYMS - - These variables specify the commands and flags that Rules.make - uses to build goal files from source files. - - $(CFLAGS_KERNEL) contains extra C compiler flags used to compile - resident kernel code. - - $(MODFLAGS) contains extra C compiler flags used to compile code - for loadable kernel modules. In the future, this flag may be - renamed to the more regular name $(CFLAGS_MODULE). - - $(AFLAGS) contains assembler flags. - - $(GENKSYMS) contains the command used to generate kernel symbol - signatures when CONFIG_MODVERSIONS is enabled. The genksyms - command comes from the module-init-tools package. - - CROSS_COMPILE - - This variable is a prefix path for other variables such as $(CC), - $(AS), and $(LD). The arch Makefiles sometimes use and set this - variable explicitly. Subdirectory Makefiles don't need to worry - about it. - - The user may override $(CROSS_COMPILE) on the command line if - desired. - - HOSTCC, HOSTCFLAGS - - These variables define the C compiler and C compiler flags to - be used for compiling host side programs. These are separate - variables because the target architecture can be different from - the host architecture. - - If your Makefile compiles and runs a program that is executed - during the course of building the kernel, then it should use - $(HOSTCC) and $(HOSTCFLAGS). +Most Makefiles within the kernel are kbuild Makefiles that use the +kbuild infrastructure. This chapter introduce the syntax used in the +kbuild makefiles. - For example, the subdirectory drivers/pci has a helper program - named gen-devlist.c. This program reads a list of PCI ID's and - generates C code in the output files classlist.h and devlist.h. +Section 3.1 "Goal definitions" is a quick intro, further chapters provide +more details, with real examples. - Suppose that a user has an i386 computer and wants to build a - kernel for an ia64 machine. Then the user would use an ia64 - cross-compiler for most of the compilation, but would use a - native i386 host compiler to compile drivers/pci/gen-devlist.c. +--- 3.1 Goal definitions - For another example, kbuild helper programs such as - scripts/mkdep.c and scripts/lxdialog/*.c are compiled with - $(HOSTCC) rather than $(CC). + Goal definitions are the main part (heart) of the kbuild Makefile. + These lines define the files to be built, any special compilation + options, and any subdirectories to be entered recursively. - ROOT_DEV, SVGA_MODE, RAMDISK + The most simple kbuild makefile contains one line: - End users edit these variables to specify certain information - about the configuration of their kernel. These variables - are ancient! They are also specific to the i386 architecture. - They really should be replaced with CONFIG_* options. - - MAKEBOOT - - This variable is defined and used only inside the main arch - Makefiles. The top Makefile should not export it. - - INSTALL_PATH - - This variable defines a place for the arch Makefiles to install - the resident kernel image and System.map file. + Example: + obj-y += foo.o - INSTALL_MOD_PATH, MODLIB + This tell kbuild that there is one object in that directory named + foo.o. foo.o will be build from foo.c or foo.S. - $(INSTALL_MOD_PATH) specifies a prefix to $(MODLIB) for module - installation. This variable is not defined in the Makefile but - may be passed in by the user if desired. + If foo.o shall be built as a module, the variable obj-m is used. + Therefore the following pattern is often used: - $(MODLIB) specifies the directory for module installation. - The top Makefile defines $(MODLIB) to - $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE). The user may - override this value on the command line if desired. + Example: + obj-$(CONFIG_FOO) += foo.o - CONFIG_SHELL + $(CONFIG_FOO) evaluates to either y (for built-in) or m (for module). + If CONFIG_FOO is neither y nor m, then the file will not be compiled + nor linked. - This variable is private between Makefile and Rules.make. - Arch makefiles and subdirectory Makefiles should never use this. +--- 3.2 Built-in object goals - obj-y - MODVERFILE + The kbuild Makefile specifies object files for vmlinux + in the lists $(obj-y). These lists depend on the kernel + configuration. - An internal variable. This doesn't need to be exported, as it - is never used outside of the top Makefile. + Kbuild compiles all the $(obj-y) files. It then calls + "$(LD) -r" to merge these files into one built-in.o file. + built-in.o is later linked into vmlinux by the parent Makefile. - MAKE, MAKEFILES + The order of files in $(obj-y) is significant. Duplicates in + the lists are allowed: the first instance will be linked into + built-in.o and succeeding instances will be ignored. - Some variables internal to GNU Make. + Link order is significant, because certain functions + (module_init() / __initcall) will be called during boot in the + order they appear. So keep in mind that changing the link + order may e.g. change the order in which your SCSI + controllers are detected, and thus you disks are renumbered. - $(MAKEFILES) in particular is used to force the arch Makefiles - and subdirectory Makefiles to read $(TOPDIR)/.config without - including it explicitly. (This was an implementational hack - and could be fixed). + Example: + #drivers/isdn/i4l/Makefile + # Makefile for the kernel ISDN subsystem and device drivers. + # Each configuration option enables a list of files. + obj-$(CONFIG_ISDN) += isdn.o + obj-$(CONFIG_ISDN_PPP_BSDCOMP) += isdn_bsdcomp.o +--- 3.3 Loadable module goals - obj-m + $(obj-m) specify object files which are built as loadable + kernel modules. -=== 5 The structure of an arch Makefile + A module may be built from one source file or several source + files. In the case of one source file, the kbuild makefile + simply adds the file to $(obj-m). + Example: + #drivers/isdn/i4l/Makefile + obj-$(CONFIG_ISDN_PPP_BSDCOMP) += isdn_bsdcomp.o + Note: In this example $(CONFIG_ISDN_PPP_BSDCOMP) evaluates to 'm' ---- 5.1 Architecture-specific variables + If a kernel module is built from several source files, you specify + that you want to build a module in the same way as above. -The top Makefile includes one arch Makefile file, arch/$(ARCH)/Makefile. -This section describes the functions of the arch Makefile. + Kbuild needs to know which the parts that you want to build your + module from, so you have to tell it by setting an + $(-objs) variable. -An arch Makefile extends some of the top Makefile's variables with -architecture-specific values. + Example: + #drivers/isdn/i4l/Makefile + obj-$(CONFIG_ISDN) += isdn.o + isdn-objs := isdn_net_lib.o isdn_v110.o isdn_common.o - SUBDIRS + In this example, the module name will be isdn.o. Kbuild will + compile the objects listed in $(isdn-objs) and then run + "$(LD) -r" on the list of these files to generate isdn.o. - The top Makefile defines $(SUBDIRS). The arch Makefile extends - $(SUBDIRS) with a list of architecture-specific directories. + Kbuild recognises objects used for composite objects by the suffix + -objs, and the suffix -y. This allows the Makefiles to use + the value of a CONFIG_ symbol to determine if an object is part + of a composite object. Example: + #fs/ext2/Makefile + obj-$(CONFIG_EXT2_FS) += ext2.o + ext2-y := balloc.o bitmap.o + ext2-$(CONFIG_EXT2_FS_XATTR) += xattr.o + + In this example xattr.o is only part of the composite object + ext2.o, if $(CONFIG_EXT2_FS_XATTR) evaluates to 'y'. - # arch/alpha/Makefile - - SUBDIRS := $(SUBDIRS) arch/alpha/kernel arch/alpha/mm \ - arch/alpha/lib arch/alpha/math-emu - - This list may depend on the configuration: + Note: Of course, when you are building objects into the kernel, + the syntax above will also work. So, if you have CONFIG_EXT2_FS=y, + kbuild will build an ext2.o file for you out of the individual + parts and then link this into built-in.o, as you would expect. - # arch/arm/Makefile +--- 3.4 Objects which export symbols - export-objs - ifeq ($(CONFIG_ARCH_ACORN),y) - SUBDIRS += drivers/acorn - ... - endif + When using loadable modules, not every global symbol in the + kernel / other modules is automatically available, only those + explicitly exported are available for your module. - CPP, CC, AS, LD, AR, NM, STRIP, OBJCOPY, OBJDUMP - CPPFLAGS, CFLAGS, CFLAGS_KERNEL, MODFLAGS, AFLAGS, LDFLAGS + To make a symbol available for use in modules, to "export" it, + use the EXPORT_SYMBOL() directive in your source. In + addition, you need to list all object files which export symbols + (i.e. their source contains an EXPORT_SYMBOL() directive) in the + Makefile variable $(export-objs). - The top Makefile defines these variables, and the arch Makefile - extends them. + Example: + #drivers/isdn/i4l/Makefile + # Objects that export symbols. + export-objs := isdn_common.o - Many arch Makefiles dynamically run the target C compiler to - probe supported options: + since isdn_common.c contains - # arch/i386/Makefile + EXPORT_SYMBOL(register_isdn); - # prevent gcc from keeping the stack 16 byte aligned - CFLAGS += $(shell if $(CC) -mpreferred-stack-boundary=2 \ - -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \ - then echo "-mpreferred-stack-boundary=2"; fi) + which makes the function register_isdn available to + low-level ISDN drivers. + There exist a EXPORT_SYMBOL_GPL() variant with similar functionality, + but more restrictive with what may use that symbol. The requirement + to list the .o file in export-objs is the same. - And, of course, $(CFLAGS) can depend on the configuration: +--- 3.5 Library file goals - L_TARGET - # arch/i386/Makefile + Instead of building a built-in.o file, you may also + build an archive which again contains objects listed in $(obj-y). + This is normally not necessary and only used in lib/ and + arch/$(ARCH)/lib directories. + Only the name lib.a is allowed. - ifdef CONFIG_M386 - CFLAGS += -march=i386 - endif + Example: + #arch/i386/lib/Makefile + L_TARGET := lib.a + obj-y := checksum.o delay.o - ifdef CONFIG_M486 - CFLAGS += -march=i486 - endif + This will create a library lib.a based on checksum.o and delay.o. - ifdef CONFIG_M586 - CFLAGS += -march=i586 - endif +--- 3.6 Descending down in directories - Some arch Makefiles redefine the compilation commands in order - to add architecture-specific flags: + A Makefile is only responsible for building objects in its own + directory. Files in subdirectories should be taken care of by + Makefiles in these subdirs. The build system will automatically + invoke make recursively in subdirectories, provided you let it know of + them. - # arch/s390/Makefile + To do so obj-y and obj-m are used. + ext2 lives in a separate directory, and the Makefile present in fs/ + tells kbuild to descend down using the following assignment. - LD=$(CROSS_COMPILE)ld -m elf_s390 - OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S + Example: + #fs/Makefile + obj-$(CONfIG_EXT2_FS) += ext2/ + If CONFIG_EXT2_FS is set to either 'y' (built-in) or 'm' (modular) + the corresponding obj- variable will be set, and kbuild will descend + down in the ext2 directory. + Kbuild only uses this information to decide that it needs to visit + the directory, it is the Makefile in the subdirectory that + specifies what is modules and what is built-in. + It is good practice to use a CONFIG_ variable when assigning directory + names. This allows kbuild to totally skip the directory if the + corresponding CONFIG_ option is neither 'y' nor 'm'. ---- 5.2 Vmlinux build variables +--- 3.7 Compilation flags -An arch Makefile cooperates with the top Makefile to define variables -which specify how to build the vmlinux file. Note that there is no -corresponding arch-specific section for modules; the module-building -machinery is all architecture-independent. + EXTRA_CFLAGS, EXTRA_AFLAGS, EXTRA_LDFLAGS, EXTRA_ARFLAGS - HEAD, CORE_FILES, LIBS - LINKFLAGS + All the EXTRA_ variables apply only to the kbuild makefile + where they are assigned. The EXTRA_ variables apply to all + commands executed in the kbuild makefile. - The top Makefile defines the architecture-independent core of - thse variables, and the arch Makefile extends them. Note that the - arch Makefile defines (not just extends) $(HEAD) and $(LINKFLAGS). + $(EXTRA_CFLAGS) specifies options for compiling C files with + $(CC). Example: - - # arch/m68k/Makefile - - ifndef CONFIG_SUN3 - LINKFLAGS = -T $(TOPDIR)/arch/m68k/vmlinux.lds - else - LINKFLAGS = -T $(TOPDIR)/arch/m68k/vmlinux-sun3.lds -N - endif - - ... - - ifndef CONFIG_SUN3 - HEAD := arch/m68k/kernel/head.o - else - HEAD := arch/m68k/kernel/sun3-head.o + # drivers/sound/emu10k1/Makefile + EXTRA_CFLAGS += -I$(obj) + ifdef DEBUG + EXTRA_CFLAGS += -DEMU10K1_DEBUG endif - SUBDIRS += arch/m68k/kernel arch/m68k/mm arch/m68k/lib - CORE_FILES := arch/m68k/kernel/kernel.o arch/m68k/mm/mm.o $(CORE_FILES) - LIBS += arch/m68k/lib/lib.a + This variable is necessary because the top Makefile owns the + variable $(CFLAGS) and uses it for compilation flags for the + entire tree. + $(EXTRA_AFLAGS) is a similar string for per-directory options + when compiling assembly language source. ---- 5.3 Post-vmlinux goals + Example: + #arch/x86_64/kernel/Makefile + EXTRA_AFLAGS := -traditional -An arch Makefile specifies goals that take the vmlinux file, compress -it, wrap it in bootstrapping code, and copy the resulting files somewhere. -This includes various kinds of installation commands. -These post-vmlinux goals are not standardized across different -architectures. Here is a list of these goals and the architectures -that support each of them (as of kernel version 2.4.0-test6-pre5): + $(EXTRA_LDFLAGS) and $(EXTRA_ARFLAGS) are similar strings for + per-directory options to $(LD) and $(AR). - balo mips - bootimage alpha - bootpfile alpha, ia64 - bzImage i386, m68k - bzdisk i386 - bzlilo i386 - compressed i386, m68k, mips, mips64, sh - dasdfmt s390 - Image arm - image s390 - install arm, i386 - lilo m68k - msb alpha, ia64 - my-special-boot alpha, ia64 - orionboot mips - rawboot alpha - silo s390 - srmboot alpha - tftpboot.img sparc, sparc64 - vmlinux.64 mips64 - vmlinux.aout sparc64 - zImage arm, i386, m68k, mips, mips64, ppc, sh - zImage.initrd ppc - zdisk i386, mips, mips64, sh - zinstall arm - zlilo i386 - znetboot.initrd ppc + Example: + #arch/m68k/fpsp040/Makefile + EXTRA_LDFLAGS := -x + CFLAGS_$@, AFLAGS_$@ + CFLAGS_$@ and AFLAGS_$@ only apply to commands in current + kbuild makefile. ---- 5.4 Mandatory arch-specific goals + $(CFLAGS_$@) specifies per-file options for $(CC). The $@ + part has a literal value which specifies the file that it is for. -An arch Makefile must define the following arch-specific goals. -These goals provide arch-specific actions for the corresponding goals -in the top Makefile: + Example: + # drivers/scsi/Makefile + CFLAGS_aha152x.o = -DAHA152X_STAT -DAUTOCONF + CFLAGS_gdth.o = # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ \ + -DGDTH_STATISTICS + CFLAGS_seagate.o = -DARBITRATE -DPARITY -DSEAGATE_USE_ASM - archclean clean - archdep dep - archmrproper mrproper + These three lines specify compilation flags for aha152x.o, + gdth.o, and seagate.o + $(AFLAGS_$@) is a similar feature for source files in assembly + languages. + Example: + # arch/arm/kernel/Makefile + AFLAGS_head-armv.o := -DTEXTADDR=$(TEXTADDR) -traditional + AFLAGS_head-armo.o := -DTEXTADDR=$(TEXTADDR) -traditional -=== 6 The structure of a subdirectory Makefile +--- 3.9 Dependency tracking -A subdirectory Makefile has four sections. + Kbuild track dependencies on the following: + 1) All prerequisite files (both *.c and *.h) + 2) CONFIG_ options used in all prerequisite files + 3) Command-line used to compile target + Thus, if you change an option to $(CC) all affected files will + be re-compiled. +--- 3.10 Special Rules ---- 6.1 Comments + Special rules are used when the kbuild infrastructure does + not provide the required support. A typical example is + header files generated during the build process. + Another example is the architecture specific Makefiles which + needs special rules to prepare boot images etc. -The first section is a comment header. Historically, many anonymous -people have edited kernel Makefiles without leaving any change -histories in the header; comments from them would have been valuable. + Special rules are written as normal Make rules. + Kbuild is not executing in the directory where the Makefile is + located, so all special rules shall provide a relative + path to prerequisite files and target files. + Two variables are used when defining special rules: + $(src) + $(src) is a relative path which points to the directory + where the Makefile is located. Always use $(src) when + referring to files located in the src tree. ---- 6.2 Goal definitions + $(obj) + $(obj) is a relative path which points to the directory + where the target is saved. Always use $(obj) when + referring to generated files. -The second section is a bunch of definitions that are the heart of the -subdirectory Makefile. These lines define the files to be built, any -special compilation options, and any subdirectories to be recursively -entered. The declarations in these lines depend heavily on the kernel -configuration variables (CONFIG_* symbols). + Example: + #drivers/scsi/Makefile + $(obj)/53c8xx_d.h: $(src)/53c7,8xx.scr $(src)/script_asm.pl + $(CPP) -DCHIP=810 - < $< | ... $(src)/script_asm.pl -The second section looks like this: + This is a special rule, following the normal syntax + required by make. + The target file depends on two prerequisite files. References + to the target file are prefixed with $(obj), references + to prerequisites are referenced with $(src) (because they are not + generated files). - # drivers/block/Makefile - obj-$(CONFIG_MAC_FLOPPY) += swim3.o - obj-$(CONFIG_BLK_DEV_FD) += floppy.o - obj-$(CONFIG_AMIGA_FLOPPY) += amiflop.o - obj-$(CONFIG_ATARI_FLOPPY) += ataflop.o +=== 4 Host Program support ---- 6.4 Rules.make section +Kbuild supports building executables on the host for use during the +compilation stage. +Two steps are required in order to use a host executable. -The third section is the single line: +The first step is to tell kbuild that a host program exists. This is +done utilising the variable host-prog. - include $(TOPDIR)/Rules.make +The second step is to add an explicit dependency to the executable. +This can be done in two ways. Either add the dependency in a rule, +or utilise the variable build-targets. +Both possibilities are described in the following. +--- 4.1 Simple Host Program + In some cases there is a need to compile and run a program on the + computer where the build is running. + The following line tells kbuild that the program bin2hex shall be + built on the build host. ---- 6.5 Special rules + Example: + host-progs := bin2hex -The fourth section contains any special Makefile rules needed that are -not available through the common rules in Rules.make. + Kbuild assumes in the above example that bin2hex is made from a single + c-source file named bin2hex.c located in the same directory as + the Makefile. + +--- 4.2 Composite Host Programs + Host programs can be made up based on composite objects. + The syntax used to define composite objetcs for host programs is + similar to the syntax used for kernel objects. + $(-objs) list all objects used to link the final + executable. + Example: + #scripts/lxdialog/Makefile + host-progs := lxdialog + lxdialog-objs := checklist.o lxdialog.o -=== 7 Rules.make variables + Objects with extension .o are compiled from the corresponding .c + files. In the above example checklist.c is compiled to checklist.o + and lxdialog.c is compiled to lxdialog.o. + Finally the two .o files are linked to the executable, lxdialog. + Note: The syntax -y is not permitted for host-programs. -The public interface of Rules.make consists of the following variables: +--- 4.3 Defining shared libraries + + Objects with extension .so are considered shared libraries, and + will be compiled as position independent objects. + Kbuild provides support for shared libraries, but the usage + shall be restricted. + In the following example the libkconfig.so shared library is used + to link the executable conf. + Example: + #scripts/kconfig/Makefile + host-progs := conf + conf-objs := conf.o libkconfig.so + libkconfig-objs := expr.o type.o + + Shared libraries always require a corresponding -objs line, and + in the example above the shared library libkconfig is composed by + the two objects expr.o and type.o. + expr.o and type.o will be built as position independent code and + linked as a shared library libkconfig.so. C++ is not supported for + shared libraries. +--- 4.4 Using C++ for host programs ---- 7.1 Subdirectories + kbuild offers support for host programs written in C++. This was + introduced solely to support kconfig, and is not recommended + for general use. -A Makefile is only responsible for building objects in its own -directory. Files in subdirectories should be taken care of by -Makefiles in the these subdirs. The build system will automatically -invoke make recursively in subdirectories, provided you let it know of -them. + Example: + #scripts/kconfig/Makefile + host-progs := qconf + qconf-cxxobjs := qconf.o -To do so, use the subdir-{y,m,n,} variables: + In the example above the executable is composed of the C++ file + qconf.cc - identified by $(qconf-cxxobjs). + + If qconf is composed by a mixture of .c and .cc files, then an + additional line can be used to identify this. - subdir-$(CONFIG_ISDN) += i4l - subdir-$(CONFIG_ISDN_CAPI) += capi + Example: + #scripts/kconfig/Makefile + host-progs := qconf + qconf-cxxobjs := qconf.o + qconf-objs := check.o + +--- 4.5 Controlling compiler options for host programs -When building the actual kernel, i.e. vmlinux ("make -{vmlinux,bzImage,...}"), make will recursively descend into -directories listed in $(subdir-y). + When compiling host programs, it is possible to set specific flags. + The programs will always be compiled utilising $(HOSTCC) passed + the options specified in $(HOSTCFLAGS). + To set flags that will take effect for all host programs created + in that Makefile use the variable HOST_EXTRACFLAGS. -When building modules ("make modules"), make will recursively descend -into directories listed in $(subdir-m). + Example: + #scripts/lxdialog/Makefile + HOST_EXTRACFLAGS += -I/usr/include/ncurses + + To set specific flags for a single file the following construction + is used: -When building the dependencies ("make dep") make needs to visit every -subdir, so it'll descend into every directory listed in -$(subdir-y), $(subdir-m), $(subdir-n), $(subdir-). + Example: + #arch/ppc64/boot/Makefile + HOSTCFLAGS_piggyback.o := -DKERNELBASE=$(KERNELBASE) + + It is also possible to specify additional options to the linker. + + Example: + #scripts/kconfig/Makefile + HOSTLOADLIBES_qconf := -L$(QTDIR)/lib -You may encounter the case where a config option may be set to "y", but -you still want to possibly build modules in that subdirectory. + When linking qconf it will be passed the extra option "-L$(QTDIR)/lib". + +--- 4.6 When host programs are actually built -For example, drivers/isdn/capi/Makefile has + Kbuild will only build host-programs when they are referenced + as a prerequisite. + This is possible in two ways: - obj-$(CONFIG_ISDN_CAPI) += kernelcapi.o capiutil.o - obj-$(CONFIG_ISDN_CAPI_CAPI20) += capi.o + (1) List the prerequisite explicitly in a special rule. -where it's possible that CONFIG_ISDN_CAPI=y, but -CONFIG_ISDN_CAPI_CAPI20=m. + Example: + #drivers/pci/Makefile + host-progs := gen-devlist + $(obj)/devlist.h: $(src)/pci.ids $(obj)/gen-devlist + ( cd $(obj); ./gen-devlist ) < $< -This is expressed by the following construct in the parent Makefile -drivers/isdn/Makefile: + The target $(obj)/devlist.h will not be built before + $(obj)/gen-devlist is updated. Note that references to + the host programs in special rules must be prefixed with $(obj). - mod-subdirs := i4l hisax capi eicon - subdir-$(CONFIG_ISDN_CAPI) += capi + (2) Use $(build-targets) + When there is no suitable special rule, and the host program + shall be built when a makefile is entered, the $(build-targets) + variable shall be used. -Having a subdir ("capi") listed in the variable $(mod-subdirs) will -make the build system enter the specified subdirectory during "make -modules" also, even though the subdir ("capi") is listed only in -$(subdir-y), not $(subdir-m). + Example: + #scripts/lxdialog/Makefile + host-progs := lxdialog + build-targets := $(host-progs) + This will tell kbuild to build lxdialog even if not referenced in + any rule. ---- 7.2 Object file goals +=== 5 Kbuild clean infrastructure - O_TARGET, obj-y +"make clean" deletes most generated files in the src tree where the kernel +is compiled. This includes generated files such as host programs. +Kbuild knows targets listed in $(host-progs) and $(EXTRA_TARGETS) and +they are all deleted during "make clean". +Files matching the patterns "*.[oas]", "*.ko", plus some additional files +generated by kbuild are deleted all over the kernel src tree when +"make clean" is executed. - The subdirectory Makefile specifies object files for vmlinux - in the lists $(obj-y). These lists depend on the kernel - configuration. +Additional files can be specified by means of $(clean-files). - Rules.make compiles all the $(obj-y) files. It then calls - "$(LD) -r" to merge these files into one .o file with the name - $(O_TARGET). This $(O_TARGET) is later linked into vmlinux by - a parent Makefile. + Example: + #drivers/pci/Makefile + clean-files := devlist.h classlist.h - The order of files in $(obj-y) is significant. Duplicates in - the lists are allowed: the first instance will be linked into - $(O_TARGET) and succeeding instances will be ignored. +When executing "make clean", the two files "devlist.h classlist.h" will +be deleted. Kbuild knows that files specified by $(clean-files) are +located in the same directory as the makefile. - Link order is significant, because certain functions - (module_init() / __initcall) will be called during boot in the - order they appear. So keep in mind that changing the link - order may e.g. change the order in which your SCSI - controllers are detected, and thus you disks are renumbered. +Usually kbuild descends down in subdirectories due to "obj-* := dir/", +but in the architecture makefiles where the kbuild infrastructure +is not sufficent this sometimes needs to be explicit. Example: + #arch/i386/boot/Makefile + subdir- := compressed/ - # Makefile for the kernel ISDN subsystem and device drivers. - - # The target object and module list name. - - O_TARGET := vmlinux-obj.o +The above assignment instructs kbuild to descend down in the +directory compressed/ when "make clean" is executed. - # Each configuration option enables a list of files. +To support the clean infrastructure in the Makefiles that builds the +final bootimage there is an optional target named archclean: - obj-$(CONFIG_ISDN) += isdn.o - obj-$(CONFIG_ISDN_PPP_BSDCOMP) += isdn_bsdcomp.o + Example: + #arch/i386/Makefile + archclean: + $(Q)$(MAKE) $(clean)=arch/i386/boot - # The global Rules.make. +When "make clean" is executed, make will descend down in arch/i386/boot, +and clean as usual. The Makefile located in arch/i386/boot/ may use +the subdir- trick to descend further down. - include $(TOPDIR)/Rules.make +Note 1: arch/$(ARCH)/Makefile cannot use "subdir-", because that file is +included in the top level makefile, and the kbuild infrastructure +is not operational at that point. ---- 7.3 Library file goals +Note 2: All directories listed in core-y, libs-y, drivers-y and net-y will +be visited during "make clean". - L_TARGET +=== 6 Architecture Makefiles - Instead of building an O_TARGET object file, you may also - build an archive which again contains objects listed in - $(obj-y). This is normally not necessary and only used in - the lib, arch/$(ARCH)/lib directories. +The top level Makefile sets up the environment and does the preparation, +before starting to descend down in the individual directories. +The top level makefile contains the generic part, whereas the +arch/$(ARCH)/Makefile contains what is required to set-up kbuild +to the said architecture. +To do so arch/$(ARCH)/Makefile sets a number of variables, and defines +a few targets. +When kbuild executes the following steps are followed (roughly): +1) Configuration of the kernel => produced .config +2) Store kernel version in include/linux/version.h +3) Symlink include/asm to include/asm-$(ARCH) +4) Updating all other prerequisites to the target prepare: + - Additional prerequisites are specified in arch/$(ARCH)/Makefile +5) Recursively descend down in all directories listed in + init-* core* drivers-* net-* libs-* and build all targets. + - The value of the above variables are extended in arch/$(ARCH)/Makefile. +6) All object files are then linked and the resulting file vmlinux is + located at the root of the src tree. + The very first objects linked are listed in head-y, assigned by + arch/$(ARCH)/Makefile. +7) Finally the architecture specific part does any required post processing + and builds the final bootimage. + - This includes building boot records + - Preparing initrd images and the like ---- 7.4 Loadable module goals - obj-m +--- 6.1 Set variables to tweak the build to the architecture - $(obj-m) specify object files which are built as loadable - kernel modules. + LDFLAGS Generic $(LD) options - A module may be built from one source file or several source - files. In the case of one source file, the subdirectory - Makefile simply adds the file to $(obj-m) + Flags used for all invocations of the linker. + Often specifying the emulation is sufficient. Example: + #arch/s390/Makefile + LDFLAGS := -m elf_s390 + Note: EXTRA_LDFLAGS and LDFLAGS_$@ can be used to further customise + the flags used. See chapter 7. + + LDFLAGS_MODULE Options for $(LD) when linking modules - obj-$(CONFIG_ISDN_PPP_BSDCOMP) += isdn_bsdcomp.o + LDFLAGS_MODULE is used to set specific flags for $(LD) when + linking the .ko files used for modules. + Default is "-r", for relocatable output. - If a kernel module is built from several source files, you specify - that you want to build a module in the same way as above. + LDFLAGS_vmlinux Options for $(LD) when linking vmlinux - However, the build system of course needs to know which the parts - are that you want to build your module of, so you have to tell it - by setting an $(-objs) variable. + LDFLAGS_vmlinux is used to specify additional flags to pass to + the linker when linking the final vmlinux. + LDFLAGS_vmlinux uses the LDFLAGS_$@ support. Example: + #arch/i386/Makefile + LDFLAGS_vmlinux := -e stext - obj-$(CONFIG_ISDN) += isdn.o - - isdn-objs := isdn_net.o isdn_tty.o isdn_v110.o isdn_common.o - - In this example, the module name will be isdn.o. Rules.make - will compile the objects listed in $(isdn-objs) and then run - "$(LD) -r" on the list of these files to generate isdn.o - - Note: Of course, when you are building objects into the kernel, - the syntax above will also work. So, if you have CONFIG_ISDN=y, - the build system will build an isdn.o for you out of the individual - parts and then link this into the $(O_TARGET), as you'd expect. - + LDFLAGS_BLOB Options for $(LD) when linking the initramfs blob ---- 7.5 Objects which export symbols - - export-objs + The image used for initramfs is made during the build process. + LDFLAGS_BLOB is used to specify additional flags to be used when + creating the initramfs_data.o file. + Example: + #arch/i386/Makefile + LDFLAGS_BLOB := --format binary --oformat elf32-i386 - When using loadable modules, not every global symbol in the - kernel / other modules is automatically available, only those - explicitly exported are available for your module. + OBJCOPYFLAGS objcopy flags - To make a symbol available for use in modules, to "export" it, - use the EXPORT_SYMBOL() directive in your source. In - addition, you need to list all object files which export symbols - (i.e. their source contains an EXPORT_SYMBOL() directive) in the - Makefile variable $(export-objs). + When $(call if_changed,objcopy) is used to translate a .o file, + then the flags specified in OBJCOPYFLAGS will be used. + $(call if_changed,objcopy) is often used to generate raw binaries on + vmlinux. Example: + #arch/s390/Makefile + OBJCOPYFLAGS := -O binary - # Objects that export symbols. + #arch/s390/boot/Makefile + $(obj)/image: vmlinux FORCE + $(call if_changed,objcopy) - export-objs := isdn_common.o + In this example the binary $(obj)/image is a binary version of + vmlinux. The usage of $(call if_changed,xxx) will be described later. - since isdn_common.c contains + AFLAGS $(AS) assembler flags - EXPORT_SYMBOL(register_isdn); + Default value - see top level Makefile + Append or modify as required per architecture. - which makes the function register_isdn available to - low-level ISDN drivers. - + Example: + #arch/sparc64/Makefile + AFLAGS += -m64 -mcpu=ultrasparc ---- 7.6 Compilation flags + CFLAGS $(CC) compiler flags - EXTRA_CFLAGS, EXTRA_AFLAGS, EXTRA_LDFLAGS, EXTRA_ARFLAGS + Default value - see top level Makefile + Append or modify as required per architecture. - $(EXTRA_CFLAGS) specifies options for compiling C files with - $(CC). The options in this variable apply to all $(CC) commands - for files in the current directory. + Often the CFLAGS variable depends on the configuration. Example: + #arch/i386/Makefile + cflags-$(CONFIG_M386) += -march=i386 + CFLAGS += $(cflags-y) - # drivers/sound/emu10k1/Makefile - EXTRA_CFLAGS += -I. - ifdef DEBUG - EXTRA_CFLAGS += -DEMU10K1_DEBUG - endif + Many arch Makefiles dynamically run the target C compiler to + probe supported options: - $(EXTRA_CFLAGS) does not apply to subdirectories of the current - directory. Also, it does not apply to files compiled with - $(HOSTCC). + #arch/i386/Makefile + check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc \ + /dev/null\ > /dev/null 2>&1; then echo "$(1)"; \ + else echo "$(2)"; fi) + cflags-$(CONFIG_MCYRIXIII) += $(call check_gcc,\ + -march=c3,-march=i486) - This variable is necessary because the top Makefile owns the - variable $(CFLAGS) and uses it for compilation flags for the - entire tree. + CFLAGS += $(cflags-y) - $(EXTRA_AFLAGS) is a similar string for per-directory options - when compiling assembly language source. + The above examples both utilise the trick that a config option expands + to 'y' when selected. - Example: at the time of writing, there were no examples of - $(EXTRA_AFLAGS) in the kernel corpus. + CFLAGS_KERNEL $(CC) options specific for built-in - $(EXTRA_LDFLAGS) and $(EXTRA_ARFLAGS) are similar strings for - per-directory options to $(LD) and $(AR). + $(CFLAGS_KERNEL) contains extra C compiler flags used to compile + resident kernel code. - Example: at the time of writing, there were no examples of - $(EXTRA_LDFLAGS) or $(EXTRA_ARFLAGS) in the kernel corpus. + CFLAGS_MODULE $(CC) options specific for modules - CFLAGS_$@, AFLAGS_$@ + $(CFLAGS_MODULE) contains extra C compiler flags used to compile code + for loadable kernel modules. - $(CFLAGS_$@) specifies per-file options for $(CC). The $@ - part has a literal value which specifies the file that it's for. + +--- 6.2 Add prerequisites to prepare: - Example: + The prepare: rule is used to list prerequisites that needs to be + built before starting to descend down in the subdirectories. + This is usual header files containing assembler constants. - # drivers/scsi/Makefile - CFLAGS_aha152x.o = -DAHA152X_STAT -DAUTOCONF - CFLAGS_gdth.o = # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ \ - -DGDTH_STATISTICS - CFLAGS_seagate.o = -DARBITRATE -DPARITY -DSEAGATE_USE_ASM + Example: + #arch/s390/Makefile + prepare: include/asm-$(ARCH)/offsets.h - These three lines specify compilation flags for aha152x.o, - gdth.o, and seagate.o + In this example the file include/asm-$(ARCH)/offsets.h will + be built before descending down in the subdirectories. + See also chapter XXX-TODO that describe how kbuild supports + generating offset header files. - $(AFLAGS_$@) is a similar feature for source files in assembly - languages. - Example: +--- 6.3 List directories to visit when descending - # arch/arm/kernel/Makefile - AFLAGS_head-armv.o := -DTEXTADDR=$(TEXTADDR) -traditional - AFLAGS_head-armo.o := -DTEXTADDR=$(TEXTADDR) -traditional + An arch Makefile cooperates with the top Makefile to define variables + which specify how to build the vmlinux file. Note that there is no + corresponding arch-specific section for modules; the module-building + machinery is all architecture-independent. - Rules.make has a feature where an object file depends on the - value of $(CFLAGS_$@) that was used to compile it. (It also - depends on the values of $(CFLAGS) and $(EXTRA_CFLAGS)). Thus, - if you change the value of $(CFLAGS_$@) for a file, either by - editing the Makefile or overriding the value some other way, - Rules.make will do the right thing and re-compile your source - file with the new options. + + head-y, init-y, core-y, libs-y, drivers-y, net-y - Note: because of a deficiency in Rules.make, assembly language - files do not have flag dependencies. If you edit $(AFLAGS_$@) - for such a file, you will have to remove the object file in order - to re-build from source. + $(head-y) list objects to be linked first in vmlinux. + $(libs-y) list directories where a libs.a archive can be located. + The rest list directories where a built-in.o object file can be located. - LD_RFLAG + $(init-y) objects will be located after $(head-y). + Then the rest follows in this order: + $(core-y), $(libs-y), $(drivers-y) and $(net-y). - This variable is used, but never defined. It appears to be a - vestige of some abandoned experiment. + The top level Makefile define values for all generic directories, + and arch/$(ARCH)/Makefile only adds architecture specific directories. + Example: + #arch/sparc64/Makefile + core-y += arch/sparc64/kernel/ + libs-y += arch/sparc64/prom/ arch/sparc64/lib/ + drivers-$(CONFIG_OPROFILE) += arch/sparc64/oprofile/ ---- 7.7 Miscellaneous variables +--- 6.4 Architecture specific boot images - IGNORE_FLAGS_OBJS + An arch Makefile specifies goals that take the vmlinux file, compress + it, wrap it in bootstrapping code, and copy the resulting files + somewhere. This includes various kinds of installation commands. + The actual goals are not standardized across architectures. - $(IGNORE_FLAGS_OBJS) is a list of object files which will not have - their flag dependencies automatically tracked. This is a hackish - feature, used to kludge around a problem in the implementation - of flag dependencies. (The problem is that flag dependencies - assume that a %.o file is built from a matching %.S or %.c file. - This is sometimes not true). + It is common to locate any additional processing in a boot/ + directory below arch/$(ARCH)/. - USE_STANDARD_AS_RULE + Kbuild does not provide any smart way to support building a + target specified in boot/. Therefore arch/$(ARCH)/Makefile shall + call make manually to build a target in boot/. - This is a transition variable. If $(USE_STANDARD_AS_RULE) - is defined, then Rules.make will provide standard rules for - assembling %.S files into %.o files or %.s files (%.s files - are useful only to developers). + The recommended approach is to include shortcuts in + arch/$(ARCH)/Makefile, and use the full path when calling down + into the arch/$(ARCH)/boot/Makefile. - If $(USE_STANDARD_AS_RULE) is not defined, then Rules.make - will not provide these standard rules. In this case, the - subdirectory Makefile must provide its own private rules for - assembling %.S files. + Example: + #arch/i386/Makefile + boot := arch/i386/boot + bzImage: vmlinux + $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ - In the past, all Makefiles provided private %.S rules. Newer - Makefiles should define USE_STANDARD_AS_RULE and use the standard - Rules.make rules. As soon as all the Makefiles across all - architectures have been converted to USE_STANDARD_AS_RULE, then - Rules.make can drop the conditional test on USE_STANDARD_AS_RULE. - After that, all the other Makefiles can drop the definition of - USE_STANDARD_AS_RULE. + "$(Q)$(MAKE) $(build)=" is the recommended way to invoke + make in a subdirectory. + There are no rules for naming of the architecture specific targets, + but executing "make help" will list all relevant targets. + To support this $(archhelp) must be defined. + Example: + #arch/i386/Makefile + define archhelp + echo '* bzImage - Image (arch/$(ARCH)/boot/bzImage)' + endef -=== 8 New-style variables + When make is executed without arguments, the first goal encountered + will be built. In the top level Makefile the first goal present + is all:. + An architecture shall always per default build a bootable image. + In "make help" the default goal is highlighted with a '*'. + Add a new prerequisite to all: to select a default goal different + from vmlinux. -[ This sections dates back from a time where the way to write Makefiles - described above was "new-style". I'm leaving it in as it describes the - same thing in other words, so it may be of some use ] + Example: + #arch/i386/Makefile + all: bzImage -The "new-style variables" are simpler and more powerful than the -"old-style variables". As a result, many subdirectory Makefiles shrank -more than 60%. This author hopes that, in time, all arch Makefiles and -subdirectory Makefiles will convert to the new style. + When "make" is executed without arguments, bzImage will be built. -Rules.make does not understand new-style variables. Thus, each new-style -Makefile has a section of boilerplate code that converts the new-style -variables into old-style variables. There is also some mixing, where -people define most variables using "new style" but then fall back to -"old style" for a few lines. +--- 6.5 Building non-kbuild targets ---- 8.1 New variables + EXTRA_TARGETS - obj-y obj-m obj-n obj- + EXTRA_TARGETS specify additional targets created in current + directory, in addition to any targets specified by obj-*. - These variables replace $(O_OBJS), $(OX_OBJS), $(M_OBJS), - and $(MX_OBJS). + Listing all targets in EXTRA_TARGETS is required for three purposes: + 1) Avoid that the target is linked in as part of built-in.o + 2) Enable kbuild to check changes in command lines + - When $(call if_changed,xxx) is used + 3) kbuild knows what file to delete during "make clean" Example: + #arch/i386/kernel/Makefile + EXTRA_TARGETS := head.o init_task.o - # drivers/block/Makefile - obj-$(CONFIG_MAC_FLOPPY) += swim3.o - obj-$(CONFIG_BLK_DEV_FD) += floppy.o - obj-$(CONFIG_AMIGA_FLOPPY) += amiflop.o - obj-$(CONFIG_ATARI_FLOPPY) += ataflop.o + In this example EXTRA_TARGETS is used to list object files that + shall be built, but shall not be linked as part of built-in.o. - Notice the use of $(CONFIG_...) substitutions on the left hand - side of an assignment operator. This gives GNU Make the power - of associative indexing! Each of these assignments replaces - eight lines of code in an old-style Makefile. - - After executing all of the assignments, the subdirectory - Makefile has built up four lists: $(obj-y), $(obj-m), $(obj-n), - and $(obj-). + Example: + #arch/i386/boot/Makefile + EXTRA_TARGETS := vmlinux.bin bootsect bootsect.o - $(obj-y) is a list of files to include in vmlinux. - $(obj-m) is a list of files to build as single-file modules. - $(obj-n) and $(obj-) are ignored. + In this example EXTRA_TARGETS is used to list all intermediate + targets, and all final targets. + The targets are added to EXTRA_TARGETS to enable 2) and 3) above. + +--- 6.6 Commands useful for building a boot image - Each list may contain duplicates items; duplicates are - automatically removed later. Duplicates in both $(obj-y) and - $(obj-m) will automatically be removed from the $(obj-m) list. + Kbuild provide a few macros that are useful when building a + boot image. - Example: + if_changed - # drivers/net/Makefile + if_changed is the infrastructure used for the following commands. - ... - obj-$(CONFIG_OAKNET) += oaknet.o 8390.o - ... - obj-$(CONFIG_NE2K_PCI) += ne2k-pci.o 8390.o - ... - obj-$(CONFIG_STNIC) += stnic.o 8390.o - ... - obj-$(CONFIG_MAC8390) += daynaport.o 8390.o - ... + Usage: + target: source(s) FORCE + $(call if_changed,ld/objcopy/gzip) + + When the rule is evaluated it is checked to see if any files + needs an update, or the commandline has changed since last + invocation. The latter will force a rebuild if any options + to the executable have changed. + Any target that utilises if_changed must be listed in EXTRA_TARGETS, + otherwise the command line check will fail, and the target will + always be built. + if_changed may be used in conjunction with custom commands as + defined in 6.7 "Custom kbuild commands". + Note: It is a typical mistake to forget the FORCE prerequisite. - In this example, four different drivers require the code in - 8390.o. If one or more of these four drivers are built into - vmlinux, then 8390.o will also be built into vmlinux, and will - *not* be built as a module -- even if another driver which needs - 8390.o is built as a module. (The modular driver is able to - use services of the 8390.o code in the resident vmlinux image). + ld + Link target. Often LDFLAGS_$@ is used to set specific options to ld. + + objcopy + Copy binary. Uses OBJCOPYFLAGS usually specified in + arch/$(ARCH)/Makefile. - export-objs + gzip + Compress target. Use maximum compression to compress target. - $(export-objs) is a list of all the files in the subdirectory - which potentially export symbols. The canonical way to construct - this list is: - grep -l EXPORT_SYMBOL *.c +--- 6.7 Custom kbuild commands - (but watch out for sneaky files that call EXPORT_SYMBOL from an - included header file!) + When kbuild is executing with KBUILD_VERBOSE=0 then only a shorthand + of a command is normally displayed. + To enable this behaviour for custom commands kbuild requires + two variables to be set: + quiet_cmd_ - what shall be echoed + cmd_ - the command to execute - This is a potential list, independent of the kernel configuration. - All files that export symbols go into $(export-objs). The - boilerplate code then uses the $(export-objs) list to separate - the real file lists into $(*_OBJS) and $(*X_OBJS). + Example: + # + quiet_cmd_image = BUILD $@ + cmd_image = $(obj)/tools/build $(BUILDFLAGS) \ + $(obj)/vmlinux.bin > $@ - Experience has shown that maintaining the proper X's in an - old-style Makefile is difficult and error-prone. Maintaining the - $(export-objs) list in a new-style Makefile is simpler and easier - to audit. + $(obj)/bzImage: $(obj)/vmlinux.bin $(obj)/tools/build FORCE + $(call if_changed,image) + @echo 'Kernel: $@ is ready' - $(foo)-objs + When updating the $(obj)/bzImage target the line: - Some kernel modules are composed of multiple object files linked - together. + BUILD arch/i386/boot/bzImage - For each multi-part kernel modul there is a list of all the - object files which make up that module. For a kernel module - named foo.o, its object file list is foo-objs. + will be displayed with "make KBUILD_VERBOSE=0". + - Example: +=== 7 Kbuild Variables - # drivers/scsi/Makefile - list-multi := scsi_mod.o sr_mod.o initio.o a100u2w.o +The top Makefile exports the following variables: - ... + VERSION, PATCHLEVEL, SUBLEVEL, EXTRAVERSION - scsi_mod-objs := hosts.o scsi.o scsi_ioctl.o constants.o \ - scsicam.o scsi_proc.o scsi_error.o \ - scsi_obsolete.o scsi_queue.o scsi_lib.o \ - scsi_merge.o scsi_dma.o scsi_scan.o \ - scsi_syms.o - sr_mod-objs := sr.o sr_ioctl.o sr_vendor.o - initio-objs := ini9100u.o i91uscsi.o - a100u2w-objs := inia100.o i60uscsi.o + These variables define the current kernel version. A few arch + Makefiles actually use these values directly; they should use + $(KERNELRELEASE) instead. - The subdirectory Makefile puts the modules onto obj-* lists in - the usual configuration-dependent way: + $(VERSION), $(PATCHLEVEL), and $(SUBLEVEL) define the basic + three-part version number, such as "2", "4", and "0". These three + values are always numeric. - obj-$(CONFIG_SCSI) += scsi_mod.o - obj-$(CONFIG_BLK_DEV_SR) += sr_mod.o - obj-$(CONFIG_SCSI_INITIO) += initio.o - obj-$(CONFIG_SCSI_INIA100) += a100u2w.o + $(EXTRAVERSION) defines an even tinier sublevel for pre-patches + or additional patches. It is usually some non-numeric string + such as "-pre4", and is often blank. - Suppose that CONFIG_SCSI=y. Then vmlinux needs to link in all - 14 components of scsi_mod.o. + KERNELRELEASE - Suppose that CONFIG_BLK_DEV_SR=m. Then the 3 components - of sr_mod.o will be linked together with "$(LD) -r" to make the - kernel module sr_mod.o. + $(KERNELRELEASE) is a single string such as "2.4.0-pre4", suitable + for constructing installation directory names or showing in + version strings. Some arch Makefiles use it for this purpose. - Also suppose CONFIG_SCSI_INITIO=n. Then initio.o goes onto - the $(obj-n) list and that's the end of it. Its component - files are not compiled, and the composite file is not created. + ARCH + This variable defines the target architecture, such as "i386", + "arm", or "sparc". Some kbuild Makefiles test $(ARCH) to + determine which files to compile. - subdir-y subdir-m subdir-n subdir- + By default, the top Makefile sets $(ARCH) to be the same as the + host system architecture. For a cross build, a user may + override the value of $(ARCH) on the command line: - These variables replace $(ALL_SUB_DIRS), $(SUB_DIRS) and - $(MOD_SUB_DIRS). + make ARCH=m68k ... - Example: - # drivers/Makefile - subdir-$(CONFIG_PCI) += pci - subdir-$(CONFIG_PCMCIA) += pcmcia - subdir-$(CONFIG_MTD) += mtd - subdir-$(CONFIG_SBUS) += sbus + INSTALL_PATH - These variables work similar to obj-*, but are used for - subdirectories instead of object files. + This variable defines a place for the arch Makefiles to install + the resident kernel image and System.map file. + Use this for architecture specific install targets. - After executing all assignments, the subdirectory Makefile has - built up four lists: $(subdir-y), $(subdir-m), $(subdir-n), - and $(subdir-). + INSTALL_MOD_PATH, MODLIB - $(subdir-y) is a list of directories that should be entered - for making vmlinux. - $(subdir-m) is a list of directories that should be entered - for making modules. - $(subdir-n) and $(subdir-) are only used for collecting a list - of all subdirectories of this directory. + $(INSTALL_MOD_PATH) specifies a prefix to $(MODLIB) for module + installation. This variable is not defined in the Makefile but + may be passed in by the user if desired. - Each list besides subdir-y may contain duplicates items; duplicates - are automatically removed later. + $(MODLIB) specifies the directory for module installation. + The top Makefile defines $(MODLIB) to + $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE). The user may + override this value on the command line if desired. - mod-subdirs +=== 8 Makefile language - $(mod-subdirs) is a list of all the subdirectories that should - be added to $(subdir-m), too if they appear in $(subdir-y) +The kernel Makefiles are designed to run with GNU Make. The Makefiles +use only the documented features of GNU Make, but they do use many +GNU extensions. - Example: +GNU Make supports elementary list-processing functions. The kernel +Makefiles use a novel style of list building and manipulation with few +"if" statements. - # fs/Makefile - mod-subdirs := nls +GNU Make has two assignment operators, ":=" and "=". ":=" performs +immediate evaluation of the right-hand side and stores an actual string +into the left-hand side. "=" is like a formula definition; it stores the +right-hand side in an unevaluated form and then evaluates this form each +time the left-hand side is used. - This means nls should be added to (subdir-y) and $(subdir-m) if - CONFIG_NFS = y. +There are some cases where "=" is appropriate. Usually, though, ":=" +is the right choice. === 9 Credits -Thanks to the members of the linux-kbuild mailing list for reviewing -drafts of this document, with particular thanks to Peter Samuelson -and Thomas Molina. +Original version made by Michael Elizabeth Chastain, +Updates by Kai Germaschewski +Updates by Sam Ravnborg + +=== 10 TODO + +- Describe how kbuild support shipped files with _shipped. +- Generating offset header files. +- Add more variables to section 7? + diff -Nru a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt --- a/Documentation/kernel-parameters.txt Sun Feb 9 21:13:37 2003 +++ b/Documentation/kernel-parameters.txt Sun Feb 9 21:13:37 2003 @@ -1,4 +1,4 @@ -November 2002 Kernel Parameters v2.5.49 +February 2003 Kernel Parameters v2.5.59 ~~~~~~~~~~~~~~~~~ The following is a consolidated list of the kernel parameters as implemented @@ -60,6 +60,7 @@ V4L Video For Linux support is enabled. VGA The VGA console has been enabled. VT Virtual terminal support is enabled. + WDT Watchdog support is enabled. XT IBM PC/XT MFM hard disk support is enabled. In addition, the following text indicates that the option: @@ -98,6 +99,9 @@ advansys= [HW,SCSI] See header of drivers/scsi/advansys.c. + advwdt= [HW,WDT] Advantech WDT + Format: , + aedsp16= [HW,OSS] Audio Excel DSP 16 Format: ,,,,, See also header of sound/oss/aedsp16.c. @@ -111,6 +115,9 @@ aic7xxx= [HW,SCSI] See Documentation/scsi/aic7xxx.txt. + aic79xx= [HW,SCSI] + See Documentation/scsi/aic79xx.txt. + allowdma0 [ISAPNP] AM53C974= [HW,SCSI] @@ -230,20 +237,12 @@ cs89x0_media= [HW,NET] Format: { rj45 | aui | bnc } - - ctc= [HW,NET] - See drivers/s390/net/ctcmain.c, comment before function - ctc_setup(). cyclades= [HW,SERIAL] Cyclades multi-serial port adapter. dasd= [HW,NET] See header of drivers/s390/block/dasd_devmap.c. - dasd_discipline= - [HW,NET] - See header of drivers/s390/block/dasd.c. - db9= [HW,JOY] db9_2= db9_3= @@ -254,9 +253,6 @@ Format: [,] See also Documentation/networking/decnet.txt. - decr_overclock= [PPC] - decr_overclock_proc0= - devfs= [DEVFS] See Documentation/filesystems/devfs/boot-options. @@ -305,6 +301,9 @@ This option is obsoleted by the "netdev=" option, which has equivalent usage. See its documentation for details. + eurwdt= [HW,WDT] Eurotech CPU-1220/1410 onboard watchdog. + Format: [,] + fd_mcs= [HW,SCSI] See header of drivers/scsi/fd_mcs.c. @@ -350,7 +349,9 @@ hisax= [HW,ISDN] See Documentation/isdn/README.HiSax. - hugepages= [HW,IA-32] Maximal number of HugeTLB pages + hugepages= [HW,IA-32,IA-64] Maximal number of HugeTLB pages. + + noirqbalance [IA-32,SMP,KNL] Disable kernel irq balancing i8042_direct [HW] Non-translated mode i8042_dumbkbd @@ -394,6 +395,10 @@ inttest= [IA64] + io7= [HW] IO7 for Marvel based alpha systems + See comment before marvel_specify_io7 in + arch/alpha/kernel/core_marvel.c. + ip= [IP_PNP] See Documentation/nfsroot.txt. @@ -495,6 +500,7 @@ mdacon= [MDA] Format: , + Specifies range of consoles to be captured by the MDA. mem=exactmap [KNL,BOOT,IA-32] Enable setting of an exact E820 memory map, as specified by the user. @@ -576,6 +582,8 @@ nodisconnect [HW,SCSI,M68K] Disables SCSI disconnects. + noexec [IA-64] + nofxsr [BUGS=IA-32] nohighio [BUGS=IA-32] Disable highmem block I/O. @@ -599,7 +607,9 @@ noresume [SWSUSP] Disables resume and restore original swap space. - no-scroll [VGA] + no-scroll [VGA] Disables scrollback. + This is required for the Braillex ib80-piezo Braille + reader made by F.H. Papenmeier (Germany). nosbagart [IA-64] @@ -809,6 +819,9 @@ See a comment before function sbpcd_setup() in drivers/cdrom/sbpcd.c. + sc1200wdt= [HW,WDT] SC1200 WDT (watchdog) driver + Format: [,[,]] + scsi_debug_*= [SCSI] See drivers/scsi/scsi_debug.c. @@ -997,9 +1010,6 @@ spia_pedr= spia_peddr= - spread_lpevents= - [PPC] - sscape= [HW,OSS] Format: ,,,, @@ -1009,6 +1019,19 @@ st0x= [HW,SCSI] See header of drivers/scsi/seagate.c. + sti= [HW] + Format: + Set the STI (builtin display/keyboard on the HP-PARISC + machines) console (graphic card) which should be used + as the initial boot-console. + See also comment in drivers/video/console/sticore.c. + + sti_font= [HW] + See comment in drivers/video/console/sticore.c. + + stifb= [HW] + Format: bpp:[:[:...]] + stram_swap= [HW,M68k] swiotlb= [IA-64] Number of I/O TLB slabs @@ -1079,7 +1102,7 @@ wd7000= [HW,SCSI] See header of drivers/scsi/wd7000.c. - wdt= [HW] Watchdog + wdt= [WDT] Watchdog See Documentation/watchdog.txt. xd= [HW,XT] Original XT pre-IDE (RLL encoded) disks. diff -Nru a/Documentation/md.txt b/Documentation/md.txt --- a/Documentation/md.txt Sun Feb 9 21:13:34 2003 +++ b/Documentation/md.txt Sun Feb 9 21:13:34 2003 @@ -9,7 +9,7 @@ for old raid arrays without persistent superblocks: md=,,,,dev0,dev1,...,devn -for raid arrays with persistant superblocks +for raid arrays with persistent superblocks md=,dev0,dev1,...,devn md device no. = the number of the md device ... @@ -21,7 +21,7 @@ raid level = -1 linear mode 0 striped mode - other modes are only supported with persistant super blocks + other modes are only supported with persistent super blocks chunk size factor = (raid-0 and raid-1 only) Set the chunk size as 4k << n. diff -Nru a/Documentation/modules.txt b/Documentation/modules.txt --- a/Documentation/modules.txt Sun Feb 9 21:13:28 2003 +++ b/Documentation/modules.txt Sun Feb 9 21:13:28 2003 @@ -9,20 +9,13 @@ that the kernel now supports. The current required version is listed in the file linux/Documentation/Changes. -* * * NOTE * * * -The kernel has been changed to remove kerneld support and use -the new kmod support. Keep this in mind when reading this file. Kmod -does the exact same thing as kerneld, but doesn't require an external -program (see Documentation/kmod.txt) - In the beginning... ------------------- Anyway, your first step is to compile the kernel, as explained in the file linux/README. It generally goes like: - make config - make dep + make *config <= usually menuconfig or xconfig make clean make zImage or make zlilo @@ -39,15 +32,16 @@ plus those things that you just can't live without... The set of modules is constantly increasing, and you will be able to select -the option "m" in "make config" for those features that the current kernel +the option "m" in "make menuconfig" for those features that the current kernel can offer as loadable modules. You also have a possibility to create modules that are less dependent on -the kernel version. This option can be selected during "make config", by +the kernel version. This option can be selected during "make *config", by enabling CONFIG_MODVERSIONS, and is most useful on "stable" kernel versions, -such as the kernels from the 1.2 and 2.0 series. +such as the kernels from the 2. series. If you have modules that are based on sources that are not included in the official kernel sources, you will certainly like this option... +See below how to compile modules outside the official kernel. Here is a sample of the available modules included in the kernel sources: @@ -83,22 +77,45 @@ make modules -This will compile all modules and update the linux/modules directory. -In this directory you will then find a bunch of symbolic links, -pointing to the various object files in the kernel tree. +This will compile all modules. A module is identified by the +extension .ko, for kernel object. Now, after you have created all your modules, you should also do: make modules_install This will copy all newly made modules into subdirectories under "/lib/modules/kernel_release/", where "kernel_release" is something -like 2.0.1, or whatever the current kernel version is... +like 2.5.54, or whatever the current kernel version is. +Note: Installing modules may require root privileges. As soon as you have rebooted the newly made kernel, you can install and remove modules at will with the utilities: "insmod" and "rmmod". After reading the man-page for insmod, you will also know how easy it is to configure a module when you do "insmod" (hint: symbol=value). +Installing modules in a non-standard location +--------------------------------------------- +When the modules needs to be installed under another directory +the INSTALL_MOD_PATH can be used to prefix "/lib/modules" as seen +in the following example: + +make INSTALL_MOD_PATH=/frodo modules_install + +This will install the modules in the directory /frodo/lib/modules. +/frodo can be a NFS mounted filesystem on another machine, allowing +out-of-the-box support for installation on remote machines. + + +Compiling modules outside the official kernel +--------------------------------------------- +Often modules are developed outside the official kernel. +To keep up with changes in the build system the most portable way +to compile a module outside the kernel is to use the following command-line: + +make -C path/to/kernel/src SUBDIRS=$PWD modules + +This requires that a makefile exits made in accordance to +Documentation/kbuild/makefiles.txt. Nifty features: --------------- diff -Nru a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt --- a/Documentation/networking/bonding.txt Sun Feb 9 21:13:30 2003 +++ b/Documentation/networking/bonding.txt Sun Feb 9 21:13:30 2003 @@ -258,7 +258,7 @@ Specifies the ip addresses to use when arp_interval is > 0. These are the targets of the ARP request sent to determine the health of the link to the targets. Specify these values in ddd.ddd.ddd.ddd format. - Multiple ip adresses must be seperated by a comma. At least one ip + Multiple ip adresses must be separated by a comma. At least one ip address needs to be given for ARP monitoring to work. The maximum number of targets that can be specified is set at 16. @@ -309,7 +309,7 @@ case of just one target, the target itself may go down or have a problem making it unresponsive to ARP requests. Having an additional target (or several) would increase the reliability of the ARP monitoring. -Multiple ARP targets must be seperated by commas as follows: +Multiple ARP targets must be separated by commas as follows: # example options for ARP monitoring with three targets alias bond0 bonding diff -Nru a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt --- a/Documentation/networking/ip-sysctl.txt Sun Feb 9 21:13:31 2003 +++ b/Documentation/networking/ip-sysctl.txt Sun Feb 9 21:13:31 2003 @@ -281,6 +281,14 @@ assassination. Default: 0 +tcp_low_latency - BOOLEAN + If set, the TCP stack makes decisions that prefer lower + latency as opposed to higher throughput. By default, this + option is not set meaning that higher throughput is preferred. + An example of an application where this default should be + changed would be a Beowulf compute cluster. + Default: 0 + ip_local_port_range - 2 INTEGERS Defines the local port range that is used by TCP and UDP to choose the local port. The first number is the first, the diff -Nru a/Documentation/s390/s390dbf.txt b/Documentation/s390/s390dbf.txt --- a/Documentation/s390/s390dbf.txt Sun Feb 9 21:13:34 2003 +++ b/Documentation/s390/s390dbf.txt Sun Feb 9 21:13:34 2003 @@ -8,7 +8,7 @@ ------------ The goal of this feature is to provide a kernel debug logging API where log records can be stored efficiently in memory, where each component -(e.g. device drivers) can have one seperate debug log. +(e.g. device drivers) can have one separate debug log. One purpose of this is to inspect the debug logs after a production system crash in order to analyze the reason for the crash. If the system still runs but only a subcomponent which uses dbf failes, diff -Nru a/Documentation/scsi/ChangeLog.sym53c8xx b/Documentation/scsi/ChangeLog.sym53c8xx --- a/Documentation/scsi/ChangeLog.sym53c8xx Sun Feb 9 21:13:35 2003 +++ b/Documentation/scsi/ChangeLog.sym53c8xx Sun Feb 9 21:13:35 2003 @@ -529,7 +529,7 @@ * version pre-sym53c8xx-0.13 - Some rewrite of the device detection code. This code had been patched too much and needed to be face-lifted a bit. - Remove all platform dependant fix-ups that was not needed or + Remove all platform dependent fix-ups that was not needed or conflicted with some other driver code as work-arounds. Reread the NVRAM before the calling of ncr_attach(). This spares stack space and so allows to handle more boards. diff -Nru a/Documentation/scsi/aic79xx.txt b/Documentation/scsi/aic79xx.txt --- a/Documentation/scsi/aic79xx.txt Sun Feb 9 21:13:34 2003 +++ b/Documentation/scsi/aic79xx.txt Sun Feb 9 21:13:34 2003 @@ -1,5 +1,5 @@ ==================================================================== -= Adaptec Ultra320 Family Manager Set v1.1.1 = += Adaptec Ultra320 Family Manager Set v1.3.0 = = = = README for = = The Linux Operating System = @@ -27,6 +27,10 @@ Adaptec SCSI Card 39320D Dual Channel 64-bit PCI-X 133MHz to Ultra320 SCSI Card (two external VHDC and one internal 68-pin) + Adaptec SCSI Card 39320D Dual Channel 64-bit PCI-X 133MHz to + Ultra320 SCSI Card (two external VHDC + and one internal 68-pin) based on the + AIC-7902B ASIC Adaptec SCSI Card 29320 Single Channel 64-bit PCI-X 133MHz to Ultra320 SCSI Card (one external 68-pin, two internal 68-pin, one @@ -39,12 +43,28 @@ Ultra320 SCSI ASIC AIC-7902A4 Dual Channel 64-bit PCI-X 133MHz to Ultra320 SCSI ASIC - + AIC-7902B Dual Channel 64-bit PCI-X 133MHz to + Ultra320 SCSI ASIC 2. Version History + (V1.3.0, January 2003) Full regression testing for all U320 products + completed. + + (V1.3.0 ALPHA, November 2002) Initial Alpha release. + Added abort and target/lun reset error recovery handler and + interrupt coalessing. + + (V1.2.0, November 2002) Added support for Domain Validation and + Hewlett-Packard version of the 39320D and AIC-7902 adapters. + Support for previous adapters has not been fully tested and should + only be used at the customer's own risk. + (V1.1.1, September 2002) Added support for the Linux 2.5.X kernel series + (V1.1.0, August 2002) Added support for four additional SCSI + products: ASC-39320, ASC-29320, ASC-29320LP, AIC-7901. + (V1.1, August 2002) Added support for four additional SCSI products: ASC-39320, ASC-29320, ASC-29320LP, AIC-7901. @@ -56,20 +76,21 @@ - 320MB/s transfer rates - Packetized SCSI Protocol at 160MB/s and 320MB/s - Quick Arbitration Selection (QAS) - - Initiator Mode (target mode not currently - supported) - - Support for the PCI-x standard up to 133MHz - - Support for the PCI v2.2 standard + - Retained Training Information (Rev B. ASIC only) + - Interrupt Coalessing + - Initiator Mode (target mode not currently + supported) + - Support for the PCI-X standard up to 133MHz + - Support for the PCI v2.2 standard 2.2. Operating System Support: - - Redhat Linux 7.2, 7.3, Advanced Server 2.1 - - SuSE Linux 7.3, 8.0, Enterprise Server 7 + - Redhat Linux 7.2, 7.3, 8.0, Advanced Server 2.1 + - SuSE Linux 7.3, 8.0, 8.1, Enterprise Server 7 - only Intel and AMD x86 supported at this time - - >4GB memory configurations supported. + - >4GB memory configurations supported. Refer to the User's Guide for more details on this. - 3. Command Line Options WARNING: ALTERING OR ADDING THESE DRIVER PARAMETERS @@ -77,7 +98,7 @@ USE THEM WITH CAUTION. Edit the file "modules.conf" in the directory /etc and add/edit a - line containing 'options aic79xx=[command[,command...]]' where + line containing 'options aic79xx aic79xx=[command[,command...]]' where 'command' is one or more of the following: ----------------------------------------------------------------- Option: verbose @@ -88,6 +109,9 @@ ----------------------------------------------------------------- Option: debug:[value] Definition: Enables various levels of debugging information + The bit definitions for the debugging mask can + be found in drivers/scsi/aic7xxx/aic79xx.h under + the "Debug" heading. Possible Values: 0x0000 = no debugging, 0xffff = full debugging Default Value: 0x0000 ----------------------------------------------------------------- @@ -114,120 +138,140 @@ Possible Values: This option is a flag Default Value: disabled ----------------------------------------------------------------- - Option: global_tag_depth + Option: global_tag_depth Definition: Global tag depth for all targets on all busses. - This option sets the default tag depth which - may be selectively overridden vi the tag_info - option. + This option sets the default tag depth which + may be selectively overridden vi the tag_info + option. Possible Values: 1 - 253 Default Value: 32 ----------------------------------------------------------------- Option: tag_info:{{value[,value...]}[,{value[,value...]}...]} Definition: Set the per-target tagged queue depth on a - per controller basis. Both controllers and targets - may be ommitted indicating that they should retain - the default tag depth. + per controller basis. Both controllers and targets + may be ommitted indicating that they should retain + the default tag depth. Examples: tag_info:{{16,32,32,64,8,8,,32,32,32,32,32,32,32,32,32} - On Controller 0 - specifies a tag depth of 16 for target 0 - specifies a tag depth of 64 for target 3 - specifies a tag depth of 8 for targets 4 and 5 - leaves target 6 at the default - specifies a tag depth of 32 for targets 1,2,7-15 - All other targets retain the default depth. - - tag_info:{{},{32,,32}} - On Controller 1 - specifies a tag depth of 32 for targets 0 and 2 - All other targets retain the default depth. - + On Controller 0 + specifies a tag depth of 16 for target 0 + specifies a tag depth of 64 for target 3 + specifies a tag depth of 8 for targets 4 and 5 + leaves target 6 at the default + specifies a tag depth of 32 for targets 1,2,7-15 + All other targets retain the default depth. + + tag_info:{{},{32,,32}} + On Controller 1 + specifies a tag depth of 32 for targets 0 and 2 + All other targets retain the default depth. + Possible Values: 1 - 253 Default Value: 32 ----------------------------------------------------------------- Option: rd_strm: {rd_strm_bitmask[,rd_strm_bitmask...]} Definition: Enable read streaming on a per target basis. The rd_strm_bitmask is a 16 bit hex value in which - each bit represents a target. Setting the target's + each bit represents a target. Setting the target's bit to '1' enables read streaming for that target. Controllers may be ommitted indicating that - they should retain the default read streaming setting. - Example: rd_strm:{0x0041} - On Controller 0 - enables read streaming for targets 0 and 6. - disables read streaming for targets 1-5,7-15. - All other targets retain the default read - streaming setting. - Example: rd_strm:{0x0023,,0xFFFF} - On Controller 0 - enables read streaming for targets 1,2, and 5. - disables read streaming for targets 3,4,6-15. - On Controller 2 - enables read streaming for all targets. - All other targets retain the default read - streaming setting. - + they should retain the default read streaming setting. + Example: rd_strm:{0x0041} + On Controller 0 + enables read streaming for targets 0 and 6. + disables read streaming for targets 1-5,7-15. + All other targets retain the default read + streaming setting. + Example: rd_strm:{0x0023,,0xFFFF} + On Controller 0 + enables read streaming for targets 1,2, and 5. + disables read streaming for targets 3,4,6-15. + On Controller 2 + enables read streaming for all targets. + All other targets retain the default read + streaming setting. + Possible Values: 0x0000 - 0xffff Default Value: 0x0000 ----------------------------------------------------------------- + Option: dv: {value[,value...]} + Definition: Set Domain Validation Policy on a per-controller basis. + Controllers may be ommitted indicating that + they should retain the default read streaming setting. + Example: dv:{-1,0,,1,1,0} + On Controller 0 leave DV at its default setting. + On Controller 1 disable DV. + Skip configuration on Controller 2. + On Controllers 3 and 4 enable DV. + On Controller 5 disable DV. + + Possible Values: < 0 Use setting from serial EEPROM. + 0 Disable DV + > 0 Enable DV + Default Value: DV Serial EEPROM configuration setting. + ----------------------------------------------------------------- + Option: seltime:[value] + Definition: Specifies the selection timeout value + Possible Values: 0 = 256ms, 1 = 128ms, 2 = 64ms, 3 = 32ms + Default Value: 0 + ----------------------------------------------------------------- + + *** The following three options should only be changed at *** + *** the direction of a technical support representative. *** + + ----------------------------------------------------------------- Option: precomp: {value[,value...]} Definition: Set IO Cell precompensation value on a per-controller - basis. + basis. Controllers may be ommitted indicating that - they should retain the default precompensation setting. - Example: precomp:{0x1} - On Controller 0 set precompensation to 1. - Example: precomp:{1,,7} - On Controller 0 set precompensation to 1. - On Controller 2 set precompensation to 8. - + they should retain the default precompensation setting. + Example: precomp:{0x1} + On Controller 0 set precompensation to 1. + Example: precomp:{1,,7} + On Controller 0 set precompensation to 1. + On Controller 2 set precompensation to 8. + Possible Values: 0 - 7 Default Value: Varies based on chip revision ----------------------------------------------------------------- Option: slewrate: {value[,value...]} Definition: Set IO Cell slew rate on a per-controller basis. Controllers may be ommitted indicating that - they should retain the default slew rate setting. - Example: slewrate:{0x1} - On Controller 0 set slew rate to 1. - Example: slewrate :{1,,8} - On Controller 0 set slew rate to 1. - On Controller 2 set slew rate to 8. - + they should retain the default slew rate setting. + Example: slewrate:{0x1} + On Controller 0 set slew rate to 1. + Example: slewrate :{1,,8} + On Controller 0 set slew rate to 1. + On Controller 2 set slew rate to 8. + Possible Values: 0 - 15 Default Value: Varies based on chip revision ----------------------------------------------------------------- Option: amplitude: {value[,value...]} Definition: Set IO Cell signal amplitude on a per-controller basis. Controllers may be ommitted indicating that - they should retain the default read streaming setting. - Example: amplitude:{0x1} - On Controller 0 set amplitude to 1. - Example: amplitude :{1,,7} - On Controller 0 set amplitude to 1. - On Controller 2 set amplitude to 7. - + they should retain the default read streaming setting. + Example: amplitude:{0x1} + On Controller 0 set amplitude to 1. + Example: amplitude :{1,,7} + On Controller 0 set amplitude to 1. + On Controller 2 set amplitude to 7. + Possible Values: 1 - 7 Default Value: Varies based on chip revision ----------------------------------------------------------------- - Option: seltime:[value] - Definition: Specifies the selection timeout value - Possible Values: 0 = 256ms, 1 = 128ms, 2 = 64ms, 3 = 32ms - Default Value: 0 - ----------------------------------------------------------------- - Example: 'options aic79xx=verbose,rd_strm:{{0x0041}}' - enables verbose output in the driver and turns read streaming on - for targets 0 and 6 of Controller 0. + Example: 'options aic79xx aic79xx=verbose,rd_strm:{{0x0041}}' + enables verbose output in the driver and turns read streaming on + for targets 0 and 6 of Controller 0. 4. Additional Notes 4.1. Known/Unresolved or FYI Issues - * Domain Validation is not implemented. - * Under SuSE Linux Enterprise 7, the driver may fail to operate - correctly due to a problem with PCI interrupt routing in the - Linux kernel. Please contact SuSE for an updated Linux - kernel. + * Under SuSE Linux Enterprise 7, the driver may fail to operate + correctly due to a problem with PCI interrupt routing in the + Linux kernel. Please contact SuSE for an updated Linux + kernel. 4.2. Third-Party Compatibility Issues @@ -240,6 +284,18 @@ * PCI Hot Plug is untested and may cause the operating system to stop responding. + * Luns that are not numbered contiguously starting with 0 might not + be automatically probed during system startup. This is a limitation + of the OS. Please contact your Linux vendor for instructions on + manually probing non-contiguous luns. + * Using the Driver Update Disk version of this package during OS + installation under RedHat might result in two versions of this + driver being installed into the system module directory. This + might cause problems with the /sbin/mkinitrd program and/or + other RPM packages that try to install system modules. The best + way to correct this once the system is running is to install + the latest RPM package version of this driver, available from + http://www.adaptec.com. 5. Contacting Adaptec @@ -316,7 +372,7 @@ ------------------------------------------------------------------- -(c) 2002 Adaptec, Inc. All Rights Reserved. No part of this +(c) 2003 Adaptec, Inc. All Rights Reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without prior written consent diff -Nru a/Documentation/scsi/aic7xxx.txt b/Documentation/scsi/aic7xxx.txt --- a/Documentation/scsi/aic7xxx.txt Sun Feb 9 21:13:30 2003 +++ b/Documentation/scsi/aic7xxx.txt Sun Feb 9 21:13:30 2003 @@ -1,5 +1,5 @@ ==================================================================== -= Adaptec Aic7xxx Fast -> Ultra160 Family Manager Set v6.2.10 = += Adaptec Aic7xxx Fast -> Ultra160 Family Manager Set v6.2.28 = = README for = = The Linux Operating System = ==================================================================== @@ -7,8 +7,9 @@ The following information is available in this file: 1. Supported Hardware - 2. Command Line Options - 3. Contacting Adaptec + 2. Version History + 3. Command Line Options + 4. Contacting Adaptec 1. Supported Hardware @@ -44,52 +45,52 @@ 5. Block Move Instruction Support - Doubles the speed of certain sequencer operations. 6. `Bayonet' style Scatter Gather Engine - Improves S/G prefetch - performance. + performance. 7. Queuing Registers - Allows queuing of new transactions without - pausing the sequencer. + pausing the sequencer. 8. Multiple Target IDs - Allows the controller to respond to selection as a target on multiple SCSI IDs. Controller Chip Host-Bus Int-Connectors Ext-Connectors Notes -------------------------------------------------------------------------- - AHA-274X[A] aic7770 EISA SE-50M SE-HD50F - AHA-274X[A]W aic7770 EISA SE-HD68F SE-HD68F - SE-50M - AHA-274X[A]T aic7770 EISA 2 X SE-50M SE-HD50F - AHA-2842 aic7770 VL SE-50M SE-HD50F - AHA-2940AU aic7860 PCI/32 SE-50M SE-HD50F + AHA-274X[A] aic7770 EISA SE-50M SE-HD50F + AHA-274X[A]W aic7770 EISA SE-HD68F SE-HD68F + SE-50M + AHA-274X[A]T aic7770 EISA 2 X SE-50M SE-HD50F + AHA-2842 aic7770 VL SE-50M SE-HD50F + AHA-2940AU aic7860 PCI/32 SE-50M SE-HD50F AVA-2902I aic7860 PCI/32 SE-50M AVA-2902E aic7860 PCI/32 SE-50M - AVA-2906 aic7856 PCI/32 SE-50M SE-DB25F - APC-7850 aic7850 PCI/32 SE-50M 1 + AVA-2906 aic7856 PCI/32 SE-50M SE-DB25F + APC-7850 aic7850 PCI/32 SE-50M 1 AVA-2940 aic7860 PCI/32 SE-50M AHA-2920B aic7860 PCI/32 SE-50M AHA-2930B aic7860 PCI/32 SE-50M - AHA-2920C aic7856 PCI/32 SE-50M SE-HD50F + AHA-2920C aic7856 PCI/32 SE-50M SE-HD50F AHA-2930C aic7860 PCI/32 SE-50M AHA-2930C aic7860 PCI/32 SE-50M AHA-2910C aic7860 PCI/32 SE-50M AHA-2915C aic7860 PCI/32 SE-50M - AHA-2940AU/CN aic7860 PCI/32 SE-50M SE-HD50F - AHA-2944W aic7870 PCI/32 HVD-HD68F HVD-HD68F - HVD-50M - AHA-3940W aic7870 PCI/32 2 X SE-HD68F SE-HD68F 2 + AHA-2940AU/CN aic7860 PCI/32 SE-50M SE-HD50F + AHA-2944W aic7870 PCI/32 HVD-HD68F HVD-HD68F + HVD-50M + AHA-3940W aic7870 PCI/32 2 X SE-HD68F SE-HD68F 2 AHA-2940UW aic7880 PCI/32 SE-HD68F - SE-50M SE-HD68F - AHA-2940U aic7880 PCI/32 SE-50M SE-HD50F + SE-50M SE-HD68F + AHA-2940U aic7880 PCI/32 SE-50M SE-HD50F AHA-2940D aic7880 PCI/32 - AHA-2940 A/T aic7880 PCI/32 + aHA-2940 A/T aic7880 PCI/32 AHA-2940D A/T aic7880 PCI/32 - AHA-3940UW aic7880 PCI/32 2 X SE-HD68F SE-HD68F 3 + AHA-3940UW aic7880 PCI/32 2 X SE-HD68F SE-HD68F 3 AHA-3940UWD aic7880 PCI/32 2 X SE-HD68F 2 X SE-VHD68F 3 - AHA-3940U aic7880 PCI/32 2 X SE-50M SE-HD50F 3 - AHA-2944UW aic7880 PCI/32 HVD-HD68F HVD-HD68F - HVD-50M + AHA-3940U aic7880 PCI/32 2 X SE-50M SE-HD50F 3 + AHA-2944UW aic7880 PCI/32 HVD-HD68F HVD-HD68F + HVD-50M AHA-3944UWD aic7880 PCI/32 2 X HVD-HD68F 2 X HVD-VHD68F 3 AHA-4944UW aic7880 PCI/32 AHA-2930UW aic7880 PCI/32 - AHA-2940UW Pro aic7880 PCI/32 SE-HD68F SE-HD68F 4 - SE-50M + AHA-2940UW Pro aic7880 PCI/32 SE-HD68F SE-HD68F 4 + SE-50M AHA-2940UW/CN aic7880 PCI/32 AHA-2940UDual aic7895 PCI/32 AHA-2940UWDual aic7895 PCI/32 @@ -98,30 +99,30 @@ AHA-3940AUWD aic7895 PCI/32 AHA-3940AU aic7895 PCI/32 AHA-3944AUWD aic7895 PCI/32 2 X HVD-HD68F 2 X HVD-VHD68F - AHA-2940U2B aic7890 PCI/32 LVD-HD68F LVD-HD68F + AHA-2940U2B aic7890 PCI/32 LVD-HD68F LVD-HD68F AHA-2940U2 OEM aic7891 PCI/64 - AHA-2940U2W aic7890 PCI/32 LVD-HD68F LVD-HD68F - SE-HD68F - SE-50M - AHA-2950U2B aic7891 PCI/64 LVD-HD68F LVD-HD68F - AHA-2930U2 aic7890 PCI/32 LVD-HD68F SE-HD50F - SE-50M + AHA-2940U2W aic7890 PCI/32 LVD-HD68F LVD-HD68F + SE-HD68F + SE-50M + AHA-2950U2B aic7891 PCI/64 LVD-HD68F LVD-HD68F + AHA-2930U2 aic7890 PCI/32 LVD-HD68F SE-HD50F + SE-50M AHA-3950U2B aic7897 PCI/64 AHA-3950U2D aic7897 PCI/64 AHA-29160 aic7892 PCI/64-66 AHA-29160 CPQ aic7892 PCI/64-66 - AHA-29160N aic7892 PCI/32 LVD-HD68F SE-HD50F - SE-50M + AHA-29160N aic7892 PCI/32 LVD-HD68F SE-HD50F + SE-50M AHA-29160LP aic7892 PCI/64-66 AHA-19160 aic7892 PCI/64-66 AHA-29150LP aic7892 PCI/64-66 AHA-29130LP aic7892 PCI/64-66 AHA-3960D aic7899 PCI/64-66 2 X LVD-HD68F 2 X LVD-VHD68F - LVD-50M + LVD-50M AHA-3960D CPQ aic7899 PCI/64-66 2 X LVD-HD68F 2 X LVD-VHD68F - LVD-50M + LVD-50M AHA-39160 aic7899 PCI/64-66 2 X LVD-HD68F 2 X LVD-VHD68F - LVD-50M + LVD-50M 1. No BIOS support 2. DEC21050 PCI-PCI bridge with multiple controller chips on secondary bus @@ -129,14 +130,22 @@ 4. All three SCSI connectors may be used simultaneously without SCSI "stub" effects. -2. Command Line Options +2. Version History + + 6.2.28 - Domain Validation Fixes + PCI parity error disable + Enhanced Memory Mapped I/O probe + + 6.2.20 - Added Domain Validation + +3. Command Line Options WARNING: ALTERING OR ADDING THESE DRIVER PARAMETERS INCORRECTLY CAN RENDER YOUR SYSTEM INOPERABLE. USE THEM WITH CAUTION. Edit the file "modules.conf" in the directory /etc and add/edit a - line containing 'options aic7xxx=[command[,command...]]' where + line containing 'options aic7xxx aic7xxx=[command[,command...]]' where 'command' is one or more of the following: ----------------------------------------------------------------- Option: verbose @@ -150,6 +159,30 @@ Possible Values: 0x0000 = no debugging, 0xffff = full debugging Default Value: 0x0000 ----------------------------------------------------------------- + Option: no_probe + Definition: Do not probe for EISA/VLB controllers. + This is a toggle. If the driver is compiled + to not probe EISA/VLB controllers by default, + specifying "no_probe" will enable this probing. + If the driver is compiled to probe EISA/VLB + controllers by default, specifying "no_probe" + will disable this probing. + Possible Values: This option is a toggle + Default Value: EISA/VLB probing is disabled by default. + ----------------------------------------------------------------- + Option: pci_parity + Definition: Toggles the detection of PCI parity errors. + On many motherboards with VIA chipsets, + PCI parity is not generated correctly on the + PCI bus. It is impossible for the hardware to + differentiate between these "spurious" parity + errors and real parity errors. The symptom of + this problem is a stream of the message: + "scsi0: Data Parity Error Detected during address or write data phase" + output by the driver. + Possible Values: This option is a toggle + Default Value: PCI Parity Error reporting is disabled + ----------------------------------------------------------------- Option: no_reset Definition: Do not reset the bus during the initial probe phase @@ -173,33 +206,33 @@ Possible Values: This option is a flag Default Value: disabled ----------------------------------------------------------------- - Option: global_tag_depth + Option: global_tag_depth:[value] Definition: Global tag depth for all targets on all busses. - This option sets the default tag depth which - may be selectively overridden vi the tag_info - option. + This option sets the default tag depth which + may be selectively overridden vi the tag_info + option. Possible Values: 1 - 253 Default Value: 32 ----------------------------------------------------------------- Option: tag_info:{{value[,value...]}[,{value[,value...]}...]} Definition: Set the per-target tagged queue depth on a - per controller basis. Both controllers and targets - may be ommitted indicating that they should retain - the default tag depth. + per controller basis. Both controllers and targets + may be ommitted indicating that they should retain + the default tag depth. Examples: tag_info:{{16,32,32,64,8,8,,32,32,32,32,32,32,32,32,32} - On Controller 0 - specifies a tag depth of 16 for target 0 - specifies a tag depth of 64 for target 3 - specifies a tag depth of 8 for targets 4 and 5 - leaves target 6 at the default - specifies a tag depth of 32 for targets 1,2,7-15 - All other targets retain the default depth. - - tag_info:{{},{32,,32}} - On Controller 1 - specifies a tag depth of 32 for targets 0 and 2 - All other targets retain the default depth. - + On Controller 0 + specifies a tag depth of 16 for target 0 + specifies a tag depth of 64 for target 3 + specifies a tag depth of 8 for targets 4 and 5 + leaves target 6 at the default + specifies a tag depth of 32 for targets 1,2,7-15 + All other targets retain the default depth. + + tag_info:{{},{32,,32}} + On Controller 1 + specifies a tag depth of 32 for targets 0 and 2 + All other targets retain the default depth. + Possible Values: 1 - 253 Default Value: 32 ----------------------------------------------------------------- @@ -208,10 +241,30 @@ Possible Values: 0 = 256ms, 1 = 128ms, 2 = 64ms, 3 = 32ms Default Value: 0 ----------------------------------------------------------------- + Option: dv: {value[,value...]} + Definition: Set Domain Validation Policy on a per-controller basis. + Controllers may be ommitted indicating that + they should retain the default read streaming setting. + Example: dv:{-1,0,,1,1,0} + On Controller 0 leave DV at its default setting. + On Controller 1 disable DV. + Skip configuration on Controller 2. + On Controllers 3 and 4 enable DV. + On Controller 5 disable DV. + + Possible Values: < 0 Use setting from serial EEPROM. + 0 Disable DV + > 0 Enable DV + + Default Value: SCSI-Select setting on controllers with a SCSI Select + option for DV. Otherwise, on for controllers supporting + U160 speeds and off for all other controller types. + ----------------------------------------------------------------- - Example: 'options aic7xxx=verbose,no_probe,tag_info:{{},{,,10}},seltime:1" - enables verbose logging, Disable EISA/VLB probing, - and set tag depth on Controller 1/Target 2 to 10 tags. + Example: + 'options aic7xxx aic7xxx=verbose,no_probe,tag_info:{{},{,,10}},seltime:1" + enables verbose logging, Disable EISA/VLB probing, + and set tag depth on Controller 1/Target 2 to 10 tags. 3. Contacting Adaptec diff -Nru a/Documentation/scsi/ibmmca.txt b/Documentation/scsi/ibmmca.txt --- a/Documentation/scsi/ibmmca.txt Sun Feb 9 21:13:34 2003 +++ b/Documentation/scsi/ibmmca.txt Sun Feb 9 21:13:34 2003 @@ -346,7 +346,7 @@ This table is quite informative for interested users. It shows the load of commands on the subsystem and wether you are running the bypassed (software) or integrated (hardware) SCSI-command set (see below). The - amount of accesses is shown. Read, write, modeselect is shown seperately + amount of accesses is shown. Read, write, modeselect is shown separately in order to help debugging problems with CD-ROMs or tapedrives. The following table shows the list of 15 logical device numbers, that are @@ -906,7 +906,7 @@ to does not offer more space, invalid memory accesses destabilized the kernel. 3) version 4.0 is only valid for kernel 2.4.0 or later. This is necessary - to remove old kernel version dependant waste from the driver. 3.2d is + to remove old kernel version dependent waste from the driver. 3.2d is only distributed with older kernels but keeps compatibility with older kernel versions. 4.0 and higher versions cannot be used with older kernels anymore!! You must have at least kernel 2.4.0!! @@ -943,7 +943,7 @@ 4 To do ------- - - IBM SCSI-2 F/W external SCSI bus support in seperate mode! + - IBM SCSI-2 F/W external SCSI bus support in separate mode! - It seems that the handling of bad disks is really bad - non-existent, in fact. However, a low-level driver cannot help much, if such things happen. @@ -1382,7 +1382,7 @@ 9 Disclaimer ------------ - Beside the GNU General Public License and the dependant disclaimers and disclaimers + Beside the GNU General Public License and the dependent disclaimers and disclaimers concerning the Linux-kernel in special, this SCSI-driver comes without any warranty. Its functionality is tested as good as possible on certain machines and combinations of computer hardware, which does not exclude, diff -Nru a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt --- a/Documentation/sound/alsa/ALSA-Configuration.txt Sun Feb 9 21:13:29 2003 +++ b/Documentation/sound/alsa/ALSA-Configuration.txt Sun Feb 9 21:13:29 2003 @@ -213,6 +213,8 @@ mpu_port - 0x300 (default),0x310,0x320,0x330, -1 (diable) fm_port - 0x388 (default), -1 (disable) + soft_ac3 - Sofware-conversion of raw SPDIF packets (model 033 only) + (default = 1) Module supports autoprobe and multiple chips (max 8). @@ -748,7 +750,8 @@ Module snd-rme32 ---------------- - Module for RME Digi32, Digi32/8 and Digi32 PRO soundcards. + Module for RME Digi32, Digi32 Pro and Digi32/8 (Sek'd Prodif32, + Prodif96 and Prodif Gold) soundcards. Module supports up to 8 cards. diff -Nru a/Documentation/sound/alsa/CMIPCI.txt b/Documentation/sound/alsa/CMIPCI.txt --- a/Documentation/sound/alsa/CMIPCI.txt Sun Feb 9 21:13:28 2003 +++ b/Documentation/sound/alsa/CMIPCI.txt Sun Feb 9 21:13:28 2003 @@ -20,7 +20,7 @@ - The first DAC supports U8 and S16LE formats, while the second DAC supports only S16LE. -- The second DAC supports only two channel stereo. +- The seconde DAC supports only two channel stereo. Please note that the CM8x38 DAC doesn't support continuous playback rate but only fixed rates: 5512, 8000, 11025, 16000, 22050, 32000, @@ -65,15 +65,20 @@ "-MC" such like "CMI8738-MC6". You can check this name from /proc/asound/cards. -When the 4/6-ch output is enabled, the front DAC accepts up to 6 (or -4) channels. This is different from the dual DACs described in the -previous section. While the dual DAC supports two different rates or +When the 4/6-ch output is enabled, the second DAC accepts up to 6 (or +4) channels. While the dual DAC supports two different rates or formats, the 4/6-ch playback supports only the same condition for all -channels. +channels. Since the multi-channel playback mode uses both DACs, you +cannot operate with full-duplex. -For using 4/6 channel playback, you need to specify the PCM channels -as you like and set the format S16LE. For example, for playback with -4 channels, +The 4.0 and 5.1 modes are defined as the pcm "surround40" and "surround51" +in alsa-lib. For example, you can play a WAV file with 6 channels like + + % aplay -Dsurround51 sixchannels.wav + +For programmin the 4/6 channel playback, you need to specify the PCM +channels as you like and set the format S16LE. For example, for playback +with 4 channels, snd_pcm_hw_params_set_access(pcm, hw, SND_PCM_ACCESS_RW_INTERLEAVED); // or mmap if you like @@ -82,9 +87,15 @@ and use the interleaved 4 channel data. -There is a control switch, "Line-In As Bass". As you can imagine from -its name, the line-in jack is used for the bass (5th and 6th channels) -output. +There are some control switchs affecting to the speaker connections: + +"Line-In As Rear" - As mentioned above, the line-in jack is used + for the rear (3th and 4th channels) output. +"Line-In As Bass" - The line-in jack is used for the bass (5th + and 6th channels) output. +"Mic As Center/LFE" - The mic jack is used for the bass output. + If this switch is on, you cannot use a microphone as a capture + source, of course. Digital I/O @@ -134,8 +145,7 @@ (see the next section). "IEC958 In Select" - Select SPDIF input, the internal CD-in (false) - and the external input (true). This switch appears only on - the chip models 039 or later. + and the external input (true). "IEC958 Loop" - SPDIF input data is loop back into SPDIF output (aka bypass) @@ -169,6 +179,11 @@ Similarly the following switches are off: "IEC958 Mix Analog" and "IEC958 Loop". The switches are resumed after closing the SPDIF PCM device automatically to the previous state. + +On the model 033, AC3 is implemented by the software conversion in +the driver. This prevents the mmap support. If you need mmap +support, pass the "soft_ac3=0" module option. This doesn't matter +on the newer models. ANALOG MIXER INTERFACE diff -Nru a/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl b/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl Sun Feb 9 21:13:37 2003 @@ -0,0 +1,102 @@ + + + + + + + + + + The ALSA Driver API + + + + This document is free; 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 document is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A + PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, + MA 02111-1307 USA + + + + + + Management of Cards and Devices + Card Managment +!Esound/core/init.c + + Device Components +!Esound/core/device.c + + KMOD and Device File Entries +!Esound/core/sound.c + + Memory Management Helpers +!Esound/core/memory.c +!Iinclude/sound/sndmagic.h + + + PCM API + PCM Core +!Esound/core/pcm.c +!Esound/core/pcm_lib.c +!Esound/core/pcm_native.c + + PCM Format Helpers +!Esound/core/pcm_misc.c + + PCM Memory Managment +!Esound/core/pcm_memory.c + + SG-Buffer Helpers +!Esound/core/pcm_sgbuf.c + + + Control/Mixer API + General Control Interface +!Esound/core/control.c + + AC97 Codec API +!Esound/pci/ac97/ac97_codec.c + + + MIDI API + Raw MIDI API +!Esound/core/rawmidi.c + + MPU401-UART API +!Esound/drivers/mpu401/mpu401_uart.c + + + Proc Info API + Proc Info Interface +!Esound/core/info.c + + + Miscellaneous Functions + Hardware-Dependent Devices API +!Esound/core/hwdep.c + + ISA DMA Helpers +!Esound/core/isadma.c + + Other Helper Macros +!Iinclude/sound/core.h + + + + diff -Nru a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl Sun Feb 9 21:13:37 2003 @@ -0,0 +1,5222 @@ + + + + + + + + + + Writing an ALSA Driver + + Takashi + Iwai + +
+ tiwai@suse.de +
+
+
+ + Dec. 27, 2002 + 0.2 (reborn at Christmas) + + + + This document describes how to write an ALSA (Advanced Linux + Sound Architecture) driver. + + + + + + Copyright (c) 2002 Takashi Iwai tiwai@suse.de + + + + This document is free; 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 document is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A + PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, + MA 02111-1307 USA + + + +
+ + + + + + Preface + + This document describes how to write an + + ALSA (Advanced Linux Sound Architecture) + driver. The document focuses mainly on the PCI soundcard. + In the case of other device types, the API might + be different, too. However, at least the ALSA kernel API is + consistent, and therefore it would be still a bit help for + writing them. + + + + The target of this document is ones who already have enough + skill of C language and have the basic knowledge of linux + kernel programming. This document doesn't explain the general + topics of linux kernel codes and doesn't cover the detail of + implementation of each low-level driver. It describes only how is + the standard way to write a PCI sound driver on ALSA. + + + + If you are already familiar with the older ALSA ver.0.5.x, you + can check the drivers such as es1938.c or + maestro3.c which have also almost the same + code-base in the ALSA 0.5.x tree, so you can compare the differences. + + + + This document is still a draft version. Any feedbacks and + corrections, please!! + + + + + + + + + File Tree Structure + +
+ General + + The ALSA drivers are provided in the two ways. + + + + One is the the trees provided as a tarball or via cvs from the + ALSA's ftp site, and another is the 2.5 (or later) Linux kernel + tree. To synchronize both, the ALSA driver tree is split to + two different trees: alsa-kernel and alsa-driver. The former + contains purely the source codes for the Linux 2.5 (or later) + tree. This tree is designed only for compilation on 2.5 or + later environment. The latter, alsa-driver, contains many subtle + files for compiling the ALSA driver on the outside of Linux + kernel like configure script, the wrapper functions for older, + 2.2 and 2.4 kernels, to adapt the latest kernel API, + and additional drivers which are still in development or in + tests. The drivers in alsa-driver tree will be moved to + alsa-kernel (eventually 2.5 kernel tree) once when they are + finished and confirmed to work fine. + + + + The file tree structure of ALSA driver is depicted below. Both + alsa-kernel and alsa-driver have almost the same file + structure, except for core directory. It's + named as acore in alsa-driver tree. + + + ALSA File Tree Structure + + sound + /core + /oss + /seq + /oss + /instr + /ioctl32 + /include + /drivers + /mpu401 + /opl3 + /i2c + /l3 + /synth + /emux + /pci + /(cards) + /isa + /(cards) + /arm + /ppc + /sparc + /usb + /pcmcia /(cards) + /oss + + + +
+ +
+ core directory + + This directory contains the middle layer, that is, the heart + of ALSA drivers. In this directory, the native ALSA modules are + stored. The sub-directories contain different modules and are + dependent upon the kernel config. + + +
+ core/oss + + + The codes for PCM and mixer OSS emulation modules are stored + in this directory. The rawmidi OSS emulation is included in + the ALSA rawmidi code since it's quite small. The sequencer + code is stored in core/seq/oss directory (see + + below). + +
+ +
+ core/ioctl32 + + + This directory contains the 32bit-ioctl wrappers for 64bit + architectures such like x86-64, ppc64 and sparc64. For 32bit + and alpha architectures, these are not compiled. + +
+ +
+ core/seq + + This and its sub-directories are for the ALSA + sequencer. This directory contains the sequencer core and + primary sequencer modules such like snd-seq-midi, + snd-seq-virmidi, etc. They are compiled only when + CONFIG_SND_SEQUENCER is set in the kernel + config. + +
+ +
+ core/seq/oss + + This contains the OSS sequencer emulation codes. + +
+ +
+ core/seq/instr + + This directory contains the modules for the sequencer + instrument layer. + +
+
+ +
+ include directory + + This is the place for the public header files of ALSA drivers, + which are to be exported to the user-space, or included by + several files at different directories. Basically, the private + header files should not be placed in this directory, but you may + still find files there, due to historical reason :) + +
+ +
+ drivers directory + + This directory contains the non-architecture-specific + codes. For example, the dummy pcm driver and the serial MIDI + driver are found in this directory. In the sub-directories, + there are the codes for components which are independent from + bus and cpu architectures. + + +
+ drivers/mpu401 + + The MPU401 and MPU401-UART modules are stored here. + +
+ +
+ drivers/opl3 + + The OPL3 FM-synth stuff is found here. + +
+
+ +
+ i2c directory + + This contains the ALSA i2c components. + + + + Although there is a standard i2c layer on Linux, ALSA uses its + own i2c codes for some cards, because the soundcard needs only a + simple operation and the standard API is too complicated for + such a purpose. + + +
+ i2c/l3 + + This is a sub-directory for ARM L3 i2c. + +
+
+ +
+ synth directory + + This contains the synth middle-level modules. + + + + So far, there is only Emu8000/Emu10k1 synth driver under + synth/emux sub-directory. + +
+ +
+ pci directory + + This and its sub-directories hold the top-level card modules + for PCI soundcards. + + + + The drivers compiled from a single file is stored directly on + pci directory, while the drivers with several source files are + stored on its own sub-directory (e.g. emu10k1, ice1712). + +
+ +
+ isa directory + + This and its sub-directories hold the top-level card modules + for ISA soundcards. + +
+ +
+ arm, ppc, and sparc directories + + These are for the top-level card modules which are + architecture specific. + +
+ +
+ usb directory + + This contains the USB-audio driver. On the latest version, the + USB MIDI driver is integrated together with usb-audio driver. + +
+ +
+ pcmcia directory + + The PCMCIA, especially PCCard drivers will go here. CardBus + drivers will be on pci directory, because its API is identical + with the standard PCI cards. + + + + At this moment, only VX-pocket driver exists. + +
+ +
+ oss directory + + The OSS/Lite source files are stored here on Linux 2.5 (or + later) tree. (In the ALSA driver tarball, it's empty, of course :) + +
+
+ + + + + + + Basic Flow for PCI Drivers + +
+ Outline + + The minimum flow of PCI soundcard is like the following: + + + define the PCI ID table (see the section + PCI Entries + ). + create probe() callback. + create remove() callback. + create pci_driver table which contains the three pointers above. + create init() function just calling pci_module_init() to register the pci_driver table defined above. + create exit() function to call pci_unregister_driver() function. + + +
+ +
+ Full Code Example + + The code example is shown below. Some parts are kept + unimplemented at this moment but will be filled in the + succeeding sections. The numbers in comment lines of + snd_mychip_probe() function are the + markers. + + + Basic Flow for PCI Drivers Example + + + #include + #include + #include + #include + #define SNDRV_GET_ID + #include + + // module parameters (see "Module Parameters") + static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; + static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; + static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; + + // definition of the chip-specific record + typedef struct snd_mychip mychip_t; + struct snd_mychip { + snd_card_t *card; + // rest of implementation will be in the section + // "PCI Resource Managements" + }; + + // this should be go into + // (see "Management of Cards and Components") + #define mychip_t_magic 0xa15a4501 + + // chip-specific destructor + // (see "PCI Resource Managements") + static int snd_mychip_free(mychip_t *chip) + { + // will be implemented later... + } + + // component-destructor + // (see "Management of Cards and Components") + static int snd_mychip_dev_free(snd_device_t *device) + { + mychip_t *chip = snd_magic_cast(mychip_t, + device->device_data, return -ENXIO); + return snd_mychip_free(chip); + } + + // chip-specific constructor + // (see "Management of Cards and Components") + static int __devinit snd_mychip_create(snd_card_t *card, + struct pci_device *pci, + mychip_t *rchip) + { + mychip_t *chip; + int err; + static snd_device_ops_t ops = { + .dev_free = snd_mychip_dev_free, + }; + + *rchip = NULL; + + // check PCI availability here + // (see "PCI Resource Managements") + + // allocate a chip-specific data with magic-alloc + chip = snd_magic_kcalloc(mychip_t, 0, GFP_KERNEL); + if (chip == NULL) + return -ENOMEM; + + chip->card = card; + + // rest of initialization here; will be implemented + // later, see "PCI Resource Managements" + + if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, + chip, &ops)) < 0) { + snd_mychip_free(chip); + return err; + } + *rchip = chip; + return 0; + } + + // constructor -- see "Constructor" sub-section + static int __devinit snd_mychip_probe(struct pci_dev *pci, + const struct pci_device_id *pci_id) + { + static int dev; + snd_card_t *card; + mychip_t *chip; + int err; + + // (1) + if (dev >= SNDRV_CARDS) + return -ENODEV; + if (!enable[dev]) { + dev++; + return -ENOENT; + } + + // (2) + card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); + if (card == NULL) + return -ENOMEM; + + // (3) + if ((err = snd_mychip_create(card, pci, &chip)) < 0) { + snd_card_free(card); + return err; + } + + // (4) + // implemented later + + // (5) + strcpy(card->driver, "My Chip"); + strcpy(card->shortname, "My Own Chip 123"); + sprintf(card->longname, "%s at 0x%lx irq %i", + card->shortname, chip->ioport, chip->irq); + + // (6) + if ((err = snd_card_register(card)) < 0) { + snd_card_free(card); + return err; + } + + // (7) + pci_set_drvdata(pci, chip); + dev++; + return 0; + } + + // destructor -- see "Destructor" sub-section + static void __devexit snd_mychip_remove(struct pci_dev *pci) + { + mychip_t *chip = snd_magic_cast(mychip_t, + pci_get_drvdata(pci), return); + if (chip) + snd_card_free(chip->card); + pci_set_drvdata(pci, NULL); + } +]]> + + + +
+ +
+ Constructor + + The real constructor of PCI drivers is probe callback. The + probe callback and other component-constructors which are called + from probe callback should be defined with + __devinit prefix. You + cannot use __init prefix for them, + because any PCI device could be a hotplug device. + + + + In the probe callback, the following scheme is often used. + + +
+ 1) Check and increment the device index. + + + += SNDRV_CARDS) + return -ENODEV; + if (!enable[dev]) { + dev++; + return -ENOENT; + } +]]> + + + + where enable[dev] is the module option. + + + + At each time probe callback is called, check the + availability of the device. If not available, simply increment + the device index and returns. dev will be incremented also + later (step + 7). + +
+ +
+ 2) Create a card instance + + + + + + + + + + The detail will be explained in the section + + Management of Cards and Components. + +
+ +
+ 3) Create a main component + + In this part, the PCI resources are allocated. + + + + + + + + The detail will be explained in the section PCI Resource + Managements. + +
+ +
+ 4) Create other components, such as mixer, MIDI, etc. + + Here you define the basic components such as + PCM, + mixer (e.g. AC97), + MIDI (e.g. MPU-401), + and other interfaces. + Also, if you want a proc + file, define it here, too. + +
+ +
+ 5) Set the driver ID and name strings. + + + +driver, "My Chip"); + strcpy(card->shortname, "My Own Chip 123"); + sprintf(card->longname, "%s at 0x%lx irq %i", + card->shortname, chip->ioport, chip->irq); +]]> + + + + The driver field holds the minimal ID string of the + chip. This is referred by alsa-lib's configurator, so keep it + simple but unique. + Even the same driver can have different driver IDs to + distinguish the functionality of each chip type. + + + + The shortname field is a string shown as more verbose + name. The longname field contains the information which is + shown in /proc/asound/cards. + +
+ +
+ 6) Register the card instance. + + + + + + + + + + Will be explained in the section Management + of Cards and Components, too. + +
+ +
+ 7) Set the PCI driver data and return zero. + + + + + + + + In the above, the chip record is stored. This pointer is + referred in the remove callback and power-management + callbacks, too. + If the card doesn't support the suspend/resume, you can store + the card pointer instead of the chip pointer, so that + snd_card_free can be called directly + without cast in the remove callback. But anyway, be sure + which pointer is used. + +
+
+ +
+ Destructor + + The destructor, remove callback, simply releases the card + instance. Then the ALSA middle layer will release all the + attached components automatically. + + + + It would be typically like the following: + + + +card); + pci_set_drvdata(pci, NULL); + } +]]> + + + + The above code assumes that the chip is allocated + with snd_magic stuff and + has the field to hold the card pointer (see the next + section). + +
+ +
+ Header Files + + For the above example, at least the following include files + are necessary. + + + + + #include + #include + #include + #include + #define SNDRV_GET_ID + #include +]]> + + + + where the last twos are necessary only when module options are + defined in the source file. If the codes are split to several + files, the file without module options don't need them. + + + + In addition to them, you'll need + <linux/interrupt.h> for the interrupt + handling, and <asm/io.h> for the i/o + access. If you use mdelay() or + udelay() functions, you'll need to include + <linux/delay.h>, too. + + + + The ALSA interfaces like PCM or control API are define in other + header files as <sound/xxx.h>. + They have to be included after + <sound/core.h>. + + +
+
+ + + + + + + Management of Cards and Components + +
+ Card Instance + + For each soundcard, a card record must be allocated. + + + + A card record is the headquarters of the soundcard. It manages + the list of whole devices (components) on the soundcard, such as + PCM, mixers, MIDI, synthesizer, and so on. Also, the card + record holds the ID and the name strings of the card, manages + the root of proc files, and controls the power-management states + and hotplug disconnections. The component list on the card + record is used to manage the proper releases of resources at + destruction. + + + + As mentioned above, to create a card instance, call + snd_card_new(). + + + + + + + + + + The function takes four arguments, the card-index number, the + id string, the module pointer (usually + THIS_MODULE), + and the size of extra-data space. The last argument is used to + allocate card->private_data for the + chip-specific data. Note that this data + is allocated by + snd_card_new(). + +
+ +
+ Components + + After the card is created, you can attach the components + (devices) to the card instance. On ALSA driver, a component is + represented as a snd_device_t object. + A component can be a PCM instance, a control interface, a raw + MIDI interface, etc. Each of such instances has one component + entry. + + + + A component can be created via + snd_device_new() function. + + + + + + + + + + This takes the card pointer, the device-level + (SNDRV_DEV_XXX), the data pointer, and the + callback pointers (&ops). The + device-level defines the type of components and the order of + registration and de-registration. For most of components, the + device-level is already defined. For a user-defined component, + you can use SNDRV_DEV_LOWLEVEL. + + + + This function itself doesn't allocate the data space. The data + must be allocated manually beforehand, and its pointer is passed + as the argument. This pointer is used as the identifier + (chip in the above example) for the + instance. + + + + Each ALSA pre-defined component such as ac97 or pcm calls + snd_device_new() inside its + constructor. The destructor for each component is defined in the + callback pointers. Hence, you don't need to take care of + calling a destructor for such a component. + + + + If you would like to create your own component, you need to + set the destructor function to dev_free callback in + ops, so that it can be released + automatically via snd_card_free(). The + example will be shown later as an implementation of a + chip-specific data. + +
+ +
+ Chip-Specific Data + + The chip-specific information, e.g. the i/o port address, its + resource pointer, or the irq number, is stored in the + chip-specific record. + Usually, the chip-specific record is typedef'ed as + xxx_t like the following: + + + + + + + + + + You might have objections against such a typedef, but this + typedef is necessary if you use a magic-cast + (explained later). + + + + In general, there are two ways to allocate the chip record. + + +
+ 1. Allocating via <function>snd_card_new()</function>. + + As mentioned above, you can pass the extra-data-length to the 4th argument of snd_card_new(), i.e. + + + + + + + + whether mychip_t is the type of the chip record. + + + + In return, the allocated record can be accessed as + + + +private_data; +]]> + + + + With this method, you don't have to allocate twice. But you + cannot use magic-cast for this record pointer, + instead. + +
+ +
+ 2. Allocating an extra device. + + + After allocating a card instance via + snd_card_new() (with + NULL on the 4th arg), call + snd_magic_kcalloc(). + + + + + + + + Once when the record is allocated via snd_magic stuff, you + can use magic-cast for the void pointer. + + + + The chip record should have the field to hold the card + pointer at least, + + + + + + + + + + Then, set the card pointer in the returned chip instance. + + + +card = card; +]]> + + + + + + Also, you need to define a magic-value for mychip_t. + + + + + + + (the detail will be described in the + + next subsection). + + + + Next, initialize the fields, and register this chip + record as a low-level device with a specified + ops, + + + + + + + + snd_mychip_dev_free() is the + device-destructor function, which will call the real + destructor. + + + + + +device_data, + return -ENXIO); + return snd_mychip_free(chip); + } +]]> + + + + where snd_mychip_free() is the real destructor. + +
+ +
+ Not a magic but a logic + + Now, you might have a question: What is the advantage of the + second method? Obviously, it looks far more complicated. + + As I wrote many times, the second method allows a + magic-cast for mychip_t. If you + have a void pointer (such as + pcm->private_data), the pointer type + is unknown at the compile time, and you cannot know even if a + wrong pointer type is passed. The compiler would accept + it. The magic-cast checks the pointer type at the runtime (and + whether it's a null pointer, too). Hence, the cast will be + much safer and good for debugging. + + + + As you have already seen, allocation with a magic-header can + be done via snd_magic_kmalloc() or + snd_magic_kcalloc(). + + + + + + + + The difference of these two functions is whether the area is + zero-cleared (kcalloc) or not + (kmalloc). + + + + The first argument of the allocator is the type of the + record. The magic-constant has to be defined for this type + beforehand. In this case, we'll need to define + mychip_t_magic, for example, as already + seen, + + + + + + + + The value is arbitrary but should be unique. + This is usually defined in + <include/sndmagic.h> or + <include/amagic.h> for alsa-driver tree, + but you may define it locally in the code at the early + development stage, since changing + sndmagic.h will lead to the recompilation + of the whole driver codes. + + + + The second argument is the extra-data length. It is usually + zero. The third argument is the flags to be passed to kernel + memory allocator, GFP_XXX. Normally, + GFP_KERNEL is passed. + + + + For casting a pointer, use + snd_magic_cast() macro: + + + + + + + + where source_pointer is the pointer to + be casted (e.g. pcm->private_data), and + action is the action to do if the cast + fails (e.g. return -EINVAL). + + + + For releasing the magic-allocated data, you need to call + snd_magic_kfree() function instead of + kfree(). + + + + + + + + + + If you call kfree() for the + magic-allocated value, it will lead to memory leaks. + When the ALSA drivers are compiled with + CONFIG_SND_DEBUG_MEMORY kernel config (or + configured with ), the + non-matching free will be checked and you'll see warning + messages. + + + + If you are 100% sure that your code is bug-free, you can + compile the driver without + CONFIG_SND_DEBUG_MEMORY kernel config, + so that the magic-allocator and the magic-cast will be + replaced to the normal kmalloc and cast. + +
+
+ +
+ Registration and Release + + After all components are assigned, register the card instance + by calling snd_card_register(). The access + to the device files are enabled at this point. That is, before + snd_card_register() is called, the + components are safely inaccessible from external side. If this + call fails, exit the probe function after releasing the card via + snd_card_free(). + + + + For releasing the card instance, you can call simply + snd_card_free(). As already mentioned, all + components are released automatically by this call. + + + + As further notes, the destructors (both + snd_mychip_dev_free and + snd_mychip_free) cannot be defined with + __devexit prefix, because they may be + called from the constructor, too, at the false path. + + + + For a device which allows hotplugging, you can use + snd_card_free_in_thread. This one will + postpone the destruction and wait in a kernel-thread until all + devices are closed. + + +
+ +
+ + + + + + + PCI Resource Managements + +
+ Full Code Example + + In this section, we'll finish the chip-specific constructor, + destructor and PCI entries. The example code is shown first, + below. + + + PCI Resource Managements Example + +res_port) { + release_resource(chip->res_port); + kfree_nocheck(chip->res_port); + } + // release the irq + if (chip->irq >= 0) + free_irq(chip->irq, (void *)chip); + // release the data + snd_magic_kfree(chip); + return 0; + } + + // chip-specific constructor + static int __devinit snd_mychip_create(snd_card_t *card, + struct pci_dev *pci, + mychip_t **rchip) + { + mychip_t *chip; + int err; + static snd_device_ops_t ops = { + .dev_free = snd_mychip_dev_free, + }; + + *rchip = NULL; + + // check PCI availability (28bit DMA) + if ((err = pci_enable_device(pci)) < 0) + return err; + if (!pci_dma_supported(pci, 0x0fffffff)) { + printk(KERN_ERR "error to set 28bit mask DMA\n"); + return -ENXIO; + } + pci_set_dma_mask(pci, 0x0fffffff); + + chip = snd_magic_kcalloc(mychip_t, 0, GFP_KERNEL); + if (chip == NULL) + return -ENOMEM; + + // initialize the stuff + chip->card = card; + chip->pci = pci; + chip->irq = -1; + + // (1) PCI resource allocation + chip->port = pci_resource_start(pci, 0); + if ((chip->res_port = request_region(chip->port, 8, + "My Chip")) == NULL) { + snd_mychip_free(chip); + printk(KERN_ERR "cannot allocate the port\n"); + return -EBUSY; + } + if (request_irq(pci->irq, snd_mychip_interrupt, + SA_INTERRUPT|SA_SHIRQ, "My Chip", + (void *)chip)) { + snd_mychip_free(chip); + printk(KERN_ERR "cannot grab irq\n"); + return -EBUSY; + } + chip->irq = pci->irq; + + // (2) initialization of the chip hardware + // (not implemented in this document) + + if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, + chip, &ops)) < 0) { + snd_mychip_free(chip); + return err; + } + *rchip = chip; + return 0; + } + + // PCI IDs + static struct pci_device_id snd_mychip_ids[] __devinitdata = { + { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, + .... + { 0, } + }; + MODULE_DEVICE_TABLE(pci, snd_mychip_ids); + + // pci_driver definition + static struct pci_driver driver = { + .name = "My Own Chip", + .id_table = snd_mychip_ids, + .probe = snd_mychip_probe, + .remove = __devexit_p(snd_mychip_remove), + }; + + // initialization of the module + static int __init alsa_card_mychip_init(void) + { + int err; + + if ((err = pci_module_init(&driver)) < 0) { + #ifdef MODULE + printk(KERN_ERR "My chip soundcard not found " + "or device busy\n"); + #endif + return err; + } + return 0; + } + + // clean up the module + static void __exit alsa_card_mychip_exit(void) + { + pci_unregister_driver(&driver); + } + + module_init(alsa_card_mychip_init) + module_exit(alsa_card_mychip_exit) + + EXPORT_NO_SYMBOLS; /* for old kernels only */ +]]> + + + +
+ +
+ Some Hafta's + + The allocation of PCI resources is done in the + probe() function, and usually an extra + xxx_create() function is written for this + purpose. + + + + In the case of PCI devices, you have to call at first + pci_enable_device() function before + allocating resources. Also, you need to set the proper PCI DMA + mask to limit the accessed i/o range. In some cases, you might + need to call pci_set_master() function, + too. + + + + Suppose the 28bit mask, and the code to be added would be like: + + + + + + + +
+ +
+ Resource Allocation + + The allocation of ports and irqs are done via standard kernel + functions. Unlike ALSA ver.0.5.x., there are no helpers for + that. And these resources must be released in the destructor + function (see below). Also, on ALSA 0.9.x, you don't need + allocate (pseudo-)DMA for PCI like 0.5.x. + + + + Now assume that this PCI device has an I/O port with 8 bytes + and an interrupt. Then mychip_t will have the + following fields: + + + + + + + + + + For an i/o port (and also a memory region), you need to have + the resource pointer for the standard resource management. For + an irq, you have to keep only the irq number (integer). But you + need to initialize this number as -1 before actual allocation, + since irq 0 is valid. The port address and its resource pointer + can be initialized as null by + snd_magic_kcalloc() automatically, so you + don't have to take care of it. + + + + The allocation of an i/o port is done like this: + + + +port = pci_resource_start(pci, 0); + if ((chip->res_port = request_region(chip->port, 8, + "My Chip")) == NULL) { + printk(KERN_ERR "cannot allocate the port 0x%lx\n", + chip->port); + snd_mychip_free(chip); + return -EBUSY; + } +]]> + + + + + + It will reserve the i/o port region of 8 bytes of the given + PCI device. The returned value, chip->res_port, is allocated + via kmalloc() by + request_region(). The pointer must be + released via kfree(), but there is some + problem regarding this. This issue will be explained more below. + + + + The allocation of an interrupt source is done like this: + + + +irq, snd_mychip_interrupt, + SA_INTERRUPT|SA_SHIRQ, "My Chip", + (void *)chip)) { + snd_mychip_free(chip); + printk(KERN_ERR "cannot grab irq %d\n", pci->irq); + return -EBUSY; + } + chip->irq = pci->irq; +]]> + + + + where snd_mychip_interrupt() is the + interrupt handler defined later. + Note that chip->irq should be defined + only when request_irq() succeeded. + + + + On the PCI bus, the interrupts can be shared. Thus, + SA_SHIRQ is given as the interrupt flag of + request_irq(). + + + + The last argument of request_irq() is the + data pointer passed to the interrupt handler. Usually, the + chip-specific record is used for that, but you can use what you + like, too. + + + + I won't define the detail of the interrupt handler at this + point, but at least its appearance can be explained now. The + interrupt handler looks usually like the following: + + + + + + + + Again the magic-cast is used here to get the correct pointer + from the second argument. + + + + Now let's write the corresponding destructor for the resources + above. The role of destructor is simple: disable the hardware + (if already activated) and release the resources. So far, we + have no hardware part, so the disabling is not written here. + + + + For releasing the resources, check-and-release + method is a safer way. For the i/o port, do like this: + + + +res_port) { + release_resource(chip->res_port); + kfree_nocheck(chip->res_port); + } +]]> + + + + + + As you can see, the i/o resource pointer is also to be freed + via kfree_nocheck() after + release_resource() is called. You + cannot use kfree() here, because on ALSA, + kfree() may be a wrapper to its own + allocator with the memory debugging. Since the resource pointer + is allocated externally outside the ALSA, it must be released + via the native + kfree(). + kfree_nocheck() is used for that; it calls + the native kfree() without wrapper. + + + + For releasing the interrupt, do like this: + + + +irq >= 0) + free_irq(chip->irq, (void *)chip); +]]> + + + + And finally, release the chip-specific record. + + + + + + + + + + The chip instance is freed via + snd_magic_kfree(). Please use this function + for the object allocated by + snd_magic_kmalloc(). If you free it with + kfree(), it won't work properly and will + result in the memory leak. Also, again, remember that you cannot + set __devexit prefix for this destructor. + + + + We didn't implement the hardware-disabling part in the above. + If you need to do this, please note that the destructor may be + called even before the initialization of the chip is completed. + It would be better to have a flag to skip the hardware-disabling + if the hardware was not initialized yet. + + + + When the chip-data is assigned to the card using + snd_device_new() with + SNDRV_DEV_LOWLELVEL , its destructor is + called at the last. that is, it is assured that all other + components like PCMs and controls have been already released. + You don't have to call stopping PCMs, etc. explicitly, but just + stop the hardware in the low-level. + + + + The management of a memory-mapped region is almost as same as + the management of an i/o port. You'll need three fields like + the following: + + + + + + + + and the allocation would be (assuming its size is 512 bytes): + + + +iobase_phys = pci_resource_start(pci, 0); + chip->iobase_virt = (unsigned long) + ioremap_nocache(chip->iobase_phys, 512); + if ((chip->res_port = request_mem_region(chip->port, 512, + "My Chip")) == NULL) { + printk(KERN_ERR "cannot allocate the memory region\n"); + snd_mychip_free(chip); + return -EBUSY; + } +]]> + + + + and the corresponding destructor would be: + + + +iobase_virt) + iounmap((void *)chip->iobase_virt); + if (chip->res_iobase) { + release_resource(chip->res_iobase); + kfree_nocheck(chip->res_iobase); + } + .... + } +]]> + + + + +
+ +
+ PCI Entries + + So far, so good. Let's finish the rest of missing PCI + stuffs. At first, we need a + pci_device_id table for this + chipset. It's a table of PCI vendor/device ID number, and some + masks. + + + + For example, + + + + + + + + + + The first and second fields of + pci_device_id struct are the vendor and + device IDs. If you have nothing special to filter the matching + devices, you can use the rest of fields like above. The last + field of pci_device_id struct is a + private data for this entry. You can specify any value here, for + example, to tell the type of different operations per each + device IDs. Such an example is found in intel8x0 driver. + + + + The last entry of this list is the terminator. You must + specify this all-zero entry. + + + + Then, prepare the pci_driver record: + + + + + + + + + + The probe and + remove functions are what we already + defined in + the previous sections. The remove should + be defined with + __devexit_p() macro, so that it's not + defined for built-in (and non-hot-pluggable) case. The + name + field is the name string of this device. Note that you must not + use a slash / in this string. + + + + And at last, the module entries: + + + + + + + + + + Note that these module entries are tagged with + __init and + __exit prefixes, not + __devinit nor + __devexit. + + + + Oh, one thing was forgotten. If you have no exported symbols, + you need to declare it on 2.2 or 2.4 kernels (on 2.5 kernels + it's not necessary, though). + + + + + + + + That's all! + +
+
+ + + + + + + PCM Interface + +
+ General + + The PCM middle layer of ALSA is quite powerful and it is only + necessary for each driver to implement the low-level functions + to access its hardware. + + + + For accessing to the PCM layer, you need to include + <sound/pcm.h> above all. In addition, + <sound/pcm_params.h> might be needed + if you access to some functions related with hw_param. + + + + Each card device can have up to four pcm instances. A pcm + instance corresponds to a pcm device file. The limitation of + number of instances comes only from the available bit size of + the linux's device number. Once when 64bit device number is + used, we'll have more available pcm instances. + + + + A pcm instance consists of pcm playback and capture streams, + and each pcm stream consists of one or more pcm substreams. Some + soundcard supports the multiple-playback function. For example, + emu10k1 has a PCM playback of 32 stereo substreams. In this case, at + each open, a free substream is (usually) automatically chosen + and opened. Meanwhile, when only one substream exists and it was + already opened, the succeeding open will result in the blocking + or the error with EAGAIN according to the + file open mode. But you don't have to know the detail in your + driver. The PCM middle layer will take all such jobs. + +
+ +
+ Full Code Example + + The example code below does not include any hardware access + routines but shows only the skeleton, how to build up the PCM + interfaces. + + + PCM Example Code + + + .... + + #define chip_t mychip_t + .... + + /* hardware definition */ + static snd_pcm_hardware_t snd_mychip_playback_hw = { + .info = (SNDRV_PCM_INFO_MMAP | + SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_BLOCK_TRANSFER | + SNDRV_PCM_INFO_MMAP_VALID), + .formats = SNDRV_PCM_FMTBIT_S16_LE, + .rates = SNDRV_PCM_RATE_8000_48000, + .rate_min = 8000, + .rate_max = 48000, + .channels_min = 2, + .channels_max = 2, + .buffer_bytes_max = 32768, + .period_bytes_min = 4096, + .period_bytes_max = 32768, + .periods_min = 1, + .periods_max = 1024, + }; + + /* open callback */ + static int snd_mychip_pcm_open(snd_pcm_substream_t *subs) + { + mychip_t *chip = snd_pcm_substream_chip(substream); + snd_pcm_runtime_t *runtime = substream->runtime; + + runtime->hw = snd_mychip_playback_hw; + // more hardware-initialization will be done here + return 0; + } + + /* close callback */ + static int snd_mychip_pcm_close(snd_pcm_substream_t *substream) + { + mychip_t *chip = snd_pcm_substream_chip(substream); + // the hardware-specific codes will be here + return 0; + + } + + /* hw_params callback */ + static int snd_mychip_pcm_hw_params(snd_pcm_substream_t *substream, + snd_pcm_hw_params_t * hw_params) + { + return snd_pcm_lib_malloc_pages(substream, + params_buffer_bytes(hw_params)); + } + + /* hw_free callback */ + static int snd_mychip_pcm_hw_free(snd_pcm_substream_t *substream) + { + return snd_pcm_lib_free_pages(substream); + } + + /* prepare callback */ + static int snd_mychip_pcm_prepare(snd_pcm_substream_t *substream) + { + mychip_t *chip = snd_pcm_substream_chip(substream); + snd_pcm_runtime_t *runtime = substream->runtime; + + // set up the hardware with the current configuration + // for example... + mychip_set_sample_format(chip, runtime->format); + mychip_set_sample_rate(chip, runtime->rate); + mychip_set_channels(chip, runtime->channels); + mychip_set_dma_setup(chip, runtime->dma_area, + chip->buffer_size, + chip->period_size); + return 0; + } + + /* trigger callback */ + static int snd_mychip_pcm_trigger(snd_pcm_substream_t *substream, + int cmd) + { + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + // do something to start the PCM engine + break; + case SNDRV_PCM_TRIGGER_STOP: + // do something to stop the PCM engine + break; + default: + return -EINVAL; + } + } + + /* pointer callback */ + static snd_pcm_uframes_t + snd_mychip_pcm_pointer(snd_pcm_substream_t *substream) + { + mychip_t *chip = snd_pcm_substream_chip(substream); + unsigned int current_ptr; + + // get the current hardware pointer + current_ptr = mychip_get_hw_pointer(chip); + return current_ptr; + } + + /* operators */ + static snd_pcm_ops_t snd_mychip_playback_ops = { + .open = snd_mychip_playback_open, + .close = snd_mychip_playback_close, + .ioctl = snd_pcm_lib_ioctl, + .hw_params = snd_mychip_pcm_hw_params, + .hw_free = snd_mychip_pcm_hw_free, + .prepare = snd_mychip_pcm_prepare, + .trigger = snd_mychip_pcm_trigger, + .pointer = snd_mychip_pcm_pointer, + }; + + /* + * definitions of capture are omitted here... + */ + + /* create a pcm device */ + static int __devinit snd_mychip_new_pcm(mychip_t *chip) + { + snd_pcm_t *pcm; + int err; + + if ((err = snd_pcm_new(chip->card, "My Chip", 0, 1, 1, + &pcm)) < 0) + return err; + pcm->private_data = chip; + strcpy(pcm->name, "My Chip"); + chip->pcm = pcm; + /* set operators */ + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, + &snd_mychip_playback_ops); + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, + &snd_mychip_capture_ops); + /* pre-allocation of buffers */ + snd_pcm_lib_preallocate_pci_pages_for_all(chip->pci, pcm, + 64*1024, 64*1024); + return 0; + } +]]> + + + +
+ +
+ Constructor + + A pcm instance is allocated snd_pcm_new() + function. It would be better to create a constructor for pcm, + namely, + + + +card, "My Chip", 0, 1, 1, + &pcm)) < 0) + return err; + pcm->private_data = chip; + strcpy(pcm->name, "My Chip"); + chip->pcm = pcm; + .... + return 0; + } +]]> + + + + + + The snd_pcm_new() function takes the four + arguments. The first argument is the card pointer to which this + pcm is assigned, and the second is the ID string. + + + + The third argument (index, 0 in the + above) is the index of this new pcm. It begins from zero. When + you will create more than one pcm instances, specify the + different numbers in this argument. For example, + index = 1 for the second PCM device. + + + + The fourth and fifth arguments are the number of substreams + for playback and capture, respectively. Here both 1 are given in + the above example. When no playback or no capture is available, + pass 0 to the corresponding argument. + + + + If a chip supports multiple playbacks or captures, you can + specify more numbers, but they must be handled properly in + open/close, etc. callbacks. When you need to know which + substream you are referring to, then it can be obtained from + snd_pcm_substream_t data passed to each callback + as follows: + + + +number; +]]> + + + + + + After the pcm is created, you need to set operators for each + pcm stream. + + + + + + + + + + The operators are defined typically like this: + + + + + + + + Each of callbacks is explained in the subsection + + Operators. + + + + After setting the operators, most likely you'd like to + pre-allocate the buffer. For the pre-allocation, simply call + the following: + + + +pci, pcm, + 64*1024, 64*1024); +]]> + + + + It will allocate up to 64kB buffer as default. The details of + buffer management will be described in the later section Buffer and Memory + Management. + + + + Additionally, you can set some extra information for this pcm + in pcm->info_flags. + The available values are defined as + SNDRV_PCM_INFO_XXX in + <sound/asound.h>, which is used for + the hardware definition (described later). When your soundchip + supports only half-duplex, specify like this: + + + +info_flags = SNDRV_PCM_INFO_HALF_DUPLEX; +]]> + + + +
+ +
+ ... And the Destructor? + + The destructor for a pcm instance is not always + necessary. Since the pcm device will be released by the middle + layer code automatically, you don't have to call destructor + explicitly. + + + + The destructor would be necessary when you created some + special records internally and need to release them. In such a + case, set the destructor function to + pcm->private_free: + + + PCM Instance with a Destructor + +private_data, return); + // free your own data + kfree(chip->my_private_pcm_data); + // do what you like else... + } + + static int __devinit snd_mychip_new_pcm(mychip_t *chip) + { + snd_pcm_t *pcm; + .... + // allocate your own data + chip->my_private_pcm_data = kmalloc(...); + // set the destructor + pcm->private_data = chip; + pcm->private_free = mychip_pcm_free; + .... + } +]]> + + + +
+ +
+ Operators + + OK, now let me explain the detail of each pcm callback + (ops). In general, every callback must + return 0 if successful, or a negative number with the error + number such as -EINVAL at any + error. + + + + The callback function takes at least the argument with + snd_pcm_substream_t pointer. For retrieving the + chip record from the given substream instance, you can use the + following macro. + + + + + + + + + + It's expanded with a magic-cast, so the cast-error is + automatically checked. You should define chip_t at + the beginning of the code, since this will be referred in many + places of pcm and control interfaces. + + +
+ open callback + + + + + + + + This is called when a pcm substream is opened. + + + + At least, here you have to initialize the runtime hardware + record. Typically, this is done by like this: + + + +runtime; + + runtime->hw = snd_mychip_playback_hw; + return 0; + } +]]> + + + + where snd_mychip_playback_hw is the + pre-defined hardware record. + + + + + + + + + + The similar struct exists on ALSA 0.5.x driver, so you can + guess the values if you already wrote a driver. + + + + The info field contains the type and + capabilities of this pcm. The bit flags are defined in + <sound/asound.h> as + SNDRV_PCM_INFO_XXX. Here, at least, you + have to specify whether the mmap is supported and which + interleaved format is supported. + When the mmap is supported, add + SNDRV_PCM_INFO_MMAP flag here. When the + hardware supports the interleaved or the non-interleaved + format, SNDRV_PCM_INFO_INTERLEAVED or + SNDRV_PCM_INFO_NONINTERLEAVED flag must + be set, respectively. If both are supported, you can set both, + too. + + + + In the above example, MMAP_VALID and + BLOCK_TRANSFER are specified for OSS mmap + mode. Usually both are set. Of course, + MMAP_VALID is set only if the mmap is + really supported. + + + + The other possible flags are + SNDRV_PCM_INFO_PAUSE and + SNDRV_PCM_INFO_RESUME. The + PAUSE bit means that the pcm supports the + pause operation, while the + RESUME bit means that the pcm supports + the suspend/resume operation. If these flags + are set, the trigger callback below + must handle the corresponding commands. + + + + formats field contains the bit-flags + of supported formats (SNDRV_PCM_FMTBIT_XXX). + If the hardware supports more than one format, give all or'ed + bits. In the example above, the signed 16bit little-endian + format is specified. + + + + rates field contains the bit-flags of + supported rates (SNDRV_PCM_RATE_XXX). + When the chip supports continuous rates, pass + CONTINUOUS bit additionally. + The pre-defined rate bits are only for typical rates. If your + chip supports unconventional rates, you need to add + KNOT bit and set up the + constraint manually (explained later). + + + + There have been many changes of terminology between + ALSA 0.5.x and 0.9.x. + On the ALSA 0.9.x world, period means what is + known as fragment in the OSS. It's the least + size of (a part of) the buffer to generate an interrupt. + + + + Now, taking the new terminology into account, the other fields + are self-explanatory (I hope). Please note that here, both + min/max buffer and period sizes are specified in bytes. + + + + Some drivers allocate the private instance for each pcm + substream. It can be stored in + substream->runtime->private_data. + Since it's a void pointer, you + should use magic-kmalloc and magic-cast for such an object. + + + +runtime->private_data = data; + .... + } +]]> + + + + + + The allocated object must be released in the close callback below. + +
+ +
+ close callback + + + + + + + + Obviously, this is called when a pcm substream is closed. + + + + Any private instance for a pcm substream allocated in the + open callback will be released here. + + + +runtime->private_data); + .... + } +]]> + + + +
+ +
+ ioctl callback + + This is used for any special action to pcm ioctls. But + usually you can pass a generic ioctl callback, + snd_pcm_lib_ioctl. + +
+ +
+ hw_params callback + + + + + + + + This and hw_free callbacks exist + only on ALSA 0.9.x. + + + + This is called when the hardware parameter + (hw_params) is set + up by the application, + that is, once when the buffer size, the period size, the + format, etc. are defined for the pcm substream. + + + + Many hardware set-up should be done in this callback, + including the allocation of buffers. + + + + Parameters to be initialized are retrieved by + params_xxx() macros. For allocating a + buffer, you can call a helper function, + + + + + + + + snd_pcm_lib_malloc_pages() is available + only when the DMA buffers have been pre-allocated. + See the section + Buffer Types for more details. + + + + Note that this and prepare callbacks + may be called multiple times per initialization. + For example, the OSS emulation may + call these callbacks at each change via its ioctl. + + + + Thus, you need to take care not to allocate the same buffers + many times, which will lead to memory leak! Calling the + helper function above many times is OK. It will release the + previous buffer automatically when it was already allocated. + + + + Another note is that this callback is non-atomic + (schedulable). This is important, because the + prepare callback + is atomic (non-schedulable). That is, mutex or any + schedule-related functions are available only in + hw_params callback. + Please see the subsection + + Atomicity for details. + +
+ +
+ hw_free callback + + + + + + + + + + This is called to release the resources allocated via + hw_params. For example, releasing the + buffer via + snd_pcm_lib_malloc_pages() is done by + calling the following: + + + + + + + + + + This callback may be called multiple times, too. + Keep track whether the resource was already released. + +
+ +
+ prepare callback + + + + + + + + + + This callback is called when the pcm is + prepared. You can set the format type, sample + rate, etc. here. The difference from + hw_params is that the + prepare callback will be called at each + time + snd_pcm_prepare() is called, i.e. when + recovered after underruns, etc. + + + + As mentioned above, this callback is atomic. + + + + In this and the following callbacks, you can refer to the + values via the runtime record, + substream->runtime. + For example, to get the current + rate, format or channels, access to + runtime->rate, + runtime->format or + runtime->channels, respectively. + The physical address of the allocated buffer is set to + runtime->dma_area. The buffer and period sizes are + in runtime->buffer_size and runtime->period_size, + respectively. + + + + Note that the period and the buffer sizes are stored in + frames. In the ALSA world, 1 frame = channels + * samples-size. For conversion between frames and bytes, you + can use the helper functions, + frames_to_bytes() and + bytes_to_frames(). + + + +period_size); +]]> + + + + + + Be careful that this callback will be called many times at + each set up, too. + +
+ +
+ trigger callback + + + + + + + + This is called when the pcm is started, stopped or paused. + + + + Which action is specified in the second argument, + SNDRV_PCM_TRIGGER_XXX in + <sound/pcm.h>. At least, + START and STOP + commands must be defined in this callback. + + + + + + + + + + When the pcm supports the pause operation (given in info + field of the hardware table), PAUSE_PUSE + and PAUSE_RELEASE commands must be + handled here, too. The former is the command to pause the pcm, + and the latter to restart the pcm again. + + + + When the pcm supports the suspend/resume operation, + SUSPEND and RESUME + commands must be handled, too. Obviously it does suspend and + resume of the pcm substream. Usually, the + SUSPEND is identical with + STOP command and the + RESUME is identical with + START command. + + + + This callback is also atomic. + +
+ +
+ pointer callback + + + + + + + + This callback is called when the PCM middle layer inquires + the current hardware position on the buffer. The position must + be returned in frames (which was in bytes on ALSA 0.5.x), + ranged from 0 to buffer_size - 1. + + + + This is called usually from the buffer-update routine in the + pcm middle layer, which is invoked when + snd_pcm_period_elapsed() is called in the + interrupt routine. Then the pcm middle layer updates the + position and calculates the available space, and wakes up the + sleeping poll threads, etc. + + + + This callback is also atomic. + +
+ +
+ copy and silence callbacks + + These callbacks are not mandatory, and can be omitted in + most cases. These callbacks are used when the hardware buffer + cannot be on the normal memory space. Some chips have their + own buffer on the hardware which is not mappable. In such a + case, you have to transfer the data manually from the memory + buffer to the hardware buffer. Or, if the buffer is + non-contiguous on both physical and virtual memory spaces, + these callbacks must be defined, too. + + + + If these two callbacks are defined, copy and set-silence + operations are done by them. The detailed will be described in + the later section Buffer and Memory + Management. + +
+ +
+ page callback + + + This callback is also not mandatory. This callback is used + mainly for the non-contiguous buffer. The mmap calls this + callback to get the page address. Some examples will be + explained in the later section Buffer and Memory + Management, too. + +
+
+ +
+ Interrupt Handler + + The rest of pcm stuff is the PCM interrupt handler. The + role of PCM interrupt handler in the sound driver is to update + the buffer position and to tell the PCM middle layer when the + buffer position goes across the prescribed period size. To + inform this, call snd_pcm_period_elapsed() + function. + + + + There are several types of sound chips to generate the interrupts. + + +
+ Interrupts at the period (fragment) boundary + + This is the most frequently found type: the hardware + generates an interrupt at each period boundary. + In this case, you can call + snd_pcm_period_elapsed() at each + interrupt. + + + + snd_pcm_period_elapsed() takes the + substream pointer as its argument. Thus, you need to keep the + substream pointer accessible from the chip instance. For + example, define substream field in the chip record to hold the + current running substream pointer, and set the pointer value + at open callback (and reset at close callback). + + + + If you aquire a spinlock in the interrupt handler, and the + lock is used in other pcm callbacks, too, then you have to + release the lock before calling + snd_pcm_period_elapsed(), because + snd_pcm_period_elapsed() calls other pcm + callbacks inside. + + + + A typical coding would be like: + + + Interrupt Handler Case #1 + +lock); + .... + if (pcm_irq_invoked(chip)) { + // call updater, unlock before it + spin_unlock(&chip->lock); + snd_pcm_period_elapsed(chip->substream); + spin_lock(&chip->lock); + } + .... + spin_unlock(&chip->lock); + } +]]> + + + +
+ +
+ High-frequent timer interrupts + + This is the case when the hardware doesn't generate interrupts + at the period boundary but do timer-interrupts at the fixed + timer rate (e.g. es1968 or ymfpci drivers). + In this case, you need to check the current hardware + position and accumulates the processed sample length at each + interrupt. When the accumulated size overcomes the period + size, call + snd_pcm_period_elapsed() and reset the + accumulator. + + + + A typical coding would be like the following. + + + Interrupt Handler Case #2 + +lock); + .... + if (pcm_irq_invoked(chip)) { + unsigned int last_ptr, size; + // get the current hardware pointer (in frames) + last_ptr = get_hw_ptr(chip); + // calculate the processed frames since the + // last update + if (last_ptr < chip->last_ptr) + size = runtime->buffer_size + last_ptr + - chip->last_ptr; + else + size = last_ptr - chip->last_ptr; + // remember the last updated point + chip->last_ptr = last_ptr; + // accumulate the size + chip->size += size; + // over the period boundary? + if (chip->size >= runtime->period_size) { + // reset the accumulator + chip->size %= runtime->period_size; + // call updater + spin_unlock(&chip->lock); + snd_pcm_period_elapsed(substream); + spin_lock(&chip->lock); + } + } + .... + spin_unlock(&chip->lock); + } +]]> + + + +
+ +
+ On calling <function>snd_pcm_period_elapsed()</function> + + In both cases, even if more than one period are elapsed, you + don't have to call + snd_pcm_period_elapsed() many times. Call + only once. And the pcm layer will check the current hardware + pointer and update to the latest status. + +
+
+ +
+ Atomicity + + One of the most important (and thus difficult to debug) problem + on the kernel programming is the race condition. + On linux kernel, usually it's solved via spin-locks or + semaphores. In general, if the race condition may + happen in the interrupt handler, it's handled as atomic, and you + have to use spinlock for protecting the critical session. If it + never happens in the interrupt and it may take relatively long + time, you should use semaphore. + + + + As already seen, some pcm callbacks are atomic and some are + not. For example, hw_params callback is + non-atomic, while prepare callback is + atomic. This means, the latter is called already in a spinlock + held by the PCM middle layer. Please take this atomicity into + account when you use a spinlock or a semaphore in the callbacks. + + + + In the atomic callbacks, you cannot use functions which may call + schedule or go to + sleep. The semaphore and mutex do sleep, + and hence they cannot be used inside the atomic callbacks + (e.g. prepare callback). + For taking a certain delay in such a callback, please use + udelay() or mdelay(). + + + + This atomicity problem appears also in the initialization of the + hardware when the power-management is supported. The functions + for suspending and resuming the chip must be atomic, i.e. no + mutex nor sleep can be used in them. + + +
+
+ Constraints + + If your chip supports unconventional sample rates, or only the + limited samples, you need to set a constraint for the + condition. + + + + For example, in order to restrict the sample rates in the some + supported values, use + snd_pcm_hw_constraint_list(). + You need to call this function in the open callback. + + + Example of Hardware Constraints + +runtime, 0, + SNDRV_PCM_HW_PARAM_RATE, + &constraints_rates); + if (err < 0) + return err; + .... + } +]]> + + + + + + There are many different constraints. You can even define your + own constraint rules. I won't explain the details here, rather I + would like to say, Luke, use the source. + +
+ +
+ + + + + + + Control Interface + +
+ General + + The control interface is used widely for many switches, + sliders, etc. which are accessed from the user-space. Its most + important use is the mixer interface. In other words, on ALSA + 0.9.x, all the mixer stuff is implemented on the control kernel + API (while there was an independent mixer kernel API on 0.5.x). + + + + ALSA has a well-defined AC97 control module. If your chip + supports only the AC97 and nothing else, you can skip this + section. + + + + The control API is defined in + <sound/control.h>. + Include this file if you add your own controls. + +
+ +
+ Definition of Controls + + For creating a new control, you need to define the three + callbacks: info, + get and + put. Then, define a + snd_kcontrol_new_t record, such as: + + + Definition of a Control + + + + + + + + Most likely the control is created via + snd_ctl_new1(), and in such a case, you can + add __devinitdata prefix to the + definition like above. + + + + The iface field specifies the type of + the control, + SNDRV_CTL_ELEM_IFACE_XXX. There are + MIXER, PCM, + CARD, etc. + + + + The name is the name identifier + string. On ALSA 0.9.x, the control name is very important, + because its role is classified from its name. There are + pre-defined standard control names. The details are described in + the subsection + + Control Names. + + + + The index field holds the index number + of this control. If there are several different controls with + the same name, they can be distinguished by the index + number. This is the case when + several codecs exist on the card. If the index is zero, you can + omit the definition above. + + + + The access field contains the access + type of this control. Give the combination of bit masks, + SNDRV_CTL_ELEM_ACCESS_XXX, there. + The detailed will be explained in the subsection + + Access Flags. + + + + The private_values field contains + an arbitrary long integer value for this record. When using + generic info, + get and + put callbacks, you can pass a value + through this field. If several small numbers are necessary, you can + combine them in bitwise. Or, it's possible to give a pointer + (casted to unsigned long) of some record to this field, too. + + + + The other three are + + callback functions. + +
+ +
+ Control Names + + There are some standards for defining the control names. A + control is usually defined from the three parts as + SOURCE DIRECTION FUNCTION. + + + + The first, SOURCE, specifies the source + of the control, and is a string such as Master, + PCM, CD or + Line. There are many pre-defined sources. + + + + The second, DIRECTION, is one of the + following strings according to the direction of the control: + Playback, Capture, Bypass + Playback and Bypass Capture. Or, it can + be omitted, meaning both playback and capture directions. + + + + The third, FUNCTION, is one of the + following strings according to the function of the control: + Switch, Volume and + Route. + + + + The example of control names are, thus, Master Capture + Switch or PCM Playback Volume. + + + + There are some exceptions: + + +
+ Global capture and playback + + Capture Source, Capture Switch + and Capture Volume are used for the global + capture (input) source, switch and volume. Similarly, + Playback Switch and Playback + Volume are used for the global output gain switch and + volume. + +
+ +
+ Tone-controls + + tone-control switch and volumes are specified like + Tone Control - XXX, e.g. Tone Control - + Switch, Tone Control - Bass, + Tone Control - Center. + +
+ +
+ 3D controls + + 3D-control switches and volumes are specified like 3D + Control - XXX, e.g. 3D Control - + Switch, 3D Control - Center, 3D + Control - Space. + +
+ +
+ Mic boost + + Mic-boost switch is set as Mic Boost or + Mic Boost (6dB). + + + + More precise information can be found in + alsa-kernel/Documentation/ControlNames.txt. + +
+
+ +
+ Access Flags + + + The access flag is the bit-flags which specifies the access type + of the given control. The default access type is + SNDRV_CTL_ELEM_ACCESS_READWRITE, + which means both read and write are allowed to this control. + When the access flag is omitted (i.e. = 0), it is + regarded as READWRITE access as default. + + + + When the control is read-only, pass + SNDRV_CTL_ELEM_ACCESS_READ instead. + In this case, you don't have to define + put callback. + Similarly, when the control is write-only (although it's a rare + case), you can use WRITE flag instead, and + you don't need get callback. + + + + If the control value changes frequently (e.g. the VU meter), + VOLATILE flag should be given. This means + that the control may be changed without + + notification. Applications should poll such + a control constantly. + + + + When the control is inactive, set + INACTIVE flag, too. + There are LOCK and + OWNER flags for changing the write + permissions. + + +
+ +
+ Callbacks + +
+ info callback + + The info callback is used to get + the detailed information of this control. This must store the + values of the given snd_ctl_elem_info_t + object. For example, for a boolean control with a single + element will be: + + + Example of info callback + +type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; + uinfo->count = 1; + uinfo->value.integer.min = 0; + uinfo->value.integer.max = 1; + return 0; + } +]]> + + + + + + The type field specifies the type + of the control. There are BOOLEAN, + INTEGER, ENUMERATED, + BYTES, IEC958 and + INTEGER64. The + count field specifies the + number of elements in this control. For example, a stereo + volume would have count = 2. The + value field is a union, and + the values stored are depending on the type. The boolean and + integer are identical. + + + + The enumerated type is a bit different from others. You'll + need to set the string for the currently given item index. + + + +value.enumerated.items = 4; + if (uinfo->value.enumerated.item > 3) + uinfo->value.enumerated.item = 3; + strcpy(uinfo->value.enumerated.name, + texts[uinfo->value.enumerated.item]); +]]> + + + +
+ +
+ get callback + + + This callback is used to read the current value of the + control and to return to the user-space. + + + + For example, + + + Example of get callback + +value.integer.value[0] = get_some_value(chip); + return 0; + } +]]> + + + + + + Here, the chip instance is retrieved via + snd_kcontrol_chip() macro. This macro + converts from kcontrol->private_data to the type defined by + chip_t. The + kcontrol->private_data field is + given as the argument of snd_ctl_new() + (see the later subsection + Constructor). + + + + The value field is depending on + the type of control as well as on info callback. For example, + the sb driver uses this field to store the register offset, + the bit-shift and the bit-mask. The + private_value is set like + + + + + + and is retrieved in callbacks like + + +private_value & 0xff; + int shift = (kcontrol->private_value >> 16) & 0xff; + int mask = (kcontrol->private_value >> 24) & 0xff; + .... + } +]]> + + + + + + In get callback, you have to fill all the elements if the + control has more than one elements, + i.e. count > 1. + In the example above, we filled only one element + (value.integer.value[0]) since it's + assumed as count = 1. + +
+ +
+ put callback + + + This callback is used to write a value from the user-space. + + + + For example, + + + Example of put callback + +current_value != + ucontrol->value.integer.value[0]) { + change_current_value(chip, + ucontrol->value.integer.value[0]); + changed = 1; + } + return changed; + } +]]> + + + + As seen above, you have to return 1 if the value is + changed. If the value is not changed, return 0 instead. + If any fatal error happens, return a negative error code as + usual. + + + + Like get callback, + when the control has more than one elements, + all elemehts must be evaluated in this callback, too. + +
+ +
+ Callbacks are not atomic + + All these three callbacks are basically not atomic. + +
+
+ +
+ Constructor + + When everything is ready, finally we can create a new + control. For creating a control, there are two functions to be + called, snd_ctl_new1() and + snd_ctl_add(). + + + + In the simplest way, you can do like this: + + + + + + + + where my_control is the + snd_kcontrol_new_t object defined above, and chip + is the object pointer to be passed to + kcontrol->private_data + which can be referred in callbacks. + + + + snd_ctl_new1() allocates a new + snd_kcontrol_t instance (that's why the definition + of my_control can be with + __devinitdata + prefix), and snd_ctl_add assigns the given + control component to the card. + +
+ +
+ Change Notification + + If you need to change and update a control in the interrupt + routine, you can call snd_ctl_notify(). For + example, + + + + + + + + This function takes the card pointer, the event-mask, and the + control id pointer for the notification. The event-mask + specifies the types of notification, for example, in the above + example, the change of control values is notified. + The id pointer is the pointer of snd_ctl_elem_id_t + to be notified. + You can find some examples in es1938.c or + es1968.c for hardware volume interrupts. + +
+ +
+ + + + + + + API for AC97 Codec + +
+ General + + The ALSA AC97 codec layer is a well-defined one, and you don't + have to write many codes to control it. Only low-level control + routines are necessary. The AC97 codec API is defined in + <sound/ac97_codec.h>. + +
+ +
+ Full Code Example + + + Example of AC97 Interface + +private_data, return 0); + .... + // read a register value here from the codec + return the_register_value; + } + + static void snd_mychip_ac97_write(ac97_t *ac97, + unsigned short reg, unsigned short val) + { + mychip_t *chip = snd_magic_cast(mychip_t, + ac97->private_data, return 0); + .... + // write the given register value to the codec + } + + static int snd_mychip_ac97(mychip_t *chip) + { + ac97_t ac97; + + memset(&ac97, 0, sizeof(ac97)); + ac97.write = snd_mychip_ac97_write; + ac97.read = snd_mychip_ac97_read; + ac97.private_data = chip; + return snd_ac97_mixer(card, &ac97, &chip->ac97); + } + +]]> + + + +
+ +
+ Constructor + + For creating an ac97 instance, call + snd_ac97_mixer() with an ac97_t + record, in which the callbacks and the private_data is set. + + + +ac97); +]]> + + + + where chip->ac97 is the pointer of a newly created + ac97_t instance. + This instance is not necessarily stored in the chip + record. When you need to change the register values from the + driver, or need the suspend/resume of ac97 codecs, keep this + pointer to pass to the corresponding functions. + +
+ +
+ Callbacks + + The standard callbacks are read and + write. Obviously they + correspond to the functions for read and write accesses to the + hardware low-level codes. + + + + The read callback returns the + register value specified in the argument. + + + +private_data, return 0); + .... + return the_register_value; + } +]]> + + + + Here, the chip can be cast from ac97->private_data. + + + + Meanwhile, the write callback is + used to set the register value. + + + + + + + + + + These callbacks are non-atomic like the callbacks of control API + unless they are called during suspend/resume phase. + + + + There are also other callbacks: + reset, + wait and + init. + + + + The reset callback is used to reset + the codec. If the chip requires a special way of reset, you can + define this callback. + This callback must be atomic when it's called in the suspend + mode. + + + + The wait callback is used for a + certain wait at the standard initialization of the codec. If the + chip requires the extra wait-time, define this callback. + This callback is always non-atomic, because it's never called + in the resume mode. + + + + The init callback is used for + additional initialization of the codec. This callback is called + after the reset, and should be atomic in the resume mode. + +
+ +
+ Updating Registers in The Driver + + If you need to access to the codec from the driver, you can + call the following functions: + snd_ac97_write(), + snd_ac97_read(), + snd_ac97_update() and + snd_ac97_update_bits(). + + + + Both snd_ac97_write() and + snd_ac97_update() functions are used to + set a value to the given register + (AC97_XXX). The different between them is + that snd_ac97_update() doesn't write a + value if the given value has been already set, while + snd_ac97_write() always rewrites the + value. + + + + + + + + + + snd_ac97_read() is used to read the value + of the given register. For example, + + + + + + + + + + snd_ac97_update_bits() is used to update + some bits of the given register. + + + + + + + + + + Also, there is a function to change the sample rate (of a + certain register such as + AC97_PCM_FRONT_DAC_RATE) when VRA is + supported by the codec: + snd_ac97_set_rate(). + + + + + + + + + + The following registers are available for setting the rate: + AC97_PCM_MIC_ADC_RATE, + AC97_PCM_FRONT_DAC_RATE, + AC97_PCM_LR_ADC_RATE, + AC97_SPDIF. When the + AC97_SPDIF is specified, the register is + not really changed but the corresponding IEC958 status bits will + be updated. + +
+ +
+ Clock Adjustment + + On some chip, the clock of the codec isn't 48000 but using a + PCI clock (to save a quartz!). In this case, change the field + ac97->clock to the corresponding + value. For example, intel8x0 + and es1968 drivers have the auto-measurement function of the + clock. + +
+ +
+ Proc Files + + The ALSA AC97 interface will create a proc file such as + /proc/asound/card0/ac97#0 and + ac97#0regs. You can refer to these files to + see the current status and registers of the codec. + +
+ +
+ Multiple Codecs + + When there are several codecs on the same card, you need to + call snd_ac97_new() multiple times with + ac97.num=1 or greater. The num field + specifies the codec + number. + + + + If you have set up multiple codecs, you need to either write + different callbacks for each codec or check + ac97->num in the + callback routines. + +
+ +
+ + + + + + + MIDI (MPU401-UART) Interface + +
+ General + + Many soundcards have built-in MIDI (MPU401-UART) + interfaces. When the soundcard supports the standard MPU401-UART + interface, most likely you can use the ALSA MPU401-UART API. The + MPU401-UART API is defined in + <sound/mpu401.h>. + + + + Some soundchips have similar but a little bit different + implementation of mpu401 stuff. For example, emu10k1 has its own + mpu401 routines. + + + + In this document, I won't explain the rawmidi interface API, + which is the basis of MPU401-UART implementation. + + + + For details, please check the source, + core/rawmidi.c, and examples such as + drivers/mpu401/mpu401_uart.c or + usb/usbmidi.c. + +
+ +
+ Constructor + + For creating a rawmidi object, call + snd_mpu401_uart_new(). + + + + + + + + + + The first argument is the card pointer, and the second is the + index of this component. You can create up to 8 rawmidi + devices. + + + + The third argument is the type of the hardware, + MPU401_HW_XXX. If it's not a special one, + you can use MPU401_HW_MPU401. + + + + The 4th argument is the i/o port address. Many + backward-compatible MPU401 has an i/o port such as 0x330. Or, it + might be a part of its own PCI i/o region. It depends on the + chip design. + + + + When the i/o port address above is a part of the PCI i/o + region, the MPU401 i/o port might have been already allocated + (reserved) by the driver itself. In such a case, pass non-zero + to the 5th argument + (integrated). Otherwise, pass 0 to it, + and + the mpu401-uart layer will allocate the i/o ports by itself. + + + + Usually, the port address corresponds to the command port and + port + 1 corresponds to the data port. If not, you may change + the cport field of + mpu401_t manually + afterward. However, mpu401_t pointer is not + returned explicitly by + snd_mpu401_uart_new(). You need to cast + rmidi->private_data to + mpu401_t explicitly, + + + +private_data, ); +]]> + + + + and reset the cport as you like: + + + +cport = my_own_control_port; +]]> + + + + + + The 6th argument specifies the irq number for UART. If the irq + is already allocated, pass 0 to the 7th argument + (irq_flags). Otherwise, pass the flags + for irq allocation + (SA_XXX bits) to it, and the irq will be + reserved by the mpu401-uart layer. If the card doesn't generates + UART interrupts, pass -1 as the irq number. Then a timer + interrupt will be invoked for polling. + +
+ +
+ Interrupt Handler + + When the interrupt is allocated in + snd_mpu401_uart_new(), the private + interrupt handler is used, hence you don't have to do nothing + else than creating the mpu401 stuff. Otherwise, you have to call + snd_mpu401_uart_interrupt() explicitly when + a UART interrupt is invoked and checked in your own interrupt + handler. + + + + In this case, you need to pass the private_data of the + returned rawmidi object from + snd_mpu401_uart_new() as the second + argument of snd_mpu401_uart_interrupt(). + + + +private_data, regs); +]]> + + + +
+ +
+ + + + + + + Miscellaneous Devices + +
+ FM OPL3 + + The FM OPL3 is still used on many chips (mainly for backward + compatibility). ALSA has a nice OPL3 FM control layer, too. The + OPL3 API is defined in + <sound/opl3.h>. + + + + FM registers can be directly accessed through direct-FM API, + defined in <sound/asound_fm.h>. In + ALSA native mode, FM registers are accessed through + Hardware-Dependant Device direct-FM extension API, whereas in + OSS compatible mode, FM registers can be accessed with OSS + direct-FM compatible API on /dev/dmfmX device. + + + + For creating the OPL3 component, you have two functions to + call. The first one is a constructor for opl3_t + instance. + + + + + + + + + + The first argument is the card pointer, the second one is the + left port address, and the third is the right port address. In + most cases, the right port is placed at the left port + 2. + + + + The fourth argument is the hardware type. + + + + When the left and right ports have been already allocated by + the card driver, pass non-zero to the fifth argument + (integrated). Otherwise, opl3 module will + allocate the specified ports by itself. + + + + If this function returns successfully with 0, then create a + hwdep device for this opl3. + + + + + + + + + + The first argument is the opl3_t instance you + created, and the second is the index number, usually 0. + + + + The third argument is the index-offset for the sequencer + client assigned to the OPL3 port. When there is an MPU401-UART, + give 1 for here (UART always takes 0). + +
+ +
+ Hardware-Dependent Devices + + Some chips need the access from the user-space for special + controls or for loading the micro code. In such a case, you can + create a hwdep (hardware-dependent) device. The hwdep API is + defined in <sound/hwdep.h>. You can + find examples in opl3 driver or + isa/sb/sb16_csp.c. + + + + Creation of the hwdep instance is done via + snd_hwdep_new(). + + + + + + + + where the third argument is the index number. + + + + You can then pass any pointer value to the + private_data. Again, it should be a + magic-allocated record, so that the cast can be checked more + safely. If you assign a private data, you should define the + destructor, too. The destructor function is set to + private_free field. + + + +private_data = p; + hw->private_free = mydata_free; +]]> + + + + and the implementation of destructor would be: + + + +private_data, return); + snd_magic_kfree(p); + } +]]> + + + + + + The arbitrary file operations can be defined for this + instance. The file operators are defined in + ops table. For example, assume that + this chip needs an ioctl. + + + +ops.open = mydata_open; + hw->ops.ioctl = mydata_ioctl; + hw->ops.release = mydata_release; +]]> + + + + And implement the callback functions as you like. + +
+ +
+ IEC958 (S/PDIF) + + Usually the controls for IEC958 devices are implemented via + control interface. There is a macro to compose a name string for + IEC958 controls, SNDRV_CTL_NAME_IEC958() + defined in <include/asound.h>. + + + + There are some standard controls for IEC958 status bits. These + controls use the type SNDRV_CTL_ELEM_TYPE_IEC958, + and the size of element is fixed as 4 bytes array + (value.iec958.status[x]). For info + callback, you don't specify + the value field for this type (the count field must be set, + though). + + + + IEC958 Playback Con Mask is used to return the + bit-mask for the IEC958 status bits of consumer mode. Similarly, + IEC958 Playback Pro Mask returns the bitmask for + professional mode. They are read-only controls, and are defined + as MIXER controls (iface = + SNDRV_CTL_ELEM_IFACE_MIXER). + + + + Meanwhile, IEC958 Playback Default control is + defined for getting and setting the current default IEC958 + bits. Note that this one is usually defined as a PCM control + (iface = SNDRV_CTL_ELEM_IFACE_PCM), + although in some places it's defined as a MIXER control. + + + + In addition, you can define the control switches to + enable/disable or to set the raw bit mode. The implementation + will depend on the chip, but the control should be named as + IEC958 xxx, preferably using + SNDRV_CTL_NAME_IEC958() macro. + + + + You can find several cases, for example, + pci/emu10k1, + pci/ice1712, or + pci/cmipci.c. + +
+ +
+ + + + + + + Buffer and Memory Management + +
+ Buffer Types + + ALSA provides several different buffer allocation functions + depending on the bus and the architecture. All these have a + consistent API. The allocation of physically-contiguous pages is + done via + snd_malloc_xxx_pages() function, where xxx + is the bus type. + + + + The allocation of pages with fallback is + snd_malloc_xxx_pages_fallback(). This + function tries to allocate the specified pages but if the pages + are not available, it tries to reduce the page sizes until the + enough space is found. + + + + For releasing the space, call + snd_free_xxx_pages() function. + + + + Usually, ALSA drivers try to allocate and reserve + a large contiguous physical space + at the time the module is loaded for the later use. + This is called pre-allocation. + As already written, you can call the following function at the + construction of pcm instance (in the case of PCI bus). + + + + + + + + where size is the byte size to be + pre-allocated and the max is the maximal + size to be changed via prealloc proc file. + The allocator will try to get as the large area as possible + within the given size. + There are different versions of pre-allocator for different + buses. + + + + Once when the buffer is pre-allocated, you can use the + allocator in the hw_params callback + + + + + + + + Note that you have to pre-allocate to use this function + (i.e. you cannot use this function for + + a scatter-gather buffer). + +
+ +
+ External Hardware Buffers + + Some chips have their own hardware buffers and the DMA + transfer from the host memory is not available. In such a case, + you need to either 1) copy/set the audio data directly to the + external hardware buffer, or 2) make an intermediate buffer and + copy/set the data from it to the external hardware buffer in + interrupts (or in tasklets, preferably). + + + + The first case works fine if the external hardware buffer is enough + large. This method doesn't need any extra buffers and thus is + more effective. You need to define the + copy and + silence callbacks for + the data transfer. However, there is a drawback: it cannot + be mmapped. The examples are GUS's GF1 PCM or emu8000's + wavetable PCM. + + + + The second case allows the mmap of the buffer, although you have + to handle an interrupt or a tasklet for transferring the data + from the intermediate buffer to the hardware buffer. You can find an + example in vxpocket driver. + + + + Another case is that the chip uses a PCI memory-map + region for the buffer instead of the host memory. In this case, + mmap is available only on certain architectures like intel. In + non-mmap mode, the data cannot be transferred as the normal + way. Thus you need to define copy and + silence callbacks as well + as in the cases above. The examples are found in + rme32.c and rme96.c. + + + + The implementation of copy and + silence callbacks depends upon + whether the hardware supports interleaved or non-interleaved + samples. The copy callback is + defined like below, a bit + differently depending whether the direction is playback or + capture: + + + + + + + + + + In the case of interleaved samples, the second argument + (channel) is not used. The third argument + (pos) points the + current position offset in frames. + + + + The meaning of the fourth argument is different between + playback and capture. For playback, it holds the source data + pointer, and for capture, it's the destination data pointer. + + + + The last argument is the number of frames to be copied. + + + + What you have to do in this callback is again different + between playback and capture directions. In the case of + playback, you do: copy the given amount of data + (count) at the specified pointer + (src) to the specified offset + (pos) on the hardware buffer. When + coded like memcpy-like way, the copy would be like: + + + + + + + + + + For the capture direction, you do: copy the given amount of + data (count) at the specified offset + (pos) on the hardware buffer to the + specified pointer (dst). + + + + + + + + Note that both of the position and the data amount are given + in frames. + + + + In the case of non-interleaved samples, the implementation + will be a bit more complicated. + + + + You need to check the channel argument, and if it's -1, copy + the whole channels. Otherwise, you have to copy only the + specified channel. Please check + isa/gus/gus_pcm.c as an example. + + + + The silence callback is also + implemented in a similar way. + + + + + + + + + + The meanings of arguments are identical with the + copy + callback, although there is no src/dst + argument. In the case of interleaved samples, the channel + argument has no meaning, as well as on + copy callback. + + + + The role of silence callback is to + set the given amount + (count) of silence data at the + specified offset (pos) on the hardware + buffer. Suppose that the data format is signed (that is, the + silent-data is 0), and the implementation using a memset-like + function would be like: + + + + + + + + + + In the case of non-interleaved samples, again, the + implementation becomes a bit more complicated. See, for example, + isa/gus/gus_pcm.c. + +
+ +
+ Non-Contiguous Buffers + + If your hardware supports the page table like emu10k1 or the + buffer descriptors like via82xx, you can use the scatter-gather + (SG) DMA. ALSA provides an interface for handling SG-buffers. + The API is provided in <sound/pcm_sgbuf.h>. + + + + For creating the SG-buffer handler, call + snd_pcm_lib_preallocate_sg_pages() or + snd_pcm_lib_preallocate_sg_pages_for_all() + in the PCM constructor like other PCI pre-allocator. + You need to pass the + pci_dev struct pointer of the chip. + The snd_sg_buf_t instance is created as + substream->dma_private. You can cast + the pointer like: + + + +dma_private, return -EINVAL); +]]> + + + + + + Then call snd_pcm_lib_malloc_pages() + in hw_params callback + as well as in the case of normal PCI buffer. + The SG-buffer handler will allocate the non-contiguous kernel + pages of the given size and map them onto the virtually contiguous + memory. The virtual pointer is addressed in runtime->dma_area. + The physical address (runtime->dma_addr) is set to zero, + because the buffer is physically non-contigous. + The physical address table is set up in sgbuf->table. + You can get the physical address at a certain offset via + snd_pcm_sgbuf_get_addr(). + + + + When a SG-handler is used, you need to set + snd_pcm_sgbuf_ops_page as + the page callback. + + + + For releasing the data, call + snd_pcm_lib_free_pages() in the + hw_free callback as usual. + +
+ +
+ Vmalloc'ed Buffers + + It's possible to use a buffer allocated via + vmalloc, for example, for an intermediate + buffer. Since the allocated pages are not contiguous, you need + to set the page callback to obtain + the physical address at every offset. + + + + The implementation of page callback + would be like this: + + + + + + /* get the physical page pointer on the given offset */ + static struct page *mychip_page(snd_pcm_substream_t *substream, + unsigned long offset) + { + void *pageptr = substream->runtime->dma_area + offset; + return vmalloc_to_page(pageptr); + } +]]> + + + +
+ +
+ + + + + + + Proc Interface + + ALSA provides an easy interface for procfs. The proc files are + very useful for debugging. I recommend you set up proc files if + you write a driver and want to get a running status or register + dumps. The API is found in + <sound/info.h>. + + + + For creating a proc file, call + snd_card_proc_new(). + + + + + + + + where the second argument specifies the proc-file name to be + created. The above example will create a file + my-file under the card directory, + e.g. /proc/asound/card0/my-file. + + + + Like other components, the proc entry created via + snd_card_proc_new() will be registered and + released automatically in the card registration and release + functions. + + + + When the creation is successful, the function stores a new + instance at the pointer given in the third argument. + It is initialized as a text proc file for read only. For using + this proc file as a read-only text file as it is, set the read + callback with a private data via + snd_info_set_text_ops(). + + + + + + + + where the second argument (chip) is the + private data to be used in the callbacks and the third + (my_proc_read) is the callback function, which + is defined like + + + + + + + + + + + In the read callback, use snd_iprintf() for + output strings, which works just like normal + printf(). For example, + + + +private_data, return); + + snd_iprintf(buffer, "This is my chip!\n"); + snd_iprintf(buffer, "Port = %ld\n", chip->port); + } +]]> + + + + + + The file permission can be changed afterwards. As default, it's + set as read only for all users. If you want to add the write + permission to the user (root as default), set like below: + + + +mode = S_IFREG | S_IRUGO | S_IWUSR; +]]> + + + + and set the write buffer size and the callback + + + +c.text.write_size = 256; + entry->c.text.write = my_proc_write; +]]> + + + + + + The buffer size for read is set to 1024 implicitly by + snd_info_set_text_ops(). It should suffice + in most cases (the size will be aligned to + PAGE_SIZE anyway), but if you need to handle + very large text files, you can set it explicitly, too. + + + +c.text.read_size = 65536; +]]> + + + + + + For the write callback, you can use + snd_info_get_line() to get a text line, and + snd_info_get_str() to retrieve a string from + the line. Some examples are found in + core/oss/mixer_oss.c, core/oss/and + pcm_oss.c. + + + + For a raw-data proc-file, set the attributes like the following: + + + +content = SNDRV_INFO_CONTENT_DATA; + entry->private_data = chip; + entry->c.ops = &my_file_io_ops; + entry->size = 4096; + entry->mode = S_IFREG | S_IRUGO; +]]> + + + + + + The callback is much more complicated than the text-file + version. You need to use a low-level i/o functions such as + copy_from/to_user() to transfer the + data. Also, you have to keep tracking the file position, too. + + + +f_pos + size > local_max_size) + size = local_max_size - file->f_pos; + if (copy_to_user(buf, local_data + file->f_pos, size)) + return -EFAULT; + file->f_pos += size; + return size; + } +]]> + + + + + + + + + + + + Power Management + + If the chip is supposed to work with with suspend/resume + functions, you need to add the power-management codes to the + driver. The additional codes for the power-management should be + ifdef'ed with + CONFIG_PM. + + + + Basic jobs of suspend/resume are done in + suspend and + resume callbacks of + pci_driver struct. Unfortunately, the + API of these callbacks was changed at the middle time of Linux + 2.4.x, if you want to keep the support for older kernels, you + have to write two different callbacks. The example below is the + skeleton callbacks which just call the real suspend and resume + functions. + + + + + + + + + + The scheme of the real suspend job is as following. + + + Check whether the power-state is already D3hot. If yes, skip the job. + Call snd_pcm_suspend_all() to suspend the running PCM streams. + Save the register values if necessary. + Stop the hardware if necessary. + Set the power-state as D3hot by calling snd_power_change_state(). + + + + + A typical code would be like: + + + +card; + // (1) + if (card->power_state == SNDRV_CTL_POWER_D3hot) + return; + // (2) + snd_pcm_suspend_all(chip->pcm); + // (3) + snd_mychip_save_registers(chip); + // (4) + snd_mychip_stop_hardware(chip); + // (5) + snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); + } +]]> + + + + + + The scheme of the real resume job is as following. + + + Check whether the power-state is already D0. + If yes, skip the job. + Enable the pci device again by calling + pci_enable_device(). + Re-initialize the chip. + Restore the saved registers if necessary. + Resume the mixer, e.g. calling + snd_ac97_resume(). + Restart the hardware (if any). + Set the power-state as D0 by calling + snd_power_change_state(). + + + + + A typical code would be like: + + + +card; + // (1) + if (card->power_state == SNDRV_CTL_POWER_D0) + return; + // (2) + pci_enable_device(chip->pci); + // (3) + snd_mychip_reinit_chip(chip); + // (4) + snd_mychip_restore_registers(chip); + // (5) + snd_ac97_resume(chip->ac97); + // (6) + snd_mychip_restart_chip(chip); + // (7) + snd_power_change_state(card, SNDRV_CTL_POWER_D0); + } +]]> + + + + + + In addition to the callbacks above, you should define a callback + for the changes via the ALSA control interface. It's defined + like below: + + + +power_state_private_data, return -ENXIO); + switch (power_state) { + case SNDRV_CTL_POWER_D0: + case SNDRV_CTL_POWER_D1: + case SNDRV_CTL_POWER_D2: + mychip_resume(chip); + break; + case SNDRV_CTL_POWER_D3hot: + case SNDRV_CTL_POWER_D3cold: + mychip_suspend(chip); + break; + default: + return -EINVAL; + } + return 0; + } +]]> + + + + + + OK, we have all callbacks now. Let's set up them now. In the + initialization of the card, add the following: + + + +set_power_state = snd_mychip_set_power_state; + card->power_state_private_data = chip; + #endif + .... + } +]]> + + + + + + If you need a space for saving the registers, you'll need to + allocate the buffer for it here, too, since you cannot call + kmalloc() with + GFP_KERNEL flag or + vmalloc() in the suspend callback. + The allocated buffer should be released in the corresponding + destructor. + + + + And next, set suspend/resume callbacks to the pci_driver, + + + + + + + + + + Last but not least: Please keep in mind that you cannot call + schedule() during the suspend and the resume + callbacks. If any delay is necessary, you have to use + mdelay() or udelay() + instead of schedule_timeout()! + Of course, semaphores cannot be used, too, which will invoke sleep + inside. + + + + + + + + + Module Parameters + + There are standard module options for ALSA. At least, each + module should have index, + id and enable + options. + + + + If the module supports multiple cards (usually up to + 8 = SNDRV_CARDS cards), they should be + arrays. The default initial values are defined already as + constants for ease of programming: + + + + + + + + + + If the module supports only a single card, they could be single + variables, instead. enable option is not + always necessary in this case, but it wouldn't be so bad to have a + dummy option for compatibility. + + + + The module parameters must be declared with the standard + MODULE_PARM() and + MODULE_PARM_DESC() macros. The ALSA provides + an additional macro, MODULE_PARM_SYNTAX(), + for describing its syntax. The strings will be written to + /lib/modules/XXX/modules.generic_string + file. + + + + For convenience, the typical string arguments given to + MODULE_PARM_SYNTAX() are defined in + <sound/initval.h>, such as + SNDRV_ID_DESC or + SNDRV_ENABLED. + + + + The typical coding would be like below: + + + + + + + + + + Also, don't forget to define the module description, classes, + license and devices. Especially, the recent modprobe requires to + define the module license as GPL, etc., otherwise the system is + shown as tainted. + + + + + + + + + + For building the driver into kernel, you should define the + setup() function in addition, too. + ALSA provides get_id() function to retrieve + a string argument from the kernel boot parameters. + + + += SNDRV_CARDS) + return 0; + (void)(get_option(&str,&enable[nr_dev]) == 2 && + get_option(&str,&index[nr_dev]) == 2 && + get_id(&str,&id[nr_dev]) == 2); + nr_dev++; + return 1; + } + + __setup("snd-mychip=", alsa_card_mychip_setup); + + #endif /* ifndef MODULE */ +]]> + + + + + + + + + + + Useful Functions + +
+ <function>snd_printk()</function> and friends + + ALSA provides a verbose version of + printk() function. If a kernel config + CONFIG_SND_VERBOSE_PRINTK is set, this + function prints the given message together with the file name + and the line of the caller. The KERN_XXX + prefix is processed as + well as the original printk() does, so it's + recommended to add this prefix, e.g. + + + + + + + + + + There are also printk()'s for + debugging. snd_printd() can be used for + general debugging purposes. If + CONFIG_SND_DEBUG is set, this function is + compiled, and works just like + snd_printk(). If the ALSA is compiled + without the debugging flag, it's ignored. + + + + snd_printdd() is compiled in only when + CONFIG_SND_DEBUG_DETECT is set. Please note + that DEBUG_DETECT is not set as default + even if you configure the alsa-driver with + option. You need to give + explicitly option instead. + +
+ +
+ <function>snd_assert()</function> + + snd_assert() macro is similar with the + normal assert() macro. For example, + + + + + + + + + + The first argument is the expression to evaluate, and the + second argument is the action if it fails. When + CONFIG_SND_DEBUG, is set, it will show an + error message such as BUG? (xxx) (called from + yyy). When no debug flag is set, this is + ignored. + +
+ +
+ <function>snd_runtime_check()</function> + + This macro is quite similar with + snd_assert(). Unlike + snd_assert(), the expression is always + evaluated regardless of + CONFIG_SND_DEBUG. When + CONFIG_SND_DEBUG is set, the macro will + show a message like ERROR (xx) (called from + yyy). + +
+ +
+ <function>snd_BUG()</function> + + It calls snd_assert(0,) -- that is, just + prints the error message at the point. It's useful to show that + a fatal error happens there. + +
+
+ + + + + + + Acknowledgments + + I would like to thank Phil Kerr for his help for improvement and + corrections of this document. + + + Kevin Conder reformatted the original plain-text to the + DocBook format. + + + + +
diff -Nru a/Documentation/sound/alsa/OSS-Emulation.txt b/Documentation/sound/alsa/OSS-Emulation.txt --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/Documentation/sound/alsa/OSS-Emulation.txt Sun Feb 9 21:13:38 2003 @@ -0,0 +1,302 @@ + NOTES ON KERNEL OSS-EMULATION + ============================= + + Jan. 9, 2003 Takashi Iwai + + +Modules +======= + +ALSA provides a powerful OSS emulation on the kernel. +The OSS emulation for PCM, mixer and sequencer devices is implemented +as add-on kernel modules, snd-pcm-oss, snd-mixer-oss and snd-seq-oss. +When you need to access the OSS PCM, mixer or sequencer devices, the +corresponding module has to be loaded. + +For loading these modules automatically, define the aliases in +/etc/modules.conf like below: + + alias sound-service-0-0 snd-mixer-oss + alias sound-service-0-1 snd-seq-oss + alias sound-service-0-3 snd-pcm-oss + alias sound-service-0-8 snd-seq-oss + alias sound-service-0-12 snd-pcm-oss + +Then the access to an OSS device file such as /dev/dsp0 triggers to +load the necessary module via KMOD. + +For auto-loading the secondary card device like /dev/dsp1, the +following aliases are necessary in addition: + + alias sound-service-1-0 snd-mixer-oss + alias sound-service-1-3 snd-pcm-oss + alias sound-service-1-12 snd-pcm-oss + +Here you don't need to define service-1-1 and service-1-8 because +there is only one sequencer device. +Similarly, you can add definitions for the third or later cards as +sound-service-X-Y. + +The OSS-MIDI is emulated directly in the ALSA rawmidi module, +therefore no extra module exists for that purpose. + +The currently available OSS configuration is shown in +/proc/asound/oss/sndstat. This shows in the same syntax of +/dev/sndstat, which is available on the commercial OSS driver. +On ALSA, you can symlink /dev/sndstat to this proc file. + +Please note that the devices listed in this proc file appear only +after the corresponding OSS-emulation module is loaded. Don't worry +even if "NOT ENABLED IN CONFIG" is shown in it. + + +Device Mapping +============== + +ALSA supports the following OSS device files: + + PCM: + /dev/dspX + /dev/adspX + + Mixer: + /dev/mixerX + + MIDI: + /dev/midi0X + /dev/amidi0X + + Sequencer: + /dev/sequencer + /dev/sequencer2 (aka /dev/music) + +where X is the card number from 0 to 7. + +(NOTE: Some distributions have the device files like /dev/midi0 and + /dev/midi1. They are NOT for OSS but for tclmidi, which is + a totally different thing.) + +Unlike the real OSS, ALSA cannot use the device files more than the +assigned ones. For example, the first card cannot use /dev/dsp1 or +/dev/dsp2, but only /dev/dsp0 and /dev/adsp0. + +As seen above, PCM and MIDI may have two devices. Usually, the first +PCM device (hw:0,0 in ALSA) is mapped to /dev/dsp and the secondary +device (hw:0,1) to /dev/adsp (if available). For MIDI, /dev/midi and +/dev/amidi, respectively. + +You can change this device mapping via the module options of +snd-pcm-oss and snd-rawmidi. In the case of PCM, the following +options are available for snd-pcm-oss: + + dsp_map PCM device number assigned to /dev/dspX + (default = 0) + adsp_map PCM device number assigned to /dev/adspX + (default = 1) + +For example, to map the third PCM device (hw:0,2) to /dev/adsp0, +define like this: + + options snd-pcm-oss adsp_map=2 + +The options take arrays. For configuring the second card, specify +two entries separated by comma. For example, to map the third PCM +device on the second card to /dev/adsp1, define like below: + + options snd-pcm-oss adsp_map=0,2 + +To change the mapping of MIDI devices, the following options are +available for snd-rawmidi: + + midi_map MIDI device number assigned to /dev/midi0X + (default = 0) + amidi_map MIDI device number assigned to /dev/amidi0X + (default = 1) + +For example, to assign the third MIDI device on the first card to +/dev/midi00, define as follows: + + options snd-rawmidi midi_map=2 + + +PCM Mode +======== + +As default, ALSA emulates the OSS PCM with so-called plugin layer, +i.e. tries to convert the sample format, rate or channels +automatically when the card doesn't support it natively. +This will lead to some problems for some applications like quake or +wine, especially if they use the card only in the MMAP mode. + +In such a case, you can change the behavior of PCM per application by +writing a command to the proc file. There is a proc file for each PCM +stream, /proc/asound/cardX/pcmY[cp]/oss, where X is the card number +(zero-based), Y the PCM device number (zero-based), and 'p' is for +playback and 'c' for capture, respectively. Note that this proc file +exists only after snd-pcm-oss module is loaded. + +The command sequence has the following syntax: + + app_name fragments fragment_size [options] + +app_name is the name of application with (higher priority) or without +path. +fragments specifies the number of fragments or zero if no specific +number is given. +fragment_size is the size of fragment in bytes or zero if not given. +options is the optional parameters. The following options are +available: + + disable the application tries to open a pcm device for + this channel but does not want to use it. + direct don't use plugins + block force block open mode + non-block force non-block open mode + +The disable option is useful when one stream direction (playback or +capture) is not handled correctly by the application although the +hardware itself does support both directions. +The direct option is used, as mentioned above, to bypass the automatic +conversion and useful for MMAP-applications. +For example, to playback the first PCM device without plugins for +quake, send a command via echo like the following: + + % echo "quake 0 0 direct" > /proc/asound/card0/pcm0p/oss + +While quake wants only playback, you may append the second command +to notify driver that only this direction is about to be allocated: + + % echo "quake 0 0 disable" > /proc/asound/card0/pcm0c/oss + +The permission of proc files depend on the module options of snd. +As default it's set as root, so you'll likely need to be superuser for +sending the command above. + +The block and non-block options are used to change the behavior of +opening the device file. +As default, ALSA behaves as defined in POSIX, i.e. blocks the file +when it's busy until the device becomes free (unless O_NONBLOCK is +specified). Some applications assume the non-block open behavior, +which are actually implemented in some real OSS drivers. + +This blocking behavior can be changed globally via nonblock_open +module option of snd-pcm-oss. For using the non-block mode as default +for OSS devices, define like the following: + + options snd-pcm-oss nonblock_open=1 + +You can check the currently defined configuration by reading the proc +file. The read image can be sent to the proc file again, hence you +can save the current configuration + + % cat /proc/asound/card0/pcm0p/oss > /somewhere/oss-cfg + +and restore it like + + % cat /somewhere/oss-cfg > /proc/asound/card0/pcm0p/oss + +Also, for clearing all the current configuration, send "erase" command +as below: + + % echo "erase" > /proc/asound/card0/pcm0p/oss + + +Mixer Elements +============== + +Since ALSA has completely different mixer interface, the emulation of +OSS mixer is relatively complicated. ALSA builds up a mixer element +from several different ALSA (mixer) controls based on the name +string. For example, the volume element SOUND_MIXER_PCM is composed +from "PCM Playback Volume" and "PCM Playback Switch" controls for the +playback direction and from "PCM Capture Volume" and "PCM Capture +Switch" for the capture directory (if exists). When the PCM volume of +OSS is changed, all the volume and switch controls above are adjusted +automatically. + +As default, ALSA uses the following control for OSS volumes: + + OSS volume ALSA control Index + ----------------------------------------------------- + SOUND_MIXER_VOLUME Master 0 + SOUND_MIXER_BASS Tone Control - Bass 0 + SOUND_MIXER_TREBLE Tone Control - Treble 0 + SOUND_MIXER_SYNTH Synth 0 + SOUND_MIXER_PCM PCM 0 + SOUND_MIXER_SPEAKER PC Speaker 0 + SOUND_MIXER_LINE Line 0 + SOUND_MIXER_MIC Mic 0 + SOUND_MIXER_CD CD 0 + SOUND_MIXER_IMIX Monitor Mix 0 + SOUND_MIXER_ALTPCM PCM 1 + SOUND_MIXER_RECLEV (not assigned) + SOUND_MIXER_IGAIN Capture 0 + SOUND_MIXER_OGAIN Playback 0 + SOUND_MIXER_LINE1 Aux 0 + SOUND_MIXER_LINE2 Aux 1 + SOUND_MIXER_LINE3 Aux 2 + SOUND_MIXER_DIGITAL1 Digital 0 + SOUND_MIXER_DIGITAL2 Digital 1 + SOUND_MIXER_DIGITAL3 Digital 2 + SOUND_MIXER_PHONEIN Phone 0 + SOUND_MIXER_PHONEOUT Phone 1 + SOUND_MIXER_VIDEO Video 0 + SOUND_MIXER_RADIO Radio 0 + SOUND_MIXER_MONITOR Monitor 0 + +The second column is the base-string of the corresponding ALSA +control. In fact, the controls with "XXX [Playback|Capture] +[Volume|Switch]" will be checked in addition. + +The current assignment of these mixer elements is listed in the proc +file, /proc/asound/cardX/mixer_oss, which will be like the following + + VOLUME "Master" 0 + BASS "" 0 + TREBLE "" 0 + SYNTH "" 0 + PCM "PCM" 0 + ... + +where the first column is the OSS volume element, the second column +the base-string of the corresponding ALSA control, and the third the +control index. When the string is empty, it means that the +corresponding OSS control is not available. + +For changing the assignment, you can write the configuration to this +proc file. For example, to map "Wave Playback" to the PCM volume, +send the command like the following: + + % echo 'VOLUME "Wave Playback" 0' > /proc/asound/card0/mixer_oss + +The command is exactly as same as listed in the proc file. You can +change one or more elements, one volume per line. In the last +example, both "Wave Playback Volume" and "Wave Playback Switch" will +be affected when PCM volume is changed. + +Like the case of PCM proc file, the permission of proc files depend on +the module options of snd. you'll likely need to be superuser for +sending the command above. + +As well as in the case of PCM proc file, you can save and restore the +current mixer configuration by reading and writing the whole file +image. + + +Unsupported Features +==================== + +MMAP on ICE1712 driver +---------------------- +ICE1712 supports only the unconventional format, interleaved +10-channels 24bit (packed in 32bit) format. Therefore you cannot mmap +the buffer as the conventional (mono or 2-channels, 8 or 16bit) format +on OSS. + +USB devices +----------- +Some USB devices support only 24bit format packed in 3bytes. This +format is not supported by OSS and no conversion is provided by kernel +OSS emulation. You can use the user-space OSS emulation via libaoss +instead. + diff -Nru a/Documentation/sparc/sbus_drivers.txt b/Documentation/sparc/sbus_drivers.txt --- a/Documentation/sparc/sbus_drivers.txt Sun Feb 9 21:13:30 2003 +++ b/Documentation/sparc/sbus_drivers.txt Sun Feb 9 21:13:30 2003 @@ -208,7 +208,7 @@ char *mem; /* Address in the CPU space */ u32 busa; /* Address in the SBus space */ - mem = (char *) sbus_alloc_consistant(sdev, MYMEMSIZE, &busa); + mem = (char *) sbus_alloc_consistent(sdev, MYMEMSIZE, &busa); Then mem is used when CPU accesses this memory and u32 is fed to the device so that it can do DVMA. This is typically @@ -216,7 +216,7 @@ Do not forget to free the DVMA resources once you are done: - sbus_free_consistant(sdev, MYMEMSIZE, mem, busa); + sbus_free_consistent(sdev, MYMEMSIZE, mem, busa); Streaming DVMA is more interesting. First you allocate some memory suitable for it or pin down some user pages. Then it all works diff -Nru a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt --- a/Documentation/sysctl/kernel.txt Sun Feb 9 21:13:32 2003 +++ b/Documentation/sysctl/kernel.txt Sun Feb 9 21:13:32 2003 @@ -222,7 +222,7 @@ printk: The four values in printk denote: console_loglevel, -default_message_loglevel, minimum_console_level and +default_message_loglevel, minimum_console_loglevel and default_console_loglevel respectively. These values influence printk() behavior when printing or diff -Nru a/Documentation/tipar.txt b/Documentation/tipar.txt --- a/Documentation/tipar.txt Sun Feb 9 21:13:28 2003 +++ b/Documentation/tipar.txt Sun Feb 9 21:13:28 2003 @@ -12,7 +12,7 @@ This is a driver for the very common home-made parallel link cable, a cable designed for connecting TI8x/9x graphing calculators (handhelds) to a computer or workstation (Alpha, Sparc). Given that driver is built on parport, the -parallel port abstraction layer, this driver is independant of the platform. +parallel port abstraction layer, this driver is independent of the platform. It can also be used with another device plugged on the same port (such as a ZIP drive). I have a 100MB ZIP and both of them work fine ! @@ -90,4 +90,4 @@ CREDITS: The code is based on tidev.c & parport.c. -The driver has been developed independantly of Texas Instruments. +The driver has been developed independently of Texas Instruments. diff -Nru a/Documentation/usb/hiddev.txt b/Documentation/usb/hiddev.txt --- a/Documentation/usb/hiddev.txt Sun Feb 9 21:13:30 2003 +++ b/Documentation/usb/hiddev.txt Sun Feb 9 21:13:30 2003 @@ -9,7 +9,7 @@ supplies) and monitor control on higher end monitors. To support these disparite requirements, the Linux USB system provides -HID events to two seperate interfaces: +HID events to two separate interfaces: * the input subsystem, which converts HID events into normal input device interfaces (such as keyboard, mouse and joystick) and a normalised event interface - see Documentation/input/input.txt diff -Nru a/Documentation/usb/silverlink.txt b/Documentation/usb/silverlink.txt --- a/Documentation/usb/silverlink.txt Sun Feb 9 21:13:30 2003 +++ b/Documentation/usb/silverlink.txt Sun Feb 9 21:13:30 2003 @@ -73,4 +73,4 @@ CREDITS: The code is based on dabusb.c, printer.c and scanner.c ! -The driver has been developed independantly of Texas Instruments. +The driver has been developed independently of Texas Instruments. diff -Nru a/MAINTAINERS b/MAINTAINERS --- a/MAINTAINERS Sun Feb 9 21:13:33 2003 +++ b/MAINTAINERS Sun Feb 9 21:13:33 2003 @@ -614,11 +614,9 @@ S: Maintained ETHERNET BRIDGE -P: Lennert Buytenhek -M: buytenh@gnu.org L: bridge@math.leidenuniv.nl W: http://bridge.sourceforge.net/ -S: Maintained +S: Unmaintained ETHERTEAM 16I DRIVER P: Mika Kuoppala diff -Nru a/Makefile b/Makefile --- a/Makefile Sun Feb 9 21:13:29 2003 +++ b/Makefile Sun Feb 9 21:13:29 2003 @@ -53,6 +53,8 @@ CROSS_COMPILE = # That's our default target when none is given on the command line +# Note that 'modules' will be added as a prerequisite as well, +# in the CONFIG_MODULES part below all: vmlinux @@ -183,6 +185,8 @@ export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE +export MODVERDIR := .tmp_versions + # The temporary file to save gcc -MD generated dependencies must not # contain a comma depfile = $(subst $(comma),_,$(@D)/.$(@F).d) @@ -190,7 +194,7 @@ noconfig_targets := xconfig menuconfig config oldconfig randconfig \ defconfig allyesconfig allnoconfig allmodconfig \ clean mrproper distclean \ - help tags TAGS sgmldocs psdocs pdfdocs htmldocs \ + help tags TAGS cscope sgmldocs psdocs pdfdocs htmldocs \ checkconfig checkhelp checkincludes RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \) -prune -o @@ -256,14 +260,22 @@ -include .config.cmd -ifdef CONFIG_MODULES -export EXPORT_FLAGS := -DEXPORT_SYMTAB -endif - ifndef CONFIG_FRAME_POINTER CFLAGS += -fomit-frame-pointer endif +# When we're building modules with modversions, we need to consider +# the built-in objects during the descend as well, in order to +# make sure the checksums are uptodate before we record them. + +ifdef CONFIG_MODVERSIONS +ifeq ($(KBUILD_MODULES),1) +ifneq ($(KBUILD_BUILTIN),1) + KBUILD_BUILTIN := 1 +endif +endif +endif + # # INSTALL_PATH specifies where to place the updated kernel and system map # images. Uncomment if you want to place them anywhere other than root. @@ -289,12 +301,12 @@ # normal descending-into-subdirs phase, since at that time # we cannot yet know if we will need to relink vmlinux. # So we descend into init/ inside the rule for vmlinux again. - -vmlinux-objs := $(HEAD) $(init-y) $(core-y) $(libs-y) $(drivers-y) $(net-y) +head-y += $(HEAD) +vmlinux-objs := $(head-y) $(init-y) $(core-y) $(libs-y) $(drivers-y) $(net-y) quiet_cmd_vmlinux__ = LD $@ define cmd_vmlinux__ - $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) $(HEAD) $(init-y) \ + $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) $(head-y) $(init-y) \ --start-group \ $(core-y) \ $(libs-y) \ @@ -384,7 +396,7 @@ # Handle descending into subdirectories listed in $(SUBDIRS) .PHONY: $(SUBDIRS) -$(SUBDIRS): .hdepend prepare +$(SUBDIRS): prepare $(Q)$(MAKE) $(build)=$@ # Things we need done before we descend to build or make @@ -392,6 +404,17 @@ .PHONY: prepare prepare: include/linux/version.h include/asm include/config/MARKER +ifdef CONFIG_MODVERSIONS +ifdef KBUILD_MODULES +ifeq ($(origin SUBDIRS),file) + $(Q)rm -rf $(MODVERDIR) + $(Q)mkdir $(MODVERDIR) +else + @echo '*** Warning: Overriding SUBDIRS on the command line can cause' + @echo '*** inconsistencies with module symbol versions' +endif +endif +endif @echo ' Starting the build. KBUILD_BUILTIN=$(KBUILD_BUILTIN) KBUILD_MODULES=$(KBUILD_MODULES)' # We need to build init/vermagic.o before descending since all modules @@ -424,6 +447,8 @@ $(Q)$(MAKE) $(build)=$(@D) $@ %.o: %.c scripts FORCE $(Q)$(MAKE) $(build)=$(@D) $@ +%/: scripts prepare FORCE + $(Q)$(MAKE) $(build)=$(@D) %.ko: scripts FORCE $(Q)$(MAKE) $(build)=$(@D) $@ %.lst: %.c scripts FORCE @@ -475,75 +500,33 @@ ) > $@.tmp @$(update-if-changed) -# Generate module versions # --------------------------------------------------------------------------- -# The targets are still named depend / dep for traditional -# reasons, but the only thing we do here is generating -# the module version checksums. - -.PHONY: depend dep $(patsubst %,_sfdep_%,$(SUBDIRS)) - -depend dep: .hdepend - -# .hdepend is our (misnomed) marker for whether we've -# generated module versions - -make-versions := $(strip $(if $(filter dep depend,$(MAKECMDGOALS)),1) \ - $(if $(wildcard .hdepend),,1)) - -.hdepend: prepare FORCE -ifneq ($(make-versions),) - @$(MAKE) include/linux/modversions.h - @touch $@ -endif - -ifdef CONFIG_MODVERSIONS - -# Update modversions.h, but only if it would change. - -.PHONY: __rm_tmp_export-objs -__rm_tmp_export-objs: - @rm -rf .tmp_export-objs - -include/linux/modversions.h: $(patsubst %,_modver_%,$(SUBDIRS)) - @echo -n ' Generating $@' - @( echo "#ifndef _LINUX_MODVERSIONS_H";\ - echo "#define _LINUX_MODVERSIONS_H"; \ - echo "#include "; \ - cd .tmp_export-objs >/dev/null; \ - for f in `find modules -name \*.ver -print | sort`; do \ - echo "#include "; \ - done; \ - echo "#endif"; \ - ) > $@.tmp; \ - $(update-if-changed) - -.PHONY: $(patsubst %, _modver_%, $(SUBDIRS)) -$(patsubst %, _modver_%, $(SUBDIRS)): __rm_tmp_export-objs - $(Q)$(MAKE) -f scripts/Makefile.modver obj=$(patsubst _modver_%,%,$@) - -else # !CONFIG_MODVERSIONS - -.PHONY: include/linux/modversions.h - -include/linux/modversions.h: - -endif # CONFIG_MODVERSIONS +.PHONY: depend dep +depend dep: + @echo '*** Warning: make $@ is unnecessary now.' # --------------------------------------------------------------------------- # Modules ifdef CONFIG_MODULES +# By default, build modules as well + +all: modules + # Build modules +.PHONY: modules __modversions +modules: $(SUBDIRS) __modversions + ifdef CONFIG_MODVERSIONS -MODFLAGS += -include include/linux/modversions.h -endif -.PHONY: modules -modules: $(SUBDIRS) +__modversions: vmlinux $(SUBDIRS) + @echo ' Recording module symbol versions.'; + $(Q)$(MAKE) -rR -f scripts/Makefile.modver + +endif # Install modules @@ -574,6 +557,7 @@ .PHONY: $(patsubst %, _modinst_%, $(SUBDIRS)) $(patsubst %, _modinst_%, $(SUBDIRS)) : $(Q)$(MAKE) -rR -f scripts/Makefile.modinst obj=$(patsubst _modinst_%,%,$@) + else # CONFIG_MODULES # Modules not configured @@ -624,7 +608,7 @@ rpm: clean spec find . $(RCS_FIND_IGNORE) \ - \( -size 0 -o -name .depend -o -name .hdepend \) \ + \( -size 0 -o -name .depend -o -name .hdepend\) \ -type f -print | xargs rm -f set -e; \ cd $(TOPDIR)/.. ; \ @@ -718,25 +702,26 @@ .menuconfig.log \ include/asm \ .hdepend include/linux/modversions.h \ - tags TAGS kernel.spec \ + tags TAGS cscope kernel.spec \ .tmp* # Directories removed with 'make mrproper' MRPROPER_DIRS += \ + $(MODVERDIR) \ .tmp_export-objs \ include/config \ include/linux/modules # clean - Delete all intermediate files # -clean-dirs += $(ALL_SUBDIRS) Documentation/DocBook scripts - -$(addprefix _clean_,$(clean-dirs)): +clean-dirs += $(addprefix _clean_,$(ALL_SUBDIRS) Documentation/DocBook scripts) +.PHONY: $(clean-dirs) clean archclean mrproper archmrproper distclean +$(clean-dirs): $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) quiet_cmd_rmclean = RM $$(CLEAN_FILES) cmd_rmclean = rm -f $(CLEAN_FILES) -clean: archclean $(addprefix _clean_,$(clean-dirs)) +clean: archclean $(clean-dirs) $(call cmd,rmclean) @find . $(RCS_FIND_IGNORE) \ \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ @@ -775,6 +760,9 @@ -name '*.[chS]' -print ) endef +quiet_cmd_cscope = MAKE $@ +cmd_cscope = $(all-sources) | cscope -k -b -i - + quiet_cmd_TAGS = MAKE $@ cmd_TAGS = $(all-sources) | etags - @@ -786,6 +774,9 @@ CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \ $(all-sources) | xargs ctags $$CTAGSF -a endef + +cscope: FORCE + $(call cmd,cscope) TAGS: FORCE $(call cmd,TAGS) diff -Nru a/arch/alpha/Kconfig b/arch/alpha/Kconfig --- a/arch/alpha/Kconfig Sun Feb 9 21:13:34 2003 +++ b/arch/alpha/Kconfig Sun Feb 9 21:13:34 2003 @@ -458,6 +458,11 @@ If unsure, say N. +config EARLY_PRINTK + bool + depends on ALPHA_GENERIC || ALPHA_SRM + default y + config ALPHA_EISA bool depends on ALPHA_ALCOR || ALPHA_MIKASA || ALPHA_SABLE || ALPHA_NORITAKE || ALPHA_RAWHIDE @@ -630,7 +635,7 @@ of course). This driver is also available as a module and will be called - srm_env.o then. + srm_env then. config BINFMT_AOUT tristate "Kernel support for a.out (ECOFF) binaries" @@ -650,7 +655,7 @@ QMAGIC support" then you'll have to say Y here. You may answer M to compile a.out support as a module and later load the module when you want to use a program or library in a.out format. The module will be - called binfmt_aout.o. Saying M or N here is dangerous though, + called binfmt_aout. Saying M or N here is dangerous though, because some crucial programs on your system might still be in A.OUT format. @@ -688,7 +693,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called binfmt_elf.o. Saying M or N here is dangerous because + will be called binfmt_elf. Saying M or N here is dangerous because some crucial programs on your system might be in ELF format. config BINFMT_MISC @@ -713,7 +718,7 @@ use this part of the kernel. You may say M here for module support and later load the module when - you have use for it; the module is called binfmt_misc.o. If you + you have use for it; the module is called binfmt_misc. If you don't know what to answer at this point, say Y. config BINFMT_EM86 @@ -728,7 +733,7 @@ You may answer M to compile the emulation support as a module and later load the module when you want to use a Linux/Intel binary. The - module will be called binfmt_em86.o. If unsure, say Y. + module will be called binfmt_em86. If unsure, say Y. source "drivers/parport/Kconfig" @@ -785,7 +790,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called ide.o. + will be called ide. For further information, please read . @@ -821,7 +826,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called scsi_mod.o. If you want to compile it as + The module will be called scsi_mod. If you want to compile it as a module, say M here and read and . However, do not compile this as a module if your root file system (the one containing the directory /) @@ -915,7 +920,7 @@ and load that module after the PnP configuration is finished. To do this, say M here and read as well as ; the module will be - called soundcore.o. + called soundcore. I'm told that even without a sound card, you can make your computer say more than an occasional beep, by programming the PC speaker. diff -Nru a/arch/alpha/Makefile b/arch/alpha/Makefile --- a/arch/alpha/Makefile Sun Feb 9 21:13:33 2003 +++ b/arch/alpha/Makefile Sun Feb 9 21:13:33 2003 @@ -90,7 +90,7 @@ # BWX is most important, but we don't really want any emulation ever. CFLAGS += $(cflags-y) -Wa,-mev6 -HEAD := arch/alpha/kernel/head.o +head-y := arch/alpha/kernel/head.o core-y += arch/alpha/kernel/ arch/alpha/mm/ core-$(CONFIG_MATHEMU) += arch/alpha/math-emu/ @@ -124,8 +124,6 @@ archclean: $(Q)$(MAKE) -f scripts/Makefile.clean obj=$(boot) - -archmrproper: CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h.tmp \ include/asm-$(ARCH)/asm_offsets.h diff -Nru a/arch/alpha/kernel/Makefile b/arch/alpha/kernel/Makefile --- a/arch/alpha/kernel/Makefile Sun Feb 9 21:13:31 2003 +++ b/arch/alpha/kernel/Makefile Sun Feb 9 21:13:31 2003 @@ -6,8 +6,6 @@ EXTRA_AFLAGS := $(CFLAGS) -export-objs := alpha_ksyms.o core_marvel.o core_titan.o - obj-y := entry.o traps.o process.o init_task.o osf_sys.o irq.o \ irq_alpha.o signal.o setup.o ptrace.o time.o semaphore.o \ alpha_ksyms.o systbls.o err_common.o @@ -35,7 +33,12 @@ obj-y += es1888.o smc37c669.o smc37c93x.o ns87312.o gct.o +obj-y += srmcons.o + else + +# Misc support +obj-$(CONFIG_ALPHA_SRM) += srmcons.o # Core logic support obj-$(CONFIG_ALPHA_APECS) += core_apecs.o diff -Nru a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c --- a/arch/alpha/kernel/alpha_ksyms.c Sun Feb 9 21:13:28 2003 +++ b/arch/alpha/kernel/alpha_ksyms.c Sun Feb 9 21:13:28 2003 @@ -40,7 +40,6 @@ extern struct hwrpb_struct *hwrpb; extern void dump_thread(struct pt_regs *, struct user *); -extern int dump_fpu(struct pt_regs *, elf_fpregset_t *); extern spinlock_t rtc_lock; /* these are C runtime functions with special calling conventions: */ @@ -144,7 +143,9 @@ #endif EXPORT_SYMBOL(dump_thread); -EXPORT_SYMBOL(dump_fpu); +EXPORT_SYMBOL(dump_elf_thread); +EXPORT_SYMBOL(dump_elf_task); +EXPORT_SYMBOL(dump_elf_task_fp); EXPORT_SYMBOL(hwrpb); EXPORT_SYMBOL(start_thread); EXPORT_SYMBOL(alpha_read_fp_reg); diff -Nru a/arch/alpha/kernel/core_irongate.c b/arch/alpha/kernel/core_irongate.c --- a/arch/alpha/kernel/core_irongate.c Sun Feb 9 21:13:34 2003 +++ b/arch/alpha/kernel/core_irongate.c Sun Feb 9 21:13:34 2003 @@ -27,13 +27,11 @@ #include #undef __EXTERN_INLINE +#include + #include "proto.h" #include "pci_impl.h" -#undef DEBUG_IRONGATE /* define to enable verbose Irongate debug */ - -#define IRONGATE_DEFAULT_AGP_APER_SIZE (256*1024*1024) /* 256MB */ - /* * BIOS32-style PCI interface: */ @@ -46,6 +44,7 @@ # define DBG_CFG(args) #endif +igcsr32 *IronECC; /* * Given a bus, device, and function number, compute resulting @@ -165,143 +164,6 @@ .write = irongate_write_config, }; -#ifdef DEBUG_IRONGATE -static void -irongate_register_dump(const char *function_name) -{ - printk("%s: Irongate registers:\n" - "\tFunction 0:\n" - "\tdev_vendor\t0x%08x\n" - "\tstat_cmd\t0x%08x\n" - "\tclass\t\t0x%08x\n" - "\tlatency\t\t0x%08x\n" - "\tbar0\t\t0x%08x\n" - "\tbar1\t\t0x%08x\n" - "\tbar2\t\t0x%08x\n" - "\trsrvd0[0]\t0x%08x\n" - "\trsrvd0[1]\t0x%08x\n" - "\trsrvd0[2]\t0x%08x\n" - "\trsrvd0[3]\t0x%08x\n" - "\trsrvd0[4]\t0x%08x\n" - "\trsrvd0[5]\t0x%08x\n" - "\tcapptr\t\t0x%08x\n" - "\trsrvd1[0]\t0x%08x\n" - "\trsrvd1[1]\t0x%08x\n" - "\tbacsr10\t\t0x%08x\n" - "\tbacsr32\t\t0x%08x\n" - "\tbacsr54\t\t0x%08x\n" - "\trsrvd2[0]\t0x%08x\n" - "\tdrammap\t\t0x%08x\n" - "\tdramtm\t\t0x%08x\n" - "\tdramms\t\t0x%08x\n" - "\trsrvd3[0]\t0x%08x\n" - "\tbiu0\t\t0x%08x\n" - "\tbiusip\t\t0x%08x\n" - "\trsrvd4[0]\t0x%08x\n" - "\trsrvd4[1]\t0x%08x\n" - "\tmro\t\t0x%08x\n" - "\trsrvd5[0]\t0x%08x\n" - "\trsrvd5[1]\t0x%08x\n" - "\trsrvd5[2]\t0x%08x\n" - "\twhami\t\t0x%08x\n" - "\tpciarb\t\t0x%08x\n" - "\tpcicfg\t\t0x%08x\n" - "\trsrvd6[0]\t0x%08x\n" - "\trsrvd6[1]\t0x%08x\n" - "\trsrvd6[2]\t0x%08x\n" - "\trsrvd6[3]\t0x%08x\n" - "\trsrvd6[4]\t0x%08x\n" - "\tagpcap\t\t0x%08x\n" - "\tagpstat\t\t0x%08x\n" - "\tagpcmd\t\t0x%08x\n" - "\tagpva\t\t0x%08x\n" - "\tagpmode\t\t0x%08x\n" - - "\n\tFunction 1:\n" - "\tdev_vendor:\t0x%08x\n" - "\tcmd_status:\t0x%08x\n" - "\trevid_etc :\t0x%08x\n" - "\thtype_etc :\t0x%08x\n" - "\trsrvd0[0] :\t0x%08x\n" - "\trsrvd0[1] :\t0x%08x\n" - "\tbus_nmbers:\t0x%08x\n" - "\tio_baselim:\t0x%08x\n" - "\tmem_bselim:\t0x%08x\n" - "\tpf_baselib:\t0x%08x\n" - "\trsrvd1[0] :\t0x%08x\n" - "\trsrvd1[1] :\t0x%08x\n" - "\tio_baselim:\t0x%08x\n" - "\trsrvd2[0] :\t0x%08x\n" - "\trsrvd2[1] :\t0x%08x\n" - "\tinterrupt :\t0x%08x\n", - - function_name, - IRONGATE0->dev_vendor, - IRONGATE0->stat_cmd, - IRONGATE0->class, - IRONGATE0->latency, - IRONGATE0->bar0, - IRONGATE0->bar1, - IRONGATE0->bar2, - IRONGATE0->rsrvd0[0], - IRONGATE0->rsrvd0[1], - IRONGATE0->rsrvd0[2], - IRONGATE0->rsrvd0[3], - IRONGATE0->rsrvd0[4], - IRONGATE0->rsrvd0[5], - IRONGATE0->capptr, - IRONGATE0->rsrvd1[0], - IRONGATE0->rsrvd1[1], - IRONGATE0->bacsr10, - IRONGATE0->bacsr32, - IRONGATE0->bacsr54, - IRONGATE0->rsrvd2[0], - IRONGATE0->drammap, - IRONGATE0->dramtm, - IRONGATE0->dramms, - IRONGATE0->rsrvd3[0], - IRONGATE0->biu0, - IRONGATE0->biusip, - IRONGATE0->rsrvd4[0], - IRONGATE0->rsrvd4[1], - IRONGATE0->mro, - IRONGATE0->rsrvd5[0], - IRONGATE0->rsrvd5[1], - IRONGATE0->rsrvd5[2], - IRONGATE0->whami, - IRONGATE0->pciarb, - IRONGATE0->pcicfg, - IRONGATE0->rsrvd6[0], - IRONGATE0->rsrvd6[1], - IRONGATE0->rsrvd6[2], - IRONGATE0->rsrvd6[3], - IRONGATE0->rsrvd6[4], - IRONGATE0->agpcap, - IRONGATE0->agpstat, - IRONGATE0->agpcmd, - IRONGATE0->agpva, - IRONGATE0->agpmode, - IRONGATE1->dev_vendor, - IRONGATE1->stat_cmd, - IRONGATE1->class, - IRONGATE1->htype, - IRONGATE1->rsrvd0[0], - IRONGATE1->rsrvd0[1], - IRONGATE1->busnos, - IRONGATE1->io_baselim_regs, - IRONGATE1->mem_baselim, - IRONGATE1->pfmem_baselim, - IRONGATE1->rsrvd1[0], - IRONGATE1->rsrvd1[1], - IRONGATE1->io_baselim, - IRONGATE1->rsrvd2[0], - IRONGATE1->rsrvd2[1], - IRONGATE1->interrupt ); -} -#else -#define irongate_register_dump(x) -#endif - int irongate_pci_clr_err(void) { @@ -315,11 +177,11 @@ mb(); IRONGATE_jd = IRONGATE0->stat_cmd; /* re-read to force write */ - IRONGATE_jd = IRONGATE0->dramms; - printk("Iron dramms %x\n", IRONGATE_jd); - IRONGATE0->dramms = IRONGATE_jd; /* write again clears error bits */ + IRONGATE_jd = *IronECC; + printk("Iron ECC %x\n", IRONGATE_jd); + *IronECC = IRONGATE_jd; /* write again clears error bits */ mb(); - IRONGATE_jd = IRONGATE0->dramms; /* re-read to force write */ + IRONGATE_jd = *IronECC; /* re-read to force write */ /* Clear ALI NMI */ nmi_ctl = inb(0x61); @@ -328,28 +190,88 @@ nmi_ctl &= ~0x0c; outb(nmi_ctl, 0x61); - IRONGATE_jd = IRONGATE0->dramms; + IRONGATE_jd = *IronECC; if (IRONGATE_jd & 0x300) goto again; return 0; } +#define IRONGATE_3GB 0xc0000000UL + +/* On Albacore (aka UP1500) with 4Gb of RAM we have to reserve some + memory for PCI. At this point we just reserve memory above 3Gb. Most + of this memory will be freed after PCI setup is done. */ +static void __init +albacore_init_arch(void) +{ + unsigned long memtop = max_low_pfn << PAGE_SHIFT; + unsigned long pci_mem = (memtop + 0x1000000UL) & ~0xffffffUL; + struct percpu_struct *cpu; + int pal_rev, pal_var; + + cpu = (struct percpu_struct*)((char*)hwrpb + hwrpb->processor_offset); + pal_rev = cpu->pal_revision & 0xffff; + pal_var = (cpu->pal_revision >> 16) & 0xff; + + /* Consoles earlier than A5.6-18 (OSF PALcode v1.62-2) set up + the CPU incorrectly (leave speculative stores enabled), + which causes memory corruption under certain conditions. + Issue a warning for such consoles. */ + if (alpha_using_srm && + (pal_rev < 0x13e || (pal_rev == 0x13e && pal_var < 2))) + printk(KERN_WARNING "WARNING! Upgrade to SRM A5.6-19 " + "or later\n"); + + if (pci_mem > IRONGATE_3GB) + pci_mem = IRONGATE_3GB; + IRONGATE0->pci_mem = pci_mem; + alpha_mv.min_mem_address = pci_mem; + if (memtop > pci_mem) { +#ifdef CONFIG_BLK_DEV_INITRD + extern unsigned long initrd_start, initrd_end; + extern void *move_initrd(unsigned long); + + /* Move the initrd out of the way. */ + if (initrd_end && __pa(initrd_end) > pci_mem) { + unsigned long size; + + size = initrd_end - initrd_start; + free_bootmem(__pa(initrd_start), PAGE_ALIGN(size)); + if (!move_initrd(pci_mem)) + printk("irongate_init_arch: initrd too big " + "(%ldK)\ndisabling initrd\n", + size / 1024); + } +#endif + reserve_bootmem(pci_mem, memtop - pci_mem); + printk("irongate_init_arch: temporarily reserving " + "region %08lx-%08lx for PCI\n", pci_mem, memtop - 1); + } +} + +static void __init +irongate_setup_agp(void) +{ + /* Disable the GART window. AGPGART doesn't work due to yet + unresolved memory coherency issues... */ + IRONGATE0->agpva = IRONGATE0->agpva & ~0xf; + alpha_agpgart_size = 0; +} + void __init irongate_init_arch(void) { struct pci_controller *hose; + int amd761 = (IRONGATE0->dev_vendor >> 16) > 0x7006; /* Albacore? */ + + IronECC = amd761 ? &IRONGATE0->bacsr54_eccms761 : &IRONGATE0->dramms; - IRONGATE0->stat_cmd = IRONGATE0->stat_cmd & ~0x100; irongate_pci_clr_err(); - irongate_register_dump(__FUNCTION__); - /* - * HACK: set AGP aperture size to 256MB. - * This should really be changed during PCI probe, when the - * size of the aperture the AGP card wants is known. - */ - printk("irongate_init_arch: AGPVA was 0x%x\n", IRONGATE0->agpva); - IRONGATE0->agpva = (IRONGATE0->agpva & ~0x0000000f) | 0x00000007; + if (amd761) + albacore_init_arch(); + + irongate_setup_agp(); /* * Create our single hose. @@ -380,89 +302,9 @@ * IO map and AGP support */ #include -#include - -static inline void -irongate_remap_area_pte(pte_t * pte, unsigned long address, unsigned long size, - unsigned long phys_addr, unsigned long flags) -{ - unsigned long end; - unsigned long pfn; - - address &= ~PMD_MASK; - end = address + size; - if (end > PMD_SIZE) - end = PMD_SIZE; - if (address >= end) - BUG(); - pfn = phys_addr >> PAGE_SHIFT; - do { - if (!pte_none(*pte)) { - printk("irongate_remap_area_pte: page already exists\n"); - BUG(); - } - set_pte(pte, pfn_pte(pfn, - __pgprot(_PAGE_VALID | _PAGE_ASM | - _PAGE_KRE | _PAGE_KWE | flags))); - address += PAGE_SIZE; - pfn++; - pte++; - } while (address && (address < end)); -} - -static inline int -irongate_remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size, - unsigned long phys_addr, unsigned long flags) -{ - unsigned long end; - - address &= ~PGDIR_MASK; - end = address + size; - if (end > PGDIR_SIZE) - end = PGDIR_SIZE; - phys_addr -= address; - if (address >= end) - BUG(); - do { - pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address); - if (!pte) - return -ENOMEM; - irongate_remap_area_pte(pte, address, end - address, - address + phys_addr, flags); - address = (address + PMD_SIZE) & PMD_MASK; - pmd++; - } while (address && (address < end)); - return 0; -} - -static int -irongate_remap_area_pages(unsigned long address, unsigned long phys_addr, - unsigned long size, unsigned long flags) -{ - pgd_t * dir; - unsigned long end = address + size; - - phys_addr -= address; - dir = pgd_offset(&init_mm, address); - flush_cache_all(); - if (address >= end) - BUG(); - do { - pmd_t *pmd; - pmd = pmd_alloc(&init_mm, dir, address); - if (!pmd) - return -ENOMEM; - if (irongate_remap_area_pmd(pmd, address, end - address, - phys_addr + address, flags)) - return -ENOMEM; - address = (address + PGDIR_SIZE) & PGDIR_MASK; - dir++; - } while (address && (address < end)); - return 0; -} - #include #include +#include #define GET_PAGE_DIR_OFF(addr) (addr >> 22) #define GET_PAGE_DIR_IDX(addr) (GET_PAGE_DIR_OFF(addr)) @@ -477,15 +319,13 @@ unsigned long vaddr; unsigned long baddr, last; u32 *mmio_regs, *gatt_pages, *cur_gatt, pte; - unsigned long gart_bus_addr, gart_aper_size; - - gart_bus_addr = (unsigned long)IRONGATE0->bar0 & - PCI_BASE_ADDRESS_MEM_MASK; + unsigned long gart_bus_addr; - if (!gart_bus_addr) /* FIXME - there must be a better way!!! */ + if (!alpha_agpgart_size) return addr + IRONGATE_MEM; - gart_aper_size = IRONGATE_DEFAULT_AGP_APER_SIZE; /* FIXME */ + gart_bus_addr = (unsigned long)IRONGATE0->bar0 & + PCI_BASE_ADDRESS_MEM_MASK; /* * Check for within the AGP aperture... @@ -495,7 +335,7 @@ * Check the AGP area */ if (addr >= gart_bus_addr && addr + size - 1 < - gart_bus_addr + gart_aper_size) + gart_bus_addr + alpha_agpgart_size) break; /* @@ -549,8 +389,8 @@ cur_gatt = phys_to_virt(GET_GATT(baddr) & ~1); pte = cur_gatt[GET_GATT_OFF(baddr)] & ~1; - if (irongate_remap_area_pages(VMALLOC_VMADDR(vaddr), - pte, PAGE_SIZE, 0)) { + if (__alpha_remap_area_pages(VMALLOC_VMADDR(vaddr), + pte, PAGE_SIZE, 0)) { printk("AGP ioremap: FAILED to map...\n"); vfree(area->addr); return (unsigned long)NULL; diff -Nru a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c --- a/arch/alpha/kernel/core_marvel.c Sun Feb 9 21:13:29 2003 +++ b/arch/alpha/kernel/core_marvel.c Sun Feb 9 21:13:29 2003 @@ -732,21 +732,6 @@ EXPORT_SYMBOL(marvel_ioremap); EXPORT_SYMBOL(marvel_iounmap); #endif - -/* - * SRMCons support - * - * Marvel doesn't have a real serial console -- it's either graphics or - * server management based. If we're running on the server management based - * console, allow the srmcons callback driver to be a console device. - */ -int -marvel_srmcons_allowed(void) -{ - u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset); - - return (pu64[7] == 2); -} /* @@ -874,8 +859,6 @@ #include #include -#define MARVEL_AGP_APER_SIZE (64 * 1024 * 1024) - struct marvel_agp_aperture { struct pci_iommu_arena *arena; long pg_start; @@ -887,11 +870,14 @@ { struct marvel_agp_aperture *aper; + if (!alpha_agpgart_size) + return -ENOMEM; + aper = kmalloc(sizeof(*aper), GFP_KERNEL); if (aper == NULL) return -ENOMEM; aper->arena = agp->hose->sg_pci; - aper->pg_count = MARVEL_AGP_APER_SIZE / PAGE_SIZE; + aper->pg_count = alpha_agpgart_size / PAGE_SIZE; aper->pg_start = iommu_reserve(aper->arena, aper->pg_count, aper->pg_count - 1); diff -Nru a/arch/alpha/kernel/core_titan.c b/arch/alpha/kernel/core_titan.c --- a/arch/alpha/kernel/core_titan.c Sun Feb 9 21:13:30 2003 +++ b/arch/alpha/kernel/core_titan.c Sun Feb 9 21:13:30 2003 @@ -580,8 +580,6 @@ #include #include -#define TITAN_AGP_APER_SIZE (64 * 1024 * 1024) - struct titan_agp_aperture { struct pci_iommu_arena *arena; long pg_start; @@ -593,12 +591,15 @@ { struct titan_agp_aperture *aper; + if (!alpha_agpgart_size) + return -ENOMEM; + aper = kmalloc(sizeof(struct titan_agp_aperture), GFP_KERNEL); if (aper == NULL) return -ENOMEM; aper->arena = agp->hose->sg_pci; - aper->pg_count = TITAN_AGP_APER_SIZE / PAGE_SIZE; + aper->pg_count = alpha_agpgart_size / PAGE_SIZE; aper->pg_start = iommu_reserve(aper->arena, aper->pg_count, aper->pg_count - 1); if (aper->pg_start < 0) { diff -Nru a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c --- a/arch/alpha/kernel/irq.c Sun Feb 9 21:13:35 2003 +++ b/arch/alpha/kernel/irq.c Sun Feb 9 21:13:35 2003 @@ -534,7 +534,7 @@ #else for (j = 0; j < NR_CPUS; j++) if (cpu_online(j)) - seq_printf(p, "%10u ", kstat_cpu(i).irqs[j]); + seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); #endif seq_printf(p, " %14s", irq_desc[i].handler->typename); seq_printf(p, " %c%s", diff -Nru a/arch/alpha/kernel/pci_impl.h b/arch/alpha/kernel/pci_impl.h --- a/arch/alpha/kernel/pci_impl.h Sun Feb 9 21:13:36 2003 +++ b/arch/alpha/kernel/pci_impl.h Sun Feb 9 21:13:36 2003 @@ -71,6 +71,8 @@ #define IRONGATE_DEFAULT_MEM_BASE ((256*8-16)*1024*1024) +#define DEFAULT_AGP_APER_SIZE (64*1024*1024) + /* * A small note about bridges and interrupts. The DECchip 21050 (and * later) adheres to the PCI-PCI bridge specification. This says that @@ -152,6 +154,8 @@ /* Indicate that we trust the console to configure things properly. */ extern int pci_probe_only; + +extern unsigned long alpha_agpgart_size; extern void common_init_pci(void); extern u8 common_swizzle(struct pci_dev *, u8 *); diff -Nru a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c --- a/arch/alpha/kernel/process.c Sun Feb 9 21:13:35 2003 +++ b/arch/alpha/kernel/process.c Sun Feb 9 21:13:35 2003 @@ -313,7 +313,7 @@ } /* - * fill in the user structure for a core dump.. + * Fill in the user structure for an ECOFF core dump. */ void dump_thread(struct pt_regs * pt, struct user * dump) @@ -373,12 +373,81 @@ memcpy((char *)dump->regs + EF_SIZE, sw->fp, 32 * 8); } -int -dump_fpu(struct pt_regs * regs, elf_fpregset_t *r) +/* + * Fill in the user structure for a ELF core dump. + */ +void +dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt, struct thread_info *ti) { /* switch stack follows right below pt_regs: */ - struct switch_stack * sw = ((struct switch_stack *) regs) - 1; - memcpy(r, sw->fp, 32 * 8); + struct switch_stack * sw = ((struct switch_stack *) pt) - 1; + + dest[ 0] = pt->r0; + dest[ 1] = pt->r1; + dest[ 2] = pt->r2; + dest[ 3] = pt->r3; + dest[ 4] = pt->r4; + dest[ 5] = pt->r5; + dest[ 6] = pt->r6; + dest[ 7] = pt->r7; + dest[ 8] = pt->r8; + dest[ 9] = sw->r9; + dest[10] = sw->r10; + dest[11] = sw->r11; + dest[12] = sw->r12; + dest[13] = sw->r13; + dest[14] = sw->r14; + dest[15] = sw->r15; + dest[16] = pt->r16; + dest[17] = pt->r17; + dest[18] = pt->r18; + dest[19] = pt->r19; + dest[20] = pt->r20; + dest[21] = pt->r21; + dest[22] = pt->r22; + dest[23] = pt->r23; + dest[24] = pt->r24; + dest[25] = pt->r25; + dest[26] = pt->r26; + dest[27] = pt->r27; + dest[28] = pt->r28; + dest[29] = pt->gp; + dest[30] = rdusp(); + dest[31] = pt->pc; + + /* Once upon a time this was the PS value. Which is stupid + since that is always 8 for usermode. Usurped for the more + useful value of the thread's UNIQUE field. */ + dest[32] = ti->pcb.unique; +} + +int +dump_elf_task(elf_greg_t *dest, struct task_struct *task) +{ + struct thread_info *ti; + struct pt_regs *pt; + + ti = task->thread_info; + pt = (struct pt_regs *)((unsigned long)ti + 2*PAGE_SIZE) - 1; + + dump_elf_thread(dest, pt, ti); + + return 1; +} + +int +dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task) +{ + struct thread_info *ti; + struct pt_regs *pt; + struct switch_stack *sw; + + ti = task->thread_info; + pt = (struct pt_regs *)((unsigned long)ti + 2*PAGE_SIZE) - 1; + sw = (struct switch_stack *)pt - 1; + + memcpy(dest, sw->fp, 32 * 8); + return 1; } diff -Nru a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h --- a/arch/alpha/kernel/proto.h Sun Feb 9 21:13:29 2003 +++ b/arch/alpha/kernel/proto.h Sun Feb 9 21:13:29 2003 @@ -53,7 +53,6 @@ extern int marvel_cpuid_to_nid(int); extern unsigned long marvel_node_mem_start(int); extern unsigned long marvel_node_mem_size(int); -extern int marvel_srmcons_allowed(void); extern struct _alpha_agp_info *marvel_agp_info(void); struct io7 *marvel_find_io7(int pe); struct io7 *marvel_next_io7(struct io7 *prev); @@ -109,9 +108,15 @@ /* setup.c */ extern unsigned long srm_hae; extern int boot_cpuid; -extern int srmcons_output; + +/* srmcons.c */ +#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_SRM) extern void register_srm_console(void); extern void unregister_srm_console(void); +#else +#define register_srm_console() +#define unregister_srm_console() +#endif /* smp.c */ extern void setup_smp(void); diff -Nru a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c --- a/arch/alpha/kernel/ptrace.c Sun Feb 9 21:13:35 2003 +++ b/arch/alpha/kernel/ptrace.c Sun Feb 9 21:13:35 2003 @@ -102,7 +102,9 @@ if (regno == 30) { addr = &task->thread_info->pcb.usp; - } else if (regno == 31 || regno > 64) { + } else if (regno == 65) { + addr = &task->thread_info->pcb.unique; + } else if (regno == 31 || regno > 65) { zero = 0; addr = &zero; } else { diff -Nru a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c --- a/arch/alpha/kernel/setup.c Sun Feb 9 21:13:29 2003 +++ b/arch/alpha/kernel/setup.c Sun Feb 9 21:13:29 2003 @@ -77,18 +77,25 @@ * "srmcons" specified in the boot command arguments allows us to * see kernel messages during the period of time before the true - * console device is "registered" during console_init(). As of this - * version (2.4.10), time_init() is the last Alpha-specific code - * called before console_init(), so we put "unregister" code - * there to prevent schizophrenic console behavior later... ;-} + * console device is "registered" during console_init(). + * As of this version (2.5.59), console_init() will call + * disable_early_printk() as the last action before initializing + * the console drivers. That's the last possible time srmcons can be + * unregistered without interfering with console behavior. * - * By default, OFF; set it with a bootcommand arg of "srmcons". + * By default, OFF; set it with a bootcommand arg of "srmcons" or + * "console=srm". The meaning of these two args is: + * "srmcons" - early callback prints + * "console=srm" - full callback based console, including early prints */ int srmcons_output = 0; /* Enforce a memory size limit; useful for testing. By default, none. */ unsigned long mem_size_limit = 0; +/* Set AGP GART window size (0 means disabled). */ +unsigned long alpha_agpgart_size = DEFAULT_AGP_APER_SIZE; + #ifdef CONFIG_ALPHA_GENERIC struct alpha_machine_vector alpha_mv; int alpha_using_srm; @@ -461,57 +468,6 @@ #undef PFN_PHYS #undef PFN_MAX -#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_SRM) -/* - * Manage the SRM callbacks as a "console". - */ -static struct console srmcons; - -void __init register_srm_console(void) -{ - register_console(&srmcons); -} - -void __init unregister_srm_console(void) -{ - unregister_console(&srmcons); -} - -static void srm_console_write(struct console *co, const char *s, - unsigned count) -{ - srm_printk(s); -} - -static kdev_t srm_console_device(struct console *c) -{ - /* Huh? */ - return mk_kdev(TTY_MAJOR, 64 + c->index); -} - -static int __init srm_console_setup(struct console *co, char *options) -{ - return 1; -} - -static struct console srmcons = { - .name = "srm0", - .write = srm_console_write, - .device = srm_console_device, - .setup = srm_console_setup, - .flags = CON_PRINTBUFFER | CON_ENABLED, /* fake it out */ - .index = -1, -}; - -#else -void __init register_srm_console(void) -{ -} -void __init unregister_srm_console(void) -{ -} -#endif - void __init setup_arch(char **cmdline_p) { @@ -574,7 +530,16 @@ continue; } if (strncmp(p, "srmcons", 7) == 0) { - srmcons_output = 1; + srmcons_output |= 1; + continue; + } + if (strncmp(p, "console=srm", 11) == 0) { + srmcons_output |= 2; + continue; + } + if (strncmp(p, "gartsize=", 9) == 0) { + alpha_agpgart_size = + get_mem_size_limit(p+9) << PAGE_SHIFT; continue; } } @@ -585,6 +550,13 @@ /* If we want SRM console printk echoing early, do it now. */ if (alpha_using_srm && srmcons_output) { register_srm_console(); + + /* + * If "console=srm" was specified, clear the srmcons_output + * flag now so that time.c won't unregister_srm_console + */ + if (srmcons_output & 2) + srmcons_output = 0; } #ifdef CONFIG_MAGIC_SYSRQ @@ -686,6 +658,15 @@ setup_smp(); #endif paging_init(); +} + +void __init +disable_early_printk(void) +{ + if (alpha_using_srm && srmcons_output) { + unregister_srm_console(); + srmcons_output = 0; + } } static char sys_unknown[] = "Unknown"; diff -Nru a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c --- a/arch/alpha/kernel/signal.c Sun Feb 9 21:13:32 2003 +++ b/arch/alpha/kernel/signal.c Sun Feb 9 21:13:32 2003 @@ -63,7 +63,7 @@ unsigned long block, unblock; newmask &= _BLOCKABLE; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); oldmask = current->blocked.sig[0]; unblock = oldmask & ~newmask; @@ -76,7 +76,7 @@ sigemptyset(¤t->blocked); current->blocked.sig[0] = newmask; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); (®s)->r0 = 0; /* special no error return */ } @@ -150,11 +150,11 @@ sigset_t oldset; mask &= _BLOCKABLE; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); oldset = current->blocked; siginitset(¤t->blocked, mask); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); while (1) { current->state = TASK_INTERRUPTIBLE; @@ -177,11 +177,11 @@ return -EFAULT; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); oldset = current->blocked; current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); while (1) { current->state = TASK_INTERRUPTIBLE; @@ -284,10 +284,10 @@ goto give_sigsegv; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext(&frame->sc, regs, sw)) goto give_sigsegv; @@ -323,10 +323,10 @@ goto give_sigsegv; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext(&frame->uc.uc_mcontext, regs, sw)) goto give_sigsegv; @@ -562,11 +562,11 @@ ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked,sig); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } } diff -Nru a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c --- a/arch/alpha/kernel/smp.c Sun Feb 9 21:13:30 2003 +++ b/arch/alpha/kernel/smp.c Sun Feb 9 21:13:30 2003 @@ -544,9 +544,6 @@ smp_tune_scheduling(boot_cpuid); smp_setup_percpu_timer(boot_cpuid); - /* We have already have the boot CPU online.. */ - set_bit(boot_cpuid, &cpu_online_map); - /* Nothing to do on a UP box, or when told not to. */ if (smp_num_probed == 1 || max_cpus == 0) { cpu_present_mask = 1UL << boot_cpuid; @@ -574,7 +571,11 @@ void __devinit smp_prepare_boot_cpu(void) { + /* + * Mark the boot cpu (current cpu) as both present and online + */ set_bit(smp_processor_id(), &cpu_present_mask); + set_bit(smp_processor_id(), &cpu_online_map); } int __devinit diff -Nru a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/alpha/kernel/srmcons.c Sun Feb 9 21:13:38 2003 @@ -0,0 +1,361 @@ +/* + * linux/arch/alpha/kernel/srmcons.c + * + * Callback based driver for SRM Console console device. + * (TTY driver and console driver) + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +static spinlock_t srmcons_callback_lock = SPIN_LOCK_UNLOCKED; +static int srm_is_registered_console = 0; + +/* + * The TTY driver + */ +#define MAX_SRM_CONSOLE_DEVICES 1 /* only support 1 console device */ + +static int srmcons_refcount; +static struct tty_struct *srmcons_table[MAX_SRM_CONSOLE_DEVICES]; +static struct termios *srmcons_termios[MAX_SRM_CONSOLE_DEVICES]; +static struct termios *srmcons_termios_locked[MAX_SRM_CONSOLE_DEVICES]; + +struct srmcons_private { + struct tty_struct *tty; + struct timer_list timer; + spinlock_t lock; +}; + +typedef union _srmcons_result { + struct { + unsigned long c :61; + unsigned long status :3; + } bits; + long as_long; +} srmcons_result; + +/* called with callback_lock held */ +static int +srmcons_do_receive_chars(struct tty_struct *tty) +{ + srmcons_result result; + int count = 0, loops = 0; + + do { + result.as_long = callback_getc(0); + if (result.bits.status < 2) { + tty_insert_flip_char(tty, (char)result.bits.c, 0); + count++; + } + } while((result.bits.status & 1) && (++loops < 10)); + + if (count) + tty_schedule_flip(tty); + + return count; +} + +static void +srmcons_receive_chars(unsigned long data) +{ + struct srmcons_private *srmconsp = (struct srmcons_private *)data; + unsigned long flags; + int incr = 10; + + local_irq_save(flags); + if (spin_trylock(&srmcons_callback_lock)) { + if (!srmcons_do_receive_chars(srmconsp->tty)) + incr = 100; + spin_unlock(&srmcons_callback_lock); + } + + spin_lock(&srmconsp->lock); + if (srmconsp->tty) { + srmconsp->timer.expires = jiffies + incr; + add_timer(&srmconsp->timer); + } + spin_unlock(&srmconsp->lock); + + local_irq_restore(flags); +} + +/* called with callback_lock held */ +static int +srmcons_do_write(struct tty_struct *tty, const unsigned char *buf, int count) +{ + unsigned char *str_cr = "\r"; + long c, remaining = count; + srmcons_result result; + unsigned char *cur; + int need_cr; + + for (cur = (unsigned char *)buf; remaining > 0; ) { + need_cr = 0; + /* + * Break it up into reasonable size chunks to allow a chance + * for input to get in + */ + for (c = 0; c < min_t(long, 128L, remaining) && !need_cr; c++) + if (cur[c] == '\n') + need_cr = 1; + + while (c > 0) { + result.as_long = callback_puts(0, cur, c); + c -= result.bits.c; + remaining -= result.bits.c; + cur += result.bits.c; + + /* + * Check for pending input iff a tty was provided + */ + if (tty) + srmcons_do_receive_chars(tty); + } + + while (need_cr) { + result.as_long = callback_puts(0, str_cr, 1); + if (result.bits.c > 0) + need_cr = 0; + } + } + return count; +} + +static int +srmcons_write(struct tty_struct *tty, int from_user, + const unsigned char *buf, int count) +{ + unsigned long flags; + + if (from_user) { + unsigned char tmp[512]; + int ret = 0; + size_t c; + + while ((c = count) > 0) { + if (c > sizeof(tmp)) + c = sizeof(tmp); + + c -= copy_from_user(tmp, buf, c); + + if (!c) { + printk("%s: EFAULT (count %d)\n", + __FUNCTION__, count); + return -EFAULT; + } + + spin_lock_irqsave(&srmcons_callback_lock, flags); + srmcons_do_write(tty, tmp, c); + spin_unlock_irqrestore(&srmcons_callback_lock, flags); + + buf += c; + count -= c; + ret += c; + } + + return ret; + } + + spin_lock_irqsave(&srmcons_callback_lock, flags); + srmcons_do_write(tty, buf, count); + spin_unlock_irqrestore(&srmcons_callback_lock, flags); + + return count; +} + +static int +srmcons_write_room(struct tty_struct *tty) +{ + return 512; +} + +static int +srmcons_chars_in_buffer(struct tty_struct *tty) +{ + return 0; +} + +static int +srmcons_get_private_struct(struct srmcons_private **ps) +{ + static struct srmcons_private *srmconsp = NULL; + static spinlock_t srmconsp_lock = SPIN_LOCK_UNLOCKED; + unsigned long flags; + int retval = 0; + + spin_lock_irqsave(&srmconsp_lock, flags); + + do { + if (srmconsp != NULL) { + *ps = srmconsp; + break; + } + + srmconsp = kmalloc(sizeof(*srmconsp), GFP_KERNEL); + if (srmconsp == NULL) { + retval = -ENOMEM; + break; + } + + srmconsp->tty = NULL; + srmconsp->lock = SPIN_LOCK_UNLOCKED; + init_timer(&srmconsp->timer); + + *ps = srmconsp; + } while(0); + + spin_unlock_irqrestore(&srmconsp_lock, flags); + + return retval; +} + +static int +srmcons_open(struct tty_struct *tty, struct file *filp) +{ + struct srmcons_private *srmconsp; + unsigned long flags; + int retval; + + retval = srmcons_get_private_struct(&srmconsp); + if (retval) + return retval; + + spin_lock_irqsave(&srmconsp->lock, flags); + + if (!srmconsp->tty) { + tty->driver_data = srmconsp; + + srmconsp->tty = tty; + srmconsp->timer.function = srmcons_receive_chars; + srmconsp->timer.data = (unsigned long)srmconsp; + srmconsp->timer.expires = jiffies + 10; + add_timer(&srmconsp->timer); + } + + spin_unlock_irqrestore(&srmconsp->lock, flags); + + return 0; +} + +static void +srmcons_close(struct tty_struct *tty, struct file *filp) +{ + struct srmcons_private *srmconsp = tty->driver_data; + unsigned long flags; + + spin_lock_irqsave(&srmconsp->lock, flags); + + if (tty->count == 1) { + srmconsp->tty = NULL; + del_timer(&srmconsp->timer); + } + + spin_unlock_irqrestore(&srmconsp->lock, flags); +} + + +static struct tty_driver srmcons_driver = { + .driver_name = "srm", + .name = "srm", + .magic = TTY_DRIVER_MAGIC, + .major = 0, /* dynamic */ + .minor_start = 0, + .num = MAX_SRM_CONSOLE_DEVICES, + .type = TTY_DRIVER_TYPE_SYSTEM, + .subtype = SYSTEM_TYPE_SYSCONS, + + .table = srmcons_table, + .termios = srmcons_termios, + .termios_locked = srmcons_termios_locked, + .refcount = &srmcons_refcount, + + .open = srmcons_open, + .close = srmcons_close, + .write = srmcons_write, + .write_room = srmcons_write_room, + .chars_in_buffer= srmcons_chars_in_buffer, +}; + +static int __init +srmcons_init(void) +{ + if (srm_is_registered_console) { + srmcons_driver.init_termios = tty_std_termios; + return tty_register_driver(&srmcons_driver); + } + + return -ENODEV; +} + +module_init(srmcons_init); + + +/* + * The console driver + */ +static void +srm_console_write(struct console *co, const char *s, unsigned count) +{ + unsigned long flags; + + spin_lock_irqsave(&srmcons_callback_lock, flags); + srmcons_do_write(NULL, s, count); + spin_unlock_irqrestore(&srmcons_callback_lock, flags); +} + +static kdev_t +srm_console_device(struct console *co) +{ + return mk_kdev(srmcons_driver.major, + srmcons_driver.minor_start + co->index); +} + +static int __init +srm_console_setup(struct console *co, char *options) +{ + return 0; +} + +static struct console srmcons = { + .name = "srm", + .write = srm_console_write, + .device = srm_console_device, + .setup = srm_console_setup, + .flags = CON_PRINTBUFFER, + .index = -1, +}; + +void __init +register_srm_console(void) +{ + if (!srm_is_registered_console) { + callback_open_console(); + register_console(&srmcons); + srm_is_registered_console = 1; + } +} + +void __init +unregister_srm_console(void) +{ + if (srm_is_registered_console) { + callback_close_console(); + unregister_console(&srmcons); + srm_is_registered_console = 0; + } +} diff -Nru a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c --- a/arch/alpha/kernel/sys_nautilus.c Sun Feb 9 21:13:31 2003 +++ b/arch/alpha/kernel/sys_nautilus.c Sun Feb 9 21:13:31 2003 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -163,7 +164,7 @@ } printk(KERN_CRIT "NAUTILUS Machine check 0x%lx " - "[%s System Machine Check (NMI)]\n", + "[%s System Machine Check (NMI)]\n", vector, mchk_class); naut_sys_machine_check(vector, la_ptr, regs); @@ -174,6 +175,70 @@ mb(); } +extern void free_reserved_mem(void *, void *); + +void __init +nautilus_init_pci(void) +{ + struct pci_controller *hose = hose_head; + struct pci_bus *bus; + struct pci_dev *irongate; + unsigned long saved_io_start, saved_io_end; + unsigned long saved_mem_start, saved_mem_end; + unsigned long bus_align, bus_size, pci_mem; + unsigned long memtop = max_low_pfn << PAGE_SHIFT; + + /* Scan our single hose. */ + bus = pci_scan_bus(0, alpha_mv.pci_ops, hose); + hose->bus = bus; + hose->last_busno = bus->subordinate; + + /* We're going to size the root bus, so we must + - have a non-NULL PCI device associated with the bus + - preserve hose resources. */ + irongate = pci_find_slot(0, 0); + bus->self = irongate; + saved_io_start = bus->resource[0]->start; + saved_io_end = bus->resource[0]->end; + saved_mem_start = bus->resource[1]->start; + saved_mem_end = bus->resource[1]->end; + + pci_bus_size_bridges(bus); + + /* Don't care about IO. */ + bus->resource[0]->start = saved_io_start; + bus->resource[0]->end = saved_io_end; + + bus_align = bus->resource[1]->start; + bus_size = bus->resource[1]->end + 1 - bus_align; + /* Align to 16Mb. */ + if (bus_align < 0x1000000UL) + bus_align = 0x1000000UL; + + /* Restore hose MEM resource. */ + bus->resource[1]->start = saved_mem_start; + bus->resource[1]->end = saved_mem_end; + + pci_mem = (0x100000000UL - bus_size) & -bus_align; + + if (pci_mem < memtop && pci_mem > alpha_mv.min_mem_address) { + free_reserved_mem(__va(alpha_mv.min_mem_address), + __va(pci_mem)); + printk("nautilus_init_arch: %ldk freed\n", + (pci_mem - alpha_mv.min_mem_address) >> 10); + } + + alpha_mv.min_mem_address = pci_mem; + if ((IRONGATE0->dev_vendor >> 16) > 0x7006) /* Albacore? */ + IRONGATE0->pci_mem = pci_mem; + + pci_bus_assign_resources(bus); + + /* To break the loop in common_swizzle() */ + bus->self = NULL; + + pci_fixup_irqs(alpha_mv.pci_swizzle, alpha_mv.pci_map_irq); +} /* * The System Vectors @@ -196,7 +261,7 @@ .init_arch = irongate_init_arch, .init_irq = nautilus_init_irq, .init_rtc = common_init_rtc, - .init_pci = common_init_pci, + .init_pci = nautilus_init_pci, .kill_arch = nautilus_kill_arch, .pci_map_irq = nautilus_map_irq, .pci_swizzle = common_swizzle, diff -Nru a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c --- a/arch/alpha/kernel/time.c Sun Feb 9 21:13:32 2003 +++ b/arch/alpha/kernel/time.c Sun Feb 9 21:13:32 2003 @@ -44,6 +44,7 @@ #include #include +#include #include #include "proto.h" @@ -51,7 +52,6 @@ u64 jiffies_64; -extern rwlock_t xtime_lock; extern unsigned long wall_jiffies; /* kernel/timer.c */ static int set_rtc_mmss(unsigned long); @@ -106,7 +106,7 @@ alpha_do_profile(regs->pc); #endif - write_lock(&xtime_lock); + write_seqlock(&xtime_lock); /* * Calculate how many ticks have passed since the last update, @@ -138,7 +138,7 @@ state.last_rtc_update = xtime.tv_sec - (tmp ? 600 : 0); } - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); } void @@ -383,21 +383,6 @@ /* Startup the timer source. */ alpha_mv.init_rtc(); - - /* - * If we had wanted SRM console printk echoing early, undo it now. - * - * "srmcons" specified in the boot command arguments allows us to - * see kernel messages during the period of time before the true - * console device is "registered" during console_init(). As of this - * version (2.4.10), time_init() is the last Alpha-specific code - * called before console_init(), so we put this "unregister" code - * here to prevent schizophrenic console behavior later... ;-} - */ - if (alpha_using_srm && srmcons_output) { - unregister_srm_console(); - srmcons_output = 0; - } } /* @@ -410,18 +395,20 @@ void do_gettimeofday(struct timeval *tv) { - unsigned long sec, usec, lost, flags; + unsigned long flags; + unsigned long sec, usec, lost, seq; unsigned long delta_cycles, delta_usec, partial_tick; - read_lock_irqsave(&xtime_lock, flags); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); - delta_cycles = rpcc() - state.last_time; - sec = xtime.tv_sec; - usec = (xtime.tv_nsec / 1000); - partial_tick = state.partial_tick; - lost = jiffies - wall_jiffies; + delta_cycles = rpcc() - state.last_time; + sec = xtime.tv_sec; + usec = (xtime.tv_nsec / 1000); + partial_tick = state.partial_tick; + lost = jiffies - wall_jiffies; - read_unlock_irqrestore(&xtime_lock, flags); + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); #ifdef CONFIG_SMP /* Until and unless we figure out how to get cpu cycle counters @@ -463,7 +450,7 @@ unsigned long delta_usec; long sec, usec; - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); /* The offset that is added into time in do_gettimeofday above must be subtracted out here to keep a coherent view of the @@ -494,7 +481,7 @@ time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } diff -Nru a/arch/arm/Kconfig b/arch/arm/Kconfig --- a/arch/arm/Kconfig Sun Feb 9 21:13:32 2003 +++ b/arch/arm/Kconfig Sun Feb 9 21:13:32 2003 @@ -577,7 +577,7 @@ your machine has an FPA or floating point co-processor podule. It is also possible to say M to build the emulator as a module - (nwfpe.o) or indeed to leave it out altogether. However, unless you + (nwfpe) or indeed to leave it out altogether. However, unless you know what you are doing this can easily render your machine unbootable. Saying Y is the safe option. @@ -599,7 +599,7 @@ choose NWFPE. It is also possible to say M to build the emulator as a module - (fastfpe.o). But keep in mind that you should only load the FP + (fastfpe). But keep in mind that you should only load the FP emulator early in the bootup. You should never change from NWFPE to FASTFPE or vice versa in an active system! @@ -654,7 +654,7 @@ QMAGIC support" then you'll have to say Y here. You may answer M to compile a.out support as a module and later load the module when you want to use a program or library in a.out format. The module will be - called binfmt_aout.o. Saying M or N here is dangerous though, + called binfmt_aout. Saying M or N here is dangerous though, because some crucial programs on your system might still be in A.OUT format. @@ -684,7 +684,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called binfmt_elf.o. Saying M or N here is dangerous because + will be called binfmt_elf. Saying M or N here is dangerous because some crucial programs on your system might be in ELF format. config BINFMT_MISC @@ -709,7 +709,7 @@ use this part of the kernel. You may say M here for module support and later load the module when - you have use for it; the module is called binfmt_misc.o. If you + you have use for it; the module is called binfmt_misc. If you don't know what to answer at this point, say Y. config PM @@ -804,7 +804,7 @@ To compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module will be called - apm.o. + apm. config ARTHUR tristate "RISC OS personality" @@ -814,7 +814,7 @@ Acorn RISC OS/Arthur binaries under Linux. This code is still very experimental; if this sounds frightening, say N and sleep in peace. You can also say M here to compile this support as a module (which - will be called arthur.o). + will be called arthur). config CMDLINE string "Default kernel command string" @@ -946,7 +946,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called ide.o. + will be called ide. For further information, please read . @@ -973,7 +973,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called scsi_mod.o. If you want to compile it as + The module will be called scsi_mod. If you want to compile it as a module, say M here and read and . However, do not compile this as a module if your root file system (the one containing the directory /) @@ -1036,7 +1036,7 @@ and load that module after the PnP configuration is finished. To do this, say M here and read as well as ; the module will be - called soundcore.o. + called soundcore. I'm told that even without a sound card, you can make your computer say more than an occasional beep, by programming the PC speaker. diff -Nru a/arch/arm/Makefile b/arch/arm/Makefile --- a/arch/arm/Makefile Sun Feb 9 21:13:31 2003 +++ b/arch/arm/Makefile Sun Feb 9 21:13:31 2003 @@ -17,7 +17,7 @@ CFLAGS :=$(CFLAGS:-O2=-Os) ifeq ($(CONFIG_FRAME_POINTER),y) -CFLAGS :=$(CFLAGS:-fomit-frame-pointer=-mapcs -mno-sched-prolog) +CFLAGS +=-fno-omit-frame-pointer -mapcs -mno-sched-prolog endif ifeq ($(CONFIG_DEBUG_INFO),y) @@ -36,7 +36,7 @@ # series of macros. arch-$(CONFIG_CPU_32v3) :=-D__LINUX_ARM_ARCH__=3 -march=armv3 arch-$(CONFIG_CPU_32v4) :=-D__LINUX_ARM_ARCH__=4 -march=armv4 -arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 -march=armv5 +arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 -march=armv5te arch-$(CONFIG_CPU_XSCALE) :=-D__LINUX_ARM_ARCH__=5 -march=armv4 -Wa,-mxscale #-march=armv5te # This selects how we optimise for the processor. @@ -61,7 +61,7 @@ ifeq ($(CONFIG_CPU_26),y) PROCESSOR := armo -HEAD := arch/arm/mach-arc/head.o arch/arm/kernel/init_task.o +head-y := arch/arm/mach-arc/head.o arch/arm/kernel/init_task.o LDFLAGS_BLOB += --oformat elf26-littlearm ifeq ($(CONFIG_ROM_KERNEL),y) DATAADDR := 0x02080000 @@ -73,7 +73,7 @@ ifeq ($(CONFIG_CPU_32),y) PROCESSOR := armv -HEAD := arch/arm/kernel/head.o arch/arm/kernel/init_task.o +head-y := arch/arm/kernel/head.o arch/arm/kernel/init_task.o LDFLAGS_BLOB += --oformat elf32-littlearm textaddr-y := 0xC0008000 endif @@ -124,10 +124,10 @@ endif # If we have a machine-specific directory, then include it in the build. +core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/ ifneq ($(MACHINE),) core-y += arch/arm/mach-$(MACHINE)/ endif -core-y += arch/arm/kernel/ arch/arm/mm/ core-$(CONFIG_FPE_NWFPE) += arch/arm/nwfpe/ core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ) @@ -181,7 +181,6 @@ include/asm-arm/mach-types.h # We use MRPROPER_FILES and CLEAN_FILES now -archmrproper: archclean: $(Q)$(MAKE) $(clean)=$(boot) diff -Nru a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S --- a/arch/arm/boot/compressed/head.S Sun Feb 9 21:13:35 2003 +++ b/arch/arm/boot/compressed/head.S Sun Feb 9 21:13:35 2003 @@ -664,5 +664,5 @@ reloc_end: .align - .section ".stack", "aw" + .section ".stack", "w" user_stack: .space 4096 diff -Nru a/arch/arm/common/Makefile b/arch/arm/common/Makefile --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/arm/common/Makefile Sun Feb 9 21:13:37 2003 @@ -0,0 +1,8 @@ +# +# Makefile for the linux kernel. +# + +obj-$(CONFIG_SA1111) += sa1111.o sa1111-pcibuf.o sa1111-pcipool.o + +obj-$(CONFIG_PCI_HOST_PLX90X0) += plx90x0.o +obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o diff -Nru a/arch/arm/common/plx90x0.c b/arch/arm/common/plx90x0.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/arm/common/plx90x0.c Sun Feb 9 21:13:29 2003 @@ -0,0 +1,178 @@ +/* + * Driver for PLX Technology PCI9000-series host bridge. + * + * Copyright (C) 1997, 1998, 1999, 2000 FutureTV Labs Ltd + */ + +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include +#include +#include + +#include +#include +#include +#include +#include + +/* + * Since the following functions are all very similar, the common parts + * are pulled out into these macros. + */ + +#define PLX_CLEAR_CONFIG \ + __raw_writel(0, PLX_BASE + 0xac); \ + local_irq_restore(flags); } + +#define PLX_SET_CONFIG \ + { unsigned long flags; \ + local_irq_save(flags); \ + __raw_writel((1<<31 | (bus->number << 16) \ + | (devfn << 8) | (where & ~3) \ + | ((bus->number == 0)?0:1)), PLX_BASE + 0xac); \ + +#define PLX_CONFIG_WRITE(size) \ + PLX_SET_CONFIG \ + __raw_write##size(value, PCIO_BASE + (where & 3)); \ + if (__raw_readw(PLX_BASE + 0x6) & 0x2000) \ + __raw_writew(0x2000, PLX_BASE + 0x6); \ + PLX_CLEAR_CONFIG \ + return PCIBIOS_SUCCESSFUL; + +#define PLX_CONFIG_READ(size) \ + PLX_SET_CONFIG \ + *value = __raw_read##size(PCIO_BASE + (where & 3)); \ + if (__raw_readw(PLX_BASE + 0x6) & 0x2000) { \ + __raw_writew(0x2000, PLX_BASE + 0x6); \ + *value = 0xffffffffUL; \ + } \ + PLX_CLEAR_CONFIG \ + return PCIBIOS_SUCCESSFUL; + +/* Configuration space access routines */ + +static int +plx90x0_read_config (struct pci_bus *bus, unsigned int devfn, int where, + int where, int size, u32 *value) +{ + switch (size) { + case 1: + PLX_CONFIG_READ(b) + break; + case 2: + PLX_CONFIG_READ(w) + break; + case 4: + PLX_CONFIG_READ(l) + break; + } + return PCIBIOS_SUCCESSFUL; +} + +static int +plx90x0_write_config (struct pci_bus *bus, unsigned int devfn, int where, + int where, int size, u32 value) +{ + switch (size) { + case 1: + PLX_CONFIG_WRITE(b) + break; + case 2: + PLX_CONFIG_WRITE(w) + break; + case 4: + PLX_CONFIG_WRITE(l) + break; + } + return PCIBIOS_SUCCESSFUL; +} + +static struct pci_ops plx90x0_ops = +{ + .read = plx90x0_read_config, + .write = plx90x0_write_config, +}; + +static void +plx_syserr_handler(int irq, void *handle, struct pt_regs *regs) +{ + printk("PLX90x0: machine check %04x (pc=%08lx)\n", + readw(PLX_BASE + 6), regs->ARM_pc); + __raw_writew(0xf000, PLX_BASE + 6); +} + +/* + * Initialise the PCI system. + */ + +void __init +plx90x0_init(struct arm_sysdata *sysdata) +{ + static const unsigned long int base = PLX_BASE; + char *what; + unsigned long bar = (unsigned long)virt_to_bus((void *)PAGE_OFFSET); + + /* Have a sniff around and see which PLX device is present. */ + unsigned long id = __raw_readl(base + 0xf0); + +#if 0 + /* This check was a good idea, but can fail. The PLX9060 puts no + default value in these registers unless NB# is asserted (which it + isn't on these cards). */ + if ((id & 0xffff) != PCI_VENDOR_ID_PLX) + return; /* Nothing found */ +#endif + + /* Found one - now work out what it is. */ + switch (id >> 16) { + case 0: /* PCI_DEVICE_ID_PLX_9060 */ + what = "PCI9060"; + break; + case PCI_DEVICE_ID_PLX_9060ES: + what = "PCI9060ES"; + break; + case PCI_DEVICE_ID_PLX_9060SD: + what = "PCI9060SD"; /* uhuhh.. */ + break; + case PCI_DEVICE_ID_PLX_9080: + what = "PCI9080"; + break; + default: + printk("PCI: Unknown PLX device %04lx found -- ignored.\n", + id >> 16); + return; + } + + printk("PCI: PLX Technology %s host bridge found.\n", what); + + /* Now set it up for both master and slave accesses. */ + __raw_writel(0xffff0147, base + 0x4); + __raw_writeb(32, base + 0xd); + __raw_writel(0x8 | bar, base + 0x18); + __raw_writel(0xf8000008, base + 0x80); + __raw_writel(0x40000001, base + 0x84); + __raw_writel(0, base + 0x88); + __raw_writel(0, base + 0x8c); + __raw_writel(0x11, base + 0x94); + __raw_writel(0xC3 + (4 << 28) + + (8 << 11) + (1 << 10) + + (1 << 24), base + 0x98); + __raw_writel(0xC0000000, base + 0x9c); + __raw_writel(PLX_MEM_START, base + 0xa0); + __raw_writel(PLX_IO_START, base + 0xa4); + __raw_writel(0x3, base + 0xa8); + __raw_writel(0, base + 0xac); + __raw_writel(0x10001, base + 0xe8); + __raw_writel(0x8000767e, base + 0xec); + + request_irq(IRQ_SYSERR, plx_syserr_handler, 0, + "system error", NULL); + + pci_scan_bus(0, &plx90x0_ops, sysdata); +} diff -Nru a/arch/arm/common/sa1111-pcibuf.c b/arch/arm/common/sa1111-pcibuf.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/arm/common/sa1111-pcibuf.c Sun Feb 9 21:13:28 2003 @@ -0,0 +1,551 @@ +/* + * linux/arch/arm/mach-sa1100/pci-sa1111.c + * + * Special pci_{map/unmap/dma_sync}_* routines for SA-1111. + * + * These functions utilize bouncer buffers to compensate for a bug in + * the SA-1111 hardware which don't allow DMA to/from addresses + * certain addresses above 1MB. + * + * Re-written by Christopher Hoover + * Original version by Brad Parker (brad@heeltoe.com) + * + * Copyright (C) 2002 Hewlett Packard Company. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * */ + +#include +#include +#include +#include +#include +#include + +//#define DEBUG +#ifdef DEBUG +#define DPRINTK(...) do { printk(KERN_DEBUG __VA_ARGS__); } while (0) +#else +#define DPRINTK(...) do { } while (0) +#endif + +//#define STATS +#ifdef STATS +#define DO_STATS(X) do { X ; } while (0) +#else +#define DO_STATS(X) do { } while (0) +#endif + +/* ************************************************** */ + +struct safe_buffer { + struct list_head node; + + /* original request */ + void *ptr; + size_t size; + int direction; + + /* safe buffer info */ + struct pci_pool *pool; + void *safe; + dma_addr_t safe_dma_addr; +}; + +LIST_HEAD(safe_buffers); + + +#define SIZE_SMALL 1024 +#define SIZE_LARGE (4*1024) + +static struct pci_pool *small_buffer_pool, *large_buffer_pool; + +#ifdef STATS +static unsigned long sbp_allocs __initdata = 0; +static unsigned long lbp_allocs __initdata = 0; +static unsigned long total_allocs __initdata= 0; + +static void print_alloc_stats(void) +{ + printk(KERN_INFO + "sa1111_pcibuf: sbp: %lu, lbp: %lu, other: %lu, total: %lu\n", + sbp_allocs, lbp_allocs, + total_allocs - sbp_allocs - lbp_allocs, total_allocs); +} +#endif + +static int __init +create_safe_buffer_pools(void) +{ + small_buffer_pool = pci_pool_create("sa1111_small_dma_buffer", + SA1111_FAKE_PCIDEV, + SIZE_SMALL, + 0 /* byte alignment */, + 0 /* no page-crossing issues */); + if (0 == small_buffer_pool) { + printk(KERN_ERR + "sa1111_pcibuf: could not allocate small pci pool\n"); + return -1; + } + + large_buffer_pool = pci_pool_create("sa1111_large_dma_buffer", + SA1111_FAKE_PCIDEV, + SIZE_LARGE, + 0 /* byte alignment */, + 0 /* no page-crossing issues */); + if (0 == large_buffer_pool) { + printk(KERN_ERR + "sa1111_pcibuf: could not allocate large pci pool\n"); + pci_pool_destroy(small_buffer_pool); + small_buffer_pool = 0; + return -1; + } + + printk(KERN_INFO + "sa1111_pcibuf: buffer sizes: small=%u, large=%u\n", + SIZE_SMALL, SIZE_LARGE); + + return 0; +} + +static void __exit +destroy_safe_buffer_pools(void) +{ + if (small_buffer_pool) + pci_pool_destroy(small_buffer_pool); + if (large_buffer_pool) + pci_pool_destroy(large_buffer_pool); + + small_buffer_pool = large_buffer_pool = 0; +} + + +/* allocate a 'safe' buffer and keep track of it */ +static struct safe_buffer * +alloc_safe_buffer(void *ptr, size_t size, int direction) +{ + struct safe_buffer *buf; + struct pci_pool *pool; + void *safe; + dma_addr_t safe_dma_addr; + + DPRINTK("%s(ptr=%p, size=%d, direction=%d)\n", + __func__, ptr, size, direction); + + DO_STATS ( total_allocs++ ); + + buf = kmalloc(sizeof(struct safe_buffer), GFP_ATOMIC); + if (buf == 0) { + printk(KERN_WARNING "%s: kmalloc failed\n", __func__); + return 0; + } + + if (size <= SIZE_SMALL) { + pool = small_buffer_pool; + safe = pci_pool_alloc(pool, GFP_ATOMIC, &safe_dma_addr); + + DO_STATS ( sbp_allocs++ ); + } else if (size <= SIZE_LARGE) { + pool = large_buffer_pool; + safe = pci_pool_alloc(pool, GFP_ATOMIC, &safe_dma_addr); + + DO_STATS ( lbp_allocs++ ); + } else { + pool = 0; + safe = pci_alloc_consistent(SA1111_FAKE_PCIDEV, size, + &safe_dma_addr); + } + + if (safe == 0) { + printk(KERN_WARNING + "%s: could not alloc dma memory (size=%d)\n", + __func__, size); + kfree(buf); + return 0; + } + +#ifdef STATS + if (total_allocs % 1000 == 0) + print_alloc_stats(); +#endif + + BUG_ON(sa1111_check_dma_bug(safe_dma_addr)); // paranoia + + buf->ptr = ptr; + buf->size = size; + buf->direction = direction; + buf->pool = pool; + buf->safe = safe; + buf->safe_dma_addr = safe_dma_addr; + + MOD_INC_USE_COUNT; + list_add(&buf->node, &safe_buffers); + + return buf; +} + +/* determine if a buffer is from our "safe" pool */ +static struct safe_buffer * +find_safe_buffer(dma_addr_t safe_dma_addr) +{ + struct list_head *entry; + + list_for_each(entry, &safe_buffers) { + struct safe_buffer *b = + list_entry(entry, struct safe_buffer, node); + + if (b->safe_dma_addr == safe_dma_addr) { + return b; + } + } + + return 0; +} + +static void +free_safe_buffer(struct safe_buffer *buf) +{ + DPRINTK("%s(buf=%p)\n", __func__, buf); + + list_del(&buf->node); + + if (buf->pool) + pci_pool_free(buf->pool, buf->safe, buf->safe_dma_addr); + else + pci_free_consistent(SA1111_FAKE_PCIDEV, buf->size, buf->safe, + buf->safe_dma_addr); + kfree(buf); + + MOD_DEC_USE_COUNT; +} + +static inline int +dma_range_is_safe(dma_addr_t addr, size_t size) +{ + unsigned int physaddr = SA1111_DMA_ADDR((unsigned int) addr); + + /* Any address within one megabyte of the start of the target + * bank will be OK. This is an overly conservative test: + * other addresses can be OK depending on the dram + * configuration. (See sa1111.c:sa1111_check_dma_bug() * for + * details.) + * + * We take care to ensure the entire dma region is within + * the safe range. + */ + + return ((physaddr + size - 1) < (1<<20)); +} + +/* ************************************************** */ + +#ifdef STATS +static unsigned long map_op_count __initdata = 0; +static unsigned long bounce_count __initdata = 0; + +static void print_map_stats(void) +{ + printk(KERN_INFO + "sa1111_pcibuf: map_op_count=%lu, bounce_count=%lu\n", + map_op_count, bounce_count); +} +#endif + +static dma_addr_t +map_single(void *ptr, size_t size, int direction) +{ + dma_addr_t dma_addr; + + DO_STATS ( map_op_count++ ); + + dma_addr = virt_to_bus(ptr); + + if (!dma_range_is_safe(dma_addr, size)) { + struct safe_buffer *buf; + + DO_STATS ( bounce_count++ ) ; + + buf = alloc_safe_buffer(ptr, size, direction); + if (buf == 0) { + printk(KERN_ERR + "%s: unable to map unsafe buffer %p!\n", + __func__, ptr); + return 0; + } + + DPRINTK("%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n", + __func__, + buf->ptr, (void *) virt_to_bus(buf->ptr), + buf->safe, (void *) buf->safe_dma_addr); + + if ((direction == PCI_DMA_TODEVICE) || + (direction == PCI_DMA_BIDIRECTIONAL)) { + DPRINTK("%s: copy out from unsafe %p, to safe %p, size %d\n", + __func__, ptr, buf->safe, size); + memcpy(buf->safe, ptr, size); + } + consistent_sync(buf->safe, size, direction); + + dma_addr = buf->safe_dma_addr; + } else { + consistent_sync(ptr, size, direction); + } + +#ifdef STATS + if (map_op_count % 1000 == 0) + print_map_stats(); +#endif + + return dma_addr; +} + +static void +unmap_single(dma_addr_t dma_addr, size_t size, int direction) +{ + struct safe_buffer *buf; + + buf = find_safe_buffer(dma_addr); + + if (buf) { + BUG_ON(buf->size != size); + BUG_ON(buf->direction != direction); + + DPRINTK("%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n", + __func__, + buf->ptr, (void *) virt_to_bus(buf->ptr), + buf->safe, (void *) buf->safe_dma_addr); + + + DO_STATS ( bounce_count++ ); + + if ((direction == PCI_DMA_FROMDEVICE) || + (direction == PCI_DMA_BIDIRECTIONAL)) { + DPRINTK("%s: copy back from safe %p, to unsafe %p size %d\n", + __func__, buf->safe, buf->ptr, size); + memcpy(buf->ptr, buf->safe, size); + } + free_safe_buffer(buf); + } +} + +static void +sync_single(dma_addr_t dma_addr, size_t size, int direction) +{ + struct safe_buffer *buf; + + buf = find_safe_buffer(dma_addr); + + if (buf) { + BUG_ON(buf->size != size); + BUG_ON(buf->direction != direction); + + DPRINTK("%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n", + __func__, + buf->ptr, (void *) virt_to_bus(buf->ptr), + buf->safe, (void *) buf->safe_dma_addr); + + DO_STATS ( bounce_count++ ); + + switch (direction) { + case PCI_DMA_FROMDEVICE: + DPRINTK("%s: copy back from safe %p, to unsafe %p size %d\n", + __func__, buf->safe, buf->ptr, size); + memcpy(buf->ptr, buf->safe, size); + break; + case PCI_DMA_TODEVICE: + DPRINTK("%s: copy out from unsafe %p, to safe %p, size %d\n", + __func__,buf->ptr, buf->safe, size); + memcpy(buf->safe, buf->ptr, size); + break; + case PCI_DMA_BIDIRECTIONAL: + BUG(); /* is this allowed? what does it mean? */ + default: + BUG(); + } + consistent_sync(buf->safe, size, direction); + } else { + consistent_sync(bus_to_virt(dma_addr), size, direction); + } +} + +/* ************************************************** */ + +/* + * see if a buffer address is in an 'unsafe' range. if it is + * allocate a 'safe' buffer and copy the unsafe buffer into it. + * substitute the safe buffer for the unsafe one. + * (basically move the buffer from an unsafe area to a safe one) + */ +dma_addr_t +sa1111_map_single(void *ptr, size_t size, int direction) +{ + unsigned long flags; + dma_addr_t dma_addr; + + DPRINTK("%s(ptr=%p,size=%d,dir=%x)\n", + __func__, ptr, size, direction); + + BUG_ON(direction == PCI_DMA_NONE); + + local_irq_save(flags); + + dma_addr = map_single(ptr, size, direction); + + local_irq_restore(flags); + + return dma_addr; +} + +/* + * see if a mapped address was really a "safe" buffer and if so, copy + * the data from the safe buffer back to the unsafe buffer and free up + * the safe buffer. (basically return things back to the way they + * should be) + */ + +void +sa1111_unmap_single(dma_addr_t dma_addr, size_t size, int direction) +{ + unsigned long flags; + + DPRINTK("%s(ptr=%p,size=%d,dir=%x)\n", + __func__, (void *) dma_addr, size, direction); + + BUG_ON(direction == PCI_DMA_NONE); + + local_irq_save(flags); + + unmap_single(dma_addr, size, direction); + + local_irq_restore(flags); +} + +int +sa1111_map_sg(struct scatterlist *sg, int nents, int direction) +{ + unsigned long flags; + int i; + + DPRINTK("%s(sg=%p,nents=%d,dir=%x)\n", + __func__, sg, nents, direction); + + BUG_ON(direction == PCI_DMA_NONE); + + local_irq_save(flags); + + for (i = 0; i < nents; i++, sg++) { + struct page *page = sg->page; + unsigned int offset = sg->offset; + unsigned int length = sg->length; + void *ptr = page_address(page) + offset; + + sg->dma_address = + map_single(ptr, length, direction); + } + + local_irq_restore(flags); + + return nents; +} + +void +sa1111_unmap_sg(struct scatterlist *sg, int nents, int direction) +{ + unsigned long flags; + int i; + + DPRINTK("%s(sg=%p,nents=%d,dir=%x)\n", + __func__, sg, nents, direction); + + BUG_ON(direction == PCI_DMA_NONE); + + local_irq_save(flags); + + for (i = 0; i < nents; i++, sg++) { + dma_addr_t dma_addr = sg->dma_address; + unsigned int length = sg->length; + + unmap_single(dma_addr, length, direction); + } + + local_irq_restore(flags); +} + +void +sa1111_dma_sync_single(dma_addr_t dma_addr, size_t size, int direction) +{ + unsigned long flags; + + DPRINTK("%s(ptr=%p,size=%d,dir=%x)\n", + __func__, (void *) dma_addr, size, direction); + + local_irq_save(flags); + + sync_single(dma_addr, size, direction); + + local_irq_restore(flags); +} + +void +sa1111_dma_sync_sg(struct scatterlist *sg, int nents, int direction) +{ + unsigned long flags; + int i; + + DPRINTK("%s(sg=%p,nents=%d,dir=%x)\n", + __func__, sg, nents, direction); + + BUG_ON(direction == PCI_DMA_NONE); + + local_irq_save(flags); + + for (i = 0; i < nents; i++, sg++) { + dma_addr_t dma_addr = sg->dma_address; + unsigned int length = sg->length; + + sync_single(dma_addr, length, direction); + } + + local_irq_restore(flags); +} + +EXPORT_SYMBOL(sa1111_map_single); +EXPORT_SYMBOL(sa1111_unmap_single); +EXPORT_SYMBOL(sa1111_map_sg); +EXPORT_SYMBOL(sa1111_unmap_sg); +EXPORT_SYMBOL(sa1111_dma_sync_single); +EXPORT_SYMBOL(sa1111_dma_sync_sg); + +/* **************************************** */ + +static int __init sa1111_pcibuf_init(void) +{ + int ret; + + printk(KERN_DEBUG + "sa1111_pcibuf: initializing SA-1111 DMA workaround\n"); + + ret = create_safe_buffer_pools(); + + return ret; +} +module_init(sa1111_pcibuf_init); + +static void __exit sa1111_pcibuf_exit(void) +{ + BUG_ON(!list_empty(&safe_buffers)); + +#ifdef STATS + print_alloc_stats(); + print_map_stats(); +#endif + + destroy_safe_buffer_pools(); +} +module_exit(sa1111_pcibuf_exit); + +MODULE_AUTHOR("Christopher Hoover "); +MODULE_DESCRIPTION("Special pci_{map/unmap/dma_sync}_* routines for SA-1111."); +MODULE_LICENSE("GPL"); diff -Nru a/arch/arm/common/sa1111-pcipool.c b/arch/arm/common/sa1111-pcipool.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/arm/common/sa1111-pcipool.c Sun Feb 9 21:13:34 2003 @@ -0,0 +1,390 @@ +/* + NOTE: + + this code was lifted straight out of drivers/pci/pci.c; + when compiling for the Intel StrongARM SA-1110/SA-1111 the + usb-ohci.c driver needs these routines even when the architecture + has no pci bus... +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* + * Pool allocator ... wraps the pci_alloc_consistent page allocator, so + * small blocks are easily used by drivers for bus mastering controllers. + * This should probably be sharing the guts of the slab allocator. + */ + +struct pci_pool { /* the pool */ + struct list_head page_list; + spinlock_t lock; + size_t blocks_per_page; + size_t size; + struct pci_dev *dev; + size_t allocation; + char name [32]; + wait_queue_head_t waitq; +}; + +struct pci_page { /* cacheable header for 'allocation' bytes */ + struct list_head page_list; + void *vaddr; + dma_addr_t dma; + unsigned long bitmap [0]; +}; + +#define POOL_TIMEOUT_JIFFIES ((100 /* msec */ * HZ) / 1000) +#define POOL_POISON_BYTE 0xa7 + +// #define CONFIG_PCIPOOL_DEBUG + +static inline const char *slot_name(const struct pci_pool *pool) +{ + const struct pci_dev *pdev = pool->dev; + + if (pdev == 0) + return "[0]"; + + else if (pcidev_is_sa1111(pdev)) + return "[SA-1111]"; + else + return pdev->slot_name; +} + + +/** + * pci_pool_create - Creates a pool of pci consistent memory blocks, for dma. + * @name: name of pool, for diagnostics + * @pdev: pci device that will be doing the DMA + * @size: size of the blocks in this pool. + * @align: alignment requirement for blocks; must be a power of two + * @allocation: returned blocks won't cross this boundary (or zero) + * Context: !in_interrupt() + * + * Returns a pci allocation pool with the requested characteristics, or + * null if one can't be created. Given one of these pools, pci_pool_alloc() + * may be used to allocate memory. Such memory will all have "consistent" + * DMA mappings, accessible by the device and its driver without using + * cache flushing primitives. The actual size of blocks allocated may be + * larger than requested because of alignment. + * + * If allocation is nonzero, objects returned from pci_pool_alloc() won't + * cross that size boundary. This is useful for devices which have + * addressing restrictions on individual DMA transfers, such as not crossing + * boundaries of 4KBytes. + */ +struct pci_pool * +pci_pool_create (const char *name, struct pci_dev *pdev, + size_t size, size_t align, size_t allocation) +{ + struct pci_pool *retval; + + if (align == 0) + align = 1; + if (size == 0) + return 0; + else if (size < align) + size = align; + else if ((size % align) != 0) { + size += align + 1; + size &= ~(align - 1); + } + + if (allocation == 0) { + if (PAGE_SIZE < size) + allocation = size; + else + allocation = PAGE_SIZE; + // FIXME: round up for less fragmentation + } else if (allocation < size) + return 0; + + if (!(retval = kmalloc (sizeof *retval, SLAB_KERNEL))) + return retval; + + strncpy (retval->name, name, sizeof retval->name); + retval->name [sizeof retval->name - 1] = 0; + + retval->dev = pdev; + INIT_LIST_HEAD (&retval->page_list); + spin_lock_init (&retval->lock); + retval->size = size; + retval->allocation = allocation; + retval->blocks_per_page = allocation / size; + init_waitqueue_head (&retval->waitq); + +#ifdef CONFIG_PCIPOOL_DEBUG + printk (KERN_DEBUG "pcipool create %s/%s size %d, %d/page (%d alloc)\n", + slot_name(retval), retval->name, size, + retval->blocks_per_page, allocation); +#endif + + return retval; +} + + +static struct pci_page * +pool_alloc_page (struct pci_pool *pool, int mem_flags) +{ + struct pci_page *page; + int mapsize; + + mapsize = pool->blocks_per_page; + mapsize = (mapsize + BITS_PER_LONG - 1) / BITS_PER_LONG; + mapsize *= sizeof (long); + + page = (struct pci_page *) kmalloc (mapsize + sizeof *page, mem_flags); + if (!page) + return 0; + page->vaddr = pci_alloc_consistent (pool->dev, + pool->allocation, + &page->dma); + if (page->vaddr) { + memset (page->bitmap, 0xff, mapsize); // bit set == free +#ifdef CONFIG_DEBUG_SLAB + memset (page->vaddr, POOL_POISON_BYTE, pool->allocation); +#endif + list_add (&page->page_list, &pool->page_list); + } else { + kfree (page); + page = 0; + } + return page; +} + + +static inline int +is_page_busy (int blocks, unsigned long *bitmap) +{ + while (blocks > 0) { + if (*bitmap++ != ~0UL) + return 1; + blocks -= BITS_PER_LONG; + } + return 0; +} + +static void +pool_free_page (struct pci_pool *pool, struct pci_page *page) +{ + dma_addr_t dma = page->dma; + +#ifdef CONFIG_DEBUG_SLAB + memset (page->vaddr, POOL_POISON_BYTE, pool->allocation); +#endif + pci_free_consistent (pool->dev, pool->allocation, page->vaddr, dma); + list_del (&page->page_list); + kfree (page); +} + + +/** + * pci_pool_destroy - destroys a pool of pci memory blocks. + * @pool: pci pool that will be destroyed + * + * Caller guarantees that no more memory from the pool is in use, + * and that nothing will try to use the pool after this call. + */ +void +pci_pool_destroy (struct pci_pool *pool) +{ + unsigned long flags; + +#ifdef CONFIG_PCIPOOL_DEBUG + printk (KERN_DEBUG "pcipool destroy %s/%s\n", + slot_name(pool), pool->name); +#endif + + spin_lock_irqsave (&pool->lock, flags); + while (!list_empty (&pool->page_list)) { + struct pci_page *page; + page = list_entry (pool->page_list.next, + struct pci_page, page_list); + if (is_page_busy (pool->blocks_per_page, page->bitmap)) { + printk (KERN_ERR "pci_pool_destroy %s/%s, %p busy\n", + slot_name(pool), pool->name, page->vaddr); + /* leak the still-in-use consistent memory */ + list_del (&page->page_list); + kfree (page); + } else + pool_free_page (pool, page); + } + spin_unlock_irqrestore (&pool->lock, flags); + kfree (pool); +} + + +/** + * pci_pool_alloc - get a block of consistent memory + * @pool: pci pool that will produce the block + * @mem_flags: SLAB_KERNEL or SLAB_ATOMIC + * @handle: pointer to dma address of block + * + * This returns the kernel virtual address of a currently unused block, + * and reports its dma address through the handle. + * If such a memory block can't be allocated, null is returned. + */ +void * +pci_pool_alloc (struct pci_pool *pool, int mem_flags, dma_addr_t *handle) +{ + unsigned long flags; + struct list_head *entry; + struct pci_page *page; + int map, block; + size_t offset; + void *retval; + +restart: + spin_lock_irqsave (&pool->lock, flags); + list_for_each (entry, &pool->page_list) { + int i; + page = list_entry (entry, struct pci_page, page_list); + /* only cachable accesses here ... */ + for (map = 0, i = 0; + i < pool->blocks_per_page; + i += BITS_PER_LONG, map++) { + if (page->bitmap [map] == 0) + continue; + block = ffz (~ page->bitmap [map]); + if ((i + block) < pool->blocks_per_page) { + clear_bit (block, &page->bitmap [map]); + offset = (BITS_PER_LONG * map) + block; + offset *= pool->size; + goto ready; + } + } + } + if (!(page = pool_alloc_page (pool, mem_flags))) { + if (mem_flags == SLAB_KERNEL) { + DECLARE_WAITQUEUE (wait, current); + + current->state = TASK_INTERRUPTIBLE; + add_wait_queue (&pool->waitq, &wait); + spin_unlock_irqrestore (&pool->lock, flags); + + schedule_timeout (POOL_TIMEOUT_JIFFIES); + + current->state = TASK_RUNNING; + remove_wait_queue (&pool->waitq, &wait); + goto restart; + } + retval = 0; + goto done; + } + + clear_bit (0, &page->bitmap [0]); + offset = 0; +ready: + retval = offset + page->vaddr; + *handle = offset + page->dma; +done: + spin_unlock_irqrestore (&pool->lock, flags); + return retval; +} + + +static struct pci_page * +pool_find_page (struct pci_pool *pool, dma_addr_t dma) +{ + unsigned long flags; + struct list_head *entry; + struct pci_page *page; + + spin_lock_irqsave (&pool->lock, flags); + list_for_each (entry, &pool->page_list) { + page = list_entry (entry, struct pci_page, page_list); + if (dma < page->dma) + continue; + if (dma < (page->dma + pool->allocation)) + goto done; + } + page = 0; +done: + spin_unlock_irqrestore (&pool->lock, flags); + return page; +} + + +/** + * pci_pool_free - put block back into pci pool + * @pool: the pci pool holding the block + * @vaddr: virtual address of block + * @dma: dma address of block + * + * Caller promises neither device nor driver will again touch this block + * unless it is first re-allocated. + */ +void +pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t dma) +{ + struct pci_page *page; + unsigned long flags; + int map, block; + + if ((page = pool_find_page (pool, dma)) == 0) { + printk (KERN_ERR "pci_pool_free %s/%s, %p/%lx (bad dma)\n", + pool->dev ? pool->dev->slot_name : NULL, + pool->name, vaddr, (unsigned long) dma); + return; + } + + block = dma - page->dma; + block /= pool->size; + map = block / BITS_PER_LONG; + block %= BITS_PER_LONG; + +#ifdef CONFIG_DEBUG_SLAB + if (((dma - page->dma) + (void *)page->vaddr) != vaddr) { + printk (KERN_ERR "pci_pool_free %s/%s, %p (bad vaddr)/%lx\n", + pool->dev ? pool->dev->slot_name : NULL, + pool->name, vaddr, (unsigned long) dma); + return; + } + if (page->bitmap [map] & (1UL << block)) { + printk (KERN_ERR "pci_pool_free %s/%s, dma %x already free\n", + pool->dev ? pool->dev->slot_name : NULL, + pool->name, dma); + return; + } + memset (vaddr, POOL_POISON_BYTE, pool->size); +#endif + + spin_lock_irqsave (&pool->lock, flags); + set_bit (block, &page->bitmap [map]); + if (waitqueue_active (&pool->waitq)) + wake_up (&pool->waitq); + /* + * Resist a temptation to do + * if (!is_page_busy(bpp, page->bitmap)) pool_free_page(pool, page); + * it is not interrupt safe. Better have empty pages hang around. + */ + spin_unlock_irqrestore (&pool->lock, flags); +} + +EXPORT_SYMBOL (pci_pool_create); +EXPORT_SYMBOL (pci_pool_destroy); +EXPORT_SYMBOL (pci_pool_alloc); +EXPORT_SYMBOL (pci_pool_free); + +/* **************************************** */ + +static int __init pcipool_init(void) +{ + MOD_INC_USE_COUNT; /* never unload */ + + return 0; +} +module_init(pcipool_init); + +MODULE_LICENSE("GPL"); diff -Nru a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/arm/common/sa1111.c Sun Feb 9 21:13:36 2003 @@ -0,0 +1,1107 @@ +/* + * linux/arch/arm/mach-sa1100/sa1111.c + * + * SA1111 support + * + * Original code by John Dorsey + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This file contains all generic SA1111 support. + * + * All initialization functions provided here are intended to be called + * from machine specific code with proper arguments when required. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +/* + * We keep the following data for the overall SA1111. Note that the + * struct device and struct resource are "fake"; they should be supplied + * by the bus above us. However, in the interests of getting all SA1111 + * drivers converted over to the device model, we provide this as an + * anchor point for all the other drivers. + */ +struct sa1111 { + struct device *dev; + struct resource res; + int irq; + spinlock_t lock; + void *base; +}; + +/* + * We _really_ need to eliminate this. Its only users + * are the PWM and DMA checking code. + */ +static struct sa1111 *g_sa1111; + +static struct sa1111_dev usb_dev = { + .dev = { + .name = "Intel Corporation SA1111 [USB Controller]", + }, + .skpcr_mask = SKPCR_UCLKEN, + .devid = SA1111_DEVID_USB, + .irq = { + IRQ_USBPWR, + IRQ_HCIM, + IRQ_HCIBUFFACC, + IRQ_HCIRMTWKP, + IRQ_NHCIMFCIR, + IRQ_USB_PORT_RESUME + }, +}; + +static struct sa1111_dev sac_dev = { + .dev = { + .name = "Intel Corporation SA1111 [Audio Controller]", + }, + .skpcr_mask = SKPCR_I2SCLKEN | SKPCR_L3CLKEN, + .devid = SA1111_DEVID_SAC, + .irq = { + AUDXMTDMADONEA, + AUDXMTDMADONEB, + AUDRCVDMADONEA, + AUDRCVDMADONEB + }, +}; + +static struct sa1111_dev ssp_dev = { + .dev = { + .name = "Intel Corporation SA1111 [SSP Controller]", + }, + .skpcr_mask = SKPCR_SCLKEN, + .devid = SA1111_DEVID_SSP, +}; + +static struct sa1111_dev kbd_dev = { + .dev = { + .name = "Intel Corporation SA1111 [PS2]", + }, + .skpcr_mask = SKPCR_PTCLKEN, + .devid = SA1111_DEVID_PS2, + .irq = { + IRQ_TPRXINT, + IRQ_TPTXINT + }, +}; + +static struct sa1111_dev mse_dev = { + .dev = { + .name = "Intel Corporation SA1111 [PS2]", + }, + .skpcr_mask = SKPCR_PMCLKEN, + .devid = SA1111_DEVID_PS2, + .irq = { + IRQ_MSRXINT, + IRQ_MSTXINT + }, +}; + +static struct sa1111_dev int_dev = { + .dev = { + .name = "Intel Corporation SA1111 [Interrupt Controller]", + }, + .skpcr_mask = 0, + .devid = SA1111_DEVID_INT, +}; + +static struct sa1111_dev pcmcia_dev = { + .dev = { + .name = "Intel Corporation SA1111 [PCMCIA Controller]", + }, + .skpcr_mask = 0, + .devid = SA1111_DEVID_PCMCIA, + .irq = { + IRQ_S0_READY_NINT, + IRQ_S0_CD_VALID, + IRQ_S0_BVD1_STSCHG, + IRQ_S1_READY_NINT, + IRQ_S1_CD_VALID, + IRQ_S1_BVD1_STSCHG, + }, +}; + +static struct sa1111_dev *devs[] = { + &usb_dev, + &sac_dev, + &ssp_dev, + &kbd_dev, + &mse_dev, + &pcmcia_dev, +}; + +static unsigned int dev_offset[] = { + SA1111_USB, + 0x0600, + 0x0800, + SA1111_KBD, + SA1111_MSE, + 0x1800, +}; + +/* + * SA1111 interrupt support. Since clearing an IRQ while there are + * active IRQs causes the interrupt output to pulse, the upper levels + * will call us again if there are more interrupts to process. + */ +static void +sa1111_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +{ + unsigned int stat0, stat1, i; + + stat0 = INTSTATCLR0; + stat1 = INTSTATCLR1; + + INTSTATCLR0 = stat0; + + desc->chip->ack(irq); + + INTSTATCLR1 = stat1; + + if (stat0 == 0 && stat1 == 0) { + do_bad_IRQ(irq, desc, regs); + return; + } + + for (i = IRQ_SA1111_START; stat0; i++, stat0 >>= 1) + if (stat0 & 1) + do_edge_IRQ(i, irq_desc + i, regs); + + for (i = IRQ_SA1111_START + 32; stat1; i++, stat1 >>= 1) + if (stat1 & 1) + do_edge_IRQ(i, irq_desc + i, regs); + + /* For level-based interrupts */ + desc->chip->unmask(irq); +} + +#define SA1111_IRQMASK_LO(x) (1 << (x - IRQ_SA1111_START)) +#define SA1111_IRQMASK_HI(x) (1 << (x - IRQ_SA1111_START - 32)) + +static void sa1111_ack_irq(unsigned int irq) +{ +} + +static void sa1111_mask_lowirq(unsigned int irq) +{ + INTEN0 &= ~SA1111_IRQMASK_LO(irq); +} + +static void sa1111_unmask_lowirq(unsigned int irq) +{ + INTEN0 |= SA1111_IRQMASK_LO(irq); +} + +/* + * Attempt to re-trigger the interrupt. The SA1111 contains a register + * (INTSET) which claims to do this. However, in practice no amount of + * manipulation of INTEN and INTSET guarantees that the interrupt will + * be triggered. In fact, its very difficult, if not impossible to get + * INTSET to re-trigger the interrupt. + */ +static void sa1111_rerun_lowirq(unsigned int irq) +{ + unsigned int mask = SA1111_IRQMASK_LO(irq); + int i; + + for (i = 0; i < 8; i++) { + INTPOL0 ^= mask; + INTPOL0 ^= mask; + if (INTSTATCLR1 & mask) + break; + } + + if (i == 8) + printk(KERN_ERR "Danger Will Robinson: failed to " + "re-trigger IRQ%d\n", irq); +} + +static int sa1111_type_lowirq(unsigned int irq, unsigned int flags) +{ + unsigned int mask = SA1111_IRQMASK_LO(irq); + + if (flags == IRQT_PROBE) + return 0; + + if ((!(flags & __IRQT_RISEDGE) ^ !(flags & __IRQT_FALEDGE)) == 0) + return -EINVAL; + + if (flags & __IRQT_RISEDGE) + INTPOL0 &= ~mask; + else + INTPOL0 |= mask; + WAKE_POL0 = INTPOL0; + + return 0; +} + +static int sa1111_wake_lowirq(unsigned int irq, unsigned int on) +{ + unsigned int mask = SA1111_IRQMASK_LO(irq); + + if (on) + WAKE_EN0 |= mask; + else + WAKE_EN0 &= ~mask; + + return 0; +} + +static struct irqchip sa1111_low_chip = { + .ack = sa1111_ack_irq, + .mask = sa1111_mask_lowirq, + .unmask = sa1111_unmask_lowirq, + .rerun = sa1111_rerun_lowirq, + .type = sa1111_type_lowirq, + .wake = sa1111_wake_lowirq, +}; + +static void sa1111_mask_highirq(unsigned int irq) +{ + INTEN1 &= ~SA1111_IRQMASK_HI(irq); +} + +static void sa1111_unmask_highirq(unsigned int irq) +{ + INTEN1 |= SA1111_IRQMASK_HI(irq); +} + +/* + * Attempt to re-trigger the interrupt. The SA1111 contains a register + * (INTSET) which claims to do this. However, in practice no amount of + * manipulation of INTEN and INTSET guarantees that the interrupt will + * be triggered. In fact, its very difficult, if not impossible to get + * INTSET to re-trigger the interrupt. + */ +static void sa1111_rerun_highirq(unsigned int irq) +{ + unsigned int mask = SA1111_IRQMASK_HI(irq); + int i; + + for (i = 0; i < 8; i++) { + INTPOL1 ^= mask; + INTPOL1 ^= mask; + if (INTSTATCLR1 & mask) + break; + } + + if (i == 8) + printk(KERN_ERR "Danger Will Robinson: failed to " + "re-trigger IRQ%d\n", irq); +} + +static int sa1111_type_highirq(unsigned int irq, unsigned int flags) +{ + unsigned int mask = SA1111_IRQMASK_HI(irq); + + if (flags == IRQT_PROBE) + return 0; + + if ((!(flags & __IRQT_RISEDGE) ^ !(flags & __IRQT_FALEDGE)) == 0) + return -EINVAL; + + if (flags & __IRQT_RISEDGE) + INTPOL1 &= ~mask; + else + INTPOL1 |= mask; + WAKE_POL1 = INTPOL1; + + return 0; +} + +static int sa1111_wake_highirq(unsigned int irq, unsigned int on) +{ + unsigned int mask = SA1111_IRQMASK_HI(irq); + + if (on) + WAKE_EN1 |= mask; + else + WAKE_EN1 &= ~mask; + + return 0; +} + +static struct irqchip sa1111_high_chip = { + .ack = sa1111_ack_irq, + .mask = sa1111_mask_highirq, + .unmask = sa1111_unmask_highirq, + .rerun = sa1111_rerun_highirq, + .type = sa1111_type_highirq, + .wake = sa1111_wake_highirq, +}; + +static void __init sa1111_init_irq(struct sa1111_dev *sadev) +{ + unsigned int irq; + + /* + * We're guaranteed that this region hasn't been taken. + */ + request_mem_region(sadev->res.start, 512, "irqs"); + + /* disable all IRQs */ + sa1111_writel(0, sadev->mapbase + SA1111_INTEN0); + sa1111_writel(0, sadev->mapbase + SA1111_INTEN1); + sa1111_writel(0, sadev->mapbase + SA1111_WAKEEN0); + sa1111_writel(0, sadev->mapbase + SA1111_WAKEEN1); + + /* + * detect on rising edge. Note: Feb 2001 Errata for SA1111 + * specifies that S0ReadyInt and S1ReadyInt should be '1'. + */ + sa1111_writel(0, sadev->mapbase + SA1111_INTPOL0); + sa1111_writel(SA1111_IRQMASK_HI(IRQ_S0_READY_NINT) | + SA1111_IRQMASK_HI(IRQ_S1_READY_NINT), + sadev->mapbase + SA1111_INTPOL1); + + /* clear all IRQs */ + sa1111_writel(~0, sadev->mapbase + SA1111_INTSTATCLR0); + sa1111_writel(~0, sadev->mapbase + SA1111_INTSTATCLR1); + + for (irq = IRQ_GPAIN0; irq <= SSPROR; irq++) { + set_irq_chip(irq, &sa1111_low_chip); + set_irq_handler(irq, do_edge_IRQ); + set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); + } + + for (irq = AUDXMTDMADONEA; irq <= IRQ_S1_BVD1_STSCHG; irq++) { + set_irq_chip(irq, &sa1111_high_chip); + set_irq_handler(irq, do_edge_IRQ); + set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); + } + + /* + * Register SA1111 interrupt + */ + set_irq_type(sadev->irq[0], IRQT_RISING); + set_irq_chained_handler(sadev->irq[0], sa1111_irq_handler); +} + +/* + * Bring the SA1111 out of reset. This requires a set procedure: + * 1. nRESET asserted (by hardware) + * 2. CLK turned on from SA1110 + * 3. nRESET deasserted + * 4. VCO turned on, PLL_BYPASS turned off + * 5. Wait lock time, then assert RCLKEn + * 7. PCR set to allow clocking of individual functions + * + * Until we've done this, the only registers we can access are: + * SBI_SKCR + * SBI_SMCR + * SBI_SKID + */ +static void sa1111_wake(struct sa1111 *sachip) +{ + unsigned long flags, r; + + spin_lock_irqsave(&sachip->lock, flags); + + /* + * First, set up the 3.6864MHz clock on GPIO 27 for the SA-1111: + * (SA-1110 Developer's Manual, section 9.1.2.1) + */ + GAFR |= GPIO_32_768kHz; + GPDR |= GPIO_32_768kHz; + TUCR = TUCR_3_6864MHz; + + /* + * Turn VCO on, and disable PLL Bypass. + */ + r = sa1111_readl(sachip->base + SA1111_SKCR); + r &= ~SKCR_VCO_OFF; + sa1111_writel(r, sachip->base + SA1111_SKCR); + r |= SKCR_PLL_BYPASS | SKCR_OE_EN; + sa1111_writel(r, sachip->base + SA1111_SKCR); + + /* + * Wait lock time. SA1111 manual _doesn't_ + * specify a figure for this! We choose 100us. + */ + udelay(100); + + /* + * Enable RCLK. We also ensure that RDYEN is set. + */ + r |= SKCR_RCLKEN | SKCR_RDYEN; + sa1111_writel(r, sachip->base + SA1111_SKCR); + + /* + * Wait 14 RCLK cycles for the chip to finish coming out + * of reset. (RCLK=24MHz). This is 590ns. + */ + udelay(1); + + /* + * Ensure all clocks are initially off. + */ + sa1111_writel(0, sachip->base + SA1111_SKPCR); + + spin_unlock_irqrestore(&sachip->lock, flags); +} + +/* + * Configure the SA1111 shared memory controller. + */ +void +sa1111_configure_smc(struct sa1111 *sachip, int sdram, unsigned int drac, + unsigned int cas_latency) +{ + unsigned int smcr = SMCR_DTIM | SMCR_MBGE | FInsrt(drac, SMCR_DRAC); + + if (cas_latency == 3) + smcr |= SMCR_CLAT; + + sa1111_writel(smcr, sachip->base + SA1111_SMCR); +} + +static void +sa1111_init_one_child(struct sa1111 *sachip, struct sa1111_dev *sadev, unsigned int offset) +{ + snprintf(sadev->dev.bus_id, sizeof(sadev->dev.bus_id), + "%4.4x", offset); + + sadev->dev.parent = sachip->dev; + sadev->dev.bus = &sa1111_bus_type; + sadev->res.start = sachip->res.start + offset; + sadev->res.end = sadev->res.start + 511; + sadev->res.name = sadev->dev.name; + sadev->res.flags = IORESOURCE_MEM; + sadev->mapbase = sachip->base + offset; + + if (request_resource(&sachip->res, &sadev->res)) { + printk("SA1111: failed to allocate resource for %s\n", + sadev->res.name); + return; + } + + device_register(&sadev->dev); +} + +/** + * sa1111_probe - probe for a single SA1111 chip. + * @phys_addr: physical address of device. + * + * Probe for a SA1111 chip. This must be called + * before any other SA1111-specific code. + * + * Returns: + * %-ENODEV device not found. + * %-EBUSY physical address already marked in-use. + * %0 successful. + */ +static int __init +__sa1111_probe(struct device *me, unsigned long phys_addr, int irq) +{ + struct sa1111 *sachip; + unsigned long id; + unsigned int has_devs, val; + int i, ret = -ENODEV; + + sachip = kmalloc(sizeof(struct sa1111), GFP_KERNEL); + if (!sachip) + return -ENOMEM; + + memset(sachip, 0, sizeof(struct sa1111)); + + spin_lock_init(&sachip->lock); + + sachip->dev = me; + dev_set_drvdata(sachip->dev, sachip); + + sachip->res.name = me->name; + sachip->res.start = phys_addr; + sachip->res.end = phys_addr + 0x2000; + sachip->irq = irq; + + if (request_resource(&iomem_resource, &sachip->res)) { + ret = -EBUSY; + goto out; + } + + /* + * Map the whole region. This also maps the + * registers for our children. + */ + sachip->base = ioremap(phys_addr, PAGE_SIZE * 2); + if (!sachip->base) { + ret = -ENOMEM; + goto release; + } + + /* + * Probe for the chip. Only touch the SBI registers. + */ + id = sa1111_readl(sachip->base + SA1111_SKID); + if ((id & SKID_ID_MASK) != SKID_SA1111_ID) { + printk(KERN_DEBUG "SA1111 not detected: ID = %08lx\n", id); + ret = -ENODEV; + goto unmap; + } + + printk(KERN_INFO "SA1111 Microprocessor Companion Chip: " + "silicon revision %lx, metal revision %lx\n", + (id & SKID_SIREV_MASK)>>4, (id & SKID_MTREV_MASK)); + + /* + * We found it. Wake the chip up, and initialise. + */ + sa1111_wake(sachip); + + /* + * The SDRAM configuration of the SA1110 and the SA1111 must + * match. This is very important to ensure that SA1111 accesses + * don't corrupt the SDRAM. Note that this ungates the SA1111's + * MBGNT signal, so we must have called sa1110_mb_disable() + * beforehand. + */ + sa1111_configure_smc(sachip, 1, + FExtr(MDCNFG, MDCNFG_SA1110_DRAC0), + FExtr(MDCNFG, MDCNFG_SA1110_TDL0)); + + /* + * We only need to turn on DCLK whenever we want to use the + * DMA. It can otherwise be held firmly in the off position. + * (currently, we always enable it.) + */ + val = sa1111_readl(sachip->base + SA1111_SKPCR); + sa1111_writel(val | SKPCR_DCLKEN, sachip->base + SA1111_SKPCR); + + /* + * Enable the SA1110 memory bus request and grant signals. + */ + sa1110_mb_enable(); + + /* + * The interrupt controller must be initialised before any + * other device to ensure that the interrupts are available. + */ + int_dev.irq[0] = irq; + sa1111_init_one_child(sachip, &int_dev, SA1111_INTC); + sa1111_init_irq(&int_dev); + + g_sa1111 = sachip; + + has_devs = ~0; + if (machine_is_assabet() || machine_is_jornada720() || + machine_is_badge4()) + has_devs &= ~(1 << 4); + else + has_devs &= ~(1 << 1); + + for (i = 0; i < ARRAY_SIZE(devs); i++) + if (has_devs & (1 << i)) + sa1111_init_one_child(sachip, devs[i], dev_offset[i]); + + return 0; + + unmap: + iounmap(sachip->base); + release: + release_resource(&sachip->res); + out: + kfree(sachip); + return ret; +} + +static void __sa1111_remove(struct sa1111 *sachip) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(devs); i++) { + put_device(&devs[i]->dev); + release_resource(&devs[i]->res); + } + + iounmap(sachip->base); + release_resource(&sachip->res); + kfree(sachip); +} + +/* + * According to the "Intel StrongARM SA-1111 Microprocessor Companion + * Chip Specification Update" (June 2000), erratum #7, there is a + * significant bug in the SA1111 SDRAM shared memory controller. If + * an access to a region of memory above 1MB relative to the bank base, + * it is important that address bit 10 _NOT_ be asserted. Depending + * on the configuration of the RAM, bit 10 may correspond to one + * of several different (processor-relative) address bits. + * + * This routine only identifies whether or not a given DMA address + * is susceptible to the bug. + */ +int sa1111_check_dma_bug(dma_addr_t addr) +{ + struct sa1111 *sachip = g_sa1111; + unsigned int physaddr = SA1111_DMA_ADDR((unsigned int)addr); + unsigned int smcr; + + /* Section 4.6 of the "Intel StrongARM SA-1111 Development Module + * User's Guide" mentions that jumpers R51 and R52 control the + * target of SA-1111 DMA (either SDRAM bank 0 on Assabet, or + * SDRAM bank 1 on Neponset). The default configuration selects + * Assabet, so any address in bank 1 is necessarily invalid. + */ + if ((machine_is_assabet() || machine_is_pfs168()) && addr >= 0xc8000000) + return -1; + + /* The bug only applies to buffers located more than one megabyte + * above the start of the target bank: + */ + if (physaddr<(1<<20)) + return 0; + + smcr = sa1111_readl(sachip->base + SA1111_SMCR); + switch (FExtr(smcr, SMCR_DRAC)) { + case 01: /* 10 row + bank address bits, A<20> must not be set */ + if (physaddr & (1<<20)) + return -1; + break; + case 02: /* 11 row + bank address bits, A<23> must not be set */ + if (physaddr & (1<<23)) + return -1; + break; + case 03: /* 12 row + bank address bits, A<24> must not be set */ + if (physaddr & (1<<24)) + return -1; + break; + case 04: /* 13 row + bank address bits, A<25> must not be set */ + if (physaddr & (1<<25)) + return -1; + break; + case 05: /* 14 row + bank address bits, A<20> must not be set */ + if (physaddr & (1<<20)) + return -1; + break; + case 06: /* 15 row + bank address bits, A<20> must not be set */ + if (physaddr & (1<<20)) + return -1; + break; + default: + printk(KERN_ERR "%s(): invalid SMCR DRAC value 0%lo\n", + __FUNCTION__, FExtr(smcr, SMCR_DRAC)); + return -1; + } + + return 0; +} + +struct sa1111_save_data { + unsigned int skcr; + unsigned int skpcr; + unsigned int skcdr; + unsigned char skaud; + unsigned char skpwm0; + unsigned char skpwm1; + + /* + * Interrupt controller + */ + unsigned int intpol0; + unsigned int intpol1; + unsigned int inten0; + unsigned int inten1; + unsigned int wakepol0; + unsigned int wakepol1; + unsigned int wakeen0; + unsigned int wakeen1; +}; + +static int sa1111_suspend(struct device *dev, u32 state, u32 level) +{ + struct sa1111 *sachip = dev_get_drvdata(dev); + unsigned long flags; + char *base; + + /* + * Save state. + */ + if (level == SUSPEND_SAVE_STATE || + level == SUSPEND_DISABLE || + level == SUSPEND_POWER_DOWN) { + struct sa1111_save_data *save; + + if (!dev->saved_state) + dev->saved_state = kmalloc(sizeof(struct sa1111_save_data), GFP_KERNEL); + if (!dev->saved_state) + return -ENOMEM; + + save = (struct sa1111_save_data *)dev->saved_state; + + spin_lock_irqsave(&sachip->lock, flags); + base = sachip->base; + save->skcr = sa1111_readl(base + SA1111_SKCR); + save->skpcr = sa1111_readl(base + SA1111_SKPCR); + save->skcdr = sa1111_readl(base + SA1111_SKCDR); + save->skaud = sa1111_readl(base + SA1111_SKAUD); + save->skpwm0 = sa1111_readl(base + SA1111_SKPWM0); + save->skpwm1 = sa1111_readl(base + SA1111_SKPWM1); + + base = sachip->base + SA1111_INTC; + save->intpol0 = sa1111_readl(base + SA1111_INTPOL0); + save->intpol1 = sa1111_readl(base + SA1111_INTPOL1); + save->inten0 = sa1111_readl(base + SA1111_INTEN0); + save->inten1 = sa1111_readl(base + SA1111_INTEN1); + save->wakepol0 = sa1111_readl(base + SA1111_WAKEPOL0); + save->wakepol1 = sa1111_readl(base + SA1111_WAKEPOL1); + save->wakeen0 = sa1111_readl(base + SA1111_WAKEEN0); + save->wakeen1 = sa1111_readl(base + SA1111_WAKEEN1); + spin_unlock_irqrestore(&sachip->lock, flags); + } + + /* + * Disable. + */ + if (level == SUSPEND_DISABLE && state == 4) { + unsigned int val; + + spin_lock_irqsave(&sachip->lock, flags); + base = sachip->base; + + sa1111_writel(0, base + SA1111_SKPWM0); + sa1111_writel(0, base + SA1111_SKPWM1); + val = sa1111_readl(base + SA1111_SKCR); + sa1111_writel(val | SKCR_SLEEP, base + SA1111_SKCR); + + spin_unlock_irqrestore(&sachip->lock, flags); + } + + return 0; +} + +/* + * sa1111_resume - Restore the SA1111 device state. + * @dev: device to restore + * @level: resume level + * + * Restore the general state of the SA1111; clock control and + * interrupt controller. Other parts of the SA1111 must be + * restored by their respective drivers, and must be called + * via LDM after this function. + */ +static int sa1111_resume(struct device *dev, u32 level) +{ + struct sa1111 *sachip = dev_get_drvdata(dev); + struct sa1111_save_data *save; + unsigned long flags, id; + char *base; + + if (level != RESUME_RESTORE_STATE && level != RESUME_ENABLE) + return 0; + + save = (struct sa1111_save_data *)dev->saved_state; + if (!save) + return 0; + + dev->saved_state = NULL; + + /* + * Ensure that the SA1111 is still here. + */ + id = sa1111_readl(sachip->base + SA1111_SKID); + if ((id & SKID_ID_MASK) != SKID_SA1111_ID) { + __sa1111_remove(sachip); + dev_set_drvdata(dev, NULL); + kfree(save); + return 0; + } + + spin_lock_irqsave(&sachip->lock, flags); + sa1111_wake(sachip); + + base = sachip->base; + sa1111_writel(save->skcr, base + SA1111_SKCR); + sa1111_writel(save->skpcr, base + SA1111_SKPCR); + sa1111_writel(save->skcdr, base + SA1111_SKCDR); + sa1111_writel(save->skaud, base + SA1111_SKAUD); + sa1111_writel(save->skpwm0, base + SA1111_SKPWM0); + sa1111_writel(save->skpwm1, base + SA1111_SKPWM1); + + base = sachip->base + SA1111_INTC; + sa1111_writel(save->intpol0, base + SA1111_INTPOL0); + sa1111_writel(save->intpol1, base + SA1111_INTPOL1); + sa1111_writel(save->inten0, base + SA1111_INTEN0); + sa1111_writel(save->inten1, base + SA1111_INTEN1); + sa1111_writel(save->wakepol0, base + SA1111_WAKEPOL0); + sa1111_writel(save->wakepol1, base + SA1111_WAKEPOL1); + sa1111_writel(save->wakeen0, base + SA1111_WAKEEN0); + sa1111_writel(save->wakeen1, base + SA1111_WAKEEN1); + spin_unlock_irqrestore(&sachip->lock, flags); + + kfree(save); + + return 0; +} + +static int sa1111_probe(struct device *dev) +{ + return -ENODEV; +} + +static int sa1111_remove(struct device *dev) +{ + struct sa1111 *sachip = dev_get_drvdata(dev); + + if (sachip) { + __sa1111_remove(sachip); + dev_set_drvdata(dev, NULL); + + kfree(dev->saved_state); + dev->saved_state = NULL; + } + + return 0; +} + +/* + * Not sure if this should be on the system bus or not yet. + * We really want some way to register a system device at + * the per-machine level, and then have this driver pick + * up the registered devices. + * + * We also need to handle the SDRAM configuration for + * PXA250/SA1110 machine classes. + */ +static struct device_driver sa1111_device_driver = { + .name = "sa1111", + .bus = &system_bus_type, + .probe = sa1111_probe, + .remove = sa1111_remove, + .suspend = sa1111_suspend, + .resume = sa1111_resume, +}; + +/* + * Register the SA1111 driver with LDM. + */ +static int sa1111_driver_init(void) +{ + driver_register(&sa1111_device_driver); + return 0; +} + +arch_initcall(sa1111_driver_init); + +static struct sys_device sa1111_device = { + .name = "SA1111", + .id = 0, + .root = NULL, + .dev = { + .name = "Intel Corporation SA1111", + .driver = &sa1111_device_driver, + }, +}; + +int sa1111_init(unsigned long phys, unsigned int irq) +{ + int ret; + + snprintf(sa1111_device.dev.bus_id, sizeof(sa1111_device.dev.bus_id), "%8.8lx", phys); + + ret = sys_device_register(&sa1111_device); + if (ret) + printk("sa1111 device_register failed: %d\n", ret); + + return __sa1111_probe(&sa1111_device.dev, phys, irq); +} + +/* + * Get the parent device driver (us) structure + * from a child function device + */ +static inline struct sa1111 *sa1111_chip_driver(struct sa1111_dev *sadev) +{ + return (struct sa1111 *)dev_get_drvdata(sadev->dev.parent); +} + +/* + * The bits in the opdiv field are non-linear. + */ +static unsigned char opdiv_table[] = { 1, 4, 2, 8 }; + +static unsigned int __sa1111_pll_clock(struct sa1111 *sachip) +{ + unsigned int skcdr, fbdiv, ipdiv, opdiv; + + skcdr = sa1111_readl(sachip->base + SA1111_SKCDR); + + fbdiv = (skcdr & 0x007f) + 2; + ipdiv = ((skcdr & 0x0f80) >> 7) + 2; + opdiv = opdiv_table[(skcdr & 0x3000) >> 12]; + + return 3686400 * fbdiv / (ipdiv * opdiv); +} + +/** + * sa1111_pll_clock - return the current PLL clock frequency. + * @sadev: SA1111 function block + * + * BUG: we should look at SKCR. We also blindly believe that + * the chip is being fed with the 3.6864MHz clock. + * + * Returns the PLL clock in Hz. + */ +unsigned int sa1111_pll_clock(struct sa1111_dev *sadev) +{ + struct sa1111 *sachip = sa1111_chip_driver(sadev); + + return __sa1111_pll_clock(sachip); +} + +/** + * sa1111_select_audio_mode - select I2S or AC link mode + * @sadev: SA1111 function block + * @mode: One of %SA1111_AUDIO_ACLINK or %SA1111_AUDIO_I2S + * + * Frob the SKCR to select AC Link mode or I2S mode for + * the audio block. + */ +void sa1111_select_audio_mode(struct sa1111_dev *sadev, int mode) +{ + struct sa1111 *sachip = sa1111_chip_driver(sadev); + unsigned long flags; + unsigned int val; + + spin_lock_irqsave(&sachip->lock, flags); + + val = sa1111_readl(sachip->base + SA1111_SKCR); + if (mode == SA1111_AUDIO_I2S) { + val &= ~SKCR_SELAC; + } else { + val |= SKCR_SELAC; + } + sa1111_writel(val, sachip->base + SA1111_SKCR); + + spin_unlock_irqrestore(&sachip->lock, flags); +} + +/** + * sa1111_set_audio_rate - set the audio sample rate + * @sadev: SA1111 SAC function block + * @rate: sample rate to select + */ +int sa1111_set_audio_rate(struct sa1111_dev *sadev, int rate) +{ + struct sa1111 *sachip = sa1111_chip_driver(sadev); + unsigned int div; + + if (sadev->devid != SA1111_DEVID_SAC) + return -EINVAL; + + div = (__sa1111_pll_clock(sachip) / 256 + rate / 2) / rate; + if (div == 0) + div = 1; + if (div > 128) + div = 128; + + sa1111_writel(div - 1, sachip->base + SA1111_SKAUD); + + return 0; +} + +/** + * sa1111_get_audio_rate - get the audio sample rate + * @sadev: SA1111 SAC function block device + */ +int sa1111_get_audio_rate(struct sa1111_dev *sadev) +{ + struct sa1111 *sachip = sa1111_chip_driver(sadev); + unsigned long div; + + if (sadev->devid != SA1111_DEVID_SAC) + return -EINVAL; + + div = sa1111_readl(sachip->base + SA1111_SKAUD) + 1; + + return __sa1111_pll_clock(sachip) / (256 * div); +} + +/* + * Individual device operations. + */ + +/** + * sa1111_enable_device - enable an on-chip SA1111 function block + * @sadev: SA1111 function block device to enable + */ +void sa1111_enable_device(struct sa1111_dev *sadev) +{ + struct sa1111 *sachip = sa1111_chip_driver(sadev); + unsigned long flags; + unsigned int val; + + spin_lock_irqsave(&sachip->lock, flags); + val = sa1111_readl(sachip->base + SA1111_SKPCR); + sa1111_writel(val | sadev->skpcr_mask, sachip->base + SA1111_SKPCR); + spin_unlock_irqrestore(&sachip->lock, flags); +} + +/** + * sa1111_disable_device - disable an on-chip SA1111 function block + * @sadev: SA1111 function block device to disable + */ +void sa1111_disable_device(struct sa1111_dev *sadev) +{ + struct sa1111 *sachip = sa1111_chip_driver(sadev); + unsigned long flags; + unsigned int val; + + spin_lock_irqsave(&sachip->lock, flags); + val = sa1111_readl(sachip->base + SA1111_SKPCR); + sa1111_writel(val & ~sadev->skpcr_mask, sachip->base + SA1111_SKPCR); + spin_unlock_irqrestore(&sachip->lock, flags); +} + +/* + * SA1111 "Register Access Bus." + * + * We model this as a regular bus type, and hang devices directly + * off this. + */ +static int sa1111_match(struct device *_dev, struct device_driver *_drv) +{ + struct sa1111_dev *dev = SA1111_DEV(_dev); + struct sa1111_driver *drv = SA1111_DRV(_drv); + + return dev->devid == drv->devid; +} + +struct bus_type sa1111_bus_type = { + .name = "RAB", + .match = sa1111_match, +}; + +static int sa1111_rab_bus_init(void) +{ + return bus_register(&sa1111_bus_type); +} + +postcore_initcall(sa1111_rab_bus_init); + +EXPORT_SYMBOL(sa1111_check_dma_bug); +EXPORT_SYMBOL(sa1111_select_audio_mode); +EXPORT_SYMBOL(sa1111_set_audio_rate); +EXPORT_SYMBOL(sa1111_get_audio_rate); +EXPORT_SYMBOL(sa1111_enable_device); +EXPORT_SYMBOL(sa1111_disable_device); +EXPORT_SYMBOL(sa1111_pll_clock); +EXPORT_SYMBOL(sa1111_bus_type); diff -Nru a/arch/arm/common/via82c505.c b/arch/arm/common/via82c505.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/arm/common/via82c505.c Sun Feb 9 21:13:28 2003 @@ -0,0 +1,94 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#define MAX_SLOTS 7 + +#define CONFIG_CMD(bus, devfn, where) (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3)) + +static int +via82c505_read_config(struct pci_bus *bus, unsigned int devfn, int where, + int size, u32 *value) +{ + outl(CONFIG_CMD(bus,devfn,where),0xCF8); + switch (size) { + case 1: + *value=inb(0xCFC + (where&3)); + break; + case 2: + *value=inw(0xCFC + (where&2)); + break; + case 4: + *value=inl(0xCFC); + break; + } + return PCIBIOS_SUCCESSFUL; +} + +static int +via82c505_write_config(struct pci_bus *bus, unsigned int devfn, int where, + int size, u32 value) +{ + outl(CONFIG_CMD(bus,devfn,where),0xCF8); + switch (size) { + case 1: + outb(value, 0xCFC + (where&3)); + break; + case 2: + outw(value, 0xCFC + (where&2)); + break; + case 4: + outl(value, 0xCFC); + break; + } + return PCIBIOS_SUCCESSFUL; +} + +static struct pci_ops via82c505_ops = { + .read = via82c505_read_config, + .write = via82c505_write_config, +}; + +void __init via82c505_preinit(void *sysdata) +{ + printk(KERN_DEBUG "PCI: VIA 82c505\n"); + if (!request_region(0xA8,2,"via config")) { + printk(KERN_WARNING"VIA 82c505: Unable to request region 0xA8\n"); + return; + } + if (!request_region(0xCF8,8,"pci config")) { + printk(KERN_WARNING"VIA 82c505: Unable to request region 0xCF8\n"); + release_region(0xA8, 2); + return; + } + + /* Enable compatible Mode */ + outb(0x96,0xA8); + outb(0x18,0xA9); + outb(0x93,0xA8); + outb(0xd0,0xA9); + +} + +int __init via82c505_setup(int nr, struct pci_sys_data *sys) +{ + return (nr == 0); +} + +struct pci_bus * __init via82c505_scan_bus(int nr, struct pci_sys_data *sysdata) +{ + if (nr == 0) + return pci_scan_bus(0, &via82c505_ops, sysdata); + + return NULL; +} diff -Nru a/arch/arm/def-configs/hackkit b/arch/arm/def-configs/hackkit --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/arm/def-configs/hackkit Sun Feb 9 21:13:38 2003 @@ -0,0 +1,654 @@ +# +# Automatically generated make config: don't edit +# +CONFIG_ARM=y +CONFIG_MMU=y +CONFIG_SWAP=y +CONFIG_UID16=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# General setup +# +CONFIG_NET=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y + +# +# Loadable module support +# +CONFIG_MODULES=y +# CONFIG_MODULE_UNLOAD is not set +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_KMOD=y + +# +# System Type +# +# CONFIG_ARCH_ADIFCC is not set +# CONFIG_ARCH_ANAKIN is not set +# CONFIG_ARCH_ARCA5K is not set +# CONFIG_ARCH_CLPS7500 is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_CO285 is not set +# CONFIG_ARCH_PXA is not set +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_CAMELOT is not set +# CONFIG_ARCH_FOOTBRIDGE is not set +# CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_IOP310 is not set +# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_RPC is not set +CONFIG_ARCH_SA1100=y +# CONFIG_ARCH_SHARK is not set + +# +# Archimedes/A5000 Implementations +# + +# +# Archimedes/A5000 Implementations (select only ONE) +# + +# +# CLPS711X/EP721X Implementations +# + +# +# Epxa10db +# + +# +# Footbridge Implementations +# + +# +# IOP310 Implementation Options +# + +# +# IOP310 Chipset Features +# + +# +# Intel PXA250/210 Implementations +# + +# +# SA11x0 Implementations +# +# CONFIG_SA1100_ASSABET is not set +# CONFIG_SA1100_ADSBITSY is not set +# CONFIG_SA1100_BRUTUS is not set +# CONFIG_SA1100_CERF is not set +# CONFIG_SA1100_H3100 is not set +# CONFIG_SA1100_H3600 is not set +# CONFIG_SA1100_H3800 is not set +# CONFIG_SA1100_EXTENEX1 is not set +# CONFIG_SA1100_FLEXANET is not set +# CONFIG_SA1100_FREEBIRD is not set +# CONFIG_SA1100_GRAPHICSCLIENT is not set +# CONFIG_SA1100_GRAPHICSMASTER is not set +# CONFIG_SA1100_BADGE4 is not set +# CONFIG_SA1100_JORNADA720 is not set +CONFIG_SA1100_HACKKIT=y +# CONFIG_SA1100_HUW_WEBPANEL is not set +# CONFIG_SA1100_ITSY is not set +# CONFIG_SA1100_LART is not set +# CONFIG_SA1100_NANOENGINE is not set +# CONFIG_SA1100_OMNIMETER is not set +# CONFIG_SA1100_PANGOLIN is not set +# CONFIG_SA1100_PLEB is not set +# CONFIG_SA1100_PT_SYSTEM3 is not set +# CONFIG_SA1100_SHANNON is not set +# CONFIG_SA1100_SHERMAN is not set +# CONFIG_SA1100_SIMPAD is not set +# CONFIG_SA1100_PFS168 is not set +# CONFIG_SA1100_VICTOR is not set +# CONFIG_SA1100_XP860 is not set +# CONFIG_SA1100_YOPY is not set +# CONFIG_SA1100_STORK is not set +# CONFIG_SA1100_USB is not set + +# +# Processor Type +# +CONFIG_CPU_32=y +CONFIG_CPU_SA1100=y +CONFIG_CPU_32v4=y + +# +# Processor Features +# + +# +# General setup +# +CONFIG_DISCONTIGMEM=y +CONFIG_ISA=y +# CONFIG_ZBOOT_ROM is not set +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_24_API=y +CONFIG_CPU_FREQ_26_API=y +# CONFIG_HOTPLUG is not set + +# +# At least one math emulation must be selected +# +CONFIG_FPE_NWFPE=y +# CONFIG_FPE_FASTFPE is not set +CONFIG_KCORE_ELF=y +# CONFIG_KCORE_AOUT is not set +CONFIG_BINFMT_AOUT=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_PM is not set +# CONFIG_PREEMPT is not set +# CONFIG_ARTHUR is not set +CONFIG_CMDLINE="console=ttySA0,115200 root=/dev/ram0 initrd=0xc0400000,8M init=/rootshell" +CONFIG_LEDS=y +CONFIG_LEDS_TIMER=y +CONFIG_LEDS_CPU=y +CONFIG_ALIGNMENT_TRAP=y + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Memory Technology Devices (MTD) +# +CONFIG_MTD=y +CONFIG_MTD_DEBUG=y +CONFIG_MTD_DEBUG_VERBOSE=3 +# CONFIG_MTD_PARTITIONS is not set +# CONFIG_MTD_CONCAT is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set + +# +# RAM/ROM/Flash chip drivers +# +CONFIG_MTD_CFI=y +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_GEN_PROBE=y +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_CFI_INTELEXT=y +# CONFIG_MTD_CFI_AMDSTD is not set +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set +# CONFIG_MTD_OBSOLETE_CHIPS is not set + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_PHYSMAP is not set +# CONFIG_MTD_NORA is not set +# CONFIG_MTD_ARM_INTEGRATOR is not set +# CONFIG_MTD_EDB7312 is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLKMTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC1000 is not set +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set + +# +# NAND Flash Device Drivers +# +# CONFIG_MTD_NAND is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=8192 +CONFIG_BLK_DEV_INITRD=y + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +# CONFIG_NETLINK_DEV is not set +# CONFIG_NETFILTER is not set +# CONFIG_FILTER is not set +CONFIG_UNIX=y +# CONFIG_NET_KEY is not set +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_ARPD is not set +CONFIG_INET_ECN=y +CONFIG_SYN_COOKIES=y +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_XFRM_USER is not set +# CONFIG_IPV6 is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +CONFIG_IPV6_SCTP__=y +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_LLC is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +CONFIG_DUMMY=y +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set + +# +# Ethernet (10 or 100Mbit) +# +# CONFIG_NET_ETHERNET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +CONFIG_NET_RADIO=y +# CONFIG_STRIP is not set +# CONFIG_ARLAN is not set +# CONFIG_AIRONET4500 is not set + +# +# Wireless ISA/PCI cards support +# +# CONFIG_WAVELAN is not set +# CONFIG_AIRO is not set +# CONFIG_HERMES is not set +CONFIG_NET_WIRELESS=y + +# +# Token Ring devices (depends on LLC=y) +# +# CONFIG_NET_FC is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# IrDA (infrared) support +# +# CONFIG_IRDA is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ATA/ATAPI/MFM/RLL support +# +# CONFIG_IDE is not set + +# +# SCSI support +# +# CONFIG_SCSI is not set + +# +# I2O device support +# +# CONFIG_I2O is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN_BOOL is not set + +# +# Input device support +# +CONFIG_INPUT=y + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_TSDEV is not set +# CONFIG_INPUT_TSLIBDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set + +# +# Input I/O drivers +# +# CONFIG_GAMEPORT is not set +CONFIG_SOUND_GAMEPORT=y +CONFIG_SERIO=y +# CONFIG_SERIO_I8042 is not set +CONFIG_SERIO_SERPORT=y +# CONFIG_SERIO_CT82C710 is not set + +# +# Input Device Drivers +# +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +# CONFIG_SERIAL_8250 is not set + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_SA1100=y +CONFIG_SERIAL_SA1100_CONSOLE=y +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# L3 serial bus support +# +# CONFIG_L3 is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_GEN_RTC is not set +CONFIG_SA1100_RTC=y +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_RAW_DRIVER is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EXT3_FS is not set +# CONFIG_JBD is not set +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +CONFIG_CRAMFS=y +CONFIG_TMPFS=y +CONFIG_RAMFS=y +# CONFIG_ISO9660_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UFS_FS is not set +# CONFIG_XFS_FS is not set + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +# CONFIG_INTERMEZZO_FS is not set +# CONFIG_NFS_FS is not set +# CONFIG_NFSD is not set +# CONFIG_EXPORTFS is not set +# CONFIG_CIFS is not set +# CONFIG_SMB_FS is not set +# CONFIG_NCP_FS is not set +# CONFIG_AFS_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="iso8859-1" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Console drivers +# +# CONFIG_VGA_CONSOLE is not set + +# +# Frame-buffer support +# +# CONFIG_FB is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# Misc devices +# + +# +# Multimedia Capabilities Port drivers +# +# CONFIG_MCP is not set + +# +# Console Switches +# +# CONFIG_SWITCHES is not set + +# +# USB support +# + +# +# Bluetooth support +# +# CONFIG_BT is not set + +# +# Kernel hacking +# +CONFIG_FRAME_POINTER=y +CONFIG_DEBUG_USER=y +# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_KERNEL=y +CONFIG_DEBUG_SLAB=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_DEBUG_SPINLOCK=y +CONFIG_DEBUG_WAITQ=y +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_ERRORS=y +CONFIG_KALLSYMS=y +CONFIG_DEBUG_LL=y + +# +# Security options +# +CONFIG_SECURITY_CAPABILITIES=y + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Library routines +# +# CONFIG_CRC32 is not set +CONFIG_ZLIB_INFLATE=y diff -Nru a/arch/arm/def-configs/trizeps b/arch/arm/def-configs/trizeps --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/arm/def-configs/trizeps Sun Feb 9 21:13:37 2003 @@ -0,0 +1,852 @@ +# +# Automatically generated by make menuconfig: don't edit +# +CONFIG_ARM=y +# CONFIG_EISA is not set +# CONFIG_SBUS is not set +# CONFIG_MCA is not set +CONFIG_UID16=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +# CONFIG_GENERIC_BUST_SPINLOCK is not set +# CONFIG_GENERIC_ISA_DMA is not set + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# General setup +# +CONFIG_NET=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y + +# +# Loadable module support +# +CONFIG_MODULES=y +# CONFIG_MODVERSIONS is not set +CONFIG_KMOD=y + +# +# System Type +# +# CONFIG_ARCH_ADIFCC is not set +# CONFIG_ARCH_ANAKIN is not set +# CONFIG_ARCH_ARCA5K is not set +# CONFIG_ARCH_CLPS7500 is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_CO285 is not set +# CONFIG_ARCH_PXA is not set +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_CAMELOT is not set +# CONFIG_ARCH_FOOTBRIDGE is not set +# CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_IOP310 is not set +# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_RPC is not set +CONFIG_ARCH_SA1100=y +# CONFIG_ARCH_SHARK is not set + +# +# Archimedes/A5000 Implementations +# +# CONFIG_ARCH_ARC is not set +# CONFIG_ARCH_A5K is not set + +# +# CLPS711X/EP721X Implementations +# +# CONFIG_ARCH_AUTCPU12 is not set +# CONFIG_ARCH_CDB89712 is not set +# CONFIG_ARCH_CEIVA is not set +# CONFIG_ARCH_CLEP7312 is not set +# CONFIG_ARCH_EDB7211 is not set +# CONFIG_ARCH_P720T is not set +# CONFIG_ARCH_FORTUNET is not set +# CONFIG_ARCH_EP7211 is not set +# CONFIG_ARCH_EP7212 is not set + +# +# Epxa10db +# + +# +# Footbridge Implementations +# +# CONFIG_ARCH_CATS is not set +# CONFIG_ARCH_PERSONAL_SERVER is not set +# CONFIG_ARCH_EBSA285_ADDIN is not set +# CONFIG_ARCH_EBSA285_HOST is not set +# CONFIG_ARCH_NETWINDER is not set + +# +# IOP310 Implementation Options +# +# CONFIG_ARCH_IQ80310 is not set +# CONFIG_IOP310_AAU is not set +# CONFIG_IOP310_DMA is not set +# CONFIG_IOP310_MU is not set +# CONFIG_IOP310_PMON is not set + +# +# Intel PXA250/210 Implementations +# +# CONFIG_ARCH_LUBBOCK is not set +# CONFIG_ARCH_PXA_IDP is not set + +# +# SA11x0 Implementations +# +# CONFIG_SA1100_ASSABET is not set +# CONFIG_ASSABET_NEPONSET is not set +# CONFIG_SA1100_ADSBITSY is not set +# CONFIG_SA1100_BRUTUS is not set +# CONFIG_SA1100_CERF is not set +# CONFIG_SA1100_H3100 is not set +# CONFIG_SA1100_H3600 is not set +# CONFIG_SA1100_H3800 is not set +# CONFIG_SA1100_H3XXX is not set +# CONFIG_SA1100_EXTENEX1 is not set +# CONFIG_SA1100_FLEXANET is not set +# CONFIG_SA1100_FREEBIRD is not set +# CONFIG_SA1100_GRAPHICSCLIENT is not set +# CONFIG_SA1100_GRAPHICSMASTER is not set +# CONFIG_SA1100_BADGE4 is not set +# CONFIG_SA1100_JORNADA720 is not set +# CONFIG_SA1100_HUW_WEBPANEL is not set +# CONFIG_SA1100_ITSY is not set +# CONFIG_SA1100_LART is not set +# CONFIG_SA1100_NANOENGINE is not set +# CONFIG_SA1100_OMNIMETER is not set +# CONFIG_SA1100_PANGOLIN is not set +# CONFIG_SA1100_PLEB is not set +# CONFIG_SA1100_PT_SYSTEM3 is not set +# CONFIG_SA1100_SHANNON is not set +# CONFIG_SA1100_SHERMAN is not set +# CONFIG_SA1100_SIMPAD is not set +CONFIG_SA1100_TRIZEPS=y +CONFIG_TRIZEPS_MFTB2=y +# CONFIG_SA1100_PFS168 is not set +# CONFIG_SA1100_VICTOR is not set +# CONFIG_SA1100_XP860 is not set +# CONFIG_SA1100_YOPY is not set +# CONFIG_SA1100_STORK is not set +# CONFIG_SA1100_USB is not set +# CONFIG_SA1100_USB_NETLINK is not set +# CONFIG_SA1100_USB_CHAR is not set +# CONFIG_H3600_SLEEVE is not set +# CONFIG_ARCH_ACORN is not set +# CONFIG_FOOTBRIDGE is not set +# CONFIG_FOOTBRIDGE_HOST is not set +# CONFIG_FOOTBRIDGE_ADDIN is not set +# CONFIG_SA1111 is not set +CONFIG_CPU_32=y +# CONFIG_CPU_26 is not set +# CONFIG_CPU_ARM610 is not set +# CONFIG_CPU_ARM710 is not set +# CONFIG_CPU_ARM720T is not set +# CONFIG_CPU_ARM920T is not set +# CONFIG_CPU_ARM922T is not set +# CONFIG_CPU_ARM926T is not set +# CONFIG_CPU_ARM1020 is not set +# CONFIG_CPU_SA110 is not set +CONFIG_CPU_SA1100=y +# CONFIG_CPU_XSCALE is not set +# CONFIG_CPU_32v3 is not set +CONFIG_CPU_32v4=y +# CONFIG_CPU_32v5 is not set +# CONFIG_ARM_THUMB is not set + +# +# General setup +# +CONFIG_DISCONTIGMEM=y +# CONFIG_PCI is not set +CONFIG_ISA=y +# CONFIG_ISA_DMA is not set +# CONFIG_FIQ is not set +# CONFIG_ZBOOT_ROM is not set +CONFIG_ZBOOT_ROM_TEXT=0 +CONFIG_ZBOOT_ROM_BSS=0 +# CONFIG_CPU_FREQ is not set +# CONFIG_CPU_FREQ_24_API is not set +# CONFIG_CPU_FREQ_26_API is not set +CONFIG_HOTPLUG=y + +# +# PCMCIA/CardBus support +# +CONFIG_PCMCIA=m +# CONFIG_I82092 is not set +# CONFIG_I82365 is not set +# CONFIG_TCIC is not set +# CONFIG_PCMCIA_CLPS6700 is not set +CONFIG_PCMCIA_SA1100=m +# CONFIG_PCMCIA_SA1111 is not set +CONFIG_FPE_NWFPE=y +# CONFIG_FPE_FASTFPE is not set +CONFIG_KCORE_ELF=y +# CONFIG_KCORE_AOUT is not set +CONFIG_BINFMT_AOUT=y +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_PM is not set +# CONFIG_PREEMPT is not set +# CONFIG_APM is not set +# CONFIG_ARTHUR is not set +CONFIG_CMDLINE="keepinitrd mem=16M root=/dev/hda2 1" +# CONFIG_LEDS is not set +CONFIG_ALIGNMENT_TRAP=y + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Memory Technology Devices (MTD) +# +CONFIG_MTD=y +# CONFIG_MTD_DEBUG is not set +CONFIG_MTD_PARTITIONS=m +CONFIG_MTD_CONCAT=m +# CONFIG_MTD_REDBOOT_PARTS is not set +# CONFIG_MTD_CMDLINE_PARTS is not set +CONFIG_MTD_AFS_PARTS=m +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set + +# +# RAM/ROM/Flash chip drivers +# +CONFIG_MTD_CFI=y +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_GEN_PROBE=y +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_CFI_INTELEXT=y +# CONFIG_MTD_CFI_AMDSTD is not set +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set +# CONFIG_MTD_OBSOLETE_CHIPS is not set +# CONFIG_MTD_AMDSTD is not set +# CONFIG_MTD_SHARP is not set +# CONFIG_MTD_JEDEC is not set + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_PHYSMAP is not set +# CONFIG_MTD_NORA is not set +# CONFIG_MTD_ARM_INTEGRATOR is not set +# CONFIG_MTD_CDB89712 is not set +CONFIG_MTD_SA1100=m +# CONFIG_MTD_2PARTS_IPAQ is not set +# CONFIG_MTD_DC21285 is not set +# CONFIG_MTD_IQ80310 is not set +# CONFIG_MTD_EPXA10DB is not set +# CONFIG_MTD_FORTUNET is not set +# CONFIG_MTD_AUTCPU12 is not set +# CONFIG_MTD_EDB7312 is not set +# CONFIG_MTD_IMPA7 is not set +# CONFIG_MTD_CEIVA is not set +# CONFIG_MTD_PCI is not set +# CONFIG_MTD_PCMCIA is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLKMTD is not set +# CONFIG_MTD_DOC1000 is not set +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOCPROBE is not set + +# +# NAND Flash Device Drivers +# +# CONFIG_MTD_NAND is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_PNP_NAMES is not set +# CONFIG_PNP_DEBUG is not set +# CONFIG_ISAPNP is not set +# CONFIG_PNPBIOS is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_CISS_SCSI_TAPE is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=4096 +# CONFIG_BLK_DEV_INITRD is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +# CONFIG_NETLINK_DEV is not set +# CONFIG_NETFILTER is not set +# CONFIG_FILTER is not set +CONFIG_UNIX=y +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_ARPD is not set +# CONFIG_INET_ECN is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_IPV6 is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +CONFIG_IPV6_SCTP__=y +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_LLC is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_DEV_APPLETALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set + +# +# Ethernet (10 or 100Mbit) +# +# CONFIG_NET_ETHERNET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_E1000 is not set +# CONFIG_E1000_NAPI is not set +# CONFIG_MYRI_SBUS is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +CONFIG_PPP=m +# CONFIG_PPP_MULTILINK is not set +# CONFIG_PPP_FILTER is not set +CONFIG_PPP_ASYNC=m +# CONFIG_PPP_SYNC_TTY is not set +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_BSDCOMP=m +# CONFIG_PPPOE is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +CONFIG_NET_RADIO=y +# CONFIG_STRIP is not set +# CONFIG_ARLAN is not set +# CONFIG_AIRONET4500 is not set +# CONFIG_AIRONET4500_NONCS is not set +# CONFIG_AIRONET4500_PROC is not set +# CONFIG_WAVELAN is not set +# CONFIG_AIRO is not set +# CONFIG_HERMES is not set +# CONFIG_PCMCIA_NETWAVE is not set +# CONFIG_PCMCIA_WAVELAN is not set +# CONFIG_PCMCIA_HERMES is not set +CONFIG_AIRO_CS=m +CONFIG_NET_WIRELESS=y + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# PCMCIA network device support +# +CONFIG_NET_PCMCIA=y +# CONFIG_PCMCIA_3C589 is not set +# CONFIG_PCMCIA_3C574 is not set +# CONFIG_PCMCIA_FMVJ18X is not set +# CONFIG_PCMCIA_PCNET is not set +# CONFIG_PCMCIA_NMCLAN is not set +# CONFIG_PCMCIA_SMC91C92 is not set +# CONFIG_PCMCIA_XIRC2PS is not set +# CONFIG_PCMCIA_AXNET is not set +# CONFIG_ARCNET_COM20020_CS is not set +# CONFIG_PCMCIA_IBMTR is not set +CONFIG_NET_PCMCIA_RADIO=y +# CONFIG_PCMCIA_RAYCS is not set +# CONFIG_AIRONET4500_CS is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# IrDA (infrared) support +# +# CONFIG_IRDA is not set + +# +# ATA/ATAPI/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_IDEDISK_STROKE is not set +CONFIG_BLK_DEV_IDECS=m +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_IDE_TASK_IOCTL is not set +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_IDE_ICSIDE is not set +# CONFIG_BLK_DEV_IDEDMA_ICS is not set +# CONFIG_IDEDMA_ICS_AUTO is not set +# CONFIG_BLK_DEV_IDEDMA is not set +# CONFIG_BLK_DEV_IDE_RAPIDE is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +CONFIG_BLK_DEV_IDE_MODES=y + +# +# SCSI support +# +# CONFIG_SCSI is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN_BOOL is not set + +# +# Input device support +# +CONFIG_INPUT=y +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_TSDEV is not set +# CONFIG_INPUT_TSLIBDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set +# CONFIG_GAMEPORT is not set +CONFIG_SOUND_GAMEPORT=y +# CONFIG_GAMEPORT_NS558 is not set +# CONFIG_GAMEPORT_L4 is not set +# CONFIG_GAMEPORT_EMU10K1 is not set +# CONFIG_GAMEPORT_VORTEX is not set +# CONFIG_GAMEPORT_FM801 is not set +# CONFIG_GAMEPORT_CS461x is not set +# CONFIG_SERIO is not set +# CONFIG_SERIO_I8042 is not set +# CONFIG_SERIO_SERPORT is not set +# CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_PARKBD is not set +# CONFIG_SERIO_RPCKBD is not set +# CONFIG_SERIO_AMBAKMI is not set +# CONFIG_SERIO_SA1111 is not set +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_MOUSE_PS2 is not set +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_INPORT is not set +# CONFIG_MOUSE_LOGIBM is not set +# CONFIG_MOUSE_PC110PAD is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_JOYSTICK_ANALOG is not set +# CONFIG_JOYSTICK_A3D is not set +# CONFIG_JOYSTICK_ADI is not set +# CONFIG_JOYSTICK_COBRA is not set +# CONFIG_JOYSTICK_GF2K is not set +# CONFIG_JOYSTICK_GRIP is not set +# CONFIG_JOYSTICK_GRIP_MP is not set +# CONFIG_JOYSTICK_GUILLEMOT is not set +# CONFIG_JOYSTICK_INTERACT is not set +# CONFIG_JOYSTICK_SIDEWINDER is not set +# CONFIG_JOYSTICK_TMDC is not set +# CONFIG_JOYSTICK_IFORCE is not set +# CONFIG_JOYSTICK_WARRIOR is not set +# CONFIG_JOYSTICK_MAGELLAN is not set +# CONFIG_JOYSTICK_SPACEORB is not set +# CONFIG_JOYSTICK_SPACEBALL is not set +# CONFIG_JOYSTICK_STINGER is not set +# CONFIG_JOYSTICK_TWIDDLER is not set +# CONFIG_JOYSTICK_DB9 is not set +# CONFIG_JOYSTICK_GAMECON is not set +# CONFIG_JOYSTICK_TURBOGRAFX is not set +# CONFIG_INPUT_JOYDUMP is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_TOUCHSCREEN_GUNZE is not set +# CONFIG_INPUT_MISC is not set +# CONFIG_INPUT_PCSPKR is not set +# CONFIG_INPUT_UINPUT is not set + +# +# Character devices +# +# CONFIG_VT is not set +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +# CONFIG_SERIAL_8250 is not set +# CONFIG_SERIAL_8250_CONSOLE is not set +# CONFIG_SERIAL_8250_CS is not set +# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250_MANY_PORTS is not set +# CONFIG_SERIAL_8250_SHARE_IRQ is not set +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +# CONFIG_SERIAL_8250_MULTIPORT is not set +# CONFIG_SERIAL_8250_RSA is not set +# CONFIG_SERIAL_ACORN is not set +# CONFIG_SERIAL_ANAKIN is not set +# CONFIG_SERIAL_ANAKIN_CONSOLE is not set +# CONFIG_SERIAL_AMBA is not set +# CONFIG_SERIAL_AMBA_CONSOLE is not set +# CONFIG_SERIAL_CLPS711X is not set +# CONFIG_SERIAL_CLPS711X_CONSOLE is not set +# CONFIG_SERIAL_CLPS711X_OLD_NAME is not set +# CONFIG_SERIAL_21285 is not set +# CONFIG_SERIAL_21285_OLD is not set +# CONFIG_SERIAL_21285_CONSOLE is not set +# CONFIG_SERIAL_UART00 is not set +# CONFIG_SERIAL_UART00_CONSOLE is not set +CONFIG_SERIAL_SA1100=y +CONFIG_SERIAL_SA1100_CONSOLE=y +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_UNIX98_PTYS is not set + +# +# I2C support +# +CONFIG_I2C=m +CONFIG_I2C_ALGOBIT=m +# CONFIG_I2C_PHILIPSPAR is not set +# CONFIG_I2C_ELV is not set +# CONFIG_I2C_VELLEMAN is not set +# CONFIG_SCx200_I2C is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_I2C_BIT_SA1100_GPIO is not set +# CONFIG_I2C_ALGOPCF is not set +CONFIG_I2C_CHARDEV=m +CONFIG_I2C_PROC=m + +# +# L3 serial bus support +# +# CONFIG_L3 is not set +# CONFIG_L3_ALGOBIT is not set +# CONFIG_L3_BIT_SA1100_GPIO is not set +# CONFIG_BIT_SA1100_GPIO is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_GEN_RTC is not set +# CONFIG_SA1100_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set + +# +# PCMCIA character devices +# +# CONFIG_SYNCLINK_CS is not set +# CONFIG_SCx200_GPIO is not set +# CONFIG_RAW_DRIVER is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_QFMT_V1 is not set +# CONFIG_QFMT_V2 is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EXT3_FS is not set +# CONFIG_JBD is not set +# CONFIG_JBD_DEBUG is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +# CONFIG_TMPFS is not set +CONFIG_RAMFS=y +# CONFIG_ISO9660_FS is not set +# CONFIG_JOLIET is not set +# CONFIG_ZISOFS is not set +# CONFIG_JFS_FS is not set +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +# CONFIG_DEVPTS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_XFS_FS is not set +# CONFIG_XFS_RT is not set +# CONFIG_XFS_QUOTA is not set + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +# CONFIG_INTERMEZZO_FS is not set +CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set +# CONFIG_NFS_V4 is not set +# CONFIG_ROOT_NFS is not set +# CONFIG_NFSD is not set +# CONFIG_NFSD_V3 is not set +# CONFIG_NFSD_V4 is not set +# CONFIG_NFSD_TCP is not set +CONFIG_SUNRPC=y +CONFIG_LOCKD=y +# CONFIG_EXPORTFS is not set +# CONFIG_CIFS is not set +# CONFIG_SMB_FS is not set +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set +# CONFIG_AFS_FS is not set +# CONFIG_ZISOFS_FS is not set + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_EFI_PARTITION is not set +# CONFIG_SMB_NLS is not set +# CONFIG_NLS is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# Multimedia Capabilities Port drivers +# +# CONFIG_MCP is not set +# CONFIG_MCP_SA1100 is not set +# CONFIG_MCP_UCB1200 is not set +# CONFIG_MCP_UCB1200_AUDIO is not set +# CONFIG_MCP_UCB1200_TS is not set + +# +# Console Switches +# +# CONFIG_SWITCHES is not set +# CONFIG_SWITCHES_SA1100 is not set +# CONFIG_SWITCHES_UCB1X00 is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# Bluetooth support +# +# CONFIG_BT is not set + +# +# Kernel hacking +# +# CONFIG_NO_FRAME_POINTER is not set +CONFIG_DEBUG_USER=y +# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_WAITQ is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_ERRORS=y +# CONFIG_DEBUG_LL is not set +# CONFIG_DEBUG_DC21285_PORT is not set +# CONFIG_DEBUG_CLPS711X_UART2 is not set + +# +# Security options +# +CONFIG_SECURITY_CAPABILITIES=y + +# +# Library routines +# +# CONFIG_CRC32 is not set +CONFIG_ZLIB_INFLATE=m +CONFIG_ZLIB_DEFLATE=m diff -Nru a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile --- a/arch/arm/kernel/Makefile Sun Feb 9 21:13:36 2003 +++ b/arch/arm/kernel/Makefile Sun Feb 9 21:13:36 2003 @@ -15,8 +15,6 @@ obj-n := obj- := -export-objs := armksyms.o apm.o dma.o ecard.o fiq.o io.o time.o - obj-$(CONFIG_APM) += apm.o obj-$(CONFIG_ARCH_ACORN) += ecard.o time-acorn.o obj-$(CONFIG_ARCH_CLPS7500) += time-acorn.o @@ -26,8 +24,6 @@ obj-$(CONFIG_ARTHUR) += arthur.o obj-$(CONFIG_ISA_DMA) += dma-isa.o obj-$(CONFIG_PCI) += bios32.o -obj-$(CONFIG_PCI_HOST_PLX90X0) += plx90x0.o -obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o ifneq ($(MACHINE),ebsa110) obj-y += io.o diff -Nru a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c --- a/arch/arm/kernel/ecard.c Sun Feb 9 21:13:34 2003 +++ b/arch/arm/kernel/ecard.c Sun Feb 9 21:13:34 2003 @@ -881,6 +881,90 @@ get_ecard_dev_info); } +#define ec_set_resource(ec,nr,st,sz,flg) \ + do { \ + (ec)->resource[nr].name = ec->dev.name; \ + (ec)->resource[nr].start = st; \ + (ec)->resource[nr].end = (st) + (sz) - 1; \ + (ec)->resource[nr].flags = flg; \ + } while (0) + +static void __init ecard_init_resources(struct expansion_card *ec) +{ + unsigned long base = PODSLOT_IOC4_BASE; + unsigned int slot = ec->slot_no; + int i; + + if (slot < 4) { + ec_set_resource(ec, ECARD_RES_MEMC, + PODSLOT_MEMC_BASE + (slot << 14), + PODSLOT_MEMC_SIZE, IORESOURCE_MEM); + base = PODSLOT_IOC0_BASE; + } + +#ifdef CONFIG_ARCH_RPC + if (slot < 8) { + ec_set_resource(ec, ECARD_RES_EASI, + PODSLOT_EASI_BASE + (slot << 24), + PODSLOT_EASI_SIZE, IORESOURCE_MEM); + } + + if (slot == 8) { + ec_set_resource(ec, ECARD_RES_MEMC, NETSLOT_BASE, + NETSLOT_SIZE, IORESOURCE_MEM); + } else +#endif + + for (i = 0; i < ECARD_RES_IOCSYNC - ECARD_RES_IOCSLOW; i++) { + ec_set_resource(ec, i + ECARD_RES_IOCSLOW, + base + (slot << 14) + (i << 19), + PODSLOT_IOC_SIZE, IORESOURCE_MEM); + } + + for (i = 0; i < ECARD_NUM_RESOURCES; i++) { + if (ec->resource[i].start && + request_resource(&iomem_resource, &ec->resource[i])) { + printk(KERN_ERR "%s: resource(s) not available\n", + ec->dev.bus_id); + ec->resource[i].end -= ec->resource[i].start; + ec->resource[i].start = 0; + } + } +} + +static ssize_t ecard_show_irq(struct device *dev, char *buf) +{ + struct expansion_card *ec = ECARD_DEV(dev); + return sprintf(buf, "%u\n", ec->irq); +} + +static DEVICE_ATTR(irq, S_IRUGO, ecard_show_irq, NULL); + +static ssize_t ecard_show_dma(struct device *dev, char *buf) +{ + struct expansion_card *ec = ECARD_DEV(dev); + return sprintf(buf, "%u\n", ec->dma); +} + +static DEVICE_ATTR(dma, S_IRUGO, ecard_show_dma, NULL); + +static ssize_t ecard_show_resources(struct device *dev, char *buf) +{ + struct expansion_card *ec = ECARD_DEV(dev); + char *str = buf; + int i; + + for (i = 0; i < ECARD_NUM_RESOURCES; i++) + str += sprintf(str, "%08lx %08lx %08lx\n", + ec->resource[i].start, + ec->resource[i].end, + ec->resource[i].flags); + + return str - buf; +} + +static DEVICE_ATTR(resource, S_IRUGO, ecard_show_resources, NULL); + /* * Probe for an expansion card. * @@ -949,6 +1033,16 @@ break; } + snprintf(ec->dev.bus_id, sizeof(ec->dev.bus_id), "ecard%d", slot); + snprintf(ec->dev.name, sizeof(ec->dev.name), "ecard %04x:%04x", + ec->cid.manufacturer, ec->cid.product); + ec->dev.parent = NULL; + ec->dev.bus = &ecard_bus_type; + ec->dev.dma_mask = &ec->dma_mask; + ec->dma_mask = (u64)0xffffffff; + + ecard_init_resources(ec); + /* * hook the interrupt handlers */ @@ -974,14 +1068,10 @@ *ecp = ec; slot_to_expcard[slot] = ec; - snprintf(ec->dev.bus_id, sizeof(ec->dev.bus_id), "ecard%d", slot); - strcpy(ec->dev.name, "fixme!"); - ec->dev.parent = NULL; - ec->dev.bus = &ecard_bus_type; - ec->dev.dma_mask = &ec->dma_mask; - ec->dma_mask = (u64)0xffffffff; - device_register(&ec->dev); + device_create_file(&ec->dev, &dev_attr_dma); + device_create_file(&ec->dev, &dev_attr_irq); + device_create_file(&ec->dev, &dev_attr_resource); return 0; diff -Nru a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c --- a/arch/arm/kernel/irq.c Sun Feb 9 21:13:28 2003 +++ b/arch/arm/kernel/irq.c Sun Feb 9 21:13:28 2003 @@ -78,7 +78,8 @@ * disable_irq - disable an irq and wait for completion * @irq: Interrupt to disable * - * Disable the selected interrupt line. We do this lazily. + * Disable the selected interrupt line. Enables and disables + * are nested. We do this lazily. * * This function may be called from IRQ context. */ @@ -88,8 +89,7 @@ unsigned long flags; spin_lock_irqsave(&irq_controller_lock, flags); - if (!desc->depth++) - desc->enabled = 0; + desc->disable_depth++; spin_unlock_irqrestore(&irq_controller_lock, flags); } @@ -107,24 +107,25 @@ { struct irqdesc *desc = irq_desc + irq; unsigned long flags; - int pending = 0; spin_lock_irqsave(&irq_controller_lock, flags); - if (unlikely(!desc->depth)) { + if (unlikely(!desc->disable_depth)) { printk("enable_irq(%u) unbalanced from %p\n", irq, __builtin_return_address(0)); - } else if (!--desc->depth) { + } else if (!--desc->disable_depth) { desc->probing = 0; - desc->enabled = 1; desc->chip->unmask(irq); - pending = desc->pending; - desc->pending = 0; + /* - * If the interrupt was waiting to be processed, - * retrigger it. + * If the interrupt is waiting to be processed, + * try to re-run it. We can't directly run it + * from here since the caller might be in an + * interrupt-protected region. */ - if (pending) + if (desc->pending) { + desc->pending = 0; desc->chip->rerun(irq); + } } spin_unlock_irqrestore(&irq_controller_lock, flags); } @@ -264,7 +265,7 @@ * we shouldn't process the IRQ. Instead, turn on the * hardware masks. */ - if (unlikely(desc->running || !desc->enabled)) + if (unlikely(desc->running || desc->disable_depth)) goto running; /* @@ -286,13 +287,13 @@ if (!action) break; - if (desc->pending && desc->enabled) { + if (desc->pending && !desc->disable_depth) { desc->pending = 0; desc->chip->unmask(irq); } __do_irq(irq, action, regs); - } while (desc->pending && desc->enabled); + } while (desc->pending && !desc->disable_depth); desc->running = 0; @@ -328,7 +329,7 @@ */ desc->chip->ack(irq); - if (likely(desc->enabled)) { + if (likely(!desc->disable_depth)) { kstat_cpu(cpu).irqs[irq]++; /* @@ -338,7 +339,7 @@ if (action) { __do_irq(irq, desc->action, regs); - if (likely(desc->enabled && + if (likely(!desc->disable_depth && !check_irq_lock(desc, irq, regs))) desc->chip->unmask(irq); } @@ -390,14 +391,13 @@ if (handle == do_bad_IRQ) { desc->chip->mask(irq); desc->chip->ack(irq); - desc->depth = 1; - desc->enabled = 0; + desc->disable_depth = 1; } desc->handle = handle; if (handle != do_bad_IRQ && is_chained) { desc->valid = 0; desc->probe_ok = 0; - desc->depth = 0; + desc->disable_depth = 0; desc->chip->unmask(irq); } spin_unlock_irqrestore(&irq_controller_lock, flags); @@ -512,10 +512,9 @@ desc->probing = 0; desc->running = 0; desc->pending = 0; - desc->depth = 1; + desc->disable_depth = 1; if (!desc->noautoenable) { - desc->depth = 0; - desc->enabled = 1; + desc->disable_depth = 0; desc->chip->unmask(irq); } } diff -Nru a/arch/arm/kernel/plx90x0.c b/arch/arm/kernel/plx90x0.c --- a/arch/arm/kernel/plx90x0.c Sun Feb 9 21:13:29 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,178 +0,0 @@ -/* - * Driver for PLX Technology PCI9000-series host bridge. - * - * Copyright (C) 1997, 1998, 1999, 2000 FutureTV Labs Ltd - */ - -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include - -#include -#include -#include -#include -#include - -/* - * Since the following functions are all very similar, the common parts - * are pulled out into these macros. - */ - -#define PLX_CLEAR_CONFIG \ - __raw_writel(0, PLX_BASE + 0xac); \ - local_irq_restore(flags); } - -#define PLX_SET_CONFIG \ - { unsigned long flags; \ - local_irq_save(flags); \ - __raw_writel((1<<31 | (bus->number << 16) \ - | (devfn << 8) | (where & ~3) \ - | ((bus->number == 0)?0:1)), PLX_BASE + 0xac); \ - -#define PLX_CONFIG_WRITE(size) \ - PLX_SET_CONFIG \ - __raw_write##size(value, PCIO_BASE + (where & 3)); \ - if (__raw_readw(PLX_BASE + 0x6) & 0x2000) \ - __raw_writew(0x2000, PLX_BASE + 0x6); \ - PLX_CLEAR_CONFIG \ - return PCIBIOS_SUCCESSFUL; - -#define PLX_CONFIG_READ(size) \ - PLX_SET_CONFIG \ - *value = __raw_read##size(PCIO_BASE + (where & 3)); \ - if (__raw_readw(PLX_BASE + 0x6) & 0x2000) { \ - __raw_writew(0x2000, PLX_BASE + 0x6); \ - *value = 0xffffffffUL; \ - } \ - PLX_CLEAR_CONFIG \ - return PCIBIOS_SUCCESSFUL; - -/* Configuration space access routines */ - -static int -plx90x0_read_config (struct pci_bus *bus, unsigned int devfn, int where, - int where, int size, u32 *value) -{ - switch (size) { - case 1: - PLX_CONFIG_READ(b) - break; - case 2: - PLX_CONFIG_READ(w) - break; - case 4: - PLX_CONFIG_READ(l) - break; - } - return PCIBIOS_SUCCESSFUL; -} - -static int -plx90x0_write_config (struct pci_bus *bus, unsigned int devfn, int where, - int where, int size, u32 value) -{ - switch (size) { - case 1: - PLX_CONFIG_WRITE(b) - break; - case 2: - PLX_CONFIG_WRITE(w) - break; - case 4: - PLX_CONFIG_WRITE(l) - break; - } - return PCIBIOS_SUCCESSFUL; -} - -static struct pci_ops plx90x0_ops = -{ - .read = plx90x0_read_config, - .write = plx90x0_write_config, -}; - -static void -plx_syserr_handler(int irq, void *handle, struct pt_regs *regs) -{ - printk("PLX90x0: machine check %04x (pc=%08lx)\n", - readw(PLX_BASE + 6), regs->ARM_pc); - __raw_writew(0xf000, PLX_BASE + 6); -} - -/* - * Initialise the PCI system. - */ - -void __init -plx90x0_init(struct arm_sysdata *sysdata) -{ - static const unsigned long int base = PLX_BASE; - char *what; - unsigned long bar = (unsigned long)virt_to_bus((void *)PAGE_OFFSET); - - /* Have a sniff around and see which PLX device is present. */ - unsigned long id = __raw_readl(base + 0xf0); - -#if 0 - /* This check was a good idea, but can fail. The PLX9060 puts no - default value in these registers unless NB# is asserted (which it - isn't on these cards). */ - if ((id & 0xffff) != PCI_VENDOR_ID_PLX) - return; /* Nothing found */ -#endif - - /* Found one - now work out what it is. */ - switch (id >> 16) { - case 0: /* PCI_DEVICE_ID_PLX_9060 */ - what = "PCI9060"; - break; - case PCI_DEVICE_ID_PLX_9060ES: - what = "PCI9060ES"; - break; - case PCI_DEVICE_ID_PLX_9060SD: - what = "PCI9060SD"; /* uhuhh.. */ - break; - case PCI_DEVICE_ID_PLX_9080: - what = "PCI9080"; - break; - default: - printk("PCI: Unknown PLX device %04lx found -- ignored.\n", - id >> 16); - return; - } - - printk("PCI: PLX Technology %s host bridge found.\n", what); - - /* Now set it up for both master and slave accesses. */ - __raw_writel(0xffff0147, base + 0x4); - __raw_writeb(32, base + 0xd); - __raw_writel(0x8 | bar, base + 0x18); - __raw_writel(0xf8000008, base + 0x80); - __raw_writel(0x40000001, base + 0x84); - __raw_writel(0, base + 0x88); - __raw_writel(0, base + 0x8c); - __raw_writel(0x11, base + 0x94); - __raw_writel(0xC3 + (4 << 28) - + (8 << 11) + (1 << 10) - + (1 << 24), base + 0x98); - __raw_writel(0xC0000000, base + 0x9c); - __raw_writel(PLX_MEM_START, base + 0xa0); - __raw_writel(PLX_IO_START, base + 0xa4); - __raw_writel(0x3, base + 0xa8); - __raw_writel(0, base + 0xac); - __raw_writel(0x10001, base + 0xe8); - __raw_writel(0x8000767e, base + 0xec); - - request_irq(IRQ_SYSERR, plx_syserr_handler, 0, - "system error", NULL); - - pci_scan_bus(0, &plx90x0_ops, sysdata); -} diff -Nru a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c --- a/arch/arm/kernel/setup.c Sun Feb 9 21:13:32 2003 +++ b/arch/arm/kernel/setup.c Sun Feb 9 21:13:32 2003 @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -690,6 +691,15 @@ #endif #endif } + +static struct cpu cpu[1]; + +static int __init topology_init(void) +{ + return register_cpu(cpu, 0, NULL); +} + +subsys_initcall(topology_init); static const char *hwcap_str[] = { "swp", diff -Nru a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c --- a/arch/arm/kernel/signal.c Sun Feb 9 21:13:28 2003 +++ b/arch/arm/kernel/signal.c Sun Feb 9 21:13:28 2003 @@ -59,11 +59,11 @@ sigset_t saveset; mask &= _BLOCKABLE; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; siginitset(¤t->blocked, mask); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->ARM_r0 = -EINTR; while (1) { @@ -87,11 +87,11 @@ return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->ARM_r0 = -EINTR; while (1) { @@ -207,10 +207,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext(regs, &frame->sc)) goto badframe; @@ -247,10 +247,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) goto badframe; @@ -477,12 +477,12 @@ ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(&tsk->sig->siglock); + spin_lock_irq(&tsk->sighand->siglock); sigorsets(&tsk->blocked, &tsk->blocked, &ka->sa.sa_mask); sigaddset(&tsk->blocked, sig); recalc_sigpending(); - spin_unlock_irq(&tsk->sig->siglock); + spin_unlock_irq(&tsk->sighand->siglock); } return; } @@ -521,9 +521,9 @@ unsigned long signr = 0; struct k_sigaction *ka; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); signr = dequeue_signal(¤t->blocked, &info); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (!signr) break; diff -Nru a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c --- a/arch/arm/kernel/time.c Sun Feb 9 21:13:34 2003 +++ b/arch/arm/kernel/time.c Sun Feb 9 21:13:34 2003 @@ -34,7 +34,6 @@ u64 jiffies_64; -extern rwlock_t xtime_lock; extern unsigned long wall_jiffies; /* this needs a better home */ @@ -148,18 +147,20 @@ void do_gettimeofday(struct timeval *tv) { unsigned long flags; + unsigned long seq; unsigned long usec, sec, lost; - read_lock_irqsave(&xtime_lock, flags); - usec = gettimeoffset(); - - lost = jiffies - wall_jiffies; - if (lost) - usec += lost * USECS_PER_JIFFY; - - sec = xtime.tv_sec; - usec += xtime.tv_nsec / 1000; - read_unlock_irqrestore(&xtime_lock, flags); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); + usec = gettimeoffset(); + + lost = jiffies - wall_jiffies; + if (lost) + usec += lost * USECS_PER_JIFFY; + + sec = xtime.tv_sec; + usec += xtime.tv_nsec / 1000; + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); /* usec may have gone up a lot: be safe */ while (usec >= 1000000) { @@ -173,7 +174,7 @@ void do_settimeofday(struct timeval *tv) { - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); /* * This is revolting. We need to set "xtime" correctly. However, the * value in this location is the value at the most recent update of @@ -194,7 +195,7 @@ time_status |= STA_UNSYNC; time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } static struct irqaction timer_irq = { diff -Nru a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c --- a/arch/arm/kernel/traps.c Sun Feb 9 21:13:31 2003 +++ b/arch/arm/kernel/traps.c Sun Feb 9 21:13:31 2003 @@ -53,7 +53,8 @@ void dump_backtrace_entry(unsigned long where, unsigned long from) { printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from); - print_symbol(" %s\n", where); + print_symbol(" %s", where); + printk("\n"); } /* diff -Nru a/arch/arm/kernel/via82c505.c b/arch/arm/kernel/via82c505.c --- a/arch/arm/kernel/via82c505.c Sun Feb 9 21:13:28 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,94 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -#define MAX_SLOTS 7 - -#define CONFIG_CMD(bus, devfn, where) (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3)) - -static int -via82c505_read_config(struct pci_bus *bus, unsigned int devfn, int where, - int size, u32 *value) -{ - outl(CONFIG_CMD(bus,devfn,where),0xCF8); - switch (size) { - case 1: - *value=inb(0xCFC + (where&3)); - break; - case 2: - *value=inw(0xCFC + (where&2)); - break; - case 4: - *value=inl(0xCFC); - break; - } - return PCIBIOS_SUCCESSFUL; -} - -static int -via82c505_write_config(struct pci_bus *bus, unsigned int devfn, int where, - int size, u32 value) -{ - outl(CONFIG_CMD(bus,devfn,where),0xCF8); - switch (size) { - case 1: - outb(value, 0xCFC + (where&3)); - break; - case 2: - outw(value, 0xCFC + (where&2)); - break; - case 4: - outl(value, 0xCFC); - break; - } - return PCIBIOS_SUCCESSFUL; -} - -static struct pci_ops via82c505_ops = { - .read = via82c505_read_config, - .write = via82c505_write_config, -}; - -void __init via82c505_preinit(void *sysdata) -{ - printk(KERN_DEBUG "PCI: VIA 82c505\n"); - if (!request_region(0xA8,2,"via config")) { - printk(KERN_WARNING"VIA 82c505: Unable to request region 0xA8\n"); - return; - } - if (!request_region(0xCF8,8,"pci config")) { - printk(KERN_WARNING"VIA 82c505: Unable to request region 0xCF8\n"); - release_region(0xA8, 2); - return; - } - - /* Enable compatible Mode */ - outb(0x96,0xA8); - outb(0x18,0xA9); - outb(0x93,0xA8); - outb(0xd0,0xA9); - -} - -int __init via82c505_setup(int nr, struct pci_sys_data *sys) -{ - return (nr == 0); -} - -struct pci_bus * __init via82c505_scan_bus(int nr, struct pci_sys_data *sysdata) -{ - if (nr == 0) - return pci_scan_bus(0, &via82c505_ops, sysdata); - - return NULL; -} diff -Nru a/arch/arm/mach-adifcc/Makefile b/arch/arm/mach-adifcc/Makefile --- a/arch/arm/mach-adifcc/Makefile Sun Feb 9 21:13:28 2003 +++ b/arch/arm/mach-adifcc/Makefile Sun Feb 9 21:13:28 2003 @@ -9,4 +9,3 @@ obj-n := obj- := -export-objs := diff -Nru a/arch/arm/mach-anakin/Makefile b/arch/arm/mach-anakin/Makefile --- a/arch/arm/mach-anakin/Makefile Sun Feb 9 21:13:32 2003 +++ b/arch/arm/mach-anakin/Makefile Sun Feb 9 21:13:32 2003 @@ -9,4 +9,3 @@ obj-n := obj- := -export-objs := diff -Nru a/arch/arm/mach-arc/Makefile b/arch/arm/mach-arc/Makefile --- a/arch/arm/mach-arc/Makefile Sun Feb 9 21:13:29 2003 +++ b/arch/arm/mach-arc/Makefile Sun Feb 9 21:13:29 2003 @@ -10,8 +10,6 @@ obj-n := obj- := -export-objs := oldlatches.o - obj-$(CONFIG_DEBUG_LL) += debug.o EXTRA_TARGETS := head.o diff -Nru a/arch/arm/mach-clps7500/Makefile b/arch/arm/mach-clps7500/Makefile --- a/arch/arm/mach-clps7500/Makefile Sun Feb 9 21:13:32 2003 +++ b/arch/arm/mach-clps7500/Makefile Sun Feb 9 21:13:32 2003 @@ -9,4 +9,3 @@ obj-n := obj- := -export-objs := diff -Nru a/arch/arm/mach-ebsa110/Makefile b/arch/arm/mach-ebsa110/Makefile --- a/arch/arm/mach-ebsa110/Makefile Sun Feb 9 21:13:32 2003 +++ b/arch/arm/mach-ebsa110/Makefile Sun Feb 9 21:13:32 2003 @@ -4,11 +4,9 @@ # Object file lists. -obj-y := core.o io.o time.o +obj-y := core.o io.o obj-m := obj-n := obj- := - -export-objs := io.o obj-$(CONFIG_LEDS) += leds.o diff -Nru a/arch/arm/mach-ebsa110/time.c b/arch/arm/mach-ebsa110/time.c --- a/arch/arm/mach-ebsa110/time.c Sun Feb 9 21:13:33 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,112 +0,0 @@ -/* - * linux/arch/arm/mach-ebsa110/time.c - * - * Copyright (C) 2001 Russell King - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include - -#include - -#define PIT_CTRL (PIT_BASE + 0x0d) -#define PIT_T2 (PIT_BASE + 0x09) -#define PIT_T1 (PIT_BASE + 0x05) -#define PIT_T0 (PIT_BASE + 0x01) - -/* - * This is the rate at which your MCLK signal toggles (in Hz) - * This was measured on a 10 digit frequency counter sampling - * over 1 second. - */ -#define MCLK 47894000 - -/* - * This is the rate at which the PIT timers get clocked - */ -#define CLKBY7 (MCLK / 7) - -/* - * If CLKBY7 is larger than this, then we must do software - * division of the timer interrupt. - */ -#if CLKBY7 > 6553500 -#define DIVISOR 2 -#else -#define DIVISOR 1 -#endif - -/* - * This is the counter value - */ -#define COUNT ((CLKBY7 + (DIVISOR * HZ / 2)) / (DIVISOR * HZ)) - -extern unsigned long (*gettimeoffset)(void); - -static unsigned long divisor; - -/* - * Get the time offset from the system PIT. Note that if we have missed an - * interrupt, then the PIT counter will roll over (ie, be negative). - * This actually works out to be convenient. - */ -static unsigned long ebsa110_gettimeoffset(void) -{ - unsigned long offset, count; - - __raw_writeb(0x40, PIT_CTRL); - count = __raw_readb(PIT_T1); - count |= __raw_readb(PIT_T1) << 8; - - /* - * If count > COUNT, make the number negative. - */ - if (count > COUNT) - count |= 0xffff0000; - - offset = COUNT * (DIVISOR - divisor); - offset -= count; - - /* - * `offset' is in units of timer counts. Convert - * offset to units of microseconds. - */ - offset = offset * (1000000 / HZ) / (COUNT * DIVISOR); - - return offset; -} - -int ebsa110_reset_timer(void) -{ - u32 count; - - /* latch and read timer 1 */ - __raw_writeb(0x40, PIT_CTRL); - count = __raw_readb(PIT_T1); - count |= __raw_readb(PIT_T1) << 8; - - count += COUNT; - - __raw_writeb(count & 0xff, PIT_T1); - __raw_writeb(count >> 8, PIT_T1); - - if (divisor == 0) - divisor = DIVISOR; - divisor -= 1; - return divisor; -} - -void __init ebsa110_setup_timer(void) -{ - /* - * Timer 1, mode 2, LSB/MSB - */ - __raw_writeb(0x70, PIT_CTRL); - __raw_writeb(COUNT & 0xff, PIT_T1); - __raw_writeb(COUNT >> 8, PIT_T1); - divisor = DIVISOR - 1; - - gettimeoffset = ebsa110_gettimeoffset; -} diff -Nru a/arch/arm/mach-epxa10db/Makefile b/arch/arm/mach-epxa10db/Makefile --- a/arch/arm/mach-epxa10db/Makefile Sun Feb 9 21:13:35 2003 +++ b/arch/arm/mach-epxa10db/Makefile Sun Feb 9 21:13:35 2003 @@ -9,4 +9,3 @@ obj-n := obj- := -export-objs := diff -Nru a/arch/arm/mach-footbridge/Makefile b/arch/arm/mach-footbridge/Makefile --- a/arch/arm/mach-footbridge/Makefile Sun Feb 9 21:13:32 2003 +++ b/arch/arm/mach-footbridge/Makefile Sun Feb 9 21:13:32 2003 @@ -9,8 +9,6 @@ obj-n := obj- := -export-objs := arch.o netwinder-hw.o - pci-$(CONFIG_ARCH_CATS) += cats-pci.o pci-$(CONFIG_ARCH_EBSA285) += ebsa285-pci.o pci-$(CONFIG_ARCH_NETWINDER) += netwinder-pci.o diff -Nru a/arch/arm/mach-ftvpci/Makefile b/arch/arm/mach-ftvpci/Makefile --- a/arch/arm/mach-ftvpci/Makefile Sun Feb 9 21:13:36 2003 +++ b/arch/arm/mach-ftvpci/Makefile Sun Feb 9 21:13:36 2003 @@ -9,7 +9,5 @@ obj-n := obj- := -export-objs := - obj-$(CONFIG_PCI) += pci.o obj-$(CONFIG_LEDS) += leds.o diff -Nru a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c --- a/arch/arm/mach-integrator/pci_v3.c Sun Feb 9 21:13:34 2003 +++ b/arch/arm/mach-integrator/pci_v3.c Sun Feb 9 21:13:34 2003 @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -119,7 +120,7 @@ * function = which function * offset = configuration space register we are interested in * - * description: this routine will generate a platform dependant config + * description: this routine will generate a platform dependent config * address. * * calls: none @@ -295,7 +296,7 @@ v = __raw_readw(addr); break; - case 4: + default: v = __raw_readl(addr); break; } diff -Nru a/arch/arm/mach-iop310/Makefile b/arch/arm/mach-iop310/Makefile --- a/arch/arm/mach-iop310/Makefile Sun Feb 9 21:13:36 2003 +++ b/arch/arm/mach-iop310/Makefile Sun Feb 9 21:13:36 2003 @@ -10,8 +10,6 @@ obj-n := obj- := -export-objs := - obj-$(CONFIG_ARCH_IQ80310) += iq80310-pci.o iq80310-irq.o ifneq ($(CONFIG_XSCALE_PMU_TIMER),y) diff -Nru a/arch/arm/mach-l7200/Makefile b/arch/arm/mach-l7200/Makefile --- a/arch/arm/mach-l7200/Makefile Sun Feb 9 21:13:36 2003 +++ b/arch/arm/mach-l7200/Makefile Sun Feb 9 21:13:36 2003 @@ -9,4 +9,3 @@ obj-n := obj- := -export-objs := diff -Nru a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile --- a/arch/arm/mach-pxa/Makefile Sun Feb 9 21:13:32 2003 +++ b/arch/arm/mach-pxa/Makefile Sun Feb 9 21:13:32 2003 @@ -2,8 +2,6 @@ # Makefile for the linux kernel. # -export-objs := generic.o irq.o dma.o sa1111.o - # Common support (must be linked before board specific support) obj-y += generic.o irq.o dma.o obj-$(CONFIG_SA1111) += sa1111.o diff -Nru a/arch/arm/mach-rpc/Makefile b/arch/arm/mach-rpc/Makefile --- a/arch/arm/mach-rpc/Makefile Sun Feb 9 21:13:32 2003 +++ b/arch/arm/mach-rpc/Makefile Sun Feb 9 21:13:32 2003 @@ -9,4 +9,3 @@ obj-n := obj- := -export-objs := diff -Nru a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig --- a/arch/arm/mach-sa1100/Kconfig Sun Feb 9 21:13:37 2003 +++ b/arch/arm/mach-sa1100/Kconfig Sun Feb 9 21:13:37 2003 @@ -165,6 +165,13 @@ handheld computer. See for details. +config SA1100_HACKKIT + bool "HackKit Core CPU Board" + depends on ARCH_SA1100 + help + Say Y here to support the HackKit Core CPU Board + ; + config SA1100_HUW_WEBPANEL bool "HuW WebPanel" depends on ARCH_SA1100 @@ -306,6 +313,18 @@ help Say Y here if you intend to run this kernel on the Stork handheld computer. + +#config SA1100_TRIZEPS +# bool "Trizeps" +# depends on ARCH_SA1100 +# help +# :: write me :: + +#config TRIZEPS_MFTB2 +# bool "MFTB2" +# depends on SA1100_TRIZEPS +# help +# :: write me :: config SA1100_USB tristate "SA1100 USB function support" diff -Nru a/arch/arm/mach-sa1100/Makefile b/arch/arm/mach-sa1100/Makefile --- a/arch/arm/mach-sa1100/Makefile Sun Feb 9 21:13:37 2003 +++ b/arch/arm/mach-sa1100/Makefile Sun Feb 9 21:13:37 2003 @@ -9,31 +9,25 @@ obj- := led-y := leds.o -export-objs := dma.o generic.o pcipool.o pm.o sa1111.o sa1111-pcibuf.o - # This needs to be cleaned up. We probably need to have SA1100 # and SA1110 config symbols. ifeq ($(CONFIG_CPU_FREQ),y) obj-$(CONFIG_SA1100_ASSABET) += cpu-sa1110.o obj-$(CONFIG_SA1100_CERF) += cpu-sa1110.o +obj-$(CONFIG_SA1100_HACKKIT) += cpu-sa1110.o obj-$(CONFIG_SA1100_LART) += cpu-sa1100.o obj-$(CONFIG_SA1100_PT_SYSTEM3) += cpu-sa1110.o endif -# Next, the SA1111 stuff. -obj-$(CONFIG_SA1111) += sa1111.o sa1111-pcibuf.o pcipool.o - # Specific board support obj-$(CONFIG_SA1100_ADSBITSY) += adsbitsy.o led-$(CONFIG_SA1100_ADSBITSY) += leds-adsbitsy.o obj-$(CONFIG_SA1100_ASSABET) += assabet.o -export-objs += assabet.o led-$(CONFIG_SA1100_ASSABET) += leds-assabet.o obj-$(CONFIG_ASSABET_NEPONSET) += neponset.o obj-$(CONFIG_SA1100_BADGE4) += badge4.o -export-objs += badge4.o led-$(CONFIG_SA1100_BADGE4) += leds-badge4.o obj-$(CONFIG_SA1100_BRUTUS) += brutus.o @@ -45,12 +39,9 @@ obj-$(CONFIG_SA1100_EMPEG) += empeg.o obj-$(CONFIG_SA1100_FLEXANET) += flexanet.o -export-objs += flexanet.o led-$(CONFIG_SA1100_FLEXANET) += leds-flexanet.o obj-$(CONFIG_SA1100_FREEBIRD) += freebird.o -export-objs += freebird.o - obj-$(CONFIG_SA1100_GRAPHICSCLIENT) += graphicsclient.o led-$(CONFIG_SA1100_GRAPHICSCLIENT) += leds-graphicsclient.o @@ -58,10 +49,11 @@ led-$(CONFIG_SA1100_GRAPHICSMASTER) += leds-graphicsmaster.o obj-$(CONFIG_SA1100_H3600) += h3600.o -export-objs += h3600.o + +obj-$(CONFIG_SA1100_HACKKIT) += hackkit.o +led-$(CONFIG_SA1100_HACKKIT) += leds-hackkit.o obj-$(CONFIG_SA1100_HUW_WEBPANEL) += huw_webpanel.o -export-objs += huw_webpanel.o obj-$(CONFIG_SA1100_ITSY) += itsy.o @@ -92,12 +84,12 @@ led-$(CONFIG_SA1100_SIMPAD) += leds-simpad.o obj-$(CONFIG_SA1100_STORK) += stork.o -export-objs += stork.o + +obj-$(CONFIG_SA1100_TRIZEPS) += trizeps.o obj-$(CONFIG_SA1100_XP860) += xp860.o obj-$(CONFIG_SA1100_YOPY) += yopy.o -export-objs += yopy.o # LEDs support obj-$(CONFIG_LEDS) += $(led-y) @@ -106,4 +98,4 @@ #obj-$(CONFIG_SA1100_USB) += usb/ # Miscelaneous functions -obj-$(CONFIG_PM) += pm.o sleep.o +obj-$(CONFIG_PM) += pm.o sleep.o diff -Nru a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/arm/mach-sa1100/hackkit.c Sun Feb 9 21:13:38 2003 @@ -0,0 +1,180 @@ +/* + * linux/arch/arm/mach-sa1100/hackkit.c + * + * Copyright (C) 2002 Stefan Eletzhofer + * + * This file contains all HackKit tweaks. Based on original work from + * Nicolas Pitre's assabet fixes + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "generic.h" + +/********************************************************************** + * prototypes + */ + +/* init funcs */ +static void __init get_hackkit_scr(void); +static int __init hackkit_init(void); +static void __init hackkit_init_irq(void); +static void __init hackkit_map_io(void); + +static u_int hackkit_get_mctrl(struct uart_port *port); +static void hackkit_set_mctrl(struct uart_port *port, u_int mctrl); +static void hackkit_uart_pm(struct uart_port *port, u_int state, u_int oldstate); + +/********************************************************************** + * global data + */ + +/********************************************************************** + * static data + */ + +static struct map_desc hackkit_io_desc[] __initdata = { + /* virtual physical length type */ + { 0xe8000000, 0x00000000, 0x01000000, MT_DEVICE } /* Flash bank 0 */ +}; + +static struct sa1100_port_fns hackkit_port_fns __initdata = { + .set_mctrl = hackkit_set_mctrl, + .get_mctrl = hackkit_get_mctrl, + .pm = hackkit_uart_pm, +}; + +/********************************************************************** + * Static functions + */ + +static void __init hackkit_map_io(void) +{ + sa1100_map_io(); + iotable_init(hackkit_io_desc, ARRAY_SIZE(hackkit_io_desc)); + + sa1100_register_uart_fns(&hackkit_port_fns); + sa1100_register_uart(0, 1); /* com port */ + sa1100_register_uart(1, 2); + sa1100_register_uart(2, 3); /* radio module */ + + Ser1SDCR0 |= SDCR0_SUS; +} + +static void __init hackkit_init_irq(void) +{ + /* none used yet */ +} + +/** + * hackkit_uart_pm - powermgmt callback function for system 3 UART + * @port: uart port structure + * @state: pm state + * @oldstate: old pm state + * + */ +static void hackkit_uart_pm(struct uart_port *port, u_int state, u_int oldstate) +{ + /* TODO: switch on/off uart in powersave mode */ +} + +/* + * Note! this can be called from IRQ context. + * FIXME: No modem ctrl lines yet. + */ +static void hackkit_set_mctrl(struct uart_port *port, u_int mctrl) +{ +#if 0 + if (port->mapbase == _Ser1UTCR0) { + u_int set = 0, clear = 0; + + if (mctrl & TIOCM_RTS) + set |= PT_CTRL2_RS1_RTS; + else + clear |= PT_CTRL2_RS1_RTS; + + if (mctrl & TIOCM_DTR) + set |= PT_CTRL2_RS1_DTR; + else + clear |= PT_CTRL2_RS1_DTR; + + PTCTRL2_clear(clear); + PTCTRL2_set(set); + } +#endif +} + +static u_int hackkit_get_mctrl(struct uart_port *port) +{ + u_int ret = 0; +#if 0 + u_int irqsr = PT_IRQSR; + + /* need 2 reads to read current value */ + irqsr = PT_IRQSR; + + /* TODO: check IRQ source register for modem/com + status lines and set them correctly. */ +#endif + + ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR; + + return ret; +} + +static int __init hackkit_init(void) +{ + int ret = 0; + + if ( !machine_is_hackkit() ) { + ret = -EINVAL; + goto DONE; + } + + hackkit_init_irq(); + + ret = 0; +DONE: + return ret; +} + +/********************************************************************** + * Exported Functions + */ + +/********************************************************************** + * kernel magic macros + */ +arch_initcall(hackkit_init); + +MACHINE_START(HACKKIT, "HackKit Cpu Board") + BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) + BOOT_PARAMS(0xc0000100) + MAPIO(hackkit_map_io) + INITIRQ(sa1100_init_irq) +MACHINE_END diff -Nru a/arch/arm/mach-sa1100/leds-hackkit.c b/arch/arm/mach-sa1100/leds-hackkit.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/arm/mach-sa1100/leds-hackkit.c Sun Feb 9 21:13:37 2003 @@ -0,0 +1,113 @@ +/* + * linux/arch/arm/mach-sa1100/leds-hackkit.c + * + * based on leds-lart.c + * + * (C) Erik Mouw (J.A.K.Mouw@its.tudelft.nl), April 21, 2000 + * (C) Stefan Eletzhofer , 2002 + * + * The HackKit has two leds (GPIO 22/23). The red led (gpio 22) is used + * as cpu led, the green one is used as timer led. + */ +#include +#include + +#include +#include +#include + +#include "leds.h" + + +#define LED_STATE_ENABLED 1 +#define LED_STATE_CLAIMED 2 + +static unsigned int led_state; +static unsigned int hw_led_state; + +#define LED_GREEN GPIO_GPIO23 +#define LED_RED GPIO_GPIO22 +#define LED_MASK (LED_RED | LED_GREEN) + +void hackkit_leds_event(led_event_t evt) +{ + unsigned long flags; + + local_irq_save(flags); + + switch(evt) { + case led_start: + /* pin 22/23 are outputs */ + GPDR |= LED_MASK; + hw_led_state = LED_MASK; + led_state = LED_STATE_ENABLED; + break; + + case led_stop: + led_state &= ~LED_STATE_ENABLED; + break; + + case led_claim: + led_state |= LED_STATE_CLAIMED; + hw_led_state = LED_MASK; + break; + + case led_release: + led_state &= ~LED_STATE_CLAIMED; + hw_led_state = LED_MASK; + break; + +#ifdef CONFIG_LEDS_TIMER + case led_timer: + if (!(led_state & LED_STATE_CLAIMED)) + hw_led_state ^= LED_GREEN; + break; +#endif + +#ifdef CONFIG_LEDS_CPU + case led_idle_start: + /* The LART people like the LED to be off when the + system is idle... */ + if (!(led_state & LED_STATE_CLAIMED)) + hw_led_state &= ~LED_RED; + break; + + case led_idle_end: + /* ... and on if the system is not idle */ + if (!(led_state & LED_STATE_CLAIMED)) + hw_led_state |= LED_RED; + break; +#endif + + case led_red_on: + if (led_state & LED_STATE_CLAIMED) + hw_led_state &= ~LED_RED; + break; + + case led_red_off: + if (led_state & LED_STATE_CLAIMED) + hw_led_state |= LED_RED; + break; + + case led_green_on: + if (led_state & LED_STATE_CLAIMED) + hw_led_state &= ~LED_GREEN; + break; + + case led_green_off: + if (led_state & LED_STATE_CLAIMED) + hw_led_state |= LED_GREEN; + break; + + default: + break; + } + + /* Now set the GPIO state, or nothing will happen at all */ + if (led_state & LED_STATE_ENABLED) { + GPSR = hw_led_state; + GPCR = hw_led_state ^ LED_MASK; + } + + local_irq_restore(flags); +} diff -Nru a/arch/arm/mach-sa1100/leds.c b/arch/arm/mach-sa1100/leds.c --- a/arch/arm/mach-sa1100/leds.c Sun Feb 9 21:13:29 2003 +++ b/arch/arm/mach-sa1100/leds.c Sun Feb 9 21:13:29 2003 @@ -29,6 +29,8 @@ leds_event = flexanet_leds_event; if (machine_is_graphicsclient()) leds_event = graphicsclient_leds_event; + if (machine_is_hackkit()) + leds_event = hackkit_leds_event; if (machine_is_lart()) leds_event = lart_leds_event; if (machine_is_pfs168()) diff -Nru a/arch/arm/mach-sa1100/leds.h b/arch/arm/mach-sa1100/leds.h --- a/arch/arm/mach-sa1100/leds.h Sun Feb 9 21:13:34 2003 +++ b/arch/arm/mach-sa1100/leds.h Sun Feb 9 21:13:34 2003 @@ -5,6 +5,7 @@ extern void cerf_leds_event(led_event_t evt); extern void flexanet_leds_event(led_event_t evt); extern void graphicsclient_leds_event(led_event_t evt); +extern void hackkit_leds_event(led_event_t evt); extern void lart_leds_event(led_event_t evt); extern void pfs168_leds_event(led_event_t evt); extern void graphicsmaster_leds_event(led_event_t evt); diff -Nru a/arch/arm/mach-sa1100/pcipool.c b/arch/arm/mach-sa1100/pcipool.c --- a/arch/arm/mach-sa1100/pcipool.c Sun Feb 9 21:13:34 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,390 +0,0 @@ -/* - NOTE: - - this code was lifted straight out of drivers/pci/pci.c; - when compiling for the Intel StrongARM SA-1110/SA-1111 the - usb-ohci.c driver needs these routines even when the architecture - has no pci bus... -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -/* - * Pool allocator ... wraps the pci_alloc_consistent page allocator, so - * small blocks are easily used by drivers for bus mastering controllers. - * This should probably be sharing the guts of the slab allocator. - */ - -struct pci_pool { /* the pool */ - struct list_head page_list; - spinlock_t lock; - size_t blocks_per_page; - size_t size; - struct pci_dev *dev; - size_t allocation; - char name [32]; - wait_queue_head_t waitq; -}; - -struct pci_page { /* cacheable header for 'allocation' bytes */ - struct list_head page_list; - void *vaddr; - dma_addr_t dma; - unsigned long bitmap [0]; -}; - -#define POOL_TIMEOUT_JIFFIES ((100 /* msec */ * HZ) / 1000) -#define POOL_POISON_BYTE 0xa7 - -// #define CONFIG_PCIPOOL_DEBUG - -static inline const char *slot_name(const struct pci_pool *pool) -{ - const struct pci_dev *pdev = pool->dev; - - if (pdev == 0) - return "[0]"; - - else if (pcidev_is_sa1111(pdev)) - return "[SA-1111]"; - else - return pdev->slot_name; -} - - -/** - * pci_pool_create - Creates a pool of pci consistent memory blocks, for dma. - * @name: name of pool, for diagnostics - * @pdev: pci device that will be doing the DMA - * @size: size of the blocks in this pool. - * @align: alignment requirement for blocks; must be a power of two - * @allocation: returned blocks won't cross this boundary (or zero) - * Context: !in_interrupt() - * - * Returns a pci allocation pool with the requested characteristics, or - * null if one can't be created. Given one of these pools, pci_pool_alloc() - * may be used to allocate memory. Such memory will all have "consistent" - * DMA mappings, accessible by the device and its driver without using - * cache flushing primitives. The actual size of blocks allocated may be - * larger than requested because of alignment. - * - * If allocation is nonzero, objects returned from pci_pool_alloc() won't - * cross that size boundary. This is useful for devices which have - * addressing restrictions on individual DMA transfers, such as not crossing - * boundaries of 4KBytes. - */ -struct pci_pool * -pci_pool_create (const char *name, struct pci_dev *pdev, - size_t size, size_t align, size_t allocation) -{ - struct pci_pool *retval; - - if (align == 0) - align = 1; - if (size == 0) - return 0; - else if (size < align) - size = align; - else if ((size % align) != 0) { - size += align + 1; - size &= ~(align - 1); - } - - if (allocation == 0) { - if (PAGE_SIZE < size) - allocation = size; - else - allocation = PAGE_SIZE; - // FIXME: round up for less fragmentation - } else if (allocation < size) - return 0; - - if (!(retval = kmalloc (sizeof *retval, SLAB_KERNEL))) - return retval; - - strncpy (retval->name, name, sizeof retval->name); - retval->name [sizeof retval->name - 1] = 0; - - retval->dev = pdev; - INIT_LIST_HEAD (&retval->page_list); - spin_lock_init (&retval->lock); - retval->size = size; - retval->allocation = allocation; - retval->blocks_per_page = allocation / size; - init_waitqueue_head (&retval->waitq); - -#ifdef CONFIG_PCIPOOL_DEBUG - printk (KERN_DEBUG "pcipool create %s/%s size %d, %d/page (%d alloc)\n", - slot_name(retval), retval->name, size, - retval->blocks_per_page, allocation); -#endif - - return retval; -} - - -static struct pci_page * -pool_alloc_page (struct pci_pool *pool, int mem_flags) -{ - struct pci_page *page; - int mapsize; - - mapsize = pool->blocks_per_page; - mapsize = (mapsize + BITS_PER_LONG - 1) / BITS_PER_LONG; - mapsize *= sizeof (long); - - page = (struct pci_page *) kmalloc (mapsize + sizeof *page, mem_flags); - if (!page) - return 0; - page->vaddr = pci_alloc_consistent (pool->dev, - pool->allocation, - &page->dma); - if (page->vaddr) { - memset (page->bitmap, 0xff, mapsize); // bit set == free -#ifdef CONFIG_DEBUG_SLAB - memset (page->vaddr, POOL_POISON_BYTE, pool->allocation); -#endif - list_add (&page->page_list, &pool->page_list); - } else { - kfree (page); - page = 0; - } - return page; -} - - -static inline int -is_page_busy (int blocks, unsigned long *bitmap) -{ - while (blocks > 0) { - if (*bitmap++ != ~0UL) - return 1; - blocks -= BITS_PER_LONG; - } - return 0; -} - -static void -pool_free_page (struct pci_pool *pool, struct pci_page *page) -{ - dma_addr_t dma = page->dma; - -#ifdef CONFIG_DEBUG_SLAB - memset (page->vaddr, POOL_POISON_BYTE, pool->allocation); -#endif - pci_free_consistent (pool->dev, pool->allocation, page->vaddr, dma); - list_del (&page->page_list); - kfree (page); -} - - -/** - * pci_pool_destroy - destroys a pool of pci memory blocks. - * @pool: pci pool that will be destroyed - * - * Caller guarantees that no more memory from the pool is in use, - * and that nothing will try to use the pool after this call. - */ -void -pci_pool_destroy (struct pci_pool *pool) -{ - unsigned long flags; - -#ifdef CONFIG_PCIPOOL_DEBUG - printk (KERN_DEBUG "pcipool destroy %s/%s\n", - slot_name(pool), pool->name); -#endif - - spin_lock_irqsave (&pool->lock, flags); - while (!list_empty (&pool->page_list)) { - struct pci_page *page; - page = list_entry (pool->page_list.next, - struct pci_page, page_list); - if (is_page_busy (pool->blocks_per_page, page->bitmap)) { - printk (KERN_ERR "pci_pool_destroy %s/%s, %p busy\n", - slot_name(pool), pool->name, page->vaddr); - /* leak the still-in-use consistent memory */ - list_del (&page->page_list); - kfree (page); - } else - pool_free_page (pool, page); - } - spin_unlock_irqrestore (&pool->lock, flags); - kfree (pool); -} - - -/** - * pci_pool_alloc - get a block of consistent memory - * @pool: pci pool that will produce the block - * @mem_flags: SLAB_KERNEL or SLAB_ATOMIC - * @handle: pointer to dma address of block - * - * This returns the kernel virtual address of a currently unused block, - * and reports its dma address through the handle. - * If such a memory block can't be allocated, null is returned. - */ -void * -pci_pool_alloc (struct pci_pool *pool, int mem_flags, dma_addr_t *handle) -{ - unsigned long flags; - struct list_head *entry; - struct pci_page *page; - int map, block; - size_t offset; - void *retval; - -restart: - spin_lock_irqsave (&pool->lock, flags); - list_for_each (entry, &pool->page_list) { - int i; - page = list_entry (entry, struct pci_page, page_list); - /* only cachable accesses here ... */ - for (map = 0, i = 0; - i < pool->blocks_per_page; - i += BITS_PER_LONG, map++) { - if (page->bitmap [map] == 0) - continue; - block = ffz (~ page->bitmap [map]); - if ((i + block) < pool->blocks_per_page) { - clear_bit (block, &page->bitmap [map]); - offset = (BITS_PER_LONG * map) + block; - offset *= pool->size; - goto ready; - } - } - } - if (!(page = pool_alloc_page (pool, mem_flags))) { - if (mem_flags == SLAB_KERNEL) { - DECLARE_WAITQUEUE (wait, current); - - current->state = TASK_INTERRUPTIBLE; - add_wait_queue (&pool->waitq, &wait); - spin_unlock_irqrestore (&pool->lock, flags); - - schedule_timeout (POOL_TIMEOUT_JIFFIES); - - current->state = TASK_RUNNING; - remove_wait_queue (&pool->waitq, &wait); - goto restart; - } - retval = 0; - goto done; - } - - clear_bit (0, &page->bitmap [0]); - offset = 0; -ready: - retval = offset + page->vaddr; - *handle = offset + page->dma; -done: - spin_unlock_irqrestore (&pool->lock, flags); - return retval; -} - - -static struct pci_page * -pool_find_page (struct pci_pool *pool, dma_addr_t dma) -{ - unsigned long flags; - struct list_head *entry; - struct pci_page *page; - - spin_lock_irqsave (&pool->lock, flags); - list_for_each (entry, &pool->page_list) { - page = list_entry (entry, struct pci_page, page_list); - if (dma < page->dma) - continue; - if (dma < (page->dma + pool->allocation)) - goto done; - } - page = 0; -done: - spin_unlock_irqrestore (&pool->lock, flags); - return page; -} - - -/** - * pci_pool_free - put block back into pci pool - * @pool: the pci pool holding the block - * @vaddr: virtual address of block - * @dma: dma address of block - * - * Caller promises neither device nor driver will again touch this block - * unless it is first re-allocated. - */ -void -pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t dma) -{ - struct pci_page *page; - unsigned long flags; - int map, block; - - if ((page = pool_find_page (pool, dma)) == 0) { - printk (KERN_ERR "pci_pool_free %s/%s, %p/%lx (bad dma)\n", - pool->dev ? pool->dev->slot_name : NULL, - pool->name, vaddr, (unsigned long) dma); - return; - } - - block = dma - page->dma; - block /= pool->size; - map = block / BITS_PER_LONG; - block %= BITS_PER_LONG; - -#ifdef CONFIG_DEBUG_SLAB - if (((dma - page->dma) + (void *)page->vaddr) != vaddr) { - printk (KERN_ERR "pci_pool_free %s/%s, %p (bad vaddr)/%lx\n", - pool->dev ? pool->dev->slot_name : NULL, - pool->name, vaddr, (unsigned long) dma); - return; - } - if (page->bitmap [map] & (1UL << block)) { - printk (KERN_ERR "pci_pool_free %s/%s, dma %x already free\n", - pool->dev ? pool->dev->slot_name : NULL, - pool->name, dma); - return; - } - memset (vaddr, POOL_POISON_BYTE, pool->size); -#endif - - spin_lock_irqsave (&pool->lock, flags); - set_bit (block, &page->bitmap [map]); - if (waitqueue_active (&pool->waitq)) - wake_up (&pool->waitq); - /* - * Resist a temptation to do - * if (!is_page_busy(bpp, page->bitmap)) pool_free_page(pool, page); - * it is not interrupt safe. Better have empty pages hang around. - */ - spin_unlock_irqrestore (&pool->lock, flags); -} - -EXPORT_SYMBOL (pci_pool_create); -EXPORT_SYMBOL (pci_pool_destroy); -EXPORT_SYMBOL (pci_pool_alloc); -EXPORT_SYMBOL (pci_pool_free); - -/* **************************************** */ - -static int __init pcipool_init(void) -{ - MOD_INC_USE_COUNT; /* never unload */ - - return 0; -} -module_init(pcipool_init); - -MODULE_LICENSE("GPL"); diff -Nru a/arch/arm/mach-sa1100/sa1111-pcibuf.c b/arch/arm/mach-sa1100/sa1111-pcibuf.c --- a/arch/arm/mach-sa1100/sa1111-pcibuf.c Sun Feb 9 21:13:28 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,551 +0,0 @@ -/* - * linux/arch/arm/mach-sa1100/pci-sa1111.c - * - * Special pci_{map/unmap/dma_sync}_* routines for SA-1111. - * - * These functions utilize bouncer buffers to compensate for a bug in - * the SA-1111 hardware which don't allow DMA to/from addresses - * certain addresses above 1MB. - * - * Re-written by Christopher Hoover - * Original version by Brad Parker (brad@heeltoe.com) - * - * Copyright (C) 2002 Hewlett Packard Company. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * */ - -#include -#include -#include -#include -#include -#include - -//#define DEBUG -#ifdef DEBUG -#define DPRINTK(...) do { printk(KERN_DEBUG __VA_ARGS__); } while (0) -#else -#define DPRINTK(...) do { } while (0) -#endif - -//#define STATS -#ifdef STATS -#define DO_STATS(X) do { X ; } while (0) -#else -#define DO_STATS(X) do { } while (0) -#endif - -/* ************************************************** */ - -struct safe_buffer { - struct list_head node; - - /* original request */ - void *ptr; - size_t size; - int direction; - - /* safe buffer info */ - struct pci_pool *pool; - void *safe; - dma_addr_t safe_dma_addr; -}; - -LIST_HEAD(safe_buffers); - - -#define SIZE_SMALL 1024 -#define SIZE_LARGE (4*1024) - -static struct pci_pool *small_buffer_pool, *large_buffer_pool; - -#ifdef STATS -static unsigned long sbp_allocs __initdata = 0; -static unsigned long lbp_allocs __initdata = 0; -static unsigned long total_allocs __initdata= 0; - -static void print_alloc_stats(void) -{ - printk(KERN_INFO - "sa1111_pcibuf: sbp: %lu, lbp: %lu, other: %lu, total: %lu\n", - sbp_allocs, lbp_allocs, - total_allocs - sbp_allocs - lbp_allocs, total_allocs); -} -#endif - -static int __init -create_safe_buffer_pools(void) -{ - small_buffer_pool = pci_pool_create("sa1111_small_dma_buffer", - SA1111_FAKE_PCIDEV, - SIZE_SMALL, - 0 /* byte alignment */, - 0 /* no page-crossing issues */); - if (0 == small_buffer_pool) { - printk(KERN_ERR - "sa1111_pcibuf: could not allocate small pci pool\n"); - return -1; - } - - large_buffer_pool = pci_pool_create("sa1111_large_dma_buffer", - SA1111_FAKE_PCIDEV, - SIZE_LARGE, - 0 /* byte alignment */, - 0 /* no page-crossing issues */); - if (0 == large_buffer_pool) { - printk(KERN_ERR - "sa1111_pcibuf: could not allocate large pci pool\n"); - pci_pool_destroy(small_buffer_pool); - small_buffer_pool = 0; - return -1; - } - - printk(KERN_INFO - "sa1111_pcibuf: buffer sizes: small=%u, large=%u\n", - SIZE_SMALL, SIZE_LARGE); - - return 0; -} - -static void __exit -destroy_safe_buffer_pools(void) -{ - if (small_buffer_pool) - pci_pool_destroy(small_buffer_pool); - if (large_buffer_pool) - pci_pool_destroy(large_buffer_pool); - - small_buffer_pool = large_buffer_pool = 0; -} - - -/* allocate a 'safe' buffer and keep track of it */ -static struct safe_buffer * -alloc_safe_buffer(void *ptr, size_t size, int direction) -{ - struct safe_buffer *buf; - struct pci_pool *pool; - void *safe; - dma_addr_t safe_dma_addr; - - DPRINTK("%s(ptr=%p, size=%d, direction=%d)\n", - __func__, ptr, size, direction); - - DO_STATS ( total_allocs++ ); - - buf = kmalloc(sizeof(struct safe_buffer), GFP_ATOMIC); - if (buf == 0) { - printk(KERN_WARNING "%s: kmalloc failed\n", __func__); - return 0; - } - - if (size <= SIZE_SMALL) { - pool = small_buffer_pool; - safe = pci_pool_alloc(pool, GFP_ATOMIC, &safe_dma_addr); - - DO_STATS ( sbp_allocs++ ); - } else if (size <= SIZE_LARGE) { - pool = large_buffer_pool; - safe = pci_pool_alloc(pool, GFP_ATOMIC, &safe_dma_addr); - - DO_STATS ( lbp_allocs++ ); - } else { - pool = 0; - safe = pci_alloc_consistent(SA1111_FAKE_PCIDEV, size, - &safe_dma_addr); - } - - if (safe == 0) { - printk(KERN_WARNING - "%s: could not alloc dma memory (size=%d)\n", - __func__, size); - kfree(buf); - return 0; - } - -#ifdef STATS - if (total_allocs % 1000 == 0) - print_alloc_stats(); -#endif - - BUG_ON(sa1111_check_dma_bug(safe_dma_addr)); // paranoia - - buf->ptr = ptr; - buf->size = size; - buf->direction = direction; - buf->pool = pool; - buf->safe = safe; - buf->safe_dma_addr = safe_dma_addr; - - MOD_INC_USE_COUNT; - list_add(&buf->node, &safe_buffers); - - return buf; -} - -/* determine if a buffer is from our "safe" pool */ -static struct safe_buffer * -find_safe_buffer(dma_addr_t safe_dma_addr) -{ - struct list_head *entry; - - list_for_each(entry, &safe_buffers) { - struct safe_buffer *b = - list_entry(entry, struct safe_buffer, node); - - if (b->safe_dma_addr == safe_dma_addr) { - return b; - } - } - - return 0; -} - -static void -free_safe_buffer(struct safe_buffer *buf) -{ - DPRINTK("%s(buf=%p)\n", __func__, buf); - - list_del(&buf->node); - - if (buf->pool) - pci_pool_free(buf->pool, buf->safe, buf->safe_dma_addr); - else - pci_free_consistent(SA1111_FAKE_PCIDEV, buf->size, buf->safe, - buf->safe_dma_addr); - kfree(buf); - - MOD_DEC_USE_COUNT; -} - -static inline int -dma_range_is_safe(dma_addr_t addr, size_t size) -{ - unsigned int physaddr = SA1111_DMA_ADDR((unsigned int) addr); - - /* Any address within one megabyte of the start of the target - * bank will be OK. This is an overly conservative test: - * other addresses can be OK depending on the dram - * configuration. (See sa1111.c:sa1111_check_dma_bug() * for - * details.) - * - * We take care to ensure the entire dma region is within - * the safe range. - */ - - return ((physaddr + size - 1) < (1<<20)); -} - -/* ************************************************** */ - -#ifdef STATS -static unsigned long map_op_count __initdata = 0; -static unsigned long bounce_count __initdata = 0; - -static void print_map_stats(void) -{ - printk(KERN_INFO - "sa1111_pcibuf: map_op_count=%lu, bounce_count=%lu\n", - map_op_count, bounce_count); -} -#endif - -static dma_addr_t -map_single(void *ptr, size_t size, int direction) -{ - dma_addr_t dma_addr; - - DO_STATS ( map_op_count++ ); - - dma_addr = virt_to_bus(ptr); - - if (!dma_range_is_safe(dma_addr, size)) { - struct safe_buffer *buf; - - DO_STATS ( bounce_count++ ) ; - - buf = alloc_safe_buffer(ptr, size, direction); - if (buf == 0) { - printk(KERN_ERR - "%s: unable to map unsafe buffer %p!\n", - __func__, ptr); - return 0; - } - - DPRINTK("%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n", - __func__, - buf->ptr, (void *) virt_to_bus(buf->ptr), - buf->safe, (void *) buf->safe_dma_addr); - - if ((direction == PCI_DMA_TODEVICE) || - (direction == PCI_DMA_BIDIRECTIONAL)) { - DPRINTK("%s: copy out from unsafe %p, to safe %p, size %d\n", - __func__, ptr, buf->safe, size); - memcpy(buf->safe, ptr, size); - } - consistent_sync(buf->safe, size, direction); - - dma_addr = buf->safe_dma_addr; - } else { - consistent_sync(ptr, size, direction); - } - -#ifdef STATS - if (map_op_count % 1000 == 0) - print_map_stats(); -#endif - - return dma_addr; -} - -static void -unmap_single(dma_addr_t dma_addr, size_t size, int direction) -{ - struct safe_buffer *buf; - - buf = find_safe_buffer(dma_addr); - - if (buf) { - BUG_ON(buf->size != size); - BUG_ON(buf->direction != direction); - - DPRINTK("%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n", - __func__, - buf->ptr, (void *) virt_to_bus(buf->ptr), - buf->safe, (void *) buf->safe_dma_addr); - - - DO_STATS ( bounce_count++ ); - - if ((direction == PCI_DMA_FROMDEVICE) || - (direction == PCI_DMA_BIDIRECTIONAL)) { - DPRINTK("%s: copy back from safe %p, to unsafe %p size %d\n", - __func__, buf->safe, buf->ptr, size); - memcpy(buf->ptr, buf->safe, size); - } - free_safe_buffer(buf); - } -} - -static void -sync_single(dma_addr_t dma_addr, size_t size, int direction) -{ - struct safe_buffer *buf; - - buf = find_safe_buffer(dma_addr); - - if (buf) { - BUG_ON(buf->size != size); - BUG_ON(buf->direction != direction); - - DPRINTK("%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n", - __func__, - buf->ptr, (void *) virt_to_bus(buf->ptr), - buf->safe, (void *) buf->safe_dma_addr); - - DO_STATS ( bounce_count++ ); - - switch (direction) { - case PCI_DMA_FROMDEVICE: - DPRINTK("%s: copy back from safe %p, to unsafe %p size %d\n", - __func__, buf->safe, buf->ptr, size); - memcpy(buf->ptr, buf->safe, size); - break; - case PCI_DMA_TODEVICE: - DPRINTK("%s: copy out from unsafe %p, to safe %p, size %d\n", - __func__,buf->ptr, buf->safe, size); - memcpy(buf->safe, buf->ptr, size); - break; - case PCI_DMA_BIDIRECTIONAL: - BUG(); /* is this allowed? what does it mean? */ - default: - BUG(); - } - consistent_sync(buf->safe, size, direction); - } else { - consistent_sync(bus_to_virt(dma_addr), size, direction); - } -} - -/* ************************************************** */ - -/* - * see if a buffer address is in an 'unsafe' range. if it is - * allocate a 'safe' buffer and copy the unsafe buffer into it. - * substitute the safe buffer for the unsafe one. - * (basically move the buffer from an unsafe area to a safe one) - */ -dma_addr_t -sa1111_map_single(void *ptr, size_t size, int direction) -{ - unsigned long flags; - dma_addr_t dma_addr; - - DPRINTK("%s(ptr=%p,size=%d,dir=%x)\n", - __func__, ptr, size, direction); - - BUG_ON(direction == PCI_DMA_NONE); - - local_irq_save(flags); - - dma_addr = map_single(ptr, size, direction); - - local_irq_restore(flags); - - return dma_addr; -} - -/* - * see if a mapped address was really a "safe" buffer and if so, copy - * the data from the safe buffer back to the unsafe buffer and free up - * the safe buffer. (basically return things back to the way they - * should be) - */ - -void -sa1111_unmap_single(dma_addr_t dma_addr, size_t size, int direction) -{ - unsigned long flags; - - DPRINTK("%s(ptr=%p,size=%d,dir=%x)\n", - __func__, (void *) dma_addr, size, direction); - - BUG_ON(direction == PCI_DMA_NONE); - - local_irq_save(flags); - - unmap_single(dma_addr, size, direction); - - local_irq_restore(flags); -} - -int -sa1111_map_sg(struct scatterlist *sg, int nents, int direction) -{ - unsigned long flags; - int i; - - DPRINTK("%s(sg=%p,nents=%d,dir=%x)\n", - __func__, sg, nents, direction); - - BUG_ON(direction == PCI_DMA_NONE); - - local_irq_save(flags); - - for (i = 0; i < nents; i++, sg++) { - struct page *page = sg->page; - unsigned int offset = sg->offset; - unsigned int length = sg->length; - void *ptr = page_address(page) + offset; - - sg->dma_address = - map_single(ptr, length, direction); - } - - local_irq_restore(flags); - - return nents; -} - -void -sa1111_unmap_sg(struct scatterlist *sg, int nents, int direction) -{ - unsigned long flags; - int i; - - DPRINTK("%s(sg=%p,nents=%d,dir=%x)\n", - __func__, sg, nents, direction); - - BUG_ON(direction == PCI_DMA_NONE); - - local_irq_save(flags); - - for (i = 0; i < nents; i++, sg++) { - dma_addr_t dma_addr = sg->dma_address; - unsigned int length = sg->length; - - unmap_single(dma_addr, length, direction); - } - - local_irq_restore(flags); -} - -void -sa1111_dma_sync_single(dma_addr_t dma_addr, size_t size, int direction) -{ - unsigned long flags; - - DPRINTK("%s(ptr=%p,size=%d,dir=%x)\n", - __func__, (void *) dma_addr, size, direction); - - local_irq_save(flags); - - sync_single(dma_addr, size, direction); - - local_irq_restore(flags); -} - -void -sa1111_dma_sync_sg(struct scatterlist *sg, int nents, int direction) -{ - unsigned long flags; - int i; - - DPRINTK("%s(sg=%p,nents=%d,dir=%x)\n", - __func__, sg, nents, direction); - - BUG_ON(direction == PCI_DMA_NONE); - - local_irq_save(flags); - - for (i = 0; i < nents; i++, sg++) { - dma_addr_t dma_addr = sg->dma_address; - unsigned int length = sg->length; - - sync_single(dma_addr, length, direction); - } - - local_irq_restore(flags); -} - -EXPORT_SYMBOL(sa1111_map_single); -EXPORT_SYMBOL(sa1111_unmap_single); -EXPORT_SYMBOL(sa1111_map_sg); -EXPORT_SYMBOL(sa1111_unmap_sg); -EXPORT_SYMBOL(sa1111_dma_sync_single); -EXPORT_SYMBOL(sa1111_dma_sync_sg); - -/* **************************************** */ - -static int __init sa1111_pcibuf_init(void) -{ - int ret; - - printk(KERN_DEBUG - "sa1111_pcibuf: initializing SA-1111 DMA workaround\n"); - - ret = create_safe_buffer_pools(); - - return ret; -} -module_init(sa1111_pcibuf_init); - -static void __exit sa1111_pcibuf_exit(void) -{ - BUG_ON(!list_empty(&safe_buffers)); - -#ifdef STATS - print_alloc_stats(); - print_map_stats(); -#endif - - destroy_safe_buffer_pools(); -} -module_exit(sa1111_pcibuf_exit); - -MODULE_AUTHOR("Christopher Hoover "); -MODULE_DESCRIPTION("Special pci_{map/unmap/dma_sync}_* routines for SA-1111."); -MODULE_LICENSE("GPL"); diff -Nru a/arch/arm/mach-sa1100/sa1111.c b/arch/arm/mach-sa1100/sa1111.c --- a/arch/arm/mach-sa1100/sa1111.c Sun Feb 9 21:13:36 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,1107 +0,0 @@ -/* - * linux/arch/arm/mach-sa1100/sa1111.c - * - * SA1111 support - * - * Original code by John Dorsey - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This file contains all generic SA1111 support. - * - * All initialization functions provided here are intended to be called - * from machine specific code with proper arguments when required. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -/* - * We keep the following data for the overall SA1111. Note that the - * struct device and struct resource are "fake"; they should be supplied - * by the bus above us. However, in the interests of getting all SA1111 - * drivers converted over to the device model, we provide this as an - * anchor point for all the other drivers. - */ -struct sa1111 { - struct device *dev; - struct resource res; - int irq; - spinlock_t lock; - void *base; -}; - -/* - * We _really_ need to eliminate this. Its only users - * are the PWM and DMA checking code. - */ -static struct sa1111 *g_sa1111; - -static struct sa1111_dev usb_dev = { - .dev = { - .name = "Intel Corporation SA1111 [USB Controller]", - }, - .skpcr_mask = SKPCR_UCLKEN, - .devid = SA1111_DEVID_USB, - .irq = { - IRQ_USBPWR, - IRQ_HCIM, - IRQ_HCIBUFFACC, - IRQ_HCIRMTWKP, - IRQ_NHCIMFCIR, - IRQ_USB_PORT_RESUME - }, -}; - -static struct sa1111_dev sac_dev = { - .dev = { - .name = "Intel Corporation SA1111 [Audio Controller]", - }, - .skpcr_mask = SKPCR_I2SCLKEN | SKPCR_L3CLKEN, - .devid = SA1111_DEVID_SAC, - .irq = { - AUDXMTDMADONEA, - AUDXMTDMADONEB, - AUDRCVDMADONEA, - AUDRCVDMADONEB - }, -}; - -static struct sa1111_dev ssp_dev = { - .dev = { - .name = "Intel Corporation SA1111 [SSP Controller]", - }, - .skpcr_mask = SKPCR_SCLKEN, - .devid = SA1111_DEVID_SSP, -}; - -static struct sa1111_dev kbd_dev = { - .dev = { - .name = "Intel Corporation SA1111 [PS2]", - }, - .skpcr_mask = SKPCR_PTCLKEN, - .devid = SA1111_DEVID_PS2, - .irq = { - IRQ_TPRXINT, - IRQ_TPTXINT - }, -}; - -static struct sa1111_dev mse_dev = { - .dev = { - .name = "Intel Corporation SA1111 [PS2]", - }, - .skpcr_mask = SKPCR_PMCLKEN, - .devid = SA1111_DEVID_PS2, - .irq = { - IRQ_MSRXINT, - IRQ_MSTXINT - }, -}; - -static struct sa1111_dev int_dev = { - .dev = { - .name = "Intel Corporation SA1111 [Interrupt Controller]", - }, - .skpcr_mask = 0, - .devid = SA1111_DEVID_INT, -}; - -static struct sa1111_dev pcmcia_dev = { - .dev = { - .name = "Intel Corporation SA1111 [PCMCIA Controller]", - }, - .skpcr_mask = 0, - .devid = SA1111_DEVID_PCMCIA, - .irq = { - IRQ_S0_READY_NINT, - IRQ_S0_CD_VALID, - IRQ_S0_BVD1_STSCHG, - IRQ_S1_READY_NINT, - IRQ_S1_CD_VALID, - IRQ_S1_BVD1_STSCHG, - }, -}; - -static struct sa1111_dev *devs[] = { - &usb_dev, - &sac_dev, - &ssp_dev, - &kbd_dev, - &mse_dev, - &pcmcia_dev, -}; - -static unsigned int dev_offset[] = { - SA1111_USB, - 0x0600, - 0x0800, - SA1111_KBD, - SA1111_MSE, - 0x1800, -}; - -/* - * SA1111 interrupt support. Since clearing an IRQ while there are - * active IRQs causes the interrupt output to pulse, the upper levels - * will call us again if there are more interrupts to process. - */ -static void -sa1111_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) -{ - unsigned int stat0, stat1, i; - - stat0 = INTSTATCLR0; - stat1 = INTSTATCLR1; - - INTSTATCLR0 = stat0; - - desc->chip->ack(irq); - - INTSTATCLR1 = stat1; - - if (stat0 == 0 && stat1 == 0) { - do_bad_IRQ(irq, desc, regs); - return; - } - - for (i = IRQ_SA1111_START; stat0; i++, stat0 >>= 1) - if (stat0 & 1) - do_edge_IRQ(i, irq_desc + i, regs); - - for (i = IRQ_SA1111_START + 32; stat1; i++, stat1 >>= 1) - if (stat1 & 1) - do_edge_IRQ(i, irq_desc + i, regs); - - /* For level-based interrupts */ - desc->chip->unmask(irq); -} - -#define SA1111_IRQMASK_LO(x) (1 << (x - IRQ_SA1111_START)) -#define SA1111_IRQMASK_HI(x) (1 << (x - IRQ_SA1111_START - 32)) - -static void sa1111_ack_irq(unsigned int irq) -{ -} - -static void sa1111_mask_lowirq(unsigned int irq) -{ - INTEN0 &= ~SA1111_IRQMASK_LO(irq); -} - -static void sa1111_unmask_lowirq(unsigned int irq) -{ - INTEN0 |= SA1111_IRQMASK_LO(irq); -} - -/* - * Attempt to re-trigger the interrupt. The SA1111 contains a register - * (INTSET) which claims to do this. However, in practice no amount of - * manipulation of INTEN and INTSET guarantees that the interrupt will - * be triggered. In fact, its very difficult, if not impossible to get - * INTSET to re-trigger the interrupt. - */ -static void sa1111_rerun_lowirq(unsigned int irq) -{ - unsigned int mask = SA1111_IRQMASK_LO(irq); - int i; - - for (i = 0; i < 8; i++) { - INTPOL0 ^= mask; - INTPOL0 ^= mask; - if (INTSTATCLR1 & mask) - break; - } - - if (i == 8) - printk(KERN_ERR "Danger Will Robinson: failed to " - "re-trigger IRQ%d\n", irq); -} - -static int sa1111_type_lowirq(unsigned int irq, unsigned int flags) -{ - unsigned int mask = SA1111_IRQMASK_LO(irq); - - if (flags == IRQT_PROBE) - return 0; - - if ((!(flags & __IRQT_RISEDGE) ^ !(flags & __IRQT_FALEDGE)) == 0) - return -EINVAL; - - if (flags & __IRQT_RISEDGE) - INTPOL0 &= ~mask; - else - INTPOL0 |= mask; - WAKE_POL0 = INTPOL0; - - return 0; -} - -static int sa1111_wake_lowirq(unsigned int irq, unsigned int on) -{ - unsigned int mask = SA1111_IRQMASK_LO(irq); - - if (on) - WAKE_EN0 |= mask; - else - WAKE_EN0 &= ~mask; - - return 0; -} - -static struct irqchip sa1111_low_chip = { - .ack = sa1111_ack_irq, - .mask = sa1111_mask_lowirq, - .unmask = sa1111_unmask_lowirq, - .rerun = sa1111_rerun_lowirq, - .type = sa1111_type_lowirq, - .wake = sa1111_wake_lowirq, -}; - -static void sa1111_mask_highirq(unsigned int irq) -{ - INTEN1 &= ~SA1111_IRQMASK_HI(irq); -} - -static void sa1111_unmask_highirq(unsigned int irq) -{ - INTEN1 |= SA1111_IRQMASK_HI(irq); -} - -/* - * Attempt to re-trigger the interrupt. The SA1111 contains a register - * (INTSET) which claims to do this. However, in practice no amount of - * manipulation of INTEN and INTSET guarantees that the interrupt will - * be triggered. In fact, its very difficult, if not impossible to get - * INTSET to re-trigger the interrupt. - */ -static void sa1111_rerun_highirq(unsigned int irq) -{ - unsigned int mask = SA1111_IRQMASK_HI(irq); - int i; - - for (i = 0; i < 8; i++) { - INTPOL1 ^= mask; - INTPOL1 ^= mask; - if (INTSTATCLR1 & mask) - break; - } - - if (i == 8) - printk(KERN_ERR "Danger Will Robinson: failed to " - "re-trigger IRQ%d\n", irq); -} - -static int sa1111_type_highirq(unsigned int irq, unsigned int flags) -{ - unsigned int mask = SA1111_IRQMASK_HI(irq); - - if (flags == IRQT_PROBE) - return 0; - - if ((!(flags & __IRQT_RISEDGE) ^ !(flags & __IRQT_FALEDGE)) == 0) - return -EINVAL; - - if (flags & __IRQT_RISEDGE) - INTPOL1 &= ~mask; - else - INTPOL1 |= mask; - WAKE_POL1 = INTPOL1; - - return 0; -} - -static int sa1111_wake_highirq(unsigned int irq, unsigned int on) -{ - unsigned int mask = SA1111_IRQMASK_HI(irq); - - if (on) - WAKE_EN1 |= mask; - else - WAKE_EN1 &= ~mask; - - return 0; -} - -static struct irqchip sa1111_high_chip = { - .ack = sa1111_ack_irq, - .mask = sa1111_mask_highirq, - .unmask = sa1111_unmask_highirq, - .rerun = sa1111_rerun_highirq, - .type = sa1111_type_highirq, - .wake = sa1111_wake_highirq, -}; - -static void __init sa1111_init_irq(struct sa1111_dev *sadev) -{ - unsigned int irq; - - /* - * We're guaranteed that this region hasn't been taken. - */ - request_mem_region(sadev->res.start, 512, "irqs"); - - /* disable all IRQs */ - sa1111_writel(0, sadev->mapbase + SA1111_INTEN0); - sa1111_writel(0, sadev->mapbase + SA1111_INTEN1); - sa1111_writel(0, sadev->mapbase + SA1111_WAKEEN0); - sa1111_writel(0, sadev->mapbase + SA1111_WAKEEN1); - - /* - * detect on rising edge. Note: Feb 2001 Errata for SA1111 - * specifies that S0ReadyInt and S1ReadyInt should be '1'. - */ - sa1111_writel(0, sadev->mapbase + SA1111_INTPOL0); - sa1111_writel(SA1111_IRQMASK_HI(IRQ_S0_READY_NINT) | - SA1111_IRQMASK_HI(IRQ_S1_READY_NINT), - sadev->mapbase + SA1111_INTPOL1); - - /* clear all IRQs */ - sa1111_writel(~0, sadev->mapbase + SA1111_INTSTATCLR0); - sa1111_writel(~0, sadev->mapbase + SA1111_INTSTATCLR1); - - for (irq = IRQ_GPAIN0; irq <= SSPROR; irq++) { - set_irq_chip(irq, &sa1111_low_chip); - set_irq_handler(irq, do_edge_IRQ); - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); - } - - for (irq = AUDXMTDMADONEA; irq <= IRQ_S1_BVD1_STSCHG; irq++) { - set_irq_chip(irq, &sa1111_high_chip); - set_irq_handler(irq, do_edge_IRQ); - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); - } - - /* - * Register SA1111 interrupt - */ - set_irq_type(sadev->irq[0], IRQT_RISING); - set_irq_chained_handler(sadev->irq[0], sa1111_irq_handler); -} - -/* - * Bring the SA1111 out of reset. This requires a set procedure: - * 1. nRESET asserted (by hardware) - * 2. CLK turned on from SA1110 - * 3. nRESET deasserted - * 4. VCO turned on, PLL_BYPASS turned off - * 5. Wait lock time, then assert RCLKEn - * 7. PCR set to allow clocking of individual functions - * - * Until we've done this, the only registers we can access are: - * SBI_SKCR - * SBI_SMCR - * SBI_SKID - */ -static void sa1111_wake(struct sa1111 *sachip) -{ - unsigned long flags, r; - - spin_lock_irqsave(&sachip->lock, flags); - - /* - * First, set up the 3.6864MHz clock on GPIO 27 for the SA-1111: - * (SA-1110 Developer's Manual, section 9.1.2.1) - */ - GAFR |= GPIO_32_768kHz; - GPDR |= GPIO_32_768kHz; - TUCR = TUCR_3_6864MHz; - - /* - * Turn VCO on, and disable PLL Bypass. - */ - r = sa1111_readl(sachip->base + SA1111_SKCR); - r &= ~SKCR_VCO_OFF; - sa1111_writel(r, sachip->base + SA1111_SKCR); - r |= SKCR_PLL_BYPASS | SKCR_OE_EN; - sa1111_writel(r, sachip->base + SA1111_SKCR); - - /* - * Wait lock time. SA1111 manual _doesn't_ - * specify a figure for this! We choose 100us. - */ - udelay(100); - - /* - * Enable RCLK. We also ensure that RDYEN is set. - */ - r |= SKCR_RCLKEN | SKCR_RDYEN; - sa1111_writel(r, sachip->base + SA1111_SKCR); - - /* - * Wait 14 RCLK cycles for the chip to finish coming out - * of reset. (RCLK=24MHz). This is 590ns. - */ - udelay(1); - - /* - * Ensure all clocks are initially off. - */ - sa1111_writel(0, sachip->base + SA1111_SKPCR); - - spin_unlock_irqrestore(&sachip->lock, flags); -} - -/* - * Configure the SA1111 shared memory controller. - */ -void -sa1111_configure_smc(struct sa1111 *sachip, int sdram, unsigned int drac, - unsigned int cas_latency) -{ - unsigned int smcr = SMCR_DTIM | SMCR_MBGE | FInsrt(drac, SMCR_DRAC); - - if (cas_latency == 3) - smcr |= SMCR_CLAT; - - sa1111_writel(smcr, sachip->base + SA1111_SMCR); -} - -static void -sa1111_init_one_child(struct sa1111 *sachip, struct sa1111_dev *sadev, unsigned int offset) -{ - snprintf(sadev->dev.bus_id, sizeof(sadev->dev.bus_id), - "%4.4x", offset); - - sadev->dev.parent = sachip->dev; - sadev->dev.bus = &sa1111_bus_type; - sadev->res.start = sachip->res.start + offset; - sadev->res.end = sadev->res.start + 511; - sadev->res.name = sadev->dev.name; - sadev->res.flags = IORESOURCE_MEM; - sadev->mapbase = sachip->base + offset; - - if (request_resource(&sachip->res, &sadev->res)) { - printk("SA1111: failed to allocate resource for %s\n", - sadev->res.name); - return; - } - - device_register(&sadev->dev); -} - -/** - * sa1111_probe - probe for a single SA1111 chip. - * @phys_addr: physical address of device. - * - * Probe for a SA1111 chip. This must be called - * before any other SA1111-specific code. - * - * Returns: - * %-ENODEV device not found. - * %-EBUSY physical address already marked in-use. - * %0 successful. - */ -static int __init -__sa1111_probe(struct device *me, unsigned long phys_addr, int irq) -{ - struct sa1111 *sachip; - unsigned long id; - unsigned int has_devs, val; - int i, ret = -ENODEV; - - sachip = kmalloc(sizeof(struct sa1111), GFP_KERNEL); - if (!sachip) - return -ENOMEM; - - memset(sachip, 0, sizeof(struct sa1111)); - - spin_lock_init(&sachip->lock); - - sachip->dev = me; - dev_set_drvdata(sachip->dev, sachip); - - sachip->res.name = me->name; - sachip->res.start = phys_addr; - sachip->res.end = phys_addr + 0x2000; - sachip->irq = irq; - - if (request_resource(&iomem_resource, &sachip->res)) { - ret = -EBUSY; - goto out; - } - - /* - * Map the whole region. This also maps the - * registers for our children. - */ - sachip->base = ioremap(phys_addr, PAGE_SIZE * 2); - if (!sachip->base) { - ret = -ENOMEM; - goto release; - } - - /* - * Probe for the chip. Only touch the SBI registers. - */ - id = sa1111_readl(sachip->base + SA1111_SKID); - if ((id & SKID_ID_MASK) != SKID_SA1111_ID) { - printk(KERN_DEBUG "SA1111 not detected: ID = %08lx\n", id); - ret = -ENODEV; - goto unmap; - } - - printk(KERN_INFO "SA1111 Microprocessor Companion Chip: " - "silicon revision %lx, metal revision %lx\n", - (id & SKID_SIREV_MASK)>>4, (id & SKID_MTREV_MASK)); - - /* - * We found it. Wake the chip up, and initialise. - */ - sa1111_wake(sachip); - - /* - * The SDRAM configuration of the SA1110 and the SA1111 must - * match. This is very important to ensure that SA1111 accesses - * don't corrupt the SDRAM. Note that this ungates the SA1111's - * MBGNT signal, so we must have called sa1110_mb_disable() - * beforehand. - */ - sa1111_configure_smc(sachip, 1, - FExtr(MDCNFG, MDCNFG_SA1110_DRAC0), - FExtr(MDCNFG, MDCNFG_SA1110_TDL0)); - - /* - * We only need to turn on DCLK whenever we want to use the - * DMA. It can otherwise be held firmly in the off position. - * (currently, we always enable it.) - */ - val = sa1111_readl(sachip->base + SA1111_SKPCR); - sa1111_writel(val | SKPCR_DCLKEN, sachip->base + SA1111_SKPCR); - - /* - * Enable the SA1110 memory bus request and grant signals. - */ - sa1110_mb_enable(); - - /* - * The interrupt controller must be initialised before any - * other device to ensure that the interrupts are available. - */ - int_dev.irq[0] = irq; - sa1111_init_one_child(sachip, &int_dev, SA1111_INTC); - sa1111_init_irq(&int_dev); - - g_sa1111 = sachip; - - has_devs = ~0; - if (machine_is_assabet() || machine_is_jornada720() || - machine_is_badge4()) - has_devs &= ~(1 << 4); - else - has_devs &= ~(1 << 1); - - for (i = 0; i < ARRAY_SIZE(devs); i++) - if (has_devs & (1 << i)) - sa1111_init_one_child(sachip, devs[i], dev_offset[i]); - - return 0; - - unmap: - iounmap(sachip->base); - release: - release_resource(&sachip->res); - out: - kfree(sachip); - return ret; -} - -static void __sa1111_remove(struct sa1111 *sachip) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(devs); i++) { - put_device(&devs[i]->dev); - release_resource(&devs[i]->res); - } - - iounmap(sachip->base); - release_resource(&sachip->res); - kfree(sachip); -} - -/* - * According to the "Intel StrongARM SA-1111 Microprocessor Companion - * Chip Specification Update" (June 2000), erratum #7, there is a - * significant bug in the SA1111 SDRAM shared memory controller. If - * an access to a region of memory above 1MB relative to the bank base, - * it is important that address bit 10 _NOT_ be asserted. Depending - * on the configuration of the RAM, bit 10 may correspond to one - * of several different (processor-relative) address bits. - * - * This routine only identifies whether or not a given DMA address - * is susceptible to the bug. - */ -int sa1111_check_dma_bug(dma_addr_t addr) -{ - struct sa1111 *sachip = g_sa1111; - unsigned int physaddr = SA1111_DMA_ADDR((unsigned int)addr); - unsigned int smcr; - - /* Section 4.6 of the "Intel StrongARM SA-1111 Development Module - * User's Guide" mentions that jumpers R51 and R52 control the - * target of SA-1111 DMA (either SDRAM bank 0 on Assabet, or - * SDRAM bank 1 on Neponset). The default configuration selects - * Assabet, so any address in bank 1 is necessarily invalid. - */ - if ((machine_is_assabet() || machine_is_pfs168()) && addr >= 0xc8000000) - return -1; - - /* The bug only applies to buffers located more than one megabyte - * above the start of the target bank: - */ - if (physaddr<(1<<20)) - return 0; - - smcr = sa1111_readl(sachip->base + SA1111_SMCR); - switch (FExtr(smcr, SMCR_DRAC)) { - case 01: /* 10 row + bank address bits, A<20> must not be set */ - if (physaddr & (1<<20)) - return -1; - break; - case 02: /* 11 row + bank address bits, A<23> must not be set */ - if (physaddr & (1<<23)) - return -1; - break; - case 03: /* 12 row + bank address bits, A<24> must not be set */ - if (physaddr & (1<<24)) - return -1; - break; - case 04: /* 13 row + bank address bits, A<25> must not be set */ - if (physaddr & (1<<25)) - return -1; - break; - case 05: /* 14 row + bank address bits, A<20> must not be set */ - if (physaddr & (1<<20)) - return -1; - break; - case 06: /* 15 row + bank address bits, A<20> must not be set */ - if (physaddr & (1<<20)) - return -1; - break; - default: - printk(KERN_ERR "%s(): invalid SMCR DRAC value 0%lo\n", - __FUNCTION__, FExtr(smcr, SMCR_DRAC)); - return -1; - } - - return 0; -} - -struct sa1111_save_data { - unsigned int skcr; - unsigned int skpcr; - unsigned int skcdr; - unsigned char skaud; - unsigned char skpwm0; - unsigned char skpwm1; - - /* - * Interrupt controller - */ - unsigned int intpol0; - unsigned int intpol1; - unsigned int inten0; - unsigned int inten1; - unsigned int wakepol0; - unsigned int wakepol1; - unsigned int wakeen0; - unsigned int wakeen1; -}; - -static int sa1111_suspend(struct device *dev, u32 state, u32 level) -{ - struct sa1111 *sachip = dev_get_drvdata(dev); - unsigned long flags; - char *base; - - /* - * Save state. - */ - if (level == SUSPEND_SAVE_STATE || - level == SUSPEND_DISABLE || - level == SUSPEND_POWER_DOWN) { - struct sa1111_save_data *save; - - if (!dev->saved_state) - dev->saved_state = kmalloc(sizeof(struct sa1111_save_data), GFP_KERNEL); - if (!dev->saved_state) - return -ENOMEM; - - save = (struct sa1111_save_data *)dev->saved_state; - - spin_lock_irqsave(&sachip->lock, flags); - base = sachip->base; - save->skcr = sa1111_readl(base + SA1111_SKCR); - save->skpcr = sa1111_readl(base + SA1111_SKPCR); - save->skcdr = sa1111_readl(base + SA1111_SKCDR); - save->skaud = sa1111_readl(base + SA1111_SKAUD); - save->skpwm0 = sa1111_readl(base + SA1111_SKPWM0); - save->skpwm1 = sa1111_readl(base + SA1111_SKPWM1); - - base = sachip->base + SA1111_INTC; - save->intpol0 = sa1111_readl(base + SA1111_INTPOL0); - save->intpol1 = sa1111_readl(base + SA1111_INTPOL1); - save->inten0 = sa1111_readl(base + SA1111_INTEN0); - save->inten1 = sa1111_readl(base + SA1111_INTEN1); - save->wakepol0 = sa1111_readl(base + SA1111_WAKEPOL0); - save->wakepol1 = sa1111_readl(base + SA1111_WAKEPOL1); - save->wakeen0 = sa1111_readl(base + SA1111_WAKEEN0); - save->wakeen1 = sa1111_readl(base + SA1111_WAKEEN1); - spin_unlock_irqrestore(&sachip->lock, flags); - } - - /* - * Disable. - */ - if (level == SUSPEND_DISABLE && state == 4) { - unsigned int val; - - spin_lock_irqsave(&sachip->lock, flags); - base = sachip->base; - - sa1111_writel(0, base + SA1111_SKPWM0); - sa1111_writel(0, base + SA1111_SKPWM1); - val = sa1111_readl(base + SA1111_SKCR); - sa1111_writel(val | SKCR_SLEEP, base + SA1111_SKCR); - - spin_unlock_irqrestore(&sachip->lock, flags); - } - - return 0; -} - -/* - * sa1111_resume - Restore the SA1111 device state. - * @dev: device to restore - * @level: resume level - * - * Restore the general state of the SA1111; clock control and - * interrupt controller. Other parts of the SA1111 must be - * restored by their respective drivers, and must be called - * via LDM after this function. - */ -static int sa1111_resume(struct device *dev, u32 level) -{ - struct sa1111 *sachip = dev_get_drvdata(dev); - struct sa1111_save_data *save; - unsigned long flags, id; - char *base; - - if (level != RESUME_RESTORE_STATE && level != RESUME_ENABLE) - return 0; - - save = (struct sa1111_save_data *)dev->saved_state; - if (!save) - return 0; - - dev->saved_state = NULL; - - /* - * Ensure that the SA1111 is still here. - */ - id = sa1111_readl(sachip->base + SA1111_SKID); - if ((id & SKID_ID_MASK) != SKID_SA1111_ID) { - __sa1111_remove(sachip); - dev_set_drvdata(dev, NULL); - kfree(save); - return 0; - } - - spin_lock_irqsave(&sachip->lock, flags); - sa1111_wake(sachip); - - base = sachip->base; - sa1111_writel(save->skcr, base + SA1111_SKCR); - sa1111_writel(save->skpcr, base + SA1111_SKPCR); - sa1111_writel(save->skcdr, base + SA1111_SKCDR); - sa1111_writel(save->skaud, base + SA1111_SKAUD); - sa1111_writel(save->skpwm0, base + SA1111_SKPWM0); - sa1111_writel(save->skpwm1, base + SA1111_SKPWM1); - - base = sachip->base + SA1111_INTC; - sa1111_writel(save->intpol0, base + SA1111_INTPOL0); - sa1111_writel(save->intpol1, base + SA1111_INTPOL1); - sa1111_writel(save->inten0, base + SA1111_INTEN0); - sa1111_writel(save->inten1, base + SA1111_INTEN1); - sa1111_writel(save->wakepol0, base + SA1111_WAKEPOL0); - sa1111_writel(save->wakepol1, base + SA1111_WAKEPOL1); - sa1111_writel(save->wakeen0, base + SA1111_WAKEEN0); - sa1111_writel(save->wakeen1, base + SA1111_WAKEEN1); - spin_unlock_irqrestore(&sachip->lock, flags); - - kfree(save); - - return 0; -} - -static int sa1111_probe(struct device *dev) -{ - return -ENODEV; -} - -static int sa1111_remove(struct device *dev) -{ - struct sa1111 *sachip = dev_get_drvdata(dev); - - if (sachip) { - __sa1111_remove(sachip); - dev_set_drvdata(dev, NULL); - - kfree(dev->saved_state); - dev->saved_state = NULL; - } - - return 0; -} - -/* - * Not sure if this should be on the system bus or not yet. - * We really want some way to register a system device at - * the per-machine level, and then have this driver pick - * up the registered devices. - * - * We also need to handle the SDRAM configuration for - * PXA250/SA1110 machine classes. - */ -static struct device_driver sa1111_device_driver = { - .name = "sa1111", - .bus = &system_bus_type, - .probe = sa1111_probe, - .remove = sa1111_remove, - .suspend = sa1111_suspend, - .resume = sa1111_resume, -}; - -/* - * Register the SA1111 driver with LDM. - */ -static int sa1111_driver_init(void) -{ - driver_register(&sa1111_device_driver); - return 0; -} - -arch_initcall(sa1111_driver_init); - -static struct sys_device sa1111_device = { - .name = "SA1111", - .id = 0, - .root = NULL, - .dev = { - .name = "Intel Corporation SA1111", - .driver = &sa1111_device_driver, - }, -}; - -int sa1111_init(unsigned long phys, unsigned int irq) -{ - int ret; - - snprintf(sa1111_device.dev.bus_id, sizeof(sa1111_device.dev.bus_id), "%8.8lx", phys); - - ret = sys_device_register(&sa1111_device); - if (ret) - printk("sa1111 device_register failed: %d\n", ret); - - return __sa1111_probe(&sa1111_device.dev, phys, irq); -} - -/* - * Get the parent device driver (us) structure - * from a child function device - */ -static inline struct sa1111 *sa1111_chip_driver(struct sa1111_dev *sadev) -{ - return (struct sa1111 *)dev_get_drvdata(sadev->dev.parent); -} - -/* - * The bits in the opdiv field are non-linear. - */ -static unsigned char opdiv_table[] = { 1, 4, 2, 8 }; - -static unsigned int __sa1111_pll_clock(struct sa1111 *sachip) -{ - unsigned int skcdr, fbdiv, ipdiv, opdiv; - - skcdr = sa1111_readl(sachip->base + SA1111_SKCDR); - - fbdiv = (skcdr & 0x007f) + 2; - ipdiv = ((skcdr & 0x0f80) >> 7) + 2; - opdiv = opdiv_table[(skcdr & 0x3000) >> 12]; - - return 3686400 * fbdiv / (ipdiv * opdiv); -} - -/** - * sa1111_pll_clock - return the current PLL clock frequency. - * @sadev: SA1111 function block - * - * BUG: we should look at SKCR. We also blindly believe that - * the chip is being fed with the 3.6864MHz clock. - * - * Returns the PLL clock in Hz. - */ -unsigned int sa1111_pll_clock(struct sa1111_dev *sadev) -{ - struct sa1111 *sachip = sa1111_chip_driver(sadev); - - return __sa1111_pll_clock(sachip); -} - -/** - * sa1111_select_audio_mode - select I2S or AC link mode - * @sadev: SA1111 function block - * @mode: One of %SA1111_AUDIO_ACLINK or %SA1111_AUDIO_I2S - * - * Frob the SKCR to select AC Link mode or I2S mode for - * the audio block. - */ -void sa1111_select_audio_mode(struct sa1111_dev *sadev, int mode) -{ - struct sa1111 *sachip = sa1111_chip_driver(sadev); - unsigned long flags; - unsigned int val; - - spin_lock_irqsave(&sachip->lock, flags); - - val = sa1111_readl(sachip->base + SA1111_SKCR); - if (mode == SA1111_AUDIO_I2S) { - val &= ~SKCR_SELAC; - } else { - val |= SKCR_SELAC; - } - sa1111_writel(val, sachip->base + SA1111_SKCR); - - spin_unlock_irqrestore(&sachip->lock, flags); -} - -/** - * sa1111_set_audio_rate - set the audio sample rate - * @sadev: SA1111 SAC function block - * @rate: sample rate to select - */ -int sa1111_set_audio_rate(struct sa1111_dev *sadev, int rate) -{ - struct sa1111 *sachip = sa1111_chip_driver(sadev); - unsigned int div; - - if (sadev->devid != SA1111_DEVID_SAC) - return -EINVAL; - - div = (__sa1111_pll_clock(sachip) / 256 + rate / 2) / rate; - if (div == 0) - div = 1; - if (div > 128) - div = 128; - - sa1111_writel(div - 1, sachip->base + SA1111_SKAUD); - - return 0; -} - -/** - * sa1111_get_audio_rate - get the audio sample rate - * @sadev: SA1111 SAC function block device - */ -int sa1111_get_audio_rate(struct sa1111_dev *sadev) -{ - struct sa1111 *sachip = sa1111_chip_driver(sadev); - unsigned long div; - - if (sadev->devid != SA1111_DEVID_SAC) - return -EINVAL; - - div = sa1111_readl(sachip->base + SA1111_SKAUD) + 1; - - return __sa1111_pll_clock(sachip) / (256 * div); -} - -/* - * Individual device operations. - */ - -/** - * sa1111_enable_device - enable an on-chip SA1111 function block - * @sadev: SA1111 function block device to enable - */ -void sa1111_enable_device(struct sa1111_dev *sadev) -{ - struct sa1111 *sachip = sa1111_chip_driver(sadev); - unsigned long flags; - unsigned int val; - - spin_lock_irqsave(&sachip->lock, flags); - val = sa1111_readl(sachip->base + SA1111_SKPCR); - sa1111_writel(val | sadev->skpcr_mask, sachip->base + SA1111_SKPCR); - spin_unlock_irqrestore(&sachip->lock, flags); -} - -/** - * sa1111_disable_device - disable an on-chip SA1111 function block - * @sadev: SA1111 function block device to disable - */ -void sa1111_disable_device(struct sa1111_dev *sadev) -{ - struct sa1111 *sachip = sa1111_chip_driver(sadev); - unsigned long flags; - unsigned int val; - - spin_lock_irqsave(&sachip->lock, flags); - val = sa1111_readl(sachip->base + SA1111_SKPCR); - sa1111_writel(val & ~sadev->skpcr_mask, sachip->base + SA1111_SKPCR); - spin_unlock_irqrestore(&sachip->lock, flags); -} - -/* - * SA1111 "Register Access Bus." - * - * We model this as a regular bus type, and hang devices directly - * off this. - */ -static int sa1111_match(struct device *_dev, struct device_driver *_drv) -{ - struct sa1111_dev *dev = SA1111_DEV(_dev); - struct sa1111_driver *drv = SA1111_DRV(_drv); - - return dev->devid == drv->devid; -} - -struct bus_type sa1111_bus_type = { - .name = "RAB", - .match = sa1111_match, -}; - -static int sa1111_rab_bus_init(void) -{ - return bus_register(&sa1111_bus_type); -} - -postcore_initcall(sa1111_rab_bus_init); - -EXPORT_SYMBOL(sa1111_check_dma_bug); -EXPORT_SYMBOL(sa1111_select_audio_mode); -EXPORT_SYMBOL(sa1111_set_audio_rate); -EXPORT_SYMBOL(sa1111_get_audio_rate); -EXPORT_SYMBOL(sa1111_enable_device); -EXPORT_SYMBOL(sa1111_disable_device); -EXPORT_SYMBOL(sa1111_pll_clock); -EXPORT_SYMBOL(sa1111_bus_type); diff -Nru a/arch/arm/mach-sa1100/stork.c b/arch/arm/mach-sa1100/stork.c --- a/arch/arm/mach-sa1100/stork.c Sun Feb 9 21:13:34 2003 +++ b/arch/arm/mach-sa1100/stork.c Sun Feb 9 21:13:34 2003 @@ -181,7 +181,7 @@ { storkSetLatchB(STORK_TOUCH_SCREEN_DCLK); udelay(10); /* hmm wait 200ns (min) - ok this ought to be udelay(1) but that doesn't get */ - /* consistant values so I'm using 10 (urgh) */ + /* consistent values so I'm using 10 (urgh) */ storkClearLatchB(STORK_TOUCH_SCREEN_DCLK); udelay(10); } diff -Nru a/arch/arm/mach-sa1100/trizeps.c b/arch/arm/mach-sa1100/trizeps.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/arm/mach-sa1100/trizeps.c Sun Feb 9 21:13:38 2003 @@ -0,0 +1,232 @@ +/* + * linux/arch/arm/mach-sa1100/trizeps.c + * + * Authors: + * Andreas Hofer , + * Peter Lueg , + * Guennadi Liakhovetski + * + * This file contains all Trizeps-specific tweaks. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "generic.h" + +#undef DEBUG_TRIZEPS +#ifdef DEBUG_TRIZEPS +#define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args) +#else +#define DPRINTK( x... ) +#endif + +static struct tri_uart_cts_data_t tri_uart_cts_data[] = { + { TRIZEPS_GPIO_UART1_CTS, 0, NULL, NULL,"int. UART1 cts" }, + { TRIZEPS_GPIO_UART2_CTS, 0, NULL, NULL,"int. UART2 cts" }, + { TRIZEPS_GPIO_UART3_CTS, 0, NULL, NULL,"int. UART3 cts" } +}; + +static void trizeps_cts_intr(int irq, void *dev_id, struct pt_regs *regs) +{ + struct tri_uart_cts_data_t * uart_data = (struct tri_uart_cts_data_t *)dev_id; + int cts = (!(GPLR & uart_data->cts_gpio)); + + /* NOTE: I suppose that we will not get any interrupts + if the GPIO is not changed, so maybe + the cts_prev_state can be removed ... */ + if (cts != uart_data->cts_prev_state) { + + uart_data->cts_prev_state = cts; + uart_handle_cts_change(uart_data->port, cts); + DPRINTK("(IRQ %d) changed (cts=%d) stop=%d\n", + irq, cts, uart_data->info->tty->hw_stopped); + } +} + +static int +trizeps_register_cts_intr(int gpio, + int irq, + struct tri_uart_cts_data_t *uart_data) +{ + int ret = 0; + + if(irq != NO_IRQ) + { + set_irq_type(irq, IRQT_BOTHEDGE); + + ret = request_irq(irq, trizeps_cts_intr, + SA_INTERRUPT, uart_data->name, uart_data); + if (ret) + printk(KERN_ERR "uart_open: failed to register CTS irq (%d)\n", ret); + } + return ret; +} + +static void trizeps_set_mctrl(struct uart_port *port, u_int mctrl) +{ + if (port->mapbase == _Ser1UTCR0) + { + /**** ttySA1 ****/ + if (mctrl & TIOCM_RTS) + GPCR |= TRIZEPS_GPIO_UART1_RTS; + else + GPSR |= TRIZEPS_GPIO_UART1_RTS; + + DPRINTK("2 ttySA%d Set RTS %s\n",port->line, + mctrl & TIOCM_RTS ? "low" : "high"); + + } + else if (port->mapbase == _Ser3UTCR0) + { + /**** ttySA0 ****/ + } + else + { + /**** ttySA2 ****/ + } +} + +static u_int trizeps_get_mctrl(struct uart_port *port) +{ + int result = TIOCM_CD | TIOCM_DSR; + + if (port->mapbase == _Ser1UTCR0) + { + if (!(GPLR & TRIZEPS_GPIO_UART1_CTS)) + result |= TIOCM_CTS; + } + else if (port->mapbase == _Ser2UTCR0) + { + result |= TIOCM_CTS; + } + else if (port->mapbase == _Ser3UTCR0) + { + result |= TIOCM_CTS; + } + else + { + result = TIOCM_CTS; + } + + DPRINTK(" ttySA%d %s%s%s\n",port->line, + result & TIOCM_CD ? "CD " : "", + result & TIOCM_CTS ? "CTS " : "", + result & TIOCM_DSR ? "DSR " : ""); + + return result; +} + +static struct sa1100_port_fns trizeps_port_fns __initdata = { + .set_mctrl = trizeps_set_mctrl, + .get_mctrl = trizeps_get_mctrl, +}; + +static void trizeps_power_off(void) +{ + printk("trizeps power off\n"); + mdelay(100); + cli(); + /* disable internal oscillator, float CS lines */ + PCFR = (PCFR_OPDE | PCFR_FP | PCFR_FS); + /* enable wake-up on GPIO0 (Assabet...) */ + PWER = GFER = GRER = 1; + /* + * set scratchpad to zero, just in case it is used as a + * restart address by the bootloader. + */ + PSPR = 0; + + /* + * Power off + * -> disconnect AKku + */ + TRIZEPS_BCR_set(TRIZEPS_BCR0, TRIZEPS_MFT_OFF); + + /* + * if power supply no Akku + * -> enter sleep mode + */ + PMCR = PMCR_SF; +} + +static int __init trizeps_init(void) +{ + if (!machine_is_trizeps()) + return -EINVAL; + + DPRINTK(" \n"); + pm_power_off = trizeps_power_off; + + // Init UART2 for IrDA +// PPDR |= PPC_TXD2; // Set TXD2 as output + Ser2UTCR4 = UTCR4_HSE; // enable HSE + Ser2HSCR0 = 0; + Ser2HSSR0 = HSSR0_EIF | HSSR0_TUR | HSSR0_RAB | HSSR0_FRE; + + /* Init MECR */ + MECR = 0x00060006; + + /* Set up external serial IRQs */ + GAFR &= ~(GPIO_GPIO16 | GPIO_GPIO17); // no alternate function + GPDR &= ~(GPIO_GPIO16 | GPIO_GPIO17); // Set to Input + set_irq_type(IRQ_GPIO16, IRQT_RISING); + set_irq_type(IRQ_GPIO17, IRQT_RISING); + + return 0; +} + +__initcall(trizeps_init); + +static struct map_desc trizeps_io_desc[] __initdata = { + /* virtual physical length type */ + { 0xF0000000l, 0x30000000l, 0x00800000l, MT_DEVICE }, + { 0xF2000000l, 0x38000000l, 0x00800000l, MT_DEVICE }, +}; + +static void __init trizeps_map_io(void) +{ + sa1100_map_io(); + iotable_init(trizeps_io_desc, ARRAY_SIZE(trizeps_io_desc)); + + sa1100_register_uart_fns(&trizeps_port_fns); + sa1100_register_uart(0, 3); + sa1100_register_uart(1, 1); + sa1100_register_uart(2, 2); +} + +MACHINE_START(TRIZEPS, "TRIZEPS") + MAINTAINER("DSA") + BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) + MAPIO(trizeps_map_io) + INITIRQ(sa1100_init_irq) +MACHINE_END diff -Nru a/arch/arm/mach-shark/Makefile b/arch/arm/mach-shark/Makefile --- a/arch/arm/mach-shark/Makefile Sun Feb 9 21:13:29 2003 +++ b/arch/arm/mach-shark/Makefile Sun Feb 9 21:13:29 2003 @@ -9,6 +9,4 @@ obj-n := obj- := -export-objs := - obj-$(CONFIG_LEDS) += leds.o diff -Nru a/arch/arm/mach-tbox/Makefile b/arch/arm/mach-tbox/Makefile --- a/arch/arm/mach-tbox/Makefile Sun Feb 9 21:13:30 2003 +++ b/arch/arm/mach-tbox/Makefile Sun Feb 9 21:13:30 2003 @@ -9,4 +9,3 @@ obj-n := obj- := -export-objs := diff -Nru a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile --- a/arch/arm/mm/Makefile Sun Feb 9 21:13:37 2003 +++ b/arch/arm/mm/Makefile Sun Feb 9 21:13:37 2003 @@ -8,8 +8,6 @@ obj-m := obj-n := obj- := -export-objs := proc-syms.o discontig.o - ifeq ($(CONFIG_CPU_32),y) obj-y += consistent.o fault-armv.o ioremap.o mm-armv.o obj-$(CONFIG_MODULES) += proc-syms.o diff -Nru a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S --- a/arch/arm/mm/proc-arm920.S Sun Feb 9 21:13:28 2003 +++ b/arch/arm/mm/proc-arm920.S Sun Feb 9 21:13:28 2003 @@ -297,7 +297,7 @@ * * This is a little misleading, it is not intended to clean out * the i-cache but to make sure that any data written to the - * range is made consistant. This means that when we execute code + * range is made consistent. This means that when we execute code * in that region, everything works as we expect. * * This generally means writing back data in the Dcache and diff -Nru a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S --- a/arch/arm/mm/proc-arm922.S Sun Feb 9 21:13:35 2003 +++ b/arch/arm/mm/proc-arm922.S Sun Feb 9 21:13:35 2003 @@ -298,7 +298,7 @@ * * This is a little misleading, it is not intended to clean out * the i-cache but to make sure that any data written to the - * range is made consistant. This means that when we execute code + * range is made consistent. This means that when we execute code * in that region, everything works as we expect. * * This generally means writing back data in the Dcache and diff -Nru a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S --- a/arch/arm/mm/proc-arm926.S Sun Feb 9 21:13:32 2003 +++ b/arch/arm/mm/proc-arm926.S Sun Feb 9 21:13:32 2003 @@ -147,7 +147,7 @@ * * This is a little misleading, it is not intended to clean out * the i-cache but to make sure that any data written to the - * range is made consistant. This means that when we execute code + * range is made consistent. This means that when we execute code * in that region, everything works as we expect. * * This generally means writing back data in the Dcache and diff -Nru a/arch/cris/Kconfig b/arch/cris/Kconfig --- a/arch/cris/Kconfig Sun Feb 9 21:13:36 2003 +++ b/arch/cris/Kconfig Sun Feb 9 21:13:36 2003 @@ -55,7 +55,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called binfmt_elf.o. Saying M or N here is dangerous because + will be called binfmt_elf. Saying M or N here is dangerous because some crucial programs on your system might be in ELF format. config ETRAX_KGDB @@ -587,7 +587,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called scsi_mod.o. If you want to compile it as + The module will be called scsi_mod. If you want to compile it as a module, say M here and read and . However, do not compile this as a module if your root file system (the one containing the directory /) @@ -685,7 +685,7 @@ and load that module after the PnP configuration is finished. To do this, say M here and read as well as ; the module will be - called soundcore.o. + called soundcore. I'm told that even without a sound card, you can make your computer say more than an occasional beep, by programming the PC speaker. diff -Nru a/arch/cris/drivers/Kconfig b/arch/cris/drivers/Kconfig --- a/arch/cris/drivers/Kconfig Sun Feb 9 21:13:29 2003 +++ b/arch/cris/drivers/Kconfig Sun Feb 9 21:13:29 2003 @@ -366,7 +366,7 @@ ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module will be called - parport.o. If you have more than one parallel port and want to + parport. If you have more than one parallel port and want to specify which port and IRQ to be used by this driver at module load time, take a look at . @@ -400,7 +400,7 @@ driver as a module however ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read and - . The module will be called lp.o. + . The module will be called lp. If you have several parallel ports, you can specify which ports to use with the "lp" kernel command line option. (Try "man bootparam" @@ -463,7 +463,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called ide.o. + will be called ide. For further information, please read . @@ -494,7 +494,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read and - . The module will be called ide-mod.o. + . The module will be called ide-mod. Do not compile this driver as a module if your root file system (the one containing the directory /) is located on an IDE device. @@ -516,7 +516,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called ide-disk.o. Do not compile this driver as a module + will be called ide-disk. Do not compile this driver as a module if your root file system (the one containing the directory /) is located on the IDE disk. If unsure, say Y. @@ -544,7 +544,7 @@ If you want to compile the driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called ide-cd.o. + will be called ide-cd. config BLK_DEV_IDEDMA bool @@ -859,7 +859,7 @@ This code is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called usbcore.o. If you want to compile it as a + The module will be called usbcore. If you want to compile it as a module, say M here and read . config ETRAX_USB_HOST_PORT1 diff -Nru a/arch/cris/drivers/serial.c b/arch/cris/drivers/serial.c --- a/arch/cris/drivers/serial.c Sun Feb 9 21:13:34 2003 +++ b/arch/cris/drivers/serial.c Sun Feb 9 21:13:34 2003 @@ -318,7 +318,7 @@ #include -/* non-arch dependant serial structures are in linux/serial.h */ +/* non-arch dependent serial structures are in linux/serial.h */ #include /* while we keep our own stuff (struct e100_serial) in a local .h file */ #include "serial.h" diff -Nru a/arch/cris/kernel/Makefile b/arch/cris/kernel/Makefile --- a/arch/cris/kernel/Makefile Sun Feb 9 21:13:33 2003 +++ b/arch/cris/kernel/Makefile Sun Feb 9 21:13:33 2003 @@ -5,8 +5,6 @@ EXTRA_TARGETS := head.o -export-objs := ksyms.o - obj-y := process.o signal.o entry.o traps.o irq.o \ ptrace.o setup.o time.o sys_cris.o shadows.o \ debugport.o semaphore.o diff -Nru a/arch/cris/kernel/ptrace.c b/arch/cris/kernel/ptrace.c --- a/arch/cris/kernel/ptrace.c Sun Feb 9 21:13:30 2003 +++ b/arch/cris/kernel/ptrace.c Sun Feb 9 21:13:30 2003 @@ -18,7 +18,7 @@ * PTRACE_DETACH works more simple in 2.4.10 * * Revision 1.6 2001/07/25 16:08:47 bjornw - * PTRACE_ATTACH bulk moved into arch-independant code in 2.4.7 + * PTRACE_ATTACH bulk moved into arch-independent code in 2.4.7 * * Revision 1.5 2001/03/26 14:24:28 orjanf * * Changed loop condition. diff -Nru a/arch/cris/lib/old_checksum.c b/arch/cris/lib/old_checksum.c --- a/arch/cris/lib/old_checksum.c Sun Feb 9 21:13:35 2003 +++ b/arch/cris/lib/old_checksum.c Sun Feb 9 21:13:35 2003 @@ -75,7 +75,7 @@ sum += *((unsigned short *)buff)++; } if(endMarker - buff > 0) { - sum += *buff; /* add extra byte seperately */ + sum += *buff; /* add extra byte separately */ } BITOFF; return(sum); diff -Nru a/arch/i386/Kconfig b/arch/i386/Kconfig --- a/arch/i386/Kconfig Sun Feb 9 21:13:29 2003 +++ b/arch/i386/Kconfig Sun Feb 9 21:13:29 2003 @@ -573,7 +573,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called microcode.o. If you want to compile it as + The module will be called microcode. If you want to compile it as a module, say M here and read . If you use modprobe or kmod you may also want to add the line 'alias char-major-10-184 microcode' to your /etc/modules.conf file. @@ -859,7 +859,7 @@ To compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module will be called - apm.o. + apm. config APM_IGNORE_USER_SUSPEND bool "Ignore USER SUSPEND" @@ -983,6 +983,17 @@ If in doubt, say N. +config X86_ACPI_CPUFREQ + tristate "ACPI Processor P-States driver" + depends on CPU_FREQ && ACPI_PROCESSOR + help + This driver adds a CPUFreq driver which utilizes the ACPI + Processor Performance States. + + For details, take a look at linux/Documentation/cpufreq. + + If in doubt, say N. + config X86_POWERNOW_K6 tristate "AMD Mobile K6-2/K6-3 PowerNow!" depends on CPU_FREQ @@ -1151,7 +1162,7 @@ If you don't know what to do here, say N. This support is also available as a module. If compiled as a - module, it will be called scx200.o. + module, it will be called scx200. source "drivers/pci/Kconfig" @@ -1277,7 +1288,7 @@ QMAGIC support" then you'll have to say Y here. You may answer M to compile a.out support as a module and later load the module when you want to use a program or library in a.out format. The module will be - called binfmt_aout.o. Saying M or N here is dangerous though, + called binfmt_aout. Saying M or N here is dangerous though, because some crucial programs on your system might still be in A.OUT format. @@ -1307,7 +1318,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called binfmt_elf.o. Saying M or N here is dangerous because + will be called binfmt_elf. Saying M or N here is dangerous because some crucial programs on your system might be in ELF format. config BINFMT_MISC @@ -1332,7 +1343,7 @@ use this part of the kernel. You may say M here for module support and later load the module when - you have use for it; the module is called binfmt_misc.o. If you + you have use for it; the module is called binfmt_misc. If you don't know what to answer at this point, say Y. endmenu @@ -1388,7 +1399,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called ide.o. + will be called ide. For further information, please read . @@ -1415,7 +1426,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called scsi_mod.o. If you want to compile it as + The module will be called scsi_mod. If you want to compile it as a module, say M here and read and . However, do not compile this as a module if your root file system (the one containing the directory /) @@ -1519,7 +1530,7 @@ and load that module after the PnP configuration is finished. To do this, say M here and read as well as ; the module will be - called soundcore.o. + called soundcore. I'm told that even without a sound card, you can make your computer say more than an occasional beep, by programming the PC speaker. diff -Nru a/arch/i386/Makefile b/arch/i386/Makefile --- a/arch/i386/Makefile Sun Feb 9 21:13:30 2003 +++ b/arch/i386/Makefile Sun Feb 9 21:13:30 2003 @@ -3,8 +3,7 @@ # # This file is included by the global makefile so that you can add your own # architecture-specific flags and dependencies. Remember to do have actions -# for "archclean" and "archdep" for cleaning up and making dependencies for -# this architecture +# for "archclean" cleaning up for this architecture. # # 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 @@ -76,7 +75,7 @@ # default subarch .h files mflags-y += -Iinclude/asm-i386/mach-default -HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o +head-y := arch/i386/kernel/head.o arch/i386/kernel/init_task.o libs-y += arch/i386/lib/ core-y += arch/i386/kernel/ \ @@ -92,8 +91,7 @@ boot := arch/i386/boot -.PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \ - clean archclean archmrproper +.PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install all: bzImage diff -Nru a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile --- a/arch/i386/kernel/Makefile Sun Feb 9 21:13:29 2003 +++ b/arch/i386/kernel/Makefile Sun Feb 9 21:13:29 2003 @@ -4,8 +4,6 @@ EXTRA_TARGETS := head.o init_task.o -export-objs := mca.o i386_ksyms.o time.o - obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \ pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o @@ -34,5 +32,4 @@ EXTRA_AFLAGS := -traditional -export-objs += scx200.o obj-$(CONFIG_SCx200) += scx200.o diff -Nru a/arch/i386/kernel/acpi.c b/arch/i386/kernel/acpi.c --- a/arch/i386/kernel/acpi.c Sun Feb 9 21:13:35 2003 +++ b/arch/i386/kernel/acpi.c Sun Feb 9 21:13:35 2003 @@ -303,8 +303,7 @@ int __init -acpi_boot_init ( - char *cmdline) +acpi_boot_init (void) { int result = 0; @@ -317,7 +316,7 @@ /* * Initialize the ACPI boot-time table parser. */ - result = acpi_table_init(cmdline); + result = acpi_table_init(); if (result) return result; @@ -454,6 +453,7 @@ /* address in low memory of the wakeup routine. */ unsigned long acpi_wakeup_address = 0; +unsigned long acpi_video_flags; extern char wakeup_start, wakeup_end; extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long)); @@ -520,4 +520,20 @@ printk(KERN_DEBUG "ACPI: have wakeup address 0x%8.8lx\n", acpi_wakeup_address); } +static int __init acpi_sleep_setup(char *str) +{ + while ((str != NULL) && (*str != '\0')) { + if (strncmp(str, "s3_bios", 7) == 0) + acpi_video_flags = 1; + if (strncmp(str, "s3_mode", 7) == 0) + acpi_video_flags |= 2; + str = strchr(str, ','); + if (str != NULL) + str += strspn(str, ", \t"); + } + return 1; +} + + +__setup("acpi_sleep=", acpi_sleep_setup); #endif /*CONFIG_ACPI_SLEEP*/ diff -Nru a/arch/i386/kernel/acpi_wakeup.S b/arch/i386/kernel/acpi_wakeup.S --- a/arch/i386/kernel/acpi_wakeup.S Sun Feb 9 21:13:29 2003 +++ b/arch/i386/kernel/acpi_wakeup.S Sun Feb 9 21:13:29 2003 @@ -41,20 +41,19 @@ cmpl $0x12345678, %eax jne bogus_real_magic -#if 1 + testl $1, video_flags - wakeup_code + jz 1f lcall $0xc000,$3 -#endif -#if 0 +1: + + testl $2, video_flags - wakeup_code + jz 1f mov video_mode - wakeup_code, %ax call mode_set -#endif +1: # set up page table -#if 1 movl $swapper_pg_dir-__PAGE_OFFSET, %eax -#else - movl (real_save_cr3 - wakeup_data), %eax -#endif movl %eax, %cr3 # make sure %cr4 is set correctly (features, etc) @@ -86,6 +85,7 @@ real_save_cr4: .long 0 real_magic: .long 0 video_mode: .long 0 +video_flags: .long 0 bogus_real_magic: movw $0x0e00 + 'B', %fs:(0x12) @@ -254,6 +254,8 @@ movl saved_videomode, %edx movl %edx, video_mode - wakeup_start (%eax) + movl acpi_video_flags, %edx + movl %edx, video_flags - wakeup_start (%eax) movl $0x12345678, real_magic - wakeup_start (%eax) movl $0x12345678, saved_magic ret diff -Nru a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c --- a/arch/i386/kernel/apm.c Sun Feb 9 21:13:28 2003 +++ b/arch/i386/kernel/apm.c Sun Feb 9 21:13:28 2003 @@ -215,6 +215,7 @@ #include #include #include +#include #include #include #include @@ -227,7 +228,6 @@ #include -extern rwlock_t xtime_lock; extern spinlock_t i8253_lock; extern unsigned long get_cmos_time(void); extern void machine_real_restart(unsigned char *, int); @@ -1264,7 +1264,7 @@ printk(KERN_CRIT "apm: suspend was vetoed, but suspending anyway.\n"); } /* serialize with the timer interrupt */ - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); /* protect against access to timer chip registers */ spin_lock(&i8253_lock); @@ -1276,7 +1276,7 @@ ignore_normal_resume = 1; spin_unlock(&i8253_lock); - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); if (err == APM_NO_ERROR) err = APM_SUCCESS; @@ -1301,10 +1301,10 @@ int err; /* serialize with the timer interrupt */ - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); /* If needed, notify drivers here */ get_time_diff(); - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); err = set_system_power_state(APM_STATE_STANDBY); if ((err != APM_SUCCESS) && (err != APM_NO_ERROR)) @@ -1393,9 +1393,9 @@ ignore_bounce = 1; if ((event != APM_NORMAL_RESUME) || (ignore_normal_resume == 0)) { - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); set_time(); - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); pm_send_all(PM_RESUME, (void *)0); queue_event(event, NULL); } @@ -1410,9 +1410,9 @@ break; case APM_UPDATE_TIME: - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); set_time(); - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); break; case APM_CRITICAL_SUSPEND: diff -Nru a/arch/i386/kernel/cpu/cpufreq/Makefile b/arch/i386/kernel/cpu/cpufreq/Makefile --- a/arch/i386/kernel/cpu/cpufreq/Makefile Sun Feb 9 21:13:31 2003 +++ b/arch/i386/kernel/cpu/cpufreq/Makefile Sun Feb 9 21:13:31 2003 @@ -5,3 +5,10 @@ obj-$(CONFIG_ELAN_CPUFREQ) += elanfreq.o obj-$(CONFIG_X86_LONGRUN) += longrun.o obj-$(CONFIG_X86_GX_SUSPMOD) += gx-suspmod.o +obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi.o + +ifdef CONFIG_X86_ACPI_CPUFREQ + ifdef CONFIG_ACPI_DEBUG + EXTRA_CFLAGS += -DACPI_DEBUG_OUTPUT + endif +endif diff -Nru a/arch/i386/kernel/cpu/cpufreq/acpi.c b/arch/i386/kernel/cpu/cpufreq/acpi.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/i386/kernel/cpu/cpufreq/acpi.c Sun Feb 9 21:13:37 2003 @@ -0,0 +1,696 @@ +/* + * acpi_processor_perf.c - ACPI Processor P-States Driver ($Revision: 71 $) + * + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * Copyright (C) 2002, 2003 Dominik Brodowski + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define ACPI_PROCESSOR_COMPONENT 0x01000000 +#define ACPI_PROCESSOR_CLASS "processor" +#define ACPI_PROCESSOR_DRIVER_NAME "ACPI Processor P-States Driver" +#define ACPI_PROCESSOR_DEVICE_NAME "Processor" +#define ACPI_PROCESSOR_FILE_PERFORMANCE "performance" + +#define _COMPONENT ACPI_PROCESSOR_COMPONENT +ACPI_MODULE_NAME ("acpi_processor_perf") + +MODULE_AUTHOR("Paul Diefenbaugh, Dominik Brodowski"); +MODULE_DESCRIPTION(ACPI_PROCESSOR_DRIVER_NAME); +MODULE_LICENSE("GPL"); + + +/* Performance Management */ + +static struct acpi_processor_performance *performance; +static struct cpufreq_driver acpi_cpufreq_driver; + +static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file); +static struct file_operations acpi_processor_perf_fops = { + .open = acpi_processor_perf_open_fs, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + + +static int +acpi_processor_get_performance_control ( + struct acpi_processor *pr) +{ + int result = 0; + acpi_status status = 0; + struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; + union acpi_object *pct = NULL; + union acpi_object obj = {0}; + struct acpi_pct_register *reg = NULL; + + ACPI_FUNCTION_TRACE("acpi_processor_get_performance_control"); + + status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer); + if(ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PCT\n")); + return_VALUE(-ENODEV); + } + + pct = (union acpi_object *) buffer.pointer; + if (!pct || (pct->type != ACPI_TYPE_PACKAGE) + || (pct->package.count != 2)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PCT data\n")); + result = -EFAULT; + goto end; + } + + /* + * control_register + */ + + obj = pct->package.elements[0]; + + if ((obj.type != ACPI_TYPE_BUFFER) + || (obj.buffer.length < sizeof(struct acpi_pct_register)) + || (obj.buffer.pointer == NULL)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid _PCT data (control_register)\n")); + result = -EFAULT; + goto end; + } + + reg = (struct acpi_pct_register *) (obj.buffer.pointer); + + if (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unsupported address space [%d] (control_register)\n", + (u32) reg->space_id)); + result = -EFAULT; + goto end; + } + + pr->performance->control_register = (u16) reg->address; + + /* + * status_register + */ + + obj = pct->package.elements[1]; + + if ((obj.type != ACPI_TYPE_BUFFER) + || (obj.buffer.length < sizeof(struct acpi_pct_register)) + || (obj.buffer.pointer == NULL)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Invalid _PCT data (status_register)\n")); + result = -EFAULT; + goto end; + } + + reg = (struct acpi_pct_register *) (obj.buffer.pointer); + + if (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unsupported address space [%d] (status_register)\n", + (u32) reg->space_id)); + result = -EFAULT; + goto end; + } + + pr->performance->status_register = (u16) reg->address; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "control_register[0x%04x] status_register[0x%04x]\n", + pr->performance->control_register, + pr->performance->status_register)); + +end: + acpi_os_free(buffer.pointer); + + return_VALUE(result); +} + + +static int +acpi_processor_get_performance_states ( + struct acpi_processor* pr) +{ + int result = 0; + acpi_status status = AE_OK; + struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; + struct acpi_buffer format = {sizeof("NNNNNN"), "NNNNNN"}; + struct acpi_buffer state = {0, NULL}; + union acpi_object *pss = NULL; + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_get_performance_states"); + + status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer); + if(ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PSS\n")); + return_VALUE(-ENODEV); + } + + pss = (union acpi_object *) buffer.pointer; + if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSS data\n")); + result = -EFAULT; + goto end; + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d performance states\n", + pss->package.count)); + + if (pss->package.count > ACPI_PROCESSOR_MAX_PERFORMANCE) { + pr->performance->state_count = ACPI_PROCESSOR_MAX_PERFORMANCE; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Limiting number of states to max (%d)\n", + ACPI_PROCESSOR_MAX_PERFORMANCE)); + } + else + pr->performance->state_count = pss->package.count; + + if (pr->performance->state_count > 1) + pr->flags.performance = 1; + + for (i = 0; i < pr->performance->state_count; i++) { + + struct acpi_processor_px *px = &(pr->performance->states[i]); + + state.length = sizeof(struct acpi_processor_px); + state.pointer = px; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Extracting state %d\n", i)); + + status = acpi_extract_package(&(pss->package.elements[i]), + &format, &state); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSS data\n")); + result = -EFAULT; + goto end; + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "State [%d]: core_frequency[%d] power[%d] transition_latency[%d] bus_master_latency[%d] control[0x%x] status[0x%x]\n", + i, + (u32) px->core_frequency, + (u32) px->power, + (u32) px->transition_latency, + (u32) px->bus_master_latency, + (u32) px->control, + (u32) px->status)); + } + +end: + acpi_os_free(buffer.pointer); + + return_VALUE(result); +} + + +static int +acpi_processor_set_performance ( + struct acpi_processor *pr, + int state) +{ + u16 port = 0; + u8 value = 0; + int i = 0; + struct cpufreq_freqs cpufreq_freqs; + + ACPI_FUNCTION_TRACE("acpi_processor_set_performance"); + + if (!pr) + return_VALUE(-EINVAL); + + if (!pr->flags.performance) + return_VALUE(-ENODEV); + + if (state >= pr->performance->state_count) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Invalid target state (P%d)\n", state)); + return_VALUE(-ENODEV); + } + + if (state < pr->performance_platform_limit) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Platform limit (P%d) overrides target state (P%d)\n", + pr->performance->platform_limit, state)); + return_VALUE(-ENODEV); + } + + if (state == pr->performance->state) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Already at target state (P%d)\n", state)); + return_VALUE(0); + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Transitioning from P%d to P%d\n", + pr->performance->state, state)); + + /* cpufreq frequency struct */ + cpufreq_freqs.cpu = pr->id; + cpufreq_freqs.old = pr->performance->states[pr->performance->state].core_frequency; + cpufreq_freqs.new = pr->performance->states[state].core_frequency; + + /* notify cpufreq */ + cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE); + + /* + * First we write the target state's 'control' value to the + * control_register. + */ + + port = pr->performance->control_register; + value = (u16) pr->performance->states[state].control; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Writing 0x%02x to port 0x%04x\n", value, port)); + + outb(value, port); + + /* + * Then we read the 'status_register' and compare the value with the + * target state's 'status' to make sure the transition was successful. + * Note that we'll poll for up to 1ms (100 cycles of 10us) before + * giving up. + */ + + port = pr->performance->status_register; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Looking for 0x%02x from port 0x%04x\n", + (u8) pr->performance->states[state].status, port)); + + for (i=0; i<100; i++) { + value = inb(port); + if (value == (u8) pr->performance->states[state].status) + break; + udelay(10); + } + + /* notify cpufreq */ + cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE); + + if (value != pr->performance->states[state].status) { + unsigned int tmp = cpufreq_freqs.new; + cpufreq_freqs.new = cpufreq_freqs.old; + cpufreq_freqs.old = tmp; + cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE); + cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE); + ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Transition failed\n")); + return_VALUE(-ENODEV); + } + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Transition successful after %d microseconds\n", + i * 10)); + + pr->performance->state = state; + + return_VALUE(0); +} + +static int acpi_processor_perf_seq_show(struct seq_file *seq, void *offset) +{ + struct acpi_processor *pr = (struct acpi_processor *)seq->private; + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_processor_perf_seq_show"); + + if (!pr) + goto end; + + if (!pr->flags.performance) { + seq_puts(seq, "\n"); + goto end; + } + + seq_printf(seq, "state count: %d\n" + "active state: P%d\n", + pr->performance->state_count, + pr->performance->state); + + seq_puts(seq, "states:\n"); + for (i = 0; i < pr->performance->state_count; i++) + seq_printf(seq, " %cP%d: %d MHz, %d mW, %d uS\n", + (i == pr->performance->state?'*':' '), i, + (u32) pr->performance->states[i].core_frequency, + (u32) pr->performance->states[i].power, + (u32) pr->performance->states[i].transition_latency); + +end: + return 0; +} + +static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file) +{ + return single_open(file, acpi_processor_perf_seq_show, + PDE(inode)->data); +} + +static int +acpi_processor_write_performance ( + struct file *file, + const char *buffer, + unsigned long count, + void *data) +{ + int result = 0; + struct acpi_processor *pr = (struct acpi_processor *) data; + char state_string[12] = {'\0'}; + unsigned int new_state = 0; + struct cpufreq_policy policy; + + ACPI_FUNCTION_TRACE("acpi_processor_write_performance"); + + if (!pr || !pr->performance || (count > sizeof(state_string) - 1)) + return_VALUE(-EINVAL); + + if (copy_from_user(state_string, buffer, count)) + return_VALUE(-EFAULT); + + state_string[count] = '\0'; + new_state = simple_strtoul(state_string, NULL, 0); + + cpufreq_get_policy(&policy, pr->id); + + policy.cpu = pr->id; + policy.max = pr->performance->states[new_state].core_frequency * 1000; + + result = cpufreq_set_policy(&policy); + if (result) + return_VALUE(result); + + return_VALUE(count); +} + + +static int +acpi_cpufreq_setpolicy ( + struct cpufreq_policy *policy) +{ + struct acpi_processor *pr = performance[policy->cpu].pr; + unsigned int next_state = 0; + unsigned int result = 0; + + ACPI_FUNCTION_TRACE("acpi_cpufreq_setpolicy"); + + result = cpufreq_frequency_table_setpolicy(policy, + &performance[policy->cpu].freq_table[pr->limit.state.px], + &next_state); + if (result) + return_VALUE(result); + + result = acpi_processor_set_performance (pr, next_state); + + return_VALUE(result); +} + + +static int +acpi_cpufreq_verify ( + struct cpufreq_policy *policy) +{ + unsigned int result = 0; + unsigned int cpu = policy->cpu; + struct acpi_processor *pr = performance[policy->cpu].pr; + + ACPI_FUNCTION_TRACE("acpi_cpufreq_verify"); + + result = cpufreq_frequency_table_verify(policy, + &performance[cpu].freq_table[pr->limit.state.px]); + + cpufreq_verify_within_limits( + policy, + performance[cpu].states[performance[cpu].state_count - 1].core_frequency * 1000, + performance[cpu].states[pr->limit.state.px].core_frequency * 1000); + + return_VALUE(result); +} + + +static int +acpi_processor_get_performance_info ( + struct acpi_processor *pr) +{ + int result = 0; + acpi_status status = AE_OK; + acpi_handle handle = NULL; + + ACPI_FUNCTION_TRACE("acpi_processor_get_performance_info"); + + if (!pr) + return_VALUE(-EINVAL); + + status = acpi_get_handle(pr->handle, "_PCT", &handle); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "ACPI-based processor performance control unavailable\n")); + return_VALUE(-ENODEV); + } + + result = acpi_processor_get_performance_control(pr); + if (result) + return_VALUE(result); + + result = acpi_processor_get_performance_states(pr); + if (result) + return_VALUE(result); + + result = acpi_processor_get_platform_limit(pr); + if (result) + return_VALUE(result); + + return_VALUE(0); +} + +static int +acpi_cpufreq_cpu_init ( + struct cpufreq_policy *policy) +{ + unsigned int i; + unsigned int cpu = policy->cpu; + struct acpi_processor *pr = NULL; + unsigned int result = 0; + struct proc_dir_entry *entry = NULL; + struct acpi_device *device = NULL; + + ACPI_FUNCTION_TRACE("acpi_cpufreq_cpu_init"); + + acpi_processor_register_performance(&performance[cpu], &pr, cpu); + + pr = performance[cpu].pr; + if (!pr) + return_VALUE(-ENODEV); + + if (acpi_bus_get_device(pr->handle, &device)) + return_VALUE(-ENODEV); + + result = acpi_processor_get_performance_info(performance[cpu].pr); + if (result) + return_VALUE(-ENODEV); + + /* capability check */ + if (!pr->flags.performance) + return_VALUE(-ENODEV); + + /* detect transition latency */ + policy->cpuinfo.transition_latency = 0; + for (i=0;i policy->cpuinfo.transition_latency) + policy->cpuinfo.transition_latency = performance[cpu].states[i].transition_latency; + } + policy->policy = CPUFREQ_POLICY_PERFORMANCE; + + /* table init */ + for (i=0; i<=performance[cpu].state_count; i++) + { + performance[cpu].freq_table[i].index = i; + if (icpu] = performance[cpu].states[pr->limit.state.px].core_frequency * 1000; +#endif + + result = cpufreq_frequency_table_cpuinfo(policy, &performance[cpu].freq_table[0]); + + /* add file 'performance' [R/W] */ + entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE, + S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device)); + if (!entry) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Unable to create '%s' fs entry\n", + ACPI_PROCESSOR_FILE_PERFORMANCE)); + else { + entry->proc_fops = &acpi_processor_perf_fops; + entry->write_proc = acpi_processor_write_performance; + entry->data = acpi_driver_data(device); + } + + return_VALUE(result); +} + + +static int __init +acpi_cpufreq_init (void) +{ + int result = 0; + int current_state = 0; + int i = 0; + struct acpi_processor *pr; + + ACPI_FUNCTION_TRACE("acpi_cpufreq_init"); + + /* alloc memory */ + if (performance) + return_VALUE(-EBUSY); + + performance = kmalloc(NR_CPUS * sizeof(struct acpi_processor_performance), GFP_KERNEL); + if (!performance) + return_VALUE(-ENOMEM); + + memset(performance, 0, NR_CPUS * sizeof(struct acpi_processor_performance)); + + /* register struct acpi_performance performance */ + for (i=0; iflags.performance) + goto found_capable_cpu; + } + result = -ENODEV; + goto err; + + found_capable_cpu: + current_state = pr->performance->state; + + if (current_state == pr->limit.state.px) { + result = acpi_processor_set_performance(pr, (pr->performance->state_count - 1)); + if (result) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Disabled P-States due to failure while switching.\n")); + result = -ENODEV; + goto err; + } + } + + result = acpi_processor_set_performance(pr, pr->limit.state.px); + if (result) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Disabled P-States due to failure while switching.\n")); + result = -ENODEV; + goto err; + } + + if (current_state != 0) { + result = acpi_processor_set_performance(pr, current_state); + if (result) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Disabled P-States due to failure while switching.\n")); + result = -ENODEV; + goto err; + } + } + + result = cpufreq_register_driver(&acpi_cpufreq_driver); + if (result) + goto err; + + return_VALUE(0); + + /* error handling */ + err: + /* unregister struct acpi_performance performance */ + for (i=0; iflags.performance = 0; + performance[i].pr->performance = NULL; + performance[i].pr = NULL; + } + } + + kfree(performance); + + return_VALUE(result); +} + + +static void __exit +acpi_cpufreq_exit (void) +{ + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_cpufreq_exit"); + + for (i=0; iflags.performance = 0; + } + + cpufreq_unregister_driver(&acpi_cpufreq_driver); + + /* unregister struct acpi_performance performance */ + for (i=0; iflags.performance = 0; + performance[i].pr->performance = NULL; + performance[i].pr = NULL; + } + } + + kfree(performance); + + return_VOID; +} + +static struct cpufreq_driver acpi_cpufreq_driver = { + .verify = acpi_cpufreq_verify, + .setpolicy = acpi_cpufreq_setpolicy, + .init = acpi_cpufreq_cpu_init, + .exit = NULL, + .policy = NULL, + .name = "acpi-cpufreq", +}; + + +late_initcall(acpi_cpufreq_init); +module_exit(acpi_cpufreq_exit); diff -Nru a/arch/i386/kernel/cpu/mtrr/Makefile b/arch/i386/kernel/cpu/mtrr/Makefile --- a/arch/i386/kernel/cpu/mtrr/Makefile Sun Feb 9 21:13:28 2003 +++ b/arch/i386/kernel/cpu/mtrr/Makefile Sun Feb 9 21:13:28 2003 @@ -3,4 +3,3 @@ obj-y += cyrix.o obj-y += centaur.o -export-objs := main.o diff -Nru a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c --- a/arch/i386/kernel/dmi_scan.c Sun Feb 9 21:13:31 2003 +++ b/arch/i386/kernel/dmi_scan.c Sun Feb 9 21:13:31 2003 @@ -450,17 +450,6 @@ } /* - * ASUS K7V-RM has broken ACPI table defining sleep modes - */ - -static __init int broken_acpi_Sx(struct dmi_blacklist *d) -{ - printk(KERN_WARNING "Detected ASUS mainboard with broken ACPI sleep table\n"); - dmi_broken |= BROKEN_ACPI_Sx; - return 0; -} - -/* * Toshiba keyboard likes to repeat keys when they are not repeated. */ @@ -744,12 +733,6 @@ { broken_pirq, "Dell PowerEdge 8450", { /* Bad $PIR */ MATCH(DMI_PRODUCT_NAME, "Dell PowerEdge 8450"), NO_MATCH, NO_MATCH, NO_MATCH - } }, - - { broken_acpi_Sx, "ASUS K7V-RM", { /* Bad ACPI Sx table */ - MATCH(DMI_BIOS_VERSION,"ASUS K7V-RM ACPI BIOS Revision 1003A"), - MATCH(DMI_BOARD_NAME, ""), - NO_MATCH, NO_MATCH } }, { broken_toshiba_keyboard, "Toshiba Satellite 4030cdt", { /* Keyboard generates spurious repeats */ diff -Nru a/arch/i386/kernel/edd.c b/arch/i386/kernel/edd.c --- a/arch/i386/kernel/edd.c Sun Feb 9 21:13:30 2003 +++ b/arch/i386/kernel/edd.c Sun Feb 9 21:13:30 2003 @@ -1,6 +1,6 @@ /* * linux/arch/i386/kernel/edd.c - * Copyright (C) 2002 Dell Computer Corporation + * Copyright (C) 2002, 2003 Dell Computer Corporation * by Matt Domsch * * BIOS Enhanced Disk Drive Services (EDD) @@ -11,7 +11,7 @@ * fn41 - Check Extensions Present and * fn48 - Get Device Parametes with EDD extensions * made in setup.S, copied to safe structures in setup.c, - * and presents it in driverfs. + * and presents it in sysfs. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License v2.0 as published by @@ -30,8 +30,6 @@ * * TODO: * - Add IDE and USB disk device support - * - Get symlink creator helper functions exported from - * drivers/base instead of duplicating them here. * - move edd.[ch] to better locations if/when one is decided */ @@ -46,18 +44,18 @@ #include #include #include -#include #include #include +#include /* FIXME - this really belongs in include/scsi/scsi.h */ #include <../drivers/scsi/scsi.h> #include <../drivers/scsi/hosts.h> MODULE_AUTHOR("Matt Domsch "); -MODULE_DESCRIPTION("driverfs interface to BIOS EDD information"); +MODULE_DESCRIPTION("sysfs interface to BIOS EDD information"); MODULE_LICENSE("GPL"); -#define EDD_VERSION "0.07 2002-Oct-24" +#define EDD_VERSION "0.09 2003-Jan-22" #define EDD_DEVICE_NAME_SIZE 16 #define REPORT_URL "http://domsch.com/linux/edd30/results.html" @@ -78,6 +76,7 @@ static int edd_dev_is_type(struct edd_device *edev, const char *type); static struct pci_dev *edd_get_pci_dev(struct edd_device *edev); static struct scsi_device *edd_find_matching_scsi_device(struct edd_device *edev); +static int kernel_has_scsi(void); static struct edd_device *edd_devices[EDDMAXNR]; @@ -93,6 +92,7 @@ { return edev->info; } + static inline void edd_dev_set_info(struct edd_device *edev, struct edd_info *info) { @@ -263,8 +263,8 @@ edd_show_raw_data(struct edd_device *edev, char *buf) { struct edd_info *info = edd_dev_get_info(edev); - int i, rc, warn_padding = 0, email = 0, nonzero_path = 0, - len = sizeof (*edd) - 4, found_pci=0; + int i, warn_padding = 0, nonzero_path = 0, + len = sizeof (*info) - 4, found_pci=0; uint8_t checksum = 0, c = 0; char *p = buf; struct pci_dev *pci_dev=NULL; @@ -277,7 +277,7 @@ len = info->params.length; p += snprintf(p, left, "int13 fn48 returned data:\n\n"); - p += edd_dump_raw_data(p, left, ((char *) edd) + 4, len); + p += edd_dump_raw_data(p, left, ((char *) info) + 4, len); /* Spec violation. Adaptec AIC7899 returns 0xDDBE here, when it should be 0xBEDD. @@ -286,7 +286,6 @@ if (info->params.key == 0xDDBE) { p += snprintf(p, left, "Warning: Spec violation. Key should be 0xBEDD, is 0xDDBE\n"); - email++; } if (!(info->params.key == 0xBEDD || info->params.key == 0xDDBE)) { @@ -294,7 +293,7 @@ } for (i = 30; i <= 73; i++) { - c = *(((uint8_t *) edd) + i + 4); + c = *(((uint8_t *) info) + i + 4); if (c) nonzero_path++; checksum += c; @@ -303,12 +302,10 @@ if (checksum) { p += snprintf(p, left, "Warning: Spec violation. Device Path checksum invalid.\n"); - email++; } if (!nonzero_path) { p += snprintf(p, left, "Error: Spec violation. Empty device path.\n"); - email++; goto out; } @@ -326,45 +323,35 @@ if (warn_padding) { p += snprintf(p, left, "Warning: Spec violation. Padding should be 0x20.\n"); - email++; } - rc = edd_dev_is_type(edev, "PCI"); - if (!rc) { - pci_dev = pci_find_slot(info->params.interface_path.pci.bus, - PCI_DEVFN(info->params.interface_path. - pci.slot, - info->params.interface_path. - pci.function)); + if (edd_dev_is_type(edev, "PCI")) { + pci_dev = edd_get_pci_dev(edev); if (!pci_dev) { p += snprintf(p, left, "Error: BIOS says this is a PCI device, but the OS doesn't know\n"); p += snprintf(p, left, " about a PCI device at %02x:%02x.%d\n", info->params.interface_path.pci.bus, info->params.interface_path.pci.slot, info->params.interface_path.pci.function); - email++; } else { found_pci++; } } - if (found_pci && !edd_dev_is_type(edev, "SCSI")) { + if (found_pci && kernel_has_scsi() && edd_dev_is_type(edev, "SCSI")) { sd = edd_find_matching_scsi_device(edev); if (!sd) { p += snprintf(p, left, "Error: BIOS says this is a SCSI device, but\n"); p += snprintf(p, left, " the OS doesn't know about this SCSI device.\n"); p += snprintf(p, left, " Do you have it's driver module loaded?\n"); - email++; } } out: - if (email) { - p += snprintf(p, left, "\nPlease check %s\n", REPORT_URL); - p += snprintf(p, left, "to see if this has been reported. If not,\n"); - p += snprintf(p, left, "please send the information requested there.\n"); - } + p += snprintf(p, left, "\nPlease check %s\n", REPORT_URL); + p += snprintf(p, left, "to see if this device has been reported. If not,\n"); + p += snprintf(p, left, "please send the information requested there.\n"); return (p - buf); } @@ -502,8 +489,8 @@ { struct edd_info *info = edd_dev_get_info(edev); if (!edev || !info) - return 1; - return !info->params.num_default_cylinders; + return 0; + return info->params.num_default_cylinders > 0; } static int @@ -511,8 +498,8 @@ { struct edd_info *info = edd_dev_get_info(edev); if (!edev || !info) - return 1; - return !info->params.num_default_heads; + return 0; + return info->params.num_default_heads > 0; } static int @@ -520,8 +507,8 @@ { struct edd_info *info = edd_dev_get_info(edev); if (!edev || !info) - return 1; - return !info->params.sectors_per_track; + return 0; + return info->params.sectors_per_track > 0; } static int @@ -532,24 +519,24 @@ char c; if (!edev || !info) - return 1; + return 0; if (!(info->params.key == 0xBEDD || info->params.key == 0xDDBE)) { - return 1; + return 0; } for (i = 30; i <= 73; i++) { - c = *(((uint8_t *) edd) + i + 4); + c = *(((uint8_t *) info) + i + 4); if (c) { nonzero_path++; break; } } if (!nonzero_path) { - return 1; + return 0; } - return 0; + return 1; } static EDD_DEVICE_ATTR(raw_data, 0444, edd_show_raw_data, NULL); @@ -590,7 +577,23 @@ NULL, }; +/** + * edd_release - free edd structure + * @kobj: kobject of edd structure + * + * This is called when the refcount of the edd structure + * reaches 0. This should happen right after we unregister, + * but just in case, we use the release callback anyway. + */ + +static void edd_release(struct kobject * kobj) +{ + struct edd_device * dev = to_edd_device(kobj); + kfree(dev); +} + static struct kobj_type ktype_edd = { + .release = edd_release, .sysfs_ops = &edd_attr_ops, .default_attrs = def_attrs, }; @@ -598,27 +601,24 @@ static decl_subsys(edd,&ktype_edd); - /** * edd_dev_is_type() - is this EDD device a 'type' device? * @edev * @type - a host bus or interface identifier string per the EDD spec * - * Returns 0 if it is a 'type' device, nonzero otherwise. + * Returns 1 (TRUE) if it is a 'type' device, 0 otherwise. */ static int edd_dev_is_type(struct edd_device *edev, const char *type) { - int rc; struct edd_info *info = edd_dev_get_info(edev); - if (!edev || !info) - return 1; - rc = strncmp(info->params.host_bus_type, type, strlen(type)); - if (!rc) - return 0; - - return strncmp(info->params.interface_type, type, strlen(type)); + if (edev && type && info) { + if (!strncmp(info->params.host_bus_type, type, strlen(type)) || + !strncmp(info->params.interface_type, type, strlen(type))) + return 1; + } + return 0; } /** @@ -631,16 +631,14 @@ edd_get_pci_dev(struct edd_device *edev) { struct edd_info *info = edd_dev_get_info(edev); - int rc; - - rc = edd_dev_is_type(edev, "PCI"); - if (rc) - return NULL; - return pci_find_slot(info->params.interface_path.pci.bus, - PCI_DEVFN(info->params.interface_path.pci.slot, - info->params.interface_path.pci. - function)); + if (edd_dev_is_type(edev, "PCI")) { + return pci_find_slot(info->params.interface_path.pci.bus, + PCI_DEVFN(info->params.interface_path.pci.slot, + info->params.interface_path.pci. + function)); + } + return NULL; } static int @@ -653,105 +651,117 @@ return sysfs_create_link(&edev->kobj,&pci_dev->dev.kobj,"pci_dev"); } +/* + * FIXME - as of 15-Jan-2003, there are some non-"scsi_device"s on the + * scsi_bus list. The following functions could possibly mis-access + * memory in that case. This is actually a problem with the SCSI + * layer, which is being addressed there. Until then, don't use the + * SCSI functions. + */ + +#undef CONFIG_SCSI +#undef CONFIG_SCSI_MODULE +#if defined(CONFIG_SCSI) || defined(CONFIG_SCSI_MODULE) + +struct edd_match_data { + struct edd_device * edev; + struct scsi_device * sd; +}; + /** * edd_match_scsidev() * @edev - EDD device is a known SCSI device * @sd - scsi_device with host who's parent is a PCI controller * - * returns 0 on success, 1 on failure + * returns 1 if a match is found, 0 if not. */ -static int -edd_match_scsidev(struct edd_device *edev, struct scsi_device *sd) +static int edd_match_scsidev(struct device * dev, void * d) { - struct edd_info *info = edd_dev_get_info(edev); - - if (!edev || !sd || !info) - return 1; - - if ((sd->channel == info->params.interface_path.pci.channel) && - (sd->id == info->params.device_path.scsi.id) && - (sd->lun == info->params.device_path.scsi.lun)) { - return 0; + struct edd_match_data * data = (struct edd_match_data *)d; + struct edd_info *info = edd_dev_get_info(data->edev); + struct scsi_device * sd = to_scsi_device(dev); + + if (info) { + if ((sd->channel == info->params.interface_path.pci.channel) && + (sd->id == info->params.device_path.scsi.id) && + (sd->lun == info->params.device_path.scsi.lun)) { + data->sd = sd; + return 1; + } } - - return 1; + return 0; } /** * edd_find_matching_device() * @edev - edd_device to match * - * Returns struct scsi_device * on success, - * or NULL on failure. - * This assumes that all children of the PCI controller - * are scsi_hosts, and that all children of scsi_hosts - * are scsi_devices. - * The reference counting probably isn't the best it could be. + * Search the SCSI devices for a drive that matches the EDD + * device descriptor we have. If we find a match, return it, + * otherwise, return NULL. */ -#define children_to_dev(n) container_of(n,struct device,node) static struct scsi_device * edd_find_matching_scsi_device(struct edd_device *edev) { - struct list_head *sdev_node; - int rc = 1; - struct scsi_device *sd = NULL; - struct pci_dev *pci_dev; - - rc = edd_dev_is_type(edev, "SCSI"); - if (rc) - return NULL; + struct edd_match_data data; + struct bus_type * scsi_bus = find_bus("scsi"); - pci_dev = edd_get_pci_dev(edev); - if (!pci_dev) + if (!scsi_bus) { return NULL; + } - get_device(&pci_dev->dev); + data.edev = edev; - list_for_each(sdev_node, &pci_dev->dev.children) { - struct device *sdev_dev = children_to_dev(sdev_node); - get_device(sdev_dev); - sd = to_scsi_device(sdev_dev); - rc = edd_match_scsidev(edev, sd); - put_device(sdev_dev); - if (!rc) - break; + if (edd_dev_is_type(edev, "SCSI")) { + if (bus_for_each_dev(scsi_bus,NULL,&data,edd_match_scsidev)) + return data.sd; } - - put_device(&pci_dev->dev); - return rc ? NULL : sd; + return NULL; } static int edd_create_symlink_to_scsidev(struct edd_device *edev) { - - struct scsi_device *sdev; struct pci_dev *pci_dev; - struct edd_info *info = edd_dev_get_info(edev); - int rc; + int rc = -EINVAL; - rc = edd_dev_is_type(edev, "PCI"); - if (rc) - return rc; - - pci_dev = pci_find_slot(info->params.interface_path.pci.bus, - PCI_DEVFN(info->params.interface_path.pci.slot, - info->params.interface_path.pci. - function)); - if (!pci_dev) - return 1; + pci_dev = edd_get_pci_dev(edev); + if (pci_dev) { + struct scsi_device * sdev = edd_find_matching_scsi_device(edev); + if (sdev && get_device(&sdev->sdev_driverfs_dev)) { + rc = sysfs_create_link(&edev->kobj, + &sdev->sdev_driverfs_dev.kobj, + "disc"); + put_device(&sdev->sdev_driverfs_dev); + } + } + return rc; +} - sdev = edd_find_matching_scsi_device(edev); - if (!sdev) - return 1; +static int kernel_has_scsi(void) +{ + return 1; +} - get_device(&sdev->sdev_driverfs_dev); - rc = sysfs_create_link(&edev->kobj,&sdev->sdev_driverfs_dev.kobj, "disc"); - put_device(&sdev->sdev_driverfs_dev); +#else +static int kernel_has_scsi(void) +{ + return 0; +} - return rc; +static struct scsi_device * +edd_find_matching_scsi_device(struct edd_device *edev) +{ + return NULL; } +static int +edd_create_symlink_to_scsidev(struct edd_device *edev) +{ + return -ENOSYS; +} +#endif + static inline void edd_device_unregister(struct edd_device *edev) @@ -759,7 +769,7 @@ kobject_unregister(&edev->kobj); } -static void populate_dir(struct edd_device * edev) +static void edd_populate_dir(struct edd_device * edev) { struct edd_attribute * attr; int error = 0; @@ -767,7 +777,7 @@ for (i = 0; (attr = edd_attrs[i]) && !error; i++) { if (!attr->test || - (attr->test && !attr->test(edev))) + (attr->test && attr->test(edev))) error = sysfs_create_file(&edev->kobj,&attr->attr); } @@ -791,12 +801,12 @@ kobj_set_kset_s(edev,edd_subsys); error = kobject_register(&edev->kobj); if (!error) - populate_dir(edev); + edd_populate_dir(edev); return error; } /** - * edd_init() - creates driverfs tree of EDD data + * edd_init() - creates sysfs tree of EDD data * * This assumes that eddnr and edd were * assigned in setup.c already. @@ -845,10 +855,8 @@ struct edd_device *edev; for (i = 0; i < eddnr && i < EDDMAXNR; i++) { - if ((edev = edd_devices[i])) { + if ((edev = edd_devices[i])) edd_device_unregister(edev); - kfree(edev); - } } firmware_unregister(&edd_subsys); } diff -Nru a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S --- a/arch/i386/kernel/entry.S Sun Feb 9 21:13:30 2003 +++ b/arch/i386/kernel/entry.S Sun Feb 9 21:13:30 2003 @@ -792,8 +792,8 @@ .long sys_io_getevents .long sys_io_submit .long sys_io_cancel - .long sys_ni_syscall /* 250 sys_alloc_hugepages - reuse this */ - .long sys_ni_syscall /* was sys_free_hugepages - reuse this */ + .long sys_fadvise64 /* 250 */ + .long sys_ni_syscall .long sys_exit_group .long sys_lookup_dcookie .long sys_epoll_create diff -Nru a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c --- a/arch/i386/kernel/i386_ksyms.c Sun Feb 9 21:13:37 2003 +++ b/arch/i386/kernel/i386_ksyms.c Sun Feb 9 21:13:37 2003 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/i386/kernel/init_task.c b/arch/i386/kernel/init_task.c --- a/arch/i386/kernel/init_task.c Sun Feb 9 21:13:36 2003 +++ b/arch/i386/kernel/init_task.c Sun Feb 9 21:13:36 2003 @@ -11,6 +11,7 @@ static struct fs_struct init_fs = INIT_FS; static struct files_struct init_files = INIT_FILES; static struct signal_struct init_signals = INIT_SIGNALS(init_signals); +static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); struct mm_struct init_mm = INIT_MM(init_mm); /* diff -Nru a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c --- a/arch/i386/kernel/io_apic.c Sun Feb 9 21:13:30 2003 +++ b/arch/i386/kernel/io_apic.c Sun Feb 9 21:13:30 2003 @@ -207,19 +207,34 @@ spin_unlock_irqrestore(&ioapic_lock, flags); } -#if CONFIG_SMP - -typedef struct { - unsigned int cpu; - unsigned long timestamp; -} ____cacheline_aligned irq_balance_t; - -static irq_balance_t irq_balance[NR_IRQS] __cacheline_aligned - = { [ 0 ... NR_IRQS-1 ] = { 0, 0 } }; +#if defined(CONFIG_SMP) +# include /* kernel_thread() */ +# include /* kstat */ +# include /* kmalloc() */ +# include /* time_after() */ + +# if CONFIG_BALANCED_IRQ_DEBUG +# define TDprintk(x...) do { printk("<%ld:%s:%d>: ", jiffies, __FILE__, __LINE__); printk(x); } while (0) +# define Dprintk(x...) do { TDprintk(x); } while (0) +# else +# define TDprintk(x...) +# define Dprintk(x...) +# endif extern unsigned long irq_affinity [NR_IRQS]; - -#endif +unsigned long __cacheline_aligned irq_balance_mask [NR_IRQS]; +static int irqbalance_disabled __initdata = 0; +static int physical_balance = 0; + +struct irq_cpu_info { + unsigned long * last_irq; + unsigned long * irq_delta; + unsigned long irq; +} irq_cpu_data[NR_CPUS]; + +#define CPU_IRQ(cpu) (irq_cpu_data[cpu].irq) +#define LAST_CPU_IRQ(cpu,irq) (irq_cpu_data[cpu].last_irq[irq]) +#define IRQ_DELTA(cpu,irq) (irq_cpu_data[cpu].irq_delta[irq]) #define IDLE_ENOUGH(cpu,now) \ (idle_cpu(cpu) && ((now) - irq_stat[(cpu)].idle_timestamp > 1)) @@ -227,10 +242,224 @@ #define IRQ_ALLOWED(cpu,allowed_mask) \ ((1 << cpu) & (allowed_mask)) -#if CONFIG_SMP +#define CPU_TO_PACKAGEINDEX(i) \ + ((physical_balance && i > cpu_sibling_map[i]) ? cpu_sibling_map[i] : i) + +#define MAX_BALANCED_IRQ_INTERVAL (5*HZ) +#define MIN_BALANCED_IRQ_INTERVAL (HZ/2) +#define BALANCED_IRQ_MORE_DELTA (HZ/10) +#define BALANCED_IRQ_LESS_DELTA (HZ) + +long balanced_irq_interval = MAX_BALANCED_IRQ_INTERVAL; + +static inline void balance_irq(int cpu, int irq); + +static inline void rotate_irqs_among_cpus(unsigned long useful_load_threshold) +{ + int i, j; + Dprintk("Rotating IRQs among CPUs.\n"); + for (i = 0; i < NR_CPUS; i++) { + for (j = 0; cpu_online(i) && (j < NR_IRQS); j++) { + if (!irq_desc[j].action) + continue; + /* Is it a significant load ? */ + if (IRQ_DELTA(CPU_TO_PACKAGEINDEX(i),j) < useful_load_threshold) + continue; + balance_irq(i, j); + } + } + balanced_irq_interval = max((long)MIN_BALANCED_IRQ_INTERVAL, + balanced_irq_interval - BALANCED_IRQ_LESS_DELTA); + return; +} + +static void do_irq_balance(void) +{ + int i, j; + unsigned long max_cpu_irq = 0, min_cpu_irq = (~0); + unsigned long move_this_load = 0; + int max_loaded = 0, min_loaded = 0; + unsigned long useful_load_threshold = balanced_irq_interval + 10; + int selected_irq; + int tmp_loaded, first_attempt = 1; + unsigned long tmp_cpu_irq; + unsigned long imbalance = 0; + unsigned long allowed_mask; + unsigned long target_cpu_mask; + + for (i = 0; i < NR_CPUS; i++) { + int package_index; + CPU_IRQ(i) = 0; + if (!cpu_online(i)) + continue; + package_index = CPU_TO_PACKAGEINDEX(i); + for (j = 0; j < NR_IRQS; j++) { + unsigned long value_now, delta; + /* Is this an active IRQ? */ + if (!irq_desc[j].action) + continue; + if ( package_index == i ) + IRQ_DELTA(package_index,j) = 0; + /* Determine the total count per processor per IRQ */ + value_now = (unsigned long) kstat_cpu(i).irqs[j]; + + /* Determine the activity per processor per IRQ */ + delta = value_now - LAST_CPU_IRQ(i,j); + + /* Update last_cpu_irq[][] for the next time */ + LAST_CPU_IRQ(i,j) = value_now; + + /* Ignore IRQs whose rate is less than the clock */ + if (delta < useful_load_threshold) + continue; + /* update the load for the processor or package total */ + IRQ_DELTA(package_index,j) += delta; + + /* Keep track of the higher numbered sibling as well */ + if (i != package_index) + CPU_IRQ(i) += delta; + /* + * We have sibling A and sibling B in the package + * + * cpu_irq[A] = load for cpu A + load for cpu B + * cpu_irq[B] = load for cpu B + */ + CPU_IRQ(package_index) += delta; + } + } + /* Find the least loaded processor package */ + for (i = 0; i < NR_CPUS; i++) { + if (!cpu_online(i)) + continue; + if (physical_balance && i > cpu_sibling_map[i]) + continue; + if (min_cpu_irq > CPU_IRQ(i)) { + min_cpu_irq = CPU_IRQ(i); + min_loaded = i; + } + } + max_cpu_irq = ULONG_MAX; + +tryanothercpu: + /* Look for heaviest loaded processor. + * We may come back to get the next heaviest loaded processor. + * Skip processors with trivial loads. + */ + tmp_cpu_irq = 0; + tmp_loaded = -1; + for (i = 0; i < NR_CPUS; i++) { + if (!cpu_online(i)) + continue; + if (physical_balance && i > cpu_sibling_map[i]) + continue; + if (max_cpu_irq <= CPU_IRQ(i)) + continue; + if (tmp_cpu_irq < CPU_IRQ(i)) { + tmp_cpu_irq = CPU_IRQ(i); + tmp_loaded = i; + } + } -#define IRQ_BALANCE_INTERVAL (HZ/50) + if (tmp_loaded == -1) { + /* In the case of small number of heavy interrupt sources, + * loading some of the cpus too much. We use Ingo's original + * approach to rotate them around. + */ + if (!first_attempt && imbalance >= useful_load_threshold) { + rotate_irqs_among_cpus(useful_load_threshold); + return; + } + goto not_worth_the_effort; + } + + first_attempt = 0; /* heaviest search */ + max_cpu_irq = tmp_cpu_irq; /* load */ + max_loaded = tmp_loaded; /* processor */ + imbalance = (max_cpu_irq - min_cpu_irq) / 2; + Dprintk("max_loaded cpu = %d\n", max_loaded); + Dprintk("min_loaded cpu = %d\n", min_loaded); + Dprintk("max_cpu_irq load = %ld\n", max_cpu_irq); + Dprintk("min_cpu_irq load = %ld\n", min_cpu_irq); + Dprintk("load imbalance = %lu\n", imbalance); + + /* if imbalance is less than approx 10% of max load, then + * observe diminishing returns action. - quit + */ + if (imbalance < (max_cpu_irq >> 3)) { + Dprintk("Imbalance too trivial\n"); + goto not_worth_the_effort; + } + +tryanotherirq: + /* if we select an IRQ to move that can't go where we want, then + * see if there is another one to try. + */ + move_this_load = 0; + selected_irq = -1; + for (j = 0; j < NR_IRQS; j++) { + /* Is this an active IRQ? */ + if (!irq_desc[j].action) + continue; + if (imbalance <= IRQ_DELTA(max_loaded,j)) + continue; + /* Try to find the IRQ that is closest to the imbalance + * without going over. + */ + if (move_this_load < IRQ_DELTA(max_loaded,j)) { + move_this_load = IRQ_DELTA(max_loaded,j); + selected_irq = j; + } + } + if (selected_irq == -1) { + goto tryanothercpu; + } + + imbalance = move_this_load; + + /* For physical_balance case, we accumlated both load + * values in the one of the siblings cpu_irq[], + * to use the same code for physical and logical processors + * as much as possible. + * + * NOTE: the cpu_irq[] array holds the sum of the load for + * sibling A and sibling B in the slot for the lowest numbered + * sibling (A), _AND_ the load for sibling B in the slot for + * the higher numbered sibling. + * + * We seek the least loaded sibling by making the comparison + * (A+B)/2 vs B + */ + if (physical_balance && (CPU_IRQ(min_loaded) >> 1) > CPU_IRQ(cpu_sibling_map[min_loaded])) + min_loaded = cpu_sibling_map[min_loaded]; + + allowed_mask = cpu_online_map & irq_affinity[selected_irq]; + target_cpu_mask = 1 << min_loaded; + + if (target_cpu_mask & allowed_mask) { + irq_desc_t *desc = irq_desc + selected_irq; + Dprintk("irq = %d moved to cpu = %d\n", selected_irq, min_loaded); + /* mark for change destination */ + spin_lock(&desc->lock); + irq_balance_mask[selected_irq] = target_cpu_mask; + spin_unlock(&desc->lock); + /* Since we made a change, come back sooner to + * check for more variation. + */ + balanced_irq_interval = max((long)MIN_BALANCED_IRQ_INTERVAL, + balanced_irq_interval - BALANCED_IRQ_LESS_DELTA); + return; + } + goto tryanotherirq; + +not_worth_the_effort: + /* if we did not find an IRQ to move, then adjust the time interval upward */ + balanced_irq_interval = min((long)MAX_BALANCED_IRQ_INTERVAL, + balanced_irq_interval + BALANCED_IRQ_MORE_DELTA); + Dprintk("IRQ worth rotating not found\n"); + return; +} + static unsigned long move(int curr_cpu, unsigned long allowed_mask, unsigned long now, int direction) { int search_idle = 1; @@ -257,34 +486,113 @@ return cpu; } -static inline void balance_irq(int irq) +static inline void balance_irq (int cpu, int irq) { - irq_balance_t *entry = irq_balance + irq; unsigned long now = jiffies; - + unsigned long allowed_mask; + unsigned int new_cpu; + if (no_balance_irq) return; - if (unlikely(time_after(now, entry->timestamp + IRQ_BALANCE_INTERVAL))) { - unsigned long allowed_mask; - unsigned int new_cpu; - int random_number; - - rdtscl(random_number); - random_number &= 1; - - allowed_mask = cpu_online_map & irq_affinity[irq]; - entry->timestamp = now; - new_cpu = move(entry->cpu, allowed_mask, now, random_number); - if (entry->cpu != new_cpu) { - entry->cpu = new_cpu; - set_ioapic_affinity(irq, cpu_to_logical_apicid(new_cpu)); + allowed_mask = cpu_online_map & irq_affinity[irq]; + new_cpu = move(cpu, allowed_mask, now, 1); + if (cpu != new_cpu) { + irq_desc_t *desc = irq_desc + irq; + spin_lock(&desc->lock); + irq_balance_mask[irq] = cpu_to_logical_apicid(new_cpu); + spin_unlock(&desc->lock); + } +} + +int balanced_irq(void *unused) +{ + int i; + unsigned long prev_balance_time = jiffies; + long time_remaining = balanced_irq_interval; + daemonize(); + sigfillset(¤t->blocked); + sprintf(current->comm, "kirqd"); + + /* push everything to CPU 0 to give us a starting point. */ + for (i = 0 ; i < NR_IRQS ; i++) + irq_balance_mask[i] = 1 << 0; + for (;;) { + set_current_state(TASK_INTERRUPTIBLE); + time_remaining = schedule_timeout(time_remaining); + if (time_after(jiffies, prev_balance_time+balanced_irq_interval)) { + Dprintk("balanced_irq: calling do_irq_balance() %lu\n", jiffies); + do_irq_balance(); + prev_balance_time = jiffies; + time_remaining = balanced_irq_interval; } + } +} + +static int __init balanced_irq_init(void) +{ + int i; + struct cpuinfo_x86 *c; + c = &boot_cpu_data; + if (irqbalance_disabled) + return 0; + /* Enable physical balance only if more than 1 physical processor is present */ + if (smp_num_siblings > 1 && cpu_online_map >> 2) + physical_balance = 1; + + for (i = 0; i < NR_CPUS; i++) { + if (!cpu_online(i)) + continue; + irq_cpu_data[i].irq_delta = kmalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL); + irq_cpu_data[i].last_irq = kmalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL); + if (irq_cpu_data[i].irq_delta == NULL || irq_cpu_data[i].last_irq == NULL) { + printk(KERN_ERR "balanced_irq_init: out of memory"); + goto failed; + } + memset(irq_cpu_data[i].irq_delta,0,sizeof(unsigned long) * NR_IRQS); + memset(irq_cpu_data[i].last_irq,0,sizeof(unsigned long) * NR_IRQS); + } + + printk(KERN_INFO "Starting balanced_irq\n"); + if (kernel_thread(balanced_irq, NULL, CLONE_KERNEL) >= 0) + return 0; + else + printk(KERN_ERR "balanced_irq_init: failed to spawn balanced_irq"); +failed: + for (i = 0; i < NR_CPUS; i++) { + if(irq_cpu_data[i].irq_delta) + kfree(irq_cpu_data[i].irq_delta); + if(irq_cpu_data[i].last_irq) + kfree(irq_cpu_data[i].last_irq); } + return 0; } + +static int __init irqbalance_disable(char *str) +{ + irqbalance_disabled = 1; + return 0; +} + +__setup("noirqbalance", irqbalance_disable); + +static void set_ioapic_affinity (unsigned int irq, unsigned long mask); + +static inline void move_irq(int irq) +{ + /* note - we hold the desc->lock */ + if (unlikely(irq_balance_mask[irq])) { + set_ioapic_affinity(irq, irq_balance_mask[irq]); + irq_balance_mask[irq] = 0; + } +} + +__initcall(balanced_irq_init); + #else /* !SMP */ -static inline void balance_irq(int irq) { } -#endif +static inline void move_irq(int irq) { } +#endif /* defined(CONFIG_SMP) */ + /* * support for broken MP BIOSs, enables hand-redirection of PIRQ0-7 to @@ -1307,7 +1615,7 @@ */ static void ack_edge_ioapic_irq(unsigned int irq) { - balance_irq(irq); + move_irq(irq); if ((irq_desc[irq].status & (IRQ_PENDING | IRQ_DISABLED)) == (IRQ_PENDING | IRQ_DISABLED)) mask_IO_APIC_irq(irq); @@ -1347,7 +1655,7 @@ unsigned long v; int i; - balance_irq(irq); + move_irq(irq); /* * It appears there is an erratum which affects at least version 0x11 * of I/O APIC (that's the 82093AA and cores integrated into various diff -Nru a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c --- a/arch/i386/kernel/irq.c Sun Feb 9 21:13:28 2003 +++ b/arch/i386/kernel/irq.c Sun Feb 9 21:13:28 2003 @@ -338,9 +338,9 @@ __asm__ __volatile__("andl %%esp,%0" : "=r" (esp) : "0" (8191)); - if (unlikely(esp < (sizeof(struct task_struct) + 1024))) { + if (unlikely(esp < (sizeof(struct thread_info) + 1024))) { printk("do_IRQ: stack overflow: %ld\n", - esp - sizeof(struct task_struct)); + esp - sizeof(struct thread_info)); dump_stack(); } } diff -Nru a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c --- a/arch/i386/kernel/process.c Sun Feb 9 21:13:28 2003 +++ b/arch/i386/kernel/process.c Sun Feb 9 21:13:28 2003 @@ -86,7 +86,7 @@ */ void default_idle(void) { - if (current_cpu_data.hlt_works_ok && !hlt_counter) { + if (!hlt_counter && current_cpu_data.hlt_works_ok) { local_irq_disable(); if (!need_resched()) safe_halt(); diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c --- a/arch/i386/kernel/setup.c Sun Feb 9 21:13:32 2003 +++ b/arch/i386/kernel/setup.c Sun Feb 9 21:13:32 2003 @@ -474,7 +474,7 @@ #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE) unsigned char eddnr; -struct edd_info edd[EDDNR]; +struct edd_info edd[EDDMAXNR]; /** * copy_edd() - Copy the BIOS EDD information * from empty_zero_page into a safe place. @@ -900,7 +900,7 @@ * Parse the ACPI tables for possible boot-time SMP configuration. */ if (!acpi_disabled) - acpi_boot_init(*cmdline_p); + acpi_boot_init(); #endif #ifdef CONFIG_X86_LOCAL_APIC if (smp_found_config) diff -Nru a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c --- a/arch/i386/kernel/signal.c Sun Feb 9 21:13:31 2003 +++ b/arch/i386/kernel/signal.c Sun Feb 9 21:13:31 2003 @@ -37,11 +37,11 @@ sigset_t saveset; mask &= _BLOCKABLE; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; siginitset(¤t->blocked, mask); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->eax = -EINTR; while (1) { @@ -66,11 +66,11 @@ return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->eax = -EINTR; while (1) { @@ -224,10 +224,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext(regs, &frame->sc, &eax)) goto badframe; @@ -252,10 +252,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &eax)) goto badframe; @@ -513,7 +513,7 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset, struct pt_regs * regs) { - struct k_sigaction *ka = ¤t->sig->action[sig-1]; + struct k_sigaction *ka = ¤t->sighand->action[sig-1]; /* Are we from a system call? */ if (regs->orig_eax >= 0) { @@ -547,11 +547,11 @@ ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked,sig); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } } diff -Nru a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c --- a/arch/i386/kernel/time.c Sun Feb 9 21:13:32 2003 +++ b/arch/i386/kernel/time.c Sun Feb 9 21:13:32 2003 @@ -70,7 +70,6 @@ unsigned long cpu_khz; /* Detected as we calibrate the TSC */ -extern rwlock_t xtime_lock; extern unsigned long wall_jiffies; spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; @@ -87,19 +86,21 @@ */ void do_gettimeofday(struct timeval *tv) { - unsigned long flags; + unsigned long seq; unsigned long usec, sec; - read_lock_irqsave(&xtime_lock, flags); - usec = timer->get_offset(); - { - unsigned long lost = jiffies - wall_jiffies; - if (lost) - usec += lost * (1000000 / HZ); - } - sec = xtime.tv_sec; - usec += (xtime.tv_nsec / 1000); - read_unlock_irqrestore(&xtime_lock, flags); + do { + seq = read_seqbegin(&xtime_lock); + + usec = timer->get_offset(); + { + unsigned long lost = jiffies - wall_jiffies; + if (lost) + usec += lost * (1000000 / HZ); + } + sec = xtime.tv_sec; + usec += (xtime.tv_nsec / 1000); + } while (read_seqretry(&xtime_lock, seq)); while (usec >= 1000000) { usec -= 1000000; @@ -112,7 +113,7 @@ void do_settimeofday(struct timeval *tv) { - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); /* * This is revolting. We need to set "xtime" correctly. However, the * value in this location is the value at the most recent update of @@ -133,7 +134,7 @@ time_status |= STA_UNSYNC; time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } /* @@ -266,6 +267,41 @@ } /* + * Lost tick detection and compensation + */ +static inline void detect_lost_tick(void) +{ + /* read time since last interrupt */ + unsigned long delta = timer->get_offset(); + static unsigned long dbg_print; + + /* check if delta is greater then two ticks */ + if(delta >= 2*(1000000/HZ)){ + + /* + * only print debug info first 5 times + */ + /* + * AKPM: disable this for now; it's nice, but irritating. + */ + if (0 && dbg_print < 5) { + printk(KERN_WARNING "\nWarning! Detected %lu " + "micro-second gap between interrupts.\n", + delta); + printk(KERN_WARNING " Compensating for %lu lost " + "ticks.\n", + delta/(1000000/HZ)-1); + dump_stack(); + dbg_print++; + } + /* calculate number of missed ticks */ + delta = delta/(1000000/HZ)-1; + jiffies += delta; + } + +} + +/* * This is the same as the above, except we _also_ save the current * Time Stamp Counter value at the time of the timer interrupt, so that * we later on can estimate the time of day more exactly. @@ -279,13 +315,14 @@ * the irq version of write_lock because as just said we have irq * locally disabled. -arca */ - write_lock(&xtime_lock); + write_seqlock(&xtime_lock); + detect_lost_tick(); timer->mark_offset(); do_timer_interrupt(irq, NULL, regs); - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); } diff -Nru a/arch/i386/kernel/timers/timer_pit.c b/arch/i386/kernel/timers/timer_pit.c --- a/arch/i386/kernel/timers/timer_pit.c Sun Feb 9 21:13:35 2003 +++ b/arch/i386/kernel/timers/timer_pit.c Sun Feb 9 21:13:35 2003 @@ -76,7 +76,7 @@ static unsigned long get_offset_pit(void) { int count; - + unsigned long flags; static int count_p = LATCH; /* for the first call after boot */ static unsigned long jiffies_p = 0; @@ -85,8 +85,7 @@ */ unsigned long jiffies_t; - /* gets recalled with irq locally disabled */ - spin_lock(&i8253_lock); + spin_lock_irqsave(&i8253_lock, flags); /* timer count may underflow right here */ outb_p(0x00, 0x43); /* latch the count ASAP */ @@ -108,7 +107,7 @@ count = LATCH - 1; } - spin_unlock(&i8253_lock); + spin_unlock_irqrestore(&i8253_lock, flags); /* * avoiding timer inconsistencies (they are rare, but they happen)... diff -Nru a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c --- a/arch/i386/kernel/traps.c Sun Feb 9 21:13:29 2003 +++ b/arch/i386/kernel/traps.c Sun Feb 9 21:13:29 2003 @@ -514,6 +514,10 @@ __asm__ __volatile__("movl %%db6,%0" : "=r" (condition)); + /* It's safe to allow irq's after DR6 has been saved */ + if (regs->eflags & X86_EFLAGS_IF) + local_irq_enable(); + /* Mask out spurious debug traps due to lazy DR7 setting */ if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) { if (!tsk->thread.debugreg[7]) @@ -831,7 +835,7 @@ #endif set_trap_gate(0,÷_error); - set_trap_gate(1,&debug); + set_intr_gate(1,&debug); set_intr_gate(2,&nmi); set_system_gate(3,&int3); /* int3-5 can be called from all */ set_system_gate(4,&overflow); diff -Nru a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c --- a/arch/i386/kernel/vm86.c Sun Feb 9 21:13:29 2003 +++ b/arch/i386/kernel/vm86.c Sun Feb 9 21:13:29 2003 @@ -512,10 +512,10 @@ return 1; /* we let this handle by the calling routine */ if (current->ptrace & PT_PTRACED) { unsigned long flags; - spin_lock_irqsave(¤t->sig->siglock, flags); + spin_lock_irqsave(¤t->sighand->siglock, flags); sigdelset(¤t->blocked, SIGTRAP); recalc_sigpending(); - spin_unlock_irqrestore(¤t->sig->siglock, flags); + spin_unlock_irqrestore(¤t->sighand->siglock, flags); } send_sig(SIGTRAP, current, 1); current->thread.trap_no = trapno; diff -Nru a/arch/i386/mach-voyager/Makefile b/arch/i386/mach-voyager/Makefile --- a/arch/i386/mach-voyager/Makefile Sun Feb 9 21:13:29 2003 +++ b/arch/i386/mach-voyager/Makefile Sun Feb 9 21:13:29 2003 @@ -8,8 +8,6 @@ # Note 2! The CFLAGS definitions are now in the main makefile... EXTRA_CFLAGS += -I../kernel -export-objs := - obj-y := setup.o voyager_basic.o voyager_thread.o obj-$(CONFIG_SMP) += voyager_smp.o voyager_cat.o diff -Nru a/arch/i386/mm/Makefile b/arch/i386/mm/Makefile --- a/arch/i386/mm/Makefile Sun Feb 9 21:13:30 2003 +++ b/arch/i386/mm/Makefile Sun Feb 9 21:13:30 2003 @@ -2,8 +2,6 @@ # Makefile for the linux i386-specific parts of the memory manager. # -export-objs := pageattr.o - obj-y := init.o pgtable.o fault.o ioremap.o extable.o pageattr.o obj-$(CONFIG_DISCONTIGMEM) += discontig.o diff -Nru a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c --- a/arch/i386/mm/hugetlbpage.c Sun Feb 9 21:13:36 2003 +++ b/arch/i386/mm/hugetlbpage.c Sun Feb 9 21:13:36 2003 @@ -26,7 +26,6 @@ int htlbpage_max; static long htlbzone_pages; -struct vm_operations_struct hugetlb_vm_ops; static LIST_HEAD(htlbpage_freelist); static spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED; @@ -46,6 +45,7 @@ htlbpagemem--; spin_unlock(&htlbpage_lock); set_page_count(page, 1); + page->lru.prev = (void *)huge_page_release; for (i = 0; i < (HPAGE_SIZE/PAGE_SIZE); ++i) clear_highpage(&page[i]); return page; @@ -134,6 +134,7 @@ page = pte_page(pte); if (pages) { page += ((start & ~HPAGE_MASK) >> PAGE_SHIFT); + get_page(page); pages[i] = page; } if (vmas) @@ -150,6 +151,82 @@ return i; } +#if 0 /* This is just for testing */ +struct page * +follow_huge_addr(struct mm_struct *mm, + struct vm_area_struct *vma, unsigned long address, int write) +{ + unsigned long start = address; + int length = 1; + int nr; + struct page *page; + + nr = follow_hugetlb_page(mm, vma, &page, NULL, &start, &length, 0); + if (nr == 1) + return page; + return NULL; +} + +/* + * If virtual address `addr' lies within a huge page, return its controlling + * VMA, else NULL. + */ +struct vm_area_struct *hugepage_vma(struct mm_struct *mm, unsigned long addr) +{ + if (mm->used_hugetlb) { + struct vm_area_struct *vma = find_vma(mm, addr); + if (vma && is_vm_hugetlb_page(vma)) + return vma; + } + return NULL; +} + +int pmd_huge(pmd_t pmd) +{ + return 0; +} + +struct page * +follow_huge_pmd(struct mm_struct *mm, unsigned long address, + pmd_t *pmd, int write) +{ + return NULL; +} + +#else + +struct page * +follow_huge_addr(struct mm_struct *mm, + struct vm_area_struct *vma, unsigned long address, int write) +{ + return NULL; +} + +struct vm_area_struct *hugepage_vma(struct mm_struct *mm, unsigned long addr) +{ + return NULL; +} + +int pmd_huge(pmd_t pmd) +{ + return !!(pmd_val(pmd) & _PAGE_PSE); +} + +struct page * +follow_huge_pmd(struct mm_struct *mm, unsigned long address, + pmd_t *pmd, int write) +{ + struct page *page; + + page = pte_page(*(pte_t *)pmd); + if (page) { + page += ((address & ~HPAGE_MASK) >> PAGE_SHIFT); + get_page(page); + } + return page; +} +#endif + void free_huge_page(struct page *page) { BUG_ON(page_count(page)); @@ -171,7 +248,8 @@ free_huge_page(page); } -void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) +void unmap_hugepage_range(struct vm_area_struct *vma, + unsigned long start, unsigned long end) { struct mm_struct *mm = vma->vm_mm; unsigned long address; @@ -181,8 +259,6 @@ BUG_ON(start & (HPAGE_SIZE - 1)); BUG_ON(end & (HPAGE_SIZE - 1)); - spin_lock(&htlbpage_lock); - spin_unlock(&htlbpage_lock); for (address = start; address < end; address += HPAGE_SIZE) { pte = huge_pte_offset(mm, address); if (pte_none(*pte)) @@ -195,7 +271,9 @@ flush_tlb_range(vma, start, end); } -void zap_hugepage_range(struct vm_area_struct *vma, unsigned long start, unsigned long length) +void +zap_hugepage_range(struct vm_area_struct *vma, + unsigned long start, unsigned long length) { struct mm_struct *mm = vma->vm_mm; spin_lock(&mm->page_table_lock); @@ -206,6 +284,7 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma) { struct mm_struct *mm = current->mm; + struct inode *inode = mapping->host; unsigned long addr; int ret = 0; @@ -229,6 +308,7 @@ + (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT)); page = find_get_page(mapping, idx); if (!page) { + loff_t i_size; page = alloc_hugetlb_page(); if (!page) { ret = -ENOMEM; @@ -240,6 +320,9 @@ free_huge_page(page); goto out; } + i_size = (loff_t)(idx + 1) * HPAGE_SIZE; + if (i_size > inode->i_size) + inode->i_size = i_size; } set_huge_pte(mm, vma, page, pte, vma->vm_flags & VM_WRITE); } @@ -283,8 +366,8 @@ break; } page = list_entry(p, struct page, list); - if ((page_zone(page))->name[0] != 'H') // Look for non-Highmem - map = page; + if (!PageHighMem(page)) + map = page; } if (map) { list_del(&map->list); @@ -298,8 +381,8 @@ int set_hugetlb_mem_size(int count) { - int j, lcount; - struct page *page, *map; + int lcount; + struct page *page; extern long htlbzone_pages; extern struct list_head htlbpage_freelist; @@ -315,11 +398,6 @@ page = alloc_pages(__GFP_HIGHMEM, HUGETLB_PAGE_ORDER); if (page == NULL) break; - map = page; - for (j = 0; j < (HPAGE_SIZE / PAGE_SIZE); j++) { - SetPageReserved(map); - map++; - } spin_lock(&htlbpage_lock); list_add(&page->list, &htlbpage_freelist); htlbpagemem++; @@ -341,7 +419,8 @@ return (int) htlbzone_pages; } -int hugetlb_sysctl_handler(ctl_table *table, int write, struct file *file, void *buffer, size_t *length) +int hugetlb_sysctl_handler(ctl_table *table, int write, + struct file *file, void *buffer, size_t *length) { proc_dointvec(table, write, file, buffer, length); htlbpage_max = set_hugetlb_mem_size(htlbpage_max); @@ -358,15 +437,13 @@ static int __init hugetlb_init(void) { - int i, j; + int i; struct page *page; for (i = 0; i < htlbpage_max; ++i) { page = alloc_pages(__GFP_HIGHMEM, HUGETLB_PAGE_ORDER); if (!page) break; - for (j = 0; j < HPAGE_SIZE/PAGE_SIZE; ++j) - SetPageReserved(&page[j]); spin_lock(&htlbpage_lock); list_add(&page->list, &htlbpage_freelist); spin_unlock(&htlbpage_lock); @@ -395,7 +472,14 @@ return 1; } -static struct page *hugetlb_nopage(struct vm_area_struct * area, unsigned long address, int unused) +/* + * We cannot handle pagefaults against hugetlb pages at all. They cause + * handle_mm_fault() to try to instantiate regular-sized pages in the + * hugegpage VMA. do_page_fault() is supposed to trap this, so BUG is we get + * this far. + */ +static struct page *hugetlb_nopage(struct vm_area_struct *vma, + unsigned long address, int unused) { BUG(); return NULL; diff -Nru a/arch/i386/mm/init.c b/arch/i386/mm/init.c --- a/arch/i386/mm/init.c Sun Feb 9 21:13:34 2003 +++ b/arch/i386/mm/init.c Sun Feb 9 21:13:34 2003 @@ -508,20 +508,36 @@ #endif } -#if CONFIG_X86_PAE -struct kmem_cache_s *pae_pgd_cachep; +#include + +kmem_cache_t *pmd_cache; +kmem_cache_t *pgd_cache; + +void pmd_ctor(void *, kmem_cache_t *, unsigned long); +void pgd_ctor(void *, kmem_cache_t *, unsigned long); void __init pgtable_cache_init(void) { + if (PTRS_PER_PMD > 1) { + pmd_cache = kmem_cache_create("pae_pmd", + PTRS_PER_PMD*sizeof(pmd_t), + 0, + SLAB_HWCACHE_ALIGN | SLAB_MUST_HWCACHE_ALIGN, + pmd_ctor, + NULL); + + if (!pmd_cache) + panic("pgtable_cache_init(): cannot create pmd cache"); + } + /* * PAE pgds must be 16-byte aligned: */ - pae_pgd_cachep = kmem_cache_create("pae_pgd", 32, 0, - SLAB_HWCACHE_ALIGN | SLAB_MUST_HWCACHE_ALIGN, NULL, NULL); - if (!pae_pgd_cachep) - panic("init_pae(): Cannot alloc pae_pgd SLAB cache"); + pgd_cache = kmem_cache_create("pgd", PTRS_PER_PGD*sizeof(pgd_t), 0, + SLAB_HWCACHE_ALIGN | SLAB_MUST_HWCACHE_ALIGN, pgd_ctor, NULL); + if (!pgd_cache) + panic("pgtable_cache_init(): Cannot create pgd cache"); } -#endif /* Put this after the callers, so that it cannot be inlined */ static int do_test_wp_bit(void) diff -Nru a/arch/i386/mm/pgtable.c b/arch/i386/mm/pgtable.c --- a/arch/i386/mm/pgtable.c Sun Feb 9 21:13:37 2003 +++ b/arch/i386/mm/pgtable.c Sun Feb 9 21:13:37 2003 @@ -166,61 +166,60 @@ return pte; } -#if CONFIG_X86_PAE +extern kmem_cache_t *pmd_cache; +extern kmem_cache_t *pgd_cache; -pgd_t *pgd_alloc(struct mm_struct *mm) +void pmd_ctor(void *__pmd, kmem_cache_t *pmd_cache, unsigned long flags) { - int i; - pgd_t *pgd = kmem_cache_alloc(pae_pgd_cachep, GFP_KERNEL); - - if (pgd) { - for (i = 0; i < USER_PTRS_PER_PGD; i++) { - unsigned long pmd = __get_free_page(GFP_KERNEL); - if (!pmd) - goto out_oom; - clear_page(pmd); - set_pgd(pgd + i, __pgd(1 + __pa(pmd))); - } - memcpy(pgd + USER_PTRS_PER_PGD, - swapper_pg_dir + USER_PTRS_PER_PGD, - (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); - } - return pgd; -out_oom: - for (i--; i >= 0; i--) - free_page((unsigned long)__va(pgd_val(pgd[i])-1)); - kmem_cache_free(pae_pgd_cachep, pgd); - return NULL; + clear_page(__pmd); } -void pgd_free(pgd_t *pgd) +void pgd_ctor(void *__pgd, kmem_cache_t *pgd_cache, unsigned long flags) { - int i; + pgd_t *pgd = __pgd; - for (i = 0; i < USER_PTRS_PER_PGD; i++) - free_page((unsigned long)__va(pgd_val(pgd[i])-1)); - kmem_cache_free(pae_pgd_cachep, pgd); + if (PTRS_PER_PMD == 1) + memset(pgd, 0, USER_PTRS_PER_PGD * sizeof(pgd_t)); + memcpy(pgd + USER_PTRS_PER_PGD, + swapper_pg_dir + USER_PTRS_PER_PGD, + (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); } -#else - pgd_t *pgd_alloc(struct mm_struct *mm) { - pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL); + int i; + pgd_t *pgd = kmem_cache_alloc(pgd_cache, SLAB_KERNEL); - if (pgd) { - memset(pgd, 0, USER_PTRS_PER_PGD * sizeof(pgd_t)); - memcpy(pgd + USER_PTRS_PER_PGD, - swapper_pg_dir + USER_PTRS_PER_PGD, - (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); + if (PTRS_PER_PMD == 1) + return pgd; + else if (!pgd) + return NULL; + + for (i = 0; i < USER_PTRS_PER_PGD; ++i) { + pmd_t *pmd = kmem_cache_alloc(pmd_cache, SLAB_KERNEL); + if (!pmd) + goto out_oom; + set_pgd(pgd + i, __pgd(1 + __pa((unsigned long long)((unsigned long)pmd)))); } return pgd; + +out_oom: + for (i--; i >= 0; --i) + kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1)); + kmem_cache_free(pgd_cache, (void *)pgd); + return NULL; } void pgd_free(pgd_t *pgd) { - free_page((unsigned long)pgd); -} + int i; -#endif /* CONFIG_X86_PAE */ + if (PTRS_PER_PMD > 1) { + for (i = 0; i < USER_PTRS_PER_PGD; ++i) { + kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1)); + set_pgd(pgd + i, __pgd(0)); + } + } + kmem_cache_free(pgd_cache, (void *)pgd); +} diff -Nru a/arch/ia64/Kconfig b/arch/ia64/Kconfig --- a/arch/ia64/Kconfig Sun Feb 9 21:13:36 2003 +++ b/arch/ia64/Kconfig Sun Feb 9 21:13:36 2003 @@ -502,7 +502,7 @@ use this part of the kernel. You may say M here for module support and later load the module when - you have use for it; the module is called binfmt_misc.o. If you + you have use for it; the module is called binfmt_misc. If you don't know what to answer at this point, say Y. if !IA64_HP_SIM @@ -611,7 +611,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called ide.o. + will be called ide. For further information, please read . @@ -640,7 +640,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called scsi_mod.o. If you want to compile it as + The module will be called scsi_mod. If you want to compile it as a module, say M here and read and . However, do not compile this as a module if your root file system (the one containing the directory /) @@ -767,6 +767,9 @@ menu "Kernel hacking" + +config FSYS + bool "Light-weight system-call support (via epc)" choice prompt "Physical memory granularity" diff -Nru a/arch/ia64/Makefile b/arch/ia64/Makefile --- a/arch/ia64/Makefile Sun Feb 9 21:13:28 2003 +++ b/arch/ia64/Makefile Sun Feb 9 21:13:28 2003 @@ -5,7 +5,7 @@ # License. See the file "COPYING" in the main directory of this archive # for more details. # -# Copyright (C) 1998-2002 by David Mosberger-Tang +# Copyright (C) 1998-2003 by David Mosberger-Tang # NM := $(CROSS_COMPILE)nm -B @@ -23,6 +23,16 @@ GCC_VERSION=$(shell $(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.') +GAS_STATUS=$(shell arch/ia64/scripts/check-gas $(CC)) + +ifeq ($(GAS_STATUS),buggy) +$(error Sorry, you need a newer version of the assember, one that is built from \ + a source-tree that post-dates 18-Dec-2002. You can find a pre-compiled \ + static binary of such an assembler at: \ + \ + ftp://ftp.hpl.hp.com/pub/linux-ia64/gas-030124.tar.gz) +endif + ifneq ($(GCC_VERSION),2) cflags-y += -frename-registers --param max-inline-insns=5000 endif @@ -31,7 +41,7 @@ cflags-$(CONFIG_IA64_SGI_SN) += -DBRINGUP CFLAGS += $(cflags-y) -HEAD := arch/ia64/kernel/head.o arch/ia64/kernel/init_task.o +head-y := arch/ia64/kernel/head.o arch/ia64/kernel/init_task.o libs-y += arch/ia64/lib/ core-y += arch/ia64/kernel/ arch/ia64/mm/ @@ -48,26 +58,36 @@ drivers-$(CONFIG_IA64_HP_ZX1) += arch/ia64/hp/common/ arch/ia64/hp/zx1/ drivers-$(CONFIG_IA64_SGI_SN) += arch/ia64/sn/fakeprom/ -makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/ia64/boot $(1) -maketool =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/ia64/tools $(1) +boot := arch/ia64/boot +tools := arch/ia64/tools -.PHONY: boot compressed archclean archmrproper include/asm-ia64/offsets.h +.PHONY: boot compressed include/asm-ia64/offsets.h -all compressed: vmlinux.gz +all: vmlinux + +compressed: vmlinux.gz vmlinux.gz: vmlinux - $(call makeboot,vmlinux.gz) + $(Q)$(MAKE) $(build)=$(boot) vmlinux.gz + +check: vmlinux + arch/ia64/scripts/unwcheck.sh vmlinux -archmrproper: archclean: - $(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/ia64/boot + $(Q)$(MAKE) $(clean)=$(boot) + $(Q)$(MAKE) $(clean)=$(tools) CLEAN_FILES += include/asm-ia64/offsets.h vmlinux.gz bootloader prepare: include/asm-ia64/offsets.h boot: lib/lib.a vmlinux - $(call makeboot,$@) + $(Q)$(MAKE) $(build)=$(boot) $@ include/asm-ia64/offsets.h: include/asm include/linux/version.h include/config/MARKER - $(call maketool,$@) + $(Q)$(MAKE) $(build)=$(tools) $@ + +define archhelp + echo ' compressed - Build compressed kernel image' + echo ' boot - Build vmlinux and bootloader for Ski simulator' +endef diff -Nru a/arch/ia64/dig/setup.c b/arch/ia64/dig/setup.c --- a/arch/ia64/dig/setup.c Sun Feb 9 21:13:30 2003 +++ b/arch/ia64/dig/setup.c Sun Feb 9 21:13:30 2003 @@ -3,7 +3,7 @@ * * Copyright (C) 1999 Intel Corp. * Copyright (C) 1999, 2001 Hewlett-Packard Co - * Copyright (C) 1999, 2001 David Mosberger-Tang + * Copyright (C) 1999, 2001, 2003 David Mosberger-Tang * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond * Copyright (C) 1999 Vijay Chander @@ -56,7 +56,7 @@ if (!ia64_boot_param->console_info.num_rows || !ia64_boot_param->console_info.num_cols) { - printk("dig_setup: warning: invalid screen-info, guessing 80x25\n"); + printk(KERN_WARNING "dig_setup: warning: invalid screen-info, guessing 80x25\n"); orig_x = 0; orig_y = 0; num_cols = 80; diff -Nru a/arch/ia64/hp/common/Makefile b/arch/ia64/hp/common/Makefile --- a/arch/ia64/hp/common/Makefile Sun Feb 9 21:13:35 2003 +++ b/arch/ia64/hp/common/Makefile Sun Feb 9 21:13:35 2003 @@ -5,6 +5,4 @@ # Copyright (C) Alex Williamson (alex_williamson@hp.com) # -export-objs := sba_iommu.o - obj-y := sba_iommu.o diff -Nru a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c --- a/arch/ia64/hp/common/sba_iommu.c Sun Feb 9 21:13:29 2003 +++ b/arch/ia64/hp/common/sba_iommu.c Sun Feb 9 21:13:29 2003 @@ -288,20 +288,19 @@ unsigned long *rptr = (unsigned long *) &(ioc->res_map[(pide >>3) & ~(sizeof(unsigned long) - 1)]); uint rcnt; - /* printk(KERN_DEBUG "SBA: %s rp %p bit %d rval 0x%lx\n", */ - printk("SBA: %s rp %p bit %d rval 0x%lx\n", + printk(KERN_DEBUG "SBA: %s rp %p bit %d rval 0x%lx\n", msg, rptr, pide & (BITS_PER_LONG - 1), *rptr); rcnt = 0; while (rcnt < BITS_PER_LONG) { - printk("%s %2d %p %016Lx\n", - (rcnt == (pide & (BITS_PER_LONG - 1))) - ? " -->" : " ", - rcnt, ptr, *ptr ); + printk(KERN_DEBUG "%s %2d %p %016Lx\n", + (rcnt == (pide & (BITS_PER_LONG - 1))) + ? " -->" : " ", + rcnt, ptr, *ptr ); rcnt++; ptr++; } - printk("%s", msg); + printk(KERN_DEBUG "%s", msg); } @@ -363,11 +362,9 @@ sba_dump_sg(struct ioc *ioc, struct scatterlist *startsg, int nents) { while (nents-- > 0) { - printk(" %d : DMA %08lx/%05x CPU %p\n", - nents, - (unsigned long) sba_sg_iova(startsg), - sba_sg_iova_len(startsg), - sba_sg_address(startsg)); + printk(KERN_DEBUG " %d : DMA %08lx/%05x CPU %p\n", nents, + (unsigned long) sba_sg_iova(startsg), sba_sg_iova_len(startsg), + sba_sg_address(startsg)); startsg++; } } @@ -1451,9 +1448,10 @@ sba_dev->ioc[i].res_map; } else { u64 reserved_iov; - + /* Yet another 1.x hack */ - printk("zx1 1.x: Starting resource hint offset into IOV space to avoid initial zero value IOVA\n"); + printk(KERN_DEBUG "zx1 1.x: Starting resource hint offset into " + "IOV space to avoid initial zero value IOVA\n"); sba_dev->ioc[i].res_hint = (unsigned long *) &(sba_dev->ioc[i].res_map[L1_CACHE_BYTES]); @@ -1632,7 +1630,7 @@ device->slot_name, hpa); if ((hw_rev & 0xFF) < 0x20) { - printk("%s: SBA rev less than 2.0 not supported", DRIVER_NAME); + printk(KERN_INFO "%s: SBA rev less than 2.0 not supported", DRIVER_NAME); return; } diff -Nru a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c --- a/arch/ia64/hp/sim/simeth.c Sun Feb 9 21:13:33 2003 +++ b/arch/ia64/hp/sim/simeth.c Sun Feb 9 21:13:33 2003 @@ -1,7 +1,7 @@ /* * Simulated Ethernet Driver * - * Copyright (C) 1999-2001 Hewlett-Packard Co + * Copyright (C) 1999-2001, 2003 Hewlett-Packard Co * Stephane Eranian */ #include @@ -116,7 +116,7 @@ { int r; - printk("simeth: v%s\n", simeth_version); + printk(KERN_INFO "simeth: v%s\n", simeth_version); r = simeth_probe1(); @@ -235,7 +235,8 @@ /* Fill in the fields of the device structure with ethernet-generic values. */ ether_setup(dev); - printk("%s: hosteth=%s simfd=%d, HwAddr", dev->name, simeth_device, local->simfd); + printk(KERN_INFO "%s: hosteth=%s simfd=%d, HwAddr", + dev->name, simeth_device, local->simfd); for(i = 0; i < ETH_ALEN; i++) { printk(" %2.2x", dev->dev_addr[i]); } @@ -251,7 +252,7 @@ simeth_open(struct net_device *dev) { if (request_irq(dev->irq, simeth_interrupt, 0, "simeth", dev)) { - printk ("simeth: unable to get IRQ %d.\n", dev->irq); + printk(KERN_WARNING "simeth: unable to get IRQ %d.\n", dev->irq); return -EAGAIN; } @@ -312,11 +313,12 @@ if (strcmp(dev->name, ifa->ifa_label) == 0) break; } if ( ifa == NULL ) { - printk("simeth_open: can't find device %s's ifa\n", dev->name); + printk(KERN_ERR "simeth_open: can't find device %s's ifa\n", dev->name); return NOTIFY_DONE; } - printk("simeth_device_event: %s ipaddr=0x%x\n", dev->name, htonl(ifa->ifa_local)); + printk(KERN_INFO "simeth_device_event: %s ipaddr=0x%x\n", + dev->name, htonl(ifa->ifa_local)); /* * XXX Fix me @@ -330,7 +332,8 @@ netdev_attach(local->simfd, dev->irq, htonl(ifa->ifa_local)): netdev_detach(local->simfd); - printk("simeth: netdev_attach/detach: event=%s ->%d\n", event == NETDEV_UP ? "attach":"detach", r); + printk(KERN_INFO "simeth: netdev_attach/detach: event=%s ->%d\n", + event == NETDEV_UP ? "attach":"detach", r); return NOTIFY_DONE; } @@ -460,7 +463,8 @@ */ len = netdev_read(local->simfd, skb->data, SIMETH_FRAME_SIZE); if ( len == 0 ) { - if ( simeth_debug > 0 ) printk(KERN_WARNING "%s: count=%d netdev_read=0\n", dev->name, SIMETH_RECV_MAX-rcv_count); + if ( simeth_debug > 0 ) printk(KERN_WARNING "%s: count=%d netdev_read=0\n", + dev->name, SIMETH_RECV_MAX-rcv_count); break; } #if 0 diff -Nru a/arch/ia64/hp/sim/simscsi.c b/arch/ia64/hp/sim/simscsi.c --- a/arch/ia64/hp/sim/simscsi.c Sun Feb 9 21:13:31 2003 +++ b/arch/ia64/hp/sim/simscsi.c Sun Feb 9 21:13:31 2003 @@ -1,7 +1,7 @@ /* * Simulated SCSI driver. * - * Copyright (C) 1999, 2001-2002 Hewlett-Packard Co + * Copyright (C) 1999, 2001-2003 Hewlett-Packard Co * David Mosberger-Tang * Stephane Eranian * @@ -87,7 +87,8 @@ { /* XXX Fix me we may need to strcpy() ? */ if (strlen(s) > MAX_ROOT_LEN) { - printk("simscsi_setup: prefix too long---using default %s\n", simscsi_root); + printk(KERN_ERR "simscsi_setup: prefix too long---using default %s\n", + simscsi_root); } simscsi_root = s; return 1; @@ -354,7 +355,7 @@ break; case START_STOP: - printk("START_STOP\n"); + printk(KERN_ERR "START_STOP\n"); break; default: @@ -380,7 +381,7 @@ int simscsi_host_reset (Scsi_Cmnd *sc) { - printk ("simscsi_host_reset: not implemented\n"); + printk(KERN_ERR "simscsi_host_reset: not implemented\n"); return 0; } diff -Nru a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c --- a/arch/ia64/hp/sim/simserial.c Sun Feb 9 21:13:32 2003 +++ b/arch/ia64/hp/sim/simserial.c Sun Feb 9 21:13:32 2003 @@ -7,7 +7,7 @@ * case means sys_sim.c console (goes via the simulator). The code hereafter * is completely leveraged from the serial.c driver. * - * Copyright (C) 1999-2000, 2002 Hewlett-Packard Co + * Copyright (C) 1999-2000, 2002-2003 Hewlett-Packard Co * Stephane Eranian * David Mosberger-Tang * @@ -195,7 +195,7 @@ */ info = IRQ_ports[irq]; if (!info || !info->tty) { - printk("simrs_interrupt_single: info|tty=0 info=%p problem\n", info); + printk(KERN_INFO "simrs_interrupt_single: info|tty=0 info=%p problem\n", info); return; } /* @@ -219,13 +219,13 @@ static void do_serial_bh(void) { run_task_queue(&tq_serial); - printk("do_serial_bh: called\n"); + printk(KERN_ERR "do_serial_bh: called\n"); } #endif static void do_softint(void *private_) { - printk("simserial: do_softint called\n"); + printk(KERN_ERR "simserial: do_softint called\n"); } static void rs_put_char(struct tty_struct *tty, unsigned char ch) @@ -439,7 +439,7 @@ { if (I_IXOFF(tty)) rs_send_xchar(tty, STOP_CHAR(tty)); - printk("simrs_throttle called\n"); + printk(KERN_INFO "simrs_throttle called\n"); } static void rs_unthrottle(struct tty_struct * tty) @@ -452,7 +452,7 @@ else rs_send_xchar(tty, START_CHAR(tty)); } - printk("simrs_unthrottle called\n"); + printk(KERN_INFO "simrs_unthrottle called\n"); } /* @@ -474,29 +474,29 @@ switch (cmd) { case TIOCMGET: - printk("rs_ioctl: TIOCMGET called\n"); + printk(KERN_INFO "rs_ioctl: TIOCMGET called\n"); return -EINVAL; case TIOCMBIS: case TIOCMBIC: case TIOCMSET: - printk("rs_ioctl: TIOCMBIS/BIC/SET called\n"); + printk(KERN_INFO "rs_ioctl: TIOCMBIS/BIC/SET called\n"); return -EINVAL; case TIOCGSERIAL: - printk("simrs_ioctl TIOCGSERIAL called\n"); + printk(KERN_INFO "simrs_ioctl TIOCGSERIAL called\n"); return 0; case TIOCSSERIAL: - printk("simrs_ioctl TIOCSSERIAL called\n"); + printk(KERN_INFO "simrs_ioctl TIOCSSERIAL called\n"); return 0; case TIOCSERCONFIG: - printk("rs_ioctl: TIOCSERCONFIG called\n"); + printk(KERN_INFO "rs_ioctl: TIOCSERCONFIG called\n"); return -EINVAL; case TIOCSERGETLSR: /* Get line status register */ - printk("rs_ioctl: TIOCSERGETLSR called\n"); + printk(KERN_INFO "rs_ioctl: TIOCSERGETLSR called\n"); return -EINVAL; case TIOCSERGSTRUCT: - printk("rs_ioctl: TIOCSERGSTRUCT called\n"); + printk(KERN_INFO "rs_ioctl: TIOCSERGSTRUCT called\n"); #if 0 if (copy_to_user((struct async_struct *) arg, info, sizeof(struct async_struct))) @@ -511,7 +511,7 @@ * Caller should use TIOCGICOUNT to see which one it was */ case TIOCMIWAIT: - printk("rs_ioctl: TIOCMIWAIT: called\n"); + printk(KERN_INFO "rs_ioctl: TIOCMIWAIT: called\n"); return 0; /* * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) @@ -520,13 +520,13 @@ * RI where only 0->1 is counted. */ case TIOCGICOUNT: - printk("rs_ioctl: TIOCGICOUNT called\n"); + printk(KERN_INFO "rs_ioctl: TIOCGICOUNT called\n"); return 0; case TIOCSERGWILD: case TIOCSERSWILD: /* "setserial -W" is called in Debian boot */ - printk ("TIOCSER?WILD ioctl obsolete, ignored.\n"); + printk (KERN_INFO "TIOCSER?WILD ioctl obsolete, ignored.\n"); return 0; default: @@ -596,7 +596,7 @@ IRQ_T(info), "serial", NULL); if (retval) - printk("serial shutdown: request_irq: error %d" + printk(KERN_ERR "serial shutdown: request_irq: error %d" " Couldn't reacquire IRQ.\n", retval); } else free_irq(state->irq, NULL); @@ -654,12 +654,12 @@ * one, we've got real problems, since it means the * serial port won't be shutdown. */ - printk("rs_close: bad serial port count; tty->count is 1, " + printk(KERN_ERR "rs_close: bad serial port count; tty->count is 1, " "state->count is %d\n", state->count); state->count = 1; } if (--state->count < 0) { - printk("rs_close: bad serial port count for ttys%d: %d\n", + printk(KERN_ERR "rs_close: bad serial port count for ttys%d: %d\n", info->line, state->count); state->count = 0; } @@ -1013,7 +1013,7 @@ static inline void show_serial_version(void) { printk(KERN_INFO "%s version %s with", serial_name, serial_version); - printk(" no serial options enabled\n"); + printk(KERN_INFO " no serial options enabled\n"); } /* diff -Nru a/arch/ia64/hp/zx1/hpzx1_misc.c b/arch/ia64/hp/zx1/hpzx1_misc.c --- a/arch/ia64/hp/zx1/hpzx1_misc.c Sun Feb 9 21:13:31 2003 +++ b/arch/ia64/hp/zx1/hpzx1_misc.c Sun Feb 9 21:13:31 2003 @@ -1,9 +1,9 @@ /* * Misc. support for HP zx1 chipset support * - * Copyright (C) 2002 Hewlett-Packard Co - * Copyright (C) 2002 Alex Williamson - * Copyright (C) 2002 Bjorn Helgaas + * Copyright (C) 2002-2003 Hewlett-Packard Co + * Alex Williamson + * Bjorn Helgaas */ @@ -17,7 +17,7 @@ #include #include -extern acpi_status acpi_evaluate_integer (acpi_handle, acpi_string, acpi_object_list *, +extern acpi_status acpi_evaluate_integer (acpi_handle, acpi_string, struct acpi_object_list *, unsigned long *); #define PFX "hpzx1: " @@ -190,31 +190,31 @@ hpzx1_devices++; } -typedef struct { +struct acpi_hp_vendor_long { u8 guid_id; u8 guid[16]; u8 csr_base[8]; u8 csr_length[8]; -} acpi_hp_vendor_long; +}; #define HP_CCSR_LENGTH 0x21 #define HP_CCSR_TYPE 0x2 #define HP_CCSR_GUID EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, \ 0xf6, 0x4a, 0x24, 0xd2, 0x01, 0x37, 0x0e, 0xad) -extern acpi_status acpi_get_crs(acpi_handle, acpi_buffer *); -extern acpi_resource *acpi_get_crs_next(acpi_buffer *, int *); -extern acpi_resource_data *acpi_get_crs_type(acpi_buffer *, int *, int); -extern void acpi_dispose_crs(acpi_buffer *); +extern acpi_status acpi_get_crs(acpi_handle, struct acpi_buffer *); +extern struct acpi_resource *acpi_get_crs_next(struct acpi_buffer *, int *); +extern union acpi_resource_data *acpi_get_crs_type(struct acpi_buffer *, int *, int); +extern void acpi_dispose_crs(struct acpi_buffer *); static acpi_status hp_csr_space(acpi_handle obj, u64 *csr_base, u64 *csr_length) { int i, offset = 0; acpi_status status; - acpi_buffer buf; - acpi_resource_vendor *res; - acpi_hp_vendor_long *hp_res; + struct acpi_buffer buf; + struct acpi_resource_vendor *res; + struct acpi_hp_vendor_long *hp_res; efi_guid_t vendor_guid; *csr_base = 0; @@ -226,14 +226,14 @@ return status; } - res = (acpi_resource_vendor *)acpi_get_crs_type(&buf, &offset, ACPI_RSTYPE_VENDOR); + res = (struct acpi_resource_vendor *)acpi_get_crs_type(&buf, &offset, ACPI_RSTYPE_VENDOR); if (!res) { printk(KERN_ERR PFX "Failed to find config space for device\n"); acpi_dispose_crs(&buf); return AE_NOT_FOUND; } - hp_res = (acpi_hp_vendor_long *)(res->reserved); + hp_res = (struct acpi_hp_vendor_long *)(res->reserved); if (res->length != HP_CCSR_LENGTH || hp_res->guid_id != HP_CCSR_TYPE) { printk(KERN_ERR PFX "Unknown Vendor data\n"); @@ -288,7 +288,7 @@ { u64 csr_base = 0, csr_length = 0; acpi_status status; - NATIVE_UINT busnum; + acpi_native_uint busnum; char *name = context; char fullname[32]; diff -Nru a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c --- a/arch/ia64/ia32/binfmt_elf32.c Sun Feb 9 21:13:36 2003 +++ b/arch/ia64/ia32/binfmt_elf32.c Sun Feb 9 21:13:36 2003 @@ -44,7 +44,6 @@ static void elf32_set_personality (void); -#define ELF_PLAT_INIT(_r) ia64_elf32_init(_r) #define setup_arg_pages(bprm) ia32_setup_arg_pages(bprm) #define elf_map elf32_map diff -Nru a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S --- a/arch/ia64/ia32/ia32_entry.S Sun Feb 9 21:13:32 2003 +++ b/arch/ia64/ia32/ia32_entry.S Sun Feb 9 21:13:32 2003 @@ -95,12 +95,19 @@ GLOBAL_ENTRY(ia32_ret_from_clone) PT_REGS_UNWIND_INFO(0) #if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT) +{ /* + * Some versions of gas generate bad unwind info if the first instruction of a + * procedure doesn't go into the first slot of a bundle. This is a workaround. + */ + nop.m 0 + nop.i 0 /* * We need to call schedule_tail() to complete the scheduling process. * Called by ia64_switch_to after do_fork()->copy_thread(). r8 contains the * address of the previously executing task. */ br.call.sptk.many rp=ia64_invoke_schedule_tail +} .ret1: #endif adds r2=TI_FLAGS+IA64_TASK_SIZE,r13 @@ -264,7 +271,7 @@ data8 sys_setreuid /* 16-bit version */ /* 70 */ data8 sys_setregid /* 16-bit version */ data8 sys32_sigsuspend - data8 sys32_sigpending + data8 compat_sys_sigpending data8 sys_sethostname data8 sys32_setrlimit /* 75 */ data8 sys32_old_getrlimit @@ -290,8 +297,8 @@ data8 sys_getpriority data8 sys_setpriority data8 sys32_ni_syscall /* old profil syscall holder */ - data8 sys32_statfs - data8 sys32_fstatfs /* 100 */ + data8 compat_sys_statfs + data8 compat_sys_fstatfs /* 100 */ data8 sys32_ioperm data8 sys32_socketcall data8 sys_syslog @@ -317,7 +324,7 @@ data8 sys32_modify_ldt data8 sys32_ni_syscall /* adjtimex */ data8 sys32_mprotect /* 125 */ - data8 sys32_sigprocmask + data8 compat_sys_sigprocmask data8 sys32_ni_syscall /* create_module */ data8 sys32_ni_syscall /* init_module */ data8 sys32_ni_syscall /* delete_module */ diff -Nru a/arch/ia64/ia32/ia32_ioctl.c b/arch/ia64/ia32/ia32_ioctl.c --- a/arch/ia64/ia32/ia32_ioctl.c Sun Feb 9 21:13:34 2003 +++ b/arch/ia64/ia32/ia32_ioctl.c Sun Feb 9 21:13:34 2003 @@ -510,6 +510,6 @@ return(sg_ioctl_trans(fd, cmd, arg)); } - printk("%x:unimplemented IA32 ioctl system call\n", cmd); + printk(KERN_ERR "%x:unimplemented IA32 ioctl system call\n", cmd); return -EINVAL; } diff -Nru a/arch/ia64/ia32/ia32_signal.c b/arch/ia64/ia32/ia32_signal.c --- a/arch/ia64/ia32/ia32_signal.c Sun Feb 9 21:13:28 2003 +++ b/arch/ia64/ia32/ia32_signal.c Sun Feb 9 21:13:28 2003 @@ -56,7 +56,7 @@ int sig; struct sigcontext_ia32 sc; struct _fpstate_ia32 fpstate; - unsigned int extramask[_IA32_NSIG_WORDS-1]; + unsigned int extramask[_COMPAT_NSIG_WORDS-1]; char retcode[8]; }; @@ -463,7 +463,7 @@ } asmlinkage long -ia32_rt_sigsuspend (sigset32_t *uset, unsigned int sigsetsize, struct sigscratch *scr) +ia32_rt_sigsuspend (compat_sigset_t *uset, unsigned int sigsetsize, struct sigscratch *scr) { extern long ia64_do_signal (sigset_t *oldset, struct sigscratch *scr, long in_syscall); sigset_t oldset, set; @@ -479,13 +479,13 @@ sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); { oldset = current->blocked; current->blocked = set; recalc_sigpending(); } - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); /* * The return below usually returns to the signal handler. We need to pre-set the @@ -504,7 +504,7 @@ asmlinkage long ia32_sigsuspend (unsigned int mask, struct sigscratch *scr) { - return ia32_rt_sigsuspend((sigset32_t *)&mask, sizeof(mask), scr); + return ia32_rt_sigsuspend((compat_sigset_t *)&mask, sizeof(mask), scr); } asmlinkage long @@ -530,14 +530,14 @@ int ret; /* XXX: Don't preclude handling different sized sigset_t's. */ - if (sigsetsize != sizeof(sigset32_t)) + if (sigsetsize != sizeof(compat_sigset_t)) return -EINVAL; if (act) { ret = get_user(handler, &act->sa_handler); ret |= get_user(new_ka.sa.sa_flags, &act->sa_flags); ret |= get_user(restorer, &act->sa_restorer); - ret |= copy_from_user(&new_ka.sa.sa_mask, &act->sa_mask, sizeof(sigset32_t)); + ret |= copy_from_user(&new_ka.sa.sa_mask, &act->sa_mask, sizeof(compat_sigset_t)); if (ret) return -EFAULT; @@ -550,7 +550,7 @@ ret = put_user(IA32_SA_HANDLER(&old_ka), &oact->sa_handler); ret |= put_user(old_ka.sa.sa_flags, &oact->sa_flags); ret |= put_user(IA32_SA_RESTORER(&old_ka), &oact->sa_restorer); - ret |= copy_to_user(&oact->sa_mask, &old_ka.sa.sa_mask, sizeof(sigset32_t)); + ret |= copy_to_user(&oact->sa_mask, &old_ka.sa.sa_mask, sizeof(compat_sigset_t)); } return ret; } @@ -560,7 +560,7 @@ size_t sigsetsize); asmlinkage long -sys32_rt_sigprocmask (int how, sigset32_t *set, sigset32_t *oset, unsigned int sigsetsize) +sys32_rt_sigprocmask (int how, compat_sigset_t *set, compat_sigset_t *oset, unsigned int sigsetsize) { mm_segment_t old_fs = get_fs(); sigset_t s; @@ -587,13 +587,7 @@ } asmlinkage long -sys32_sigprocmask (int how, unsigned int *set, unsigned int *oset) -{ - return sys32_rt_sigprocmask(how, (sigset32_t *) set, (sigset32_t *) oset, sizeof(*set)); -} - -asmlinkage long -sys32_rt_sigtimedwait (sigset32_t *uthese, siginfo_t32 *uinfo, +sys32_rt_sigtimedwait (compat_sigset_t *uthese, siginfo_t32 *uinfo, struct compat_timespec *uts, unsigned int sigsetsize) { extern asmlinkage long sys_rt_sigtimedwait (const sigset_t *, siginfo_t *, @@ -605,16 +599,13 @@ sigset_t s; int ret; - if (copy_from_user(&s.sig, uthese, sizeof(sigset32_t))) + if (copy_from_user(&s.sig, uthese, sizeof(compat_sigset_t))) + return -EFAULT; + if (uts && get_compat_timespec(&t, uts)) return -EFAULT; - if (uts) { - ret = get_user(t.tv_sec, &uts->tv_sec); - ret |= get_user(t.tv_nsec, &uts->tv_nsec); - if (ret) - return -EFAULT; - } set_fs(KERNEL_DS); - ret = sys_rt_sigtimedwait(&s, &info, &t, sigsetsize); + ret = sys_rt_sigtimedwait(&s, uinfo ? &info : NULL, uts ? &t : NULL, + sigsetsize); set_fs(old_fs); if (ret >= 0 && uinfo) { if (copy_siginfo_to_user32(uinfo, &info)) @@ -648,7 +639,7 @@ int ret; if (act) { - old_sigset32_t mask; + compat_old_sigset_t mask; ret = get_user(handler, &act->sa_handler); ret |= get_user(new_ka.sa.sa_flags, &act->sa_flags); @@ -866,7 +857,7 @@ err |= setup_sigcontext_ia32(&frame->sc, &frame->fpstate, regs, set->sig[0]); - if (_IA32_NSIG_WORDS > 1) + if (_COMPAT_NSIG_WORDS > 1) err |= __copy_to_user(frame->extramask, (char *) &set->sig + 4, sizeof(frame->extramask)); @@ -1011,15 +1002,15 @@ goto badframe; if (__get_user(set.sig[0], &frame->sc.oldmask) - || (_IA32_NSIG_WORDS > 1 && __copy_from_user((char *) &set.sig + 4, &frame->extramask, + || (_COMPAT_NSIG_WORDS > 1 && __copy_from_user((char *) &set.sig + 4, &frame->extramask, sizeof(frame->extramask)))) goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = (sigset_t) set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext_ia32(regs, &frame->sc, &eax)) goto badframe; @@ -1047,10 +1038,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext_ia32(regs, &frame->uc.uc_mcontext, &eax)) goto badframe; diff -Nru a/arch/ia64/ia32/ia32_support.c b/arch/ia64/ia32/ia32_support.c --- a/arch/ia64/ia32/ia32_support.c Sun Feb 9 21:13:28 2003 +++ b/arch/ia64/ia32/ia32_support.c Sun Feb 9 21:13:28 2003 @@ -95,8 +95,6 @@ struct pt_regs *regs = ia64_task_regs(t); int nr = smp_processor_id(); /* LDT and TSS depend on CPU number: */ - nr = smp_processor_id(); - eflag = t->thread.eflag; fsr = t->thread.fsr; fcr = t->thread.fcr; diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c --- a/arch/ia64/ia32/sys_ia32.c Sun Feb 9 21:13:33 2003 +++ b/arch/ia64/ia32/sys_ia32.c Sun Feb 9 21:13:33 2003 @@ -6,7 +6,7 @@ * Copyright (C) 1999 Arun Sharma * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) - * Copyright (C) 2000-2002 Hewlett-Packard Co + * Copyright (C) 2000-2003 Hewlett-Packard Co * David Mosberger-Tang * * These routines maintain argument size conversion between 32bit and 64bit @@ -609,61 +609,6 @@ return retval; } -static inline int -put_statfs (struct statfs32 *ubuf, struct statfs *kbuf) -{ - int err; - - if (!access_ok(VERIFY_WRITE, ubuf, sizeof(*ubuf))) - return -EFAULT; - - err = __put_user(kbuf->f_type, &ubuf->f_type); - err |= __put_user(kbuf->f_bsize, &ubuf->f_bsize); - err |= __put_user(kbuf->f_blocks, &ubuf->f_blocks); - err |= __put_user(kbuf->f_bfree, &ubuf->f_bfree); - err |= __put_user(kbuf->f_bavail, &ubuf->f_bavail); - err |= __put_user(kbuf->f_files, &ubuf->f_files); - err |= __put_user(kbuf->f_ffree, &ubuf->f_ffree); - err |= __put_user(kbuf->f_namelen, &ubuf->f_namelen); - err |= __put_user(kbuf->f_fsid.val[0], &ubuf->f_fsid.val[0]); - err |= __put_user(kbuf->f_fsid.val[1], &ubuf->f_fsid.val[1]); - return err; -} - -extern asmlinkage long sys_statfs(const char * path, struct statfs * buf); - -asmlinkage long -sys32_statfs (const char *path, struct statfs32 *buf) -{ - int ret; - struct statfs s; - mm_segment_t old_fs = get_fs(); - - set_fs(KERNEL_DS); - ret = sys_statfs(path, &s); - set_fs(old_fs); - if (put_statfs(buf, &s)) - return -EFAULT; - return ret; -} - -extern asmlinkage long sys_fstatfs(unsigned int fd, struct statfs * buf); - -asmlinkage long -sys32_fstatfs (unsigned int fd, struct statfs32 *buf) -{ - int ret; - struct statfs s; - mm_segment_t old_fs = get_fs(); - - set_fs(KERNEL_DS); - ret = sys_fstatfs(fd, &s); - set_fs(old_fs); - if (put_statfs(buf, &s)) - return -EFAULT; - return ret; -} - static inline long get_tv32 (struct timeval *o, struct compat_timeval *i) { @@ -1849,10 +1794,10 @@ struct ipc64_perm32 { key_t key; - __kernel_uid32_t32 uid; - __kernel_gid32_t32 gid; - __kernel_uid32_t32 cuid; - __kernel_gid32_t32 cgid; + compat_uid32_t uid; + compat_gid32_t gid; + compat_uid32_t cuid; + compat_gid32_t cgid; compat_mode_t mode; unsigned short __pad1; unsigned short seq; @@ -1895,8 +1840,8 @@ unsigned short msg_cbytes; unsigned short msg_qnum; unsigned short msg_qbytes; - __kernel_ipc_pid_t32 msg_lspid; - __kernel_ipc_pid_t32 msg_lrpid; + compat_ipc_pid_t msg_lspid; + compat_ipc_pid_t msg_lrpid; }; struct msqid64_ds32 { @@ -1922,8 +1867,8 @@ compat_time_t shm_atime; compat_time_t shm_dtime; compat_time_t shm_ctime; - __kernel_ipc_pid_t32 shm_cpid; - __kernel_ipc_pid_t32 shm_lpid; + compat_ipc_pid_t shm_cpid; + compat_ipc_pid_t shm_lpid; unsigned short shm_nattch; }; @@ -2011,6 +1956,10 @@ else fourth.__pad = (void *)A(pad); switch (third) { + default: + err = -EINVAL; + break; + case IPC_INFO: case IPC_RMID: case IPC_SET: @@ -2399,7 +2348,7 @@ static long semtimedop32(int semid, struct sembuf *tsems, int nsems, - const struct timespec32 *timeout32) + const struct compat_timespec *timeout32) { struct timespec t; if (get_user (t.tv_sec, &timeout32->tv_sec) || @@ -2422,7 +2371,7 @@ return sys_semtimedop(first, (struct sembuf *)AA(ptr), second, NULL); case SEMTIMEDOP: return semtimedop32(first, (struct sembuf *)AA(ptr), second, - (const struct timespec32 *)AA(fifth)); + (const struct compat_timespec *)AA(fifth)); case SEMGET: return sys_semget(first, second, third); case SEMCTL: @@ -3475,12 +3424,6 @@ return ret; } -asmlinkage long -sys32_sigpending (unsigned int *set) -{ - return do_sigpending(set, sizeof(*set)); -} - struct sysinfo32 { s32 uptime; u32 loads[3]; @@ -3536,7 +3479,7 @@ set_fs(KERNEL_DS); ret = sys_sched_rr_get_interval(pid, &t); set_fs(old_fs); - if (put_user (t.tv_sec, &interval->tv_sec) || put_user (t.tv_nsec, &interval->tv_nsec)) + if (put_compat_timespec(&t, interval)) return -EFAULT; return ret; } diff -Nru a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile --- a/arch/ia64/kernel/Makefile Sun Feb 9 21:13:37 2003 +++ b/arch/ia64/kernel/Makefile Sun Feb 9 21:13:37 2003 @@ -4,14 +4,13 @@ EXTRA_TARGETS := head.o init_task.o -export-objs := ia64_ksyms.o - obj-y := acpi.o entry.o gate.o efi.o efi_stub.o ia64_ksyms.o \ irq.o irq_ia64.o irq_lsapic.o ivt.o \ machvec.o pal.o process.o perfmon.o ptrace.o sal.o \ semaphore.o setup.o \ signal.o sys_ia64.o traps.o time.o unaligned.o unwind.o +obj-$(CONFIG_FSYS) += fsys.o obj-$(CONFIG_IOSAPIC) += iosapic.o obj-$(CONFIG_IA64_PALINFO) += palinfo.o obj-$(CONFIG_EFI_VARS) += efivars.o diff -Nru a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c --- a/arch/ia64/kernel/acpi.c Sun Feb 9 21:13:32 2003 +++ b/arch/ia64/kernel/acpi.c Sun Feb 9 21:13:32 2003 @@ -3,7 +3,7 @@ * * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999,2000 Walt Drummond - * Copyright (C) 2000, 2002 Hewlett-Packard Co. + * Copyright (C) 2000, 2002-2003 Hewlett-Packard Co. * David Mosberger-Tang * Copyright (C) 2000 Intel Corp. * Copyright (C) 2000,2001 J.I. Lee @@ -75,20 +75,20 @@ rsdp_phys = acpi_find_rsdp(); if (!rsdp_phys) { - printk("ACPI 2.0 RSDP not found, default to \"dig\"\n"); + printk(KERN_ERR "ACPI 2.0 RSDP not found, default to \"dig\"\n"); return "dig"; } rsdp = (struct acpi20_table_rsdp *) __va(rsdp_phys); if (strncmp(rsdp->signature, RSDP_SIG, sizeof(RSDP_SIG) - 1)) { - printk("ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n"); + printk(KERN_ERR "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n"); return "dig"; } xsdt = (struct acpi_table_xsdt *) __va(rsdp->xsdt_address); hdr = &xsdt->header; if (strncmp(hdr->signature, XSDT_SIG, sizeof(XSDT_SIG) - 1)) { - printk("ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n"); + printk(KERN_ERR "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n"); return "dig"; } @@ -128,7 +128,7 @@ * with a list of acpi_resource structures. */ acpi_status -acpi_get_crs (acpi_handle obj, acpi_buffer *buf) +acpi_get_crs (acpi_handle obj, struct acpi_buffer *buf) { acpi_status result; buf->length = 0; @@ -144,10 +144,10 @@ return acpi_get_current_resources(obj, buf); } -acpi_resource * -acpi_get_crs_next (acpi_buffer *buf, int *offset) +struct acpi_resource * +acpi_get_crs_next (struct acpi_buffer *buf, int *offset) { - acpi_resource *res; + struct acpi_resource *res; if (*offset >= buf->length) return NULL; @@ -157,11 +157,11 @@ return res; } -acpi_resource_data * -acpi_get_crs_type (acpi_buffer *buf, int *offset, int type) +union acpi_resource_data * +acpi_get_crs_type (struct acpi_buffer *buf, int *offset, int type) { for (;;) { - acpi_resource *res = acpi_get_crs_next(buf, offset); + struct acpi_resource *res = acpi_get_crs_next(buf, offset); if (!res) return NULL; if (res->id == type) @@ -170,7 +170,7 @@ } void -acpi_dispose_crs (acpi_buffer *buf) +acpi_dispose_crs (struct acpi_buffer *buf) { kfree(buf->pointer); } @@ -199,7 +199,7 @@ /* correctable platform error interrupt */ vector = platform_intr_list[int_type]; } else - printk("acpi_request_vector(): invalid interrupt type\n"); + printk(KERN_ERR "acpi_request_vector(): invalid interrupt type\n"); return vector; } @@ -249,7 +249,7 @@ acpi_table_print_madt_entry(header); - printk("CPU %d (0x%04x)", total_cpus, (lsapic->id << 8) | lsapic->eid); + printk(KERN_INFO "CPU %d (0x%04x)", total_cpus, (lsapic->id << 8) | lsapic->eid); if (lsapic->flags.enabled) { available_cpus++; @@ -478,8 +478,8 @@ len = sizeof(struct acpi_table_header) + 8 + slit->localities * slit->localities; if (slit->header.length != len) { - printk("ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n", - len, slit->header.length); + printk(KERN_ERR "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n", + len, slit->header.length); memset(numa_slit, 10, sizeof(numa_slit)); return; } @@ -514,8 +514,8 @@ size = (size << 32) | ma->length_lo; if (num_memblks >= NR_MEMBLKS) { - printk("Too many mem chunks in SRAT. Ignoring %ld MBytes at %lx\n", - size/(1024*1024), paddr); + printk(KERN_ERR "Too many mem chunks in SRAT. Ignoring %ld MBytes at %lx\n", + size/(1024*1024), paddr); return; } @@ -545,8 +545,8 @@ if (min_hole_size) { if (min_hole_size > size) { - printk("Too huge memory hole. Ignoring %ld MBytes at %lx\n", - size/(1024*1024), paddr); + printk(KERN_ERR "Too huge memory hole. Ignoring %ld MBytes at %lx\n", + size/(1024*1024), paddr); return; } } @@ -605,8 +605,8 @@ for (i = 0; i < srat_num_cpus; i++) node_cpuid[i].nid = pxm_to_nid_map[node_cpuid[i].nid]; - printk("Number of logical nodes in system = %d\n", numnodes); - printk("Number of memory chunks in system = %d\n", num_memblks); + printk(KERN_INFO "Number of logical nodes in system = %d\n", numnodes); + printk(KERN_INFO "Number of memory chunks in system = %d\n", num_memblks); if (!slit_table) return; memset(numa_slit, -1, sizeof(numa_slit)); @@ -638,7 +638,7 @@ acpi_parse_fadt (unsigned long phys_addr, unsigned long size) { struct acpi_table_header *fadt_header; - fadt_descriptor_rev2 *fadt; + struct fadt_descriptor_rev2 *fadt; u32 sci_irq, gsi_base; char *iosapic_address; @@ -649,7 +649,7 @@ if (fadt_header->revision != 3) return -ENODEV; /* Only deal with ACPI 2.0 FADT */ - fadt = (fadt_descriptor_rev2 *) fadt_header; + fadt = (struct fadt_descriptor_rev2 *) fadt_header; if (!(fadt->iapc_boot_arch & BAF_8042_KEYBOARD_CONTROLLER)) acpi_kbd_controller_present = 0; @@ -806,7 +806,7 @@ #ifdef CONFIG_SMP if (available_cpus == 0) { - printk("ACPI: Found 0 CPUS; assuming 1\n"); + printk(KERN_INFO "ACPI: Found 0 CPUS; assuming 1\n"); available_cpus = 1; /* We've got at least one of these, no? */ } smp_boot_data.cpu_count = total_cpus; @@ -817,7 +817,7 @@ #endif #endif /* Make boot-up look pretty */ - printk("%d CPUs available, %d CPUs total\n", available_cpus, total_cpus); + printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus); return 0; } @@ -886,6 +886,28 @@ return isa_irq_to_vector(irq); return gsi_to_vector(irq); +} + +int __init +acpi_register_irq (u32 gsi, u32 polarity, u32 trigger) +{ + int vector = 0; + u32 irq_base; + char *iosapic_address; + + if (acpi_madt->flags.pcat_compat && (gsi < 16)) + return isa_irq_to_vector(gsi); + + if (!iosapic_register_intr) + return 0; + + /* Find the IOSAPIC */ + if (!acpi_find_iosapic(gsi, &irq_base, &iosapic_address)) { + /* Turn it on */ + vector = iosapic_register_intr (gsi, polarity, trigger, + irq_base, iosapic_address); + } + return vector; } #endif /* CONFIG_ACPI_BOOT */ diff -Nru a/arch/ia64/kernel/brl_emu.c b/arch/ia64/kernel/brl_emu.c --- a/arch/ia64/kernel/brl_emu.c Sun Feb 9 21:13:35 2003 +++ b/arch/ia64/kernel/brl_emu.c Sun Feb 9 21:13:35 2003 @@ -195,7 +195,7 @@ /* * The target address contains unimplemented bits. */ - printk("Woah! Unimplemented Instruction Address Trap!\n"); + printk(KERN_DEBUG "Woah! Unimplemented Instruction Address Trap!\n"); siginfo.si_signo = SIGILL; siginfo.si_errno = 0; siginfo.si_flags = 0; diff -Nru a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c --- a/arch/ia64/kernel/efi.c Sun Feb 9 21:13:28 2003 +++ b/arch/ia64/kernel/efi.c Sun Feb 9 21:13:28 2003 @@ -5,7 +5,7 @@ * * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond - * Copyright (C) 1999-2002 Hewlett-Packard Co. + * Copyright (C) 1999-2003 Hewlett-Packard Co. * David Mosberger-Tang * Stephane Eranian * @@ -33,15 +33,6 @@ #define EFI_DEBUG 0 -#ifdef CONFIG_HUGETLB_PAGE - -/* By default at total of 512MB is reserved huge pages. */ -#define HTLBZONE_SIZE_DEFAULT 0x20000000 - -unsigned long htlbzone_pages = (HTLBZONE_SIZE_DEFAULT >> HPAGE_SHIFT); - -#endif - extern efi_status_t efi_call_phys (void *, ...); struct efi efi; @@ -374,7 +365,7 @@ prev_valid = 1; } else { if (curr.start < prev.start) - printk("Oops: EFI memory table not ordered!\n"); + printk(KERN_ERR "Oops: EFI memory table not ordered!\n"); if (prev.end == curr.start) { /* merge two consecutive memory ranges */ @@ -446,7 +437,8 @@ * dedicated ITR for the PAL code. */ if ((vaddr & mask) == (KERNEL_START & mask)) { - printk("%s: no need to install ITR for PAL code\n", __FUNCTION__); + printk(KERN_INFO "%s: no need to install ITR for PAL code\n", + __FUNCTION__); continue; } @@ -454,7 +446,7 @@ panic("Woah! PAL code size bigger than a granule!"); mask = ~((1 << IA64_GRANULE_SHIFT) - 1); - printk("CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n", + printk(KERN_INFO "CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n", smp_processor_id(), md->phys_addr, md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE); @@ -497,27 +489,8 @@ ++cp; } } -#ifdef CONFIG_HUGETLB_PAGE - /* Just duplicating the above algo for lpzone start */ - for (cp = saved_command_line; *cp; ) { - if (memcmp(cp, "lpmem=", 6) == 0) { - cp += 6; - htlbzone_pages = memparse(cp, &end); - htlbzone_pages = (htlbzone_pages >> HPAGE_SHIFT); - if (end != cp) - break; - cp = end; - } else { - while (*cp != ' ' && *cp) - ++cp; - while (*cp == ' ') - ++cp; - } - } - printk("Total HugeTLB_Page memory pages requested 0x%lx \n", htlbzone_pages); -#endif if (mem_limit != ~0UL) - printk("Ignoring memory above %luMB\n", mem_limit >> 20); + printk(KERN_INFO "Ignoring memory above %luMB\n", mem_limit >> 20); efi.systab = __va(ia64_boot_param->efi_systab); @@ -529,7 +502,7 @@ if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) panic("Woah! EFI system table signature incorrect\n"); if ((efi.systab->hdr.revision ^ EFI_SYSTEM_TABLE_REVISION) >> 16 != 0) - printk("Warning: EFI system table major version mismatch: " + printk(KERN_WARNING "Warning: EFI system table major version mismatch: " "got %d.%02d, expected %d.%02d\n", efi.systab->hdr.revision >> 16, efi.systab->hdr.revision & 0xffff, EFI_SYSTEM_TABLE_REVISION >> 16, EFI_SYSTEM_TABLE_REVISION & 0xffff); @@ -544,7 +517,7 @@ vendor[i] = '\0'; } - printk("EFI v%u.%.02u by %s:", + printk(KERN_INFO "EFI v%u.%.02u by %s:", efi.systab->hdr.revision >> 16, efi.systab->hdr.revision & 0xffff, vendor); for (i = 0; i < efi.systab->nr_tables; i++) { @@ -636,7 +609,7 @@ | _PAGE_PL_0 | _PAGE_AR_RW)); #else - printk("EFI_MEMORY_WC mapping\n"); + printk(KERN_INFO "EFI_MEMORY_WC mapping\n"); md->virt_addr = (u64) ioremap(md->phys_addr, 0); #endif } else if (md->attribute & EFI_MEMORY_WT) { @@ -646,7 +619,7 @@ | _PAGE_PL_0 | _PAGE_AR_RW)); #else - printk("EFI_MEMORY_WT mapping\n"); + printk(KERN_INFO "EFI_MEMORY_WT mapping\n"); md->virt_addr = (u64) ioremap(md->phys_addr, 0); #endif } @@ -658,7 +631,8 @@ efi_desc_size, ia64_boot_param->efi_memdesc_version, ia64_boot_param->efi_memmap); if (status != EFI_SUCCESS) { - printk("Warning: unable to switch EFI into virtual mode (status=%lu)\n", status); + printk(KERN_WARNING "warning: unable to switch EFI into virtual mode " + "(status=%lu)\n", status); return; } diff -Nru a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S --- a/arch/ia64/kernel/entry.S Sun Feb 9 21:13:30 2003 +++ b/arch/ia64/kernel/entry.S Sun Feb 9 21:13:30 2003 @@ -3,7 +3,7 @@ * * Kernel entry points. * - * Copyright (C) 1998-2002 Hewlett-Packard Co + * Copyright (C) 1998-2003 Hewlett-Packard Co * David Mosberger-Tang * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond @@ -22,8 +22,8 @@ /* * Global (preserved) predicate usage on syscall entry/exit path: * - * pKern: See entry.h. - * pUser: See entry.h. + * pKStk: See entry.h. + * pUStk: See entry.h. * pSys: See entry.h. * pNonSys: !pSys */ @@ -63,7 +63,7 @@ sxt4 r8=r8 // return 64-bit result ;; stf.spill [sp]=f0 -(p6) cmp.ne pKern,pUser=r0,r0 // a successful execve() lands us in user-mode... +(p6) cmp.ne pKStk,pUStk=r0,r0 // a successful execve() lands us in user-mode... mov rp=loc0 (p6) mov ar.pfs=r0 // clear ar.pfs on success (p7) br.ret.sptk.many rp @@ -193,7 +193,7 @@ ;; (p6) srlz.d ld8 sp=[r21] // load kernel stack pointer of new task - mov IA64_KR(CURRENT)=r20 // update "current" application register + mov IA64_KR(CURRENT)=in0 // update "current" application register mov r8=r13 // return pointer to previously running task mov r13=in0 // set "current" pointer ;; @@ -507,7 +507,14 @@ GLOBAL_ENTRY(ia64_trace_syscall) PT_REGS_UNWIND_INFO(0) +{ /* + * Some versions of gas generate bad unwind info if the first instruction of a + * procedure doesn't go into the first slot of a bundle. This is a workaround. + */ + nop.m 0 + nop.i 0 br.call.sptk.many rp=invoke_syscall_trace // give parent a chance to catch syscall args +} .ret6: br.call.sptk.many rp=b6 // do the syscall strace_check_retval: cmp.lt p6,p0=r8,r0 // syscall failed? @@ -537,12 +544,19 @@ GLOBAL_ENTRY(ia64_ret_from_clone) PT_REGS_UNWIND_INFO(0) +{ /* + * Some versions of gas generate bad unwind info if the first instruction of a + * procedure doesn't go into the first slot of a bundle. This is a workaround. + */ + nop.m 0 + nop.i 0 /* * We need to call schedule_tail() to complete the scheduling process. * Called by ia64_switch_to() after do_fork()->copy_thread(). r8 contains the * address of the previously executing task. */ br.call.sptk.many rp=ia64_invoke_schedule_tail +} .ret8: adds r2=TI_FLAGS+IA64_TASK_SIZE,r13 ;; @@ -569,11 +583,12 @@ // fall through GLOBAL_ENTRY(ia64_leave_kernel) PT_REGS_UNWIND_INFO(0) - // work.need_resched etc. mustn't get changed by this CPU before it returns to userspace: -(pUser) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUser -(pUser) rsm psr.i + // work.need_resched etc. mustn't get changed by this CPU before it returns to + // user- or fsys-mode: +(pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk +(pUStk) rsm psr.i ;; -(pUser) adds r17=TI_FLAGS+IA64_TASK_SIZE,r13 +(pUStk) adds r17=TI_FLAGS+IA64_TASK_SIZE,r13 ;; .work_processed: (p6) ld4 r18=[r17] // load current_thread_info()->flags @@ -635,9 +650,9 @@ ;; srlz.i // ensure interruption collection is off mov b7=r15 + bsw.0 // switch back to bank 0 (no stop bit required beforehand...) ;; - bsw.0 // switch back to bank 0 - ;; +(pUStk) mov r18=IA64_KR(CURRENT) // Itanium 2: 12 cycle read latency adds r16=16,r12 adds r17=24,r12 ;; @@ -665,16 +680,21 @@ ;; ld8.fill r12=[r16],16 ld8.fill r13=[r17],16 +(pUStk) adds r18=IA64_TASK_THREAD_ON_USTACK_OFFSET,r18 ;; ld8.fill r14=[r16] ld8.fill r15=[r17] +(pUStk) mov r17=1 + ;; +(pUStk) st1 [r18]=r17 // restore current->thread.on_ustack shr.u r18=r19,16 // get byte size of existing "dirty" partition ;; mov r16=ar.bsp // get existing backing store pointer movl r17=THIS_CPU(ia64_phys_stacked_size_p8) ;; ld4 r17=[r17] // r17 = cpu_data->phys_stacked_size_p8 -(pKern) br.cond.dpnt skip_rbs_switch +(pKStk) br.cond.dpnt skip_rbs_switch + /* * Restore user backing store. * @@ -710,21 +730,9 @@ shr.u loc1=r18,9 // RNaTslots <= dirtySize / (64*8) + 1 sub r17=r17,r18 // r17 = (physStackedSize + 8) - dirtySize ;; -#if 1 - .align 32 // see comment below about gas bug... -#endif mov ar.rsc=r19 // load ar.rsc to be used for "loadrs" shladd in0=loc1,3,r17 mov in1=0 -#if 0 - // gas-2.12.90 is unable to generate a stop bit after .align, which is bad, - // because alloc must be at the beginning of an insn-group. - .align 32 -#else - nop 0 - nop 0 - nop 0 -#endif ;; rse_clear_invalid: #ifdef CONFIG_ITANIUM @@ -788,12 +796,12 @@ skip_rbs_switch: mov b6=rB6 mov ar.pfs=rARPFS -(pUser) mov ar.bspstore=rARBSPSTORE +(pUStk) mov ar.bspstore=rARBSPSTORE (p9) mov cr.ifs=rCRIFS mov cr.ipsr=rCRIPSR mov cr.iip=rCRIIP ;; -(pUser) mov ar.rnat=rARRNAT // must happen with RSE in lazy mode +(pUStk) mov ar.rnat=rARRNAT // must happen with RSE in lazy mode mov ar.rsc=rARRSC mov ar.unat=rARUNAT mov pr=rARPR,-1 @@ -963,17 +971,16 @@ END(sys_rt_sigreturn) GLOBAL_ENTRY(ia64_prepare_handle_unaligned) - // - // r16 = fake ar.pfs, we simply need to make sure - // privilege is still 0 - // - mov r16=r0 .prologue + /* + * r16 = fake ar.pfs, we simply need to make sure privilege is still 0 + */ + mov r16=r0 DO_SAVE_SWITCH_STACK - br.call.sptk.many rp=ia64_handle_unaligned // stack frame setup in ivt + br.call.sptk.many rp=ia64_handle_unaligned // stack frame setup in ivt .ret21: .body DO_LOAD_SWITCH_STACK - br.cond.sptk.many rp // goes to ia64_leave_kernel + br.cond.sptk.many rp // goes to ia64_leave_kernel END(ia64_prepare_handle_unaligned) // @@ -1235,8 +1242,8 @@ data8 sys_sched_setaffinity data8 sys_sched_getaffinity data8 sys_set_tid_address - data8 ia64_ni_syscall // available. (was sys_alloc_hugepages) - data8 ia64_ni_syscall // available (was sys_free_hugepages) + data8 ia64_ni_syscall + data8 ia64_ni_syscall // 1235 data8 sys_exit_group data8 sys_lookup_dcookie data8 sys_io_setup diff -Nru a/arch/ia64/kernel/entry.h b/arch/ia64/kernel/entry.h --- a/arch/ia64/kernel/entry.h Sun Feb 9 21:13:31 2003 +++ b/arch/ia64/kernel/entry.h Sun Feb 9 21:13:31 2003 @@ -4,8 +4,8 @@ * Preserved registers that are shared between code in ivt.S and entry.S. Be * careful not to step on these! */ -#define pKern p2 /* will leave_kernel return to kernel-mode? */ -#define pUser p3 /* will leave_kernel return to user-mode? */ +#define pKStk p2 /* will leave_kernel return to kernel-stacks? */ +#define pUStk p3 /* will leave_kernel return to user-stacks? */ #define pSys p4 /* are we processing a (synchronous) system call? */ #define pNonSys p5 /* complement of pSys */ diff -Nru a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/ia64/kernel/fsys.S Sun Feb 9 21:13:37 2003 @@ -0,0 +1,384 @@ +/* + * This file contains the light-weight system call handlers (fsyscall-handlers). + * + * Copyright (C) 2003 Hewlett-Packard Co + * David Mosberger-Tang + */ + +#include +#include +#include +#include + +/* + * See Documentation/ia64/fsys.txt for details on fsyscalls. + * + * On entry to an fsyscall handler: + * r10 = 0 (i.e., defaults to "successful syscall return") + * r11 = saved ar.pfs (a user-level value) + * r15 = system call number + * r16 = "current" task pointer (in normal kernel-mode, this is in r13) + * r32-r39 = system call arguments + * b6 = return address (a user-level value) + * ar.pfs = previous frame-state (a user-level value) + * PSR.be = cleared to zero (i.e., little-endian byte order is in effect) + * all other registers may contain values passed in from user-mode + * + * On return from an fsyscall handler: + * r11 = saved ar.pfs (as passed into the fsyscall handler) + * r15 = system call number (as passed into the fsyscall handler) + * r32-r39 = system call arguments (as passed into the fsyscall handler) + * b6 = return address (as passed into the fsyscall handler) + * ar.pfs = previous frame-state (as passed into the fsyscall handler) + */ + +ENTRY(fsys_ni_syscall) + mov r8=ENOSYS + mov r10=-1 + MCKINLEY_E9_WORKAROUND + br.ret.sptk.many b6 +END(fsys_ni_syscall) + +ENTRY(fsys_getpid) + add r9=TI_FLAGS+IA64_TASK_SIZE,r16 + ;; + ld4 r9=[r9] + add r8=IA64_TASK_TGID_OFFSET,r16 + ;; + and r9=TIF_ALLWORK_MASK,r9 + ld4 r8=[r8] // r8 = current->tgid + ;; + cmp.ne p8,p0=0,r9 +(p8) br.spnt.many fsys_fallback_syscall + MCKINLEY_E9_WORKAROUND + br.ret.sptk.many b6 +END(fsys_getpid) + +ENTRY(fsys_getppid) + add r17=IA64_TASK_GROUP_LEADER_OFFSET,r16 + ;; + ld8 r17=[r17] // r17 = current->group_leader + add r9=TI_FLAGS+IA64_TASK_SIZE,r16 + ;; + + ld4 r9=[r9] + add r17=IA64_TASK_REAL_PARENT_OFFSET,r17 // r17 = ¤t->group_leader->real_parent + ;; + and r9=TIF_ALLWORK_MASK,r9 + +1: ld8 r18=[r17] // r18 = current->group_leader->real_parent + ;; + cmp.ne p8,p0=0,r9 + add r8=IA64_TASK_TGID_OFFSET,r18 // r8 = ¤t->group_leader->real_parent->tgid + ;; + + /* + * The .acq is needed to ensure that the read of tgid has returned its data before + * we re-check "real_parent". + */ + ld4.acq r8=[r8] // r8 = current->group_leader->real_parent->tgid +#ifdef CONFIG_SMP + /* + * Re-read current->group_leader->real_parent. + */ + ld8 r19=[r17] // r19 = current->group_leader->real_parent +(p8) br.spnt.many fsys_fallback_syscall + ;; + cmp.ne p6,p0=r18,r19 // did real_parent change? + mov r19=0 // i must not leak kernel bits... +(p6) br.cond.spnt.few 1b // yes -> redo the read of tgid and the check + ;; + mov r17=0 // i must not leak kernel bits... + mov r18=0 // i must not leak kernel bits... +#else + mov r17=0 // i must not leak kernel bits... + mov r18=0 // i must not leak kernel bits... + mov r19=0 // i must not leak kernel bits... +#endif + MCKINLEY_E9_WORKAROUND + br.ret.sptk.many b6 +END(fsys_getppid) + +ENTRY(fsys_set_tid_address) + add r9=TI_FLAGS+IA64_TASK_SIZE,r16 + ;; + ld4 r9=[r9] + tnat.z p6,p7=r32 // check argument register for being NaT + ;; + and r9=TIF_ALLWORK_MASK,r9 + add r8=IA64_TASK_PID_OFFSET,r16 + add r18=IA64_TASK_CLEAR_CHILD_TID_OFFSET,r16 + ;; + ld4 r8=[r8] + cmp.ne p8,p0=0,r9 + mov r17=-1 + ;; +(p6) st8 [r18]=r32 +(p7) st8 [r18]=r17 +(p8) br.spnt.many fsys_fallback_syscall + ;; + mov r17=0 // i must not leak kernel bits... + mov r18=0 // i must not leak kernel bits... + MCKINLEY_E9_WORKAROUND + br.ret.sptk.many b6 +END(fsys_set_tid_address) + + .rodata + .align 8 + .globl fsyscall_table +fsyscall_table: + data8 fsys_ni_syscall + data8 fsys_fallback_syscall // exit // 1025 + data8 fsys_fallback_syscall // read + data8 fsys_fallback_syscall // write + data8 fsys_fallback_syscall // open + data8 fsys_fallback_syscall // close + data8 fsys_fallback_syscall // creat // 1030 + data8 fsys_fallback_syscall // link + data8 fsys_fallback_syscall // unlink + data8 fsys_fallback_syscall // execve + data8 fsys_fallback_syscall // chdir + data8 fsys_fallback_syscall // fchdir // 1035 + data8 fsys_fallback_syscall // utimes + data8 fsys_fallback_syscall // mknod + data8 fsys_fallback_syscall // chmod + data8 fsys_fallback_syscall // chown + data8 fsys_fallback_syscall // lseek // 1040 + data8 fsys_getpid + data8 fsys_getppid // getppid + data8 fsys_fallback_syscall // mount + data8 fsys_fallback_syscall // umount + data8 fsys_fallback_syscall // setuid // 1045 + data8 fsys_fallback_syscall // getuid + data8 fsys_fallback_syscall // geteuid + data8 fsys_fallback_syscall // ptrace + data8 fsys_fallback_syscall // access + data8 fsys_fallback_syscall // sync // 1050 + data8 fsys_fallback_syscall // fsync + data8 fsys_fallback_syscall // fdatasync + data8 fsys_fallback_syscall // kill + data8 fsys_fallback_syscall // rename + data8 fsys_fallback_syscall // mkdir // 1055 + data8 fsys_fallback_syscall // rmdir + data8 fsys_fallback_syscall // dup + data8 fsys_fallback_syscall // pipe + data8 fsys_fallback_syscall // times + data8 fsys_fallback_syscall // brk // 1060 + data8 fsys_fallback_syscall // setgid + data8 fsys_fallback_syscall // getgid + data8 fsys_fallback_syscall // getegid + data8 fsys_fallback_syscall // acct + data8 fsys_fallback_syscall // ioctl // 1065 + data8 fsys_fallback_syscall // fcntl + data8 fsys_fallback_syscall // umask + data8 fsys_fallback_syscall // chroot + data8 fsys_fallback_syscall // ustat + data8 fsys_fallback_syscall // dup2 // 1070 + data8 fsys_fallback_syscall // setreuid + data8 fsys_fallback_syscall // setregid + data8 fsys_fallback_syscall // getresuid + data8 fsys_fallback_syscall // setresuid + data8 fsys_fallback_syscall // getresgid // 1075 + data8 fsys_fallback_syscall // setresgid + data8 fsys_fallback_syscall // getgroups + data8 fsys_fallback_syscall // setgroups + data8 fsys_fallback_syscall // getpgid + data8 fsys_fallback_syscall // setpgid // 1080 + data8 fsys_fallback_syscall // setsid + data8 fsys_fallback_syscall // getsid + data8 fsys_fallback_syscall // sethostname + data8 fsys_fallback_syscall // setrlimit + data8 fsys_fallback_syscall // getrlimit // 1085 + data8 fsys_fallback_syscall // getrusage + data8 fsys_fallback_syscall // gettimeofday + data8 fsys_fallback_syscall // settimeofday + data8 fsys_fallback_syscall // select + data8 fsys_fallback_syscall // poll // 1090 + data8 fsys_fallback_syscall // symlink + data8 fsys_fallback_syscall // readlink + data8 fsys_fallback_syscall // uselib + data8 fsys_fallback_syscall // swapon + data8 fsys_fallback_syscall // swapoff // 1095 + data8 fsys_fallback_syscall // reboot + data8 fsys_fallback_syscall // truncate + data8 fsys_fallback_syscall // ftruncate + data8 fsys_fallback_syscall // fchmod + data8 fsys_fallback_syscall // fchown // 1100 + data8 fsys_fallback_syscall // getpriority + data8 fsys_fallback_syscall // setpriority + data8 fsys_fallback_syscall // statfs + data8 fsys_fallback_syscall // fstatfs + data8 fsys_fallback_syscall // gettid // 1105 + data8 fsys_fallback_syscall // semget + data8 fsys_fallback_syscall // semop + data8 fsys_fallback_syscall // semctl + data8 fsys_fallback_syscall // msgget + data8 fsys_fallback_syscall // msgsnd // 1110 + data8 fsys_fallback_syscall // msgrcv + data8 fsys_fallback_syscall // msgctl + data8 fsys_fallback_syscall // shmget + data8 fsys_fallback_syscall // shmat + data8 fsys_fallback_syscall // shmdt // 1115 + data8 fsys_fallback_syscall // shmctl + data8 fsys_fallback_syscall // syslog + data8 fsys_fallback_syscall // setitimer + data8 fsys_fallback_syscall // getitimer + data8 fsys_fallback_syscall // 1120 + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall // vhangup + data8 fsys_fallback_syscall // lchown + data8 fsys_fallback_syscall // remap_file_pages // 1125 + data8 fsys_fallback_syscall // wait4 + data8 fsys_fallback_syscall // sysinfo + data8 fsys_fallback_syscall // clone + data8 fsys_fallback_syscall // setdomainname + data8 fsys_fallback_syscall // newuname // 1130 + data8 fsys_fallback_syscall // adjtimex + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall // init_module + data8 fsys_fallback_syscall // delete_module + data8 fsys_fallback_syscall // 1135 + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall // quotactl + data8 fsys_fallback_syscall // bdflush + data8 fsys_fallback_syscall // sysfs + data8 fsys_fallback_syscall // personality // 1140 + data8 fsys_fallback_syscall // afs_syscall + data8 fsys_fallback_syscall // setfsuid + data8 fsys_fallback_syscall // setfsgid + data8 fsys_fallback_syscall // getdents + data8 fsys_fallback_syscall // flock // 1145 + data8 fsys_fallback_syscall // readv + data8 fsys_fallback_syscall // writev + data8 fsys_fallback_syscall // pread64 + data8 fsys_fallback_syscall // pwrite64 + data8 fsys_fallback_syscall // sysctl // 1150 + data8 fsys_fallback_syscall // mmap + data8 fsys_fallback_syscall // munmap + data8 fsys_fallback_syscall // mlock + data8 fsys_fallback_syscall // mlockall + data8 fsys_fallback_syscall // mprotect // 1155 + data8 fsys_fallback_syscall // mremap + data8 fsys_fallback_syscall // msync + data8 fsys_fallback_syscall // munlock + data8 fsys_fallback_syscall // munlockall + data8 fsys_fallback_syscall // sched_getparam // 1160 + data8 fsys_fallback_syscall // sched_setparam + data8 fsys_fallback_syscall // sched_getscheduler + data8 fsys_fallback_syscall // sched_setscheduler + data8 fsys_fallback_syscall // sched_yield + data8 fsys_fallback_syscall // sched_get_priority_max // 1165 + data8 fsys_fallback_syscall // sched_get_priority_min + data8 fsys_fallback_syscall // sched_rr_get_interval + data8 fsys_fallback_syscall // nanosleep + data8 fsys_fallback_syscall // nfsservctl + data8 fsys_fallback_syscall // prctl // 1170 + data8 fsys_fallback_syscall // getpagesize + data8 fsys_fallback_syscall // mmap2 + data8 fsys_fallback_syscall // pciconfig_read + data8 fsys_fallback_syscall // pciconfig_write + data8 fsys_fallback_syscall // perfmonctl // 1175 + data8 fsys_fallback_syscall // sigaltstack + data8 fsys_fallback_syscall // rt_sigaction + data8 fsys_fallback_syscall // rt_sigpending + data8 fsys_fallback_syscall // rt_sigprocmask + data8 fsys_fallback_syscall // rt_sigqueueinfo // 1180 + data8 fsys_fallback_syscall // rt_sigreturn + data8 fsys_fallback_syscall // rt_sigsuspend + data8 fsys_fallback_syscall // rt_sigtimedwait + data8 fsys_fallback_syscall // getcwd + data8 fsys_fallback_syscall // capget // 1185 + data8 fsys_fallback_syscall // capset + data8 fsys_fallback_syscall // sendfile + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall // socket // 1190 + data8 fsys_fallback_syscall // bind + data8 fsys_fallback_syscall // connect + data8 fsys_fallback_syscall // listen + data8 fsys_fallback_syscall // accept + data8 fsys_fallback_syscall // getsockname // 1195 + data8 fsys_fallback_syscall // getpeername + data8 fsys_fallback_syscall // socketpair + data8 fsys_fallback_syscall // send + data8 fsys_fallback_syscall // sendto + data8 fsys_fallback_syscall // recv // 1200 + data8 fsys_fallback_syscall // recvfrom + data8 fsys_fallback_syscall // shutdown + data8 fsys_fallback_syscall // setsockopt + data8 fsys_fallback_syscall // getsockopt + data8 fsys_fallback_syscall // sendmsg // 1205 + data8 fsys_fallback_syscall // recvmsg + data8 fsys_fallback_syscall // pivot_root + data8 fsys_fallback_syscall // mincore + data8 fsys_fallback_syscall // madvise + data8 fsys_fallback_syscall // newstat // 1210 + data8 fsys_fallback_syscall // newlstat + data8 fsys_fallback_syscall // newfstat + data8 fsys_fallback_syscall // clone2 + data8 fsys_fallback_syscall // getdents64 + data8 fsys_fallback_syscall // getunwind // 1215 + data8 fsys_fallback_syscall // readahead + data8 fsys_fallback_syscall // setxattr + data8 fsys_fallback_syscall // lsetxattr + data8 fsys_fallback_syscall // fsetxattr + data8 fsys_fallback_syscall // getxattr // 1220 + data8 fsys_fallback_syscall // lgetxattr + data8 fsys_fallback_syscall // fgetxattr + data8 fsys_fallback_syscall // listxattr + data8 fsys_fallback_syscall // llistxattr + data8 fsys_fallback_syscall // flistxattr // 1225 + data8 fsys_fallback_syscall // removexattr + data8 fsys_fallback_syscall // lremovexattr + data8 fsys_fallback_syscall // fremovexattr + data8 fsys_fallback_syscall // tkill + data8 fsys_fallback_syscall // futex // 1230 + data8 fsys_fallback_syscall // sched_setaffinity + data8 fsys_fallback_syscall // sched_getaffinity + data8 fsys_set_tid_address // set_tid_address + data8 fsys_fallback_syscall // unused + data8 fsys_fallback_syscall // unused // 1235 + data8 fsys_fallback_syscall // exit_group + data8 fsys_fallback_syscall // lookup_dcookie + data8 fsys_fallback_syscall // io_setup + data8 fsys_fallback_syscall // io_destroy + data8 fsys_fallback_syscall // io_getevents // 1240 + data8 fsys_fallback_syscall // io_submit + data8 fsys_fallback_syscall // io_cancel + data8 fsys_fallback_syscall // epoll_create + data8 fsys_fallback_syscall // epoll_ctl + data8 fsys_fallback_syscall // epoll_wait // 1245 + data8 fsys_fallback_syscall // restart_syscall + data8 fsys_fallback_syscall // semtimedop + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall // 1250 + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall // 1255 + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall // 1260 + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall // 1265 + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall // 1270 + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall // 1275 + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall + data8 fsys_fallback_syscall diff -Nru a/arch/ia64/kernel/gate.S b/arch/ia64/kernel/gate.S --- a/arch/ia64/kernel/gate.S Sun Feb 9 21:13:35 2003 +++ b/arch/ia64/kernel/gate.S Sun Feb 9 21:13:35 2003 @@ -2,7 +2,7 @@ * This file contains the code that gets mapped at the upper end of each task's text * region. For now, it contains the signal trampoline code only. * - * Copyright (C) 1999-2002 Hewlett-Packard Co + * Copyright (C) 1999-2003 Hewlett-Packard Co * David Mosberger-Tang */ @@ -14,6 +14,87 @@ #include .section .text.gate, "ax" +.start_gate: + + +#if CONFIG_FSYS + +#include + +/* + * On entry: + * r11 = saved ar.pfs + * r15 = system call # + * b0 = saved return address + * b6 = return address + * On exit: + * r11 = saved ar.pfs + * r15 = system call # + * b0 = saved return address + * all other "scratch" registers: undefined + * all "preserved" registers: same as on entry + */ +GLOBAL_ENTRY(syscall_via_epc) + .prologue + .altrp b6 + .body +{ + /* + * Note: the kernel cannot assume that the first two instructions in this + * bundle get executed. The remaining code must be safe even if + * they do not get executed. + */ + adds r17=-1024,r15 + mov r10=0 // default to successful syscall execution + epc +} + ;; + rsm psr.be + movl r18=fsyscall_table + + mov r16=IA64_KR(CURRENT) + mov r19=255 + ;; + shladd r18=r17,3,r18 + cmp.geu p6,p0=r19,r17 // (syscall > 0 && syscall <= 1024+255)? + ;; + srlz.d // ensure little-endian byteorder is in effect +(p6) ld8 r18=[r18] + ;; +(p6) mov b7=r18 +(p6) br.sptk.many b7 + + mov r10=-1 + mov r8=ENOSYS + MCKINLEY_E9_WORKAROUND + br.ret.sptk.many b6 +END(syscall_via_epc) + +GLOBAL_ENTRY(syscall_via_break) + .prologue + .altrp b6 + .body + break 0x100000 + br.ret.sptk.many b6 +END(syscall_via_break) + +GLOBAL_ENTRY(fsys_fallback_syscall) + /* + * It would be better/fsyser to do the SAVE_MIN magic directly here, but for now + * we simply fall back on doing a system-call via break. Good enough + * to get started. (Note: we have to do this through the gate page again, since + * the br.ret will switch us back to user-level privilege.) + * + * XXX Move this back to fsys.S after changing it over to avoid break 0x100000. + */ + movl r2=(syscall_via_break - .start_gate) + GATE_ADDR + ;; + MCKINLEY_E9_WORKAROUND + mov b7=r2 + br.ret.sptk.many b7 +END(fsys_fallback_syscall) + +#endif /* CONFIG_FSYS */ # define ARG0_OFF (16 + IA64_SIGFRAME_ARG0_OFFSET) # define ARG1_OFF (16 + IA64_SIGFRAME_ARG1_OFFSET) @@ -63,15 +144,18 @@ * call stack. */ +#define SIGTRAMP_SAVES \ + .unwabi @svr4, 's' // mark this as a sigtramp handler (saves scratch regs) \ + .savesp ar.unat, UNAT_OFF+SIGCONTEXT_OFF \ + .savesp ar.fpsr, FPSR_OFF+SIGCONTEXT_OFF \ + .savesp pr, PR_OFF+SIGCONTEXT_OFF \ + .savesp rp, RP_OFF+SIGCONTEXT_OFF \ + .vframesp SP_OFF+SIGCONTEXT_OFF + GLOBAL_ENTRY(ia64_sigtramp) // describe the state that is active when we get here: .prologue - .unwabi @svr4, 's' // mark this as a sigtramp handler (saves scratch regs) - .savesp ar.unat, UNAT_OFF+SIGCONTEXT_OFF - .savesp ar.fpsr, FPSR_OFF+SIGCONTEXT_OFF - .savesp pr, PR_OFF+SIGCONTEXT_OFF - .savesp rp, RP_OFF+SIGCONTEXT_OFF - .vframesp SP_OFF+SIGCONTEXT_OFF + SIGTRAMP_SAVES .body .label_state 1 @@ -156,10 +240,11 @@ ldf.fill f14=[base0],32 ldf.fill f15=[base1],32 mov r15=__NR_rt_sigreturn + .restore sp // pop .prologue break __BREAK_SYSCALL - .body - .copy_state 1 + .prologue + SIGTRAMP_SAVES setup_rbs: mov ar.rsc=0 // put RSE into enforced lazy mode ;; @@ -171,6 +256,7 @@ ;; .spillsp ar.rnat, RNAT_OFF+SIGCONTEXT_OFF st8 [r14]=r16 // save sc_ar_rnat + .body adds r14=(LOADRS_OFF+SIGCONTEXT_OFF),sp mov.m r16=ar.bsp // sc_loadrs <- (new bsp - new bspstore) << 16 @@ -182,10 +268,11 @@ ;; st8 [r14]=r15 // save sc_loadrs mov ar.rsc=0xf // set RSE into eager mode, pl 3 + .restore sp // pop .prologue br.cond.sptk back_from_setup_rbs .prologue - .copy_state 1 + SIGTRAMP_SAVES .spillsp ar.rnat, RNAT_OFF+SIGCONTEXT_OFF .body restore_rbs: diff -Nru a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S --- a/arch/ia64/kernel/head.S Sun Feb 9 21:13:34 2003 +++ b/arch/ia64/kernel/head.S Sun Feb 9 21:13:34 2003 @@ -5,7 +5,7 @@ * to set up the kernel's global pointer and jump to the kernel * entry point. * - * Copyright (C) 1998-2001 Hewlett-Packard Co + * Copyright (C) 1998-2001, 2003 Hewlett-Packard Co * David Mosberger-Tang * Stephane Eranian * Copyright (C) 1999 VA Linux Systems @@ -143,17 +143,14 @@ movl r2=init_thread_union cmp.eq isBP,isAP=r0,r0 #endif - ;; - extr r3=r2,0,61 // r3 == phys addr of task struct mov r16=KERNEL_TR_PAGE_NUM ;; // load the "current" pointer (r13) and ar.k6 with the current task - mov r13=r2 - mov IA64_KR(CURRENT)=r3 // Physical address - + mov IA64_KR(CURRENT)=r2 // virtual address // initialize k4 to a safe value (64-128MB is mapped by TR_KERNEL) mov IA64_KR(CURRENT_STACK)=r16 + mov r13=r2 /* * Reserve space at the top of the stack for "struct pt_regs". Kernel threads * don't store interesting values in that structure, but the space still needs diff -Nru a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c --- a/arch/ia64/kernel/ia64_ksyms.c Sun Feb 9 21:13:31 2003 +++ b/arch/ia64/kernel/ia64_ksyms.c Sun Feb 9 21:13:32 2003 @@ -142,4 +142,8 @@ EXPORT_SYMBOL(ia64_mv); #endif EXPORT_SYMBOL(machvec_noop); - +#ifdef CONFIG_PERFMON +#include +EXPORT_SYMBOL(pfm_install_alternate_syswide_subsystem); +EXPORT_SYMBOL(pfm_remove_alternate_syswide_subsystem); +#endif diff -Nru a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c --- a/arch/ia64/kernel/iosapic.c Sun Feb 9 21:13:32 2003 +++ b/arch/ia64/kernel/iosapic.c Sun Feb 9 21:13:32 2003 @@ -4,7 +4,7 @@ * Copyright (C) 1999 Intel Corp. * Copyright (C) 1999 Asit Mallick * Copyright (C) 2000-2002 J.I. Lee - * Copyright (C) 1999-2000, 2002 Hewlett-Packard Co. + * Copyright (C) 1999-2000, 2002-2003 Hewlett-Packard Co. * David Mosberger-Tang * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999,2000 Walt Drummond @@ -433,7 +433,7 @@ || iosapic_intr_info[vector].polarity || iosapic_intr_info[vector].trigger) { new_vector = ia64_alloc_vector(); - printk("Reassigning vector %d to %d\n", vector, new_vector); + printk(KERN_INFO "Reassigning vector %d to %d\n", vector, new_vector); memcpy(&iosapic_intr_info[new_vector], &iosapic_intr_info[vector], sizeof(struct iosapic_intr_info)); memset(&iosapic_intr_info[vector], 0, sizeof(struct iosapic_intr_info)); @@ -468,17 +468,17 @@ #else if (iosapic_address) { if (iosapic_intr_info[vector].addr && (iosapic_intr_info[vector].addr != iosapic_address)) - printk("WARN: register_intr: diff IOSAPIC ADDRESS for GSI 0x%x, vector %d\n", - gsi, vector); + printk(KERN_WARNING "warning: register_intr: diff IOSAPIC ADDRESS for " + "GSI 0x%x, vector %d\n", gsi, vector); iosapic_intr_info[vector].addr = iosapic_address; if (iosapic_intr_info[vector].gsi_base && (iosapic_intr_info[vector].gsi_base != gsi_base)) { - printk("WARN: register_intr: diff GSI base 0x%x for GSI 0x%x, vector %d\n", - gsi_base, gsi, vector); + printk(KERN_WARNING "warning: register_intr: diff GSI base 0x%x for " + "GSI 0x%x, vector %d\n", gsi_base, gsi, vector); } iosapic_intr_info[vector].gsi_base = gsi_base; } else if (!iosapic_intr_info[vector].addr) - printk("WARN: register_intr: invalid override for GSI 0x%x, vector %d\n", - gsi, vector); + printk(KERN_WARNING "warning: register_intr: invalid override for GSI 0x%x, " + "vector %d\n", gsi, vector); #endif if (edge_triggered) { iosapic_intr_info[vector].trigger = IOSAPIC_EDGE; @@ -491,9 +491,8 @@ idesc = irq_desc(vector); if (idesc->handler != irq_type) { if (idesc->handler != &no_irq_type) - printk("%s: changing vector %d from %s to %s\n", - __FUNCTION__, vector, idesc->handler->typename, - irq_type->typename); + printk(KERN_WARNING "%s: changing vector %d from %s to %s\n", + __FUNCTION__, vector, idesc->handler->typename, irq_type->typename); idesc->handler = irq_type; } } @@ -518,7 +517,7 @@ register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY, polarity, edge_triggered, gsi_base, iosapic_address); - printk("GSI 0x%x(%s,%s) -> CPU 0x%04x vector %d\n", + printk(KERN_INFO "GSI 0x%x(%s,%s) -> CPU 0x%04x vector %d\n", gsi, (polarity ? "high" : "low"), (edge_triggered ? "edge" : "level"), dest, vector); @@ -560,14 +559,14 @@ delivery = IOSAPIC_LOWEST_PRIORITY; break; default: - printk("iosapic_register_platform_irq(): invalid int type\n"); + printk(KERN_ERR "iosapic_register_platform_irq(): invalid int type\n"); return -1; } register_intr(gsi, vector, delivery, polarity, edge_triggered, gsi_base, iosapic_address); - printk("PLATFORM int 0x%x: GSI 0x%x(%s,%s) -> CPU 0x%04x vector %d\n", + printk(KERN_INFO "PLATFORM int 0x%x: GSI 0x%x(%s,%s) -> CPU 0x%04x vector %d\n", int_type, gsi, (polarity ? "high" : "low"), (edge_triggered ? "edge" : "level"), dest, vector); @@ -594,7 +593,7 @@ index = find_iosapic(gsi); if (index < 0) { - printk("ISA: No corresponding IOSAPIC found : ISA IRQ %u -> GSI 0x%x\n", + printk(KERN_ERR "ISA: No corresponding IOSAPIC found : ISA IRQ %u -> GSI 0x%x\n", isa_irq, gsi); return; } @@ -634,7 +633,7 @@ * Disable the compatibility mode interrupts (8259 style), needs IN/OUT support * enabled. */ - printk("%s: Disabling PC-AT compatible 8259 interrupts\n", __FUNCTION__); + printk(KERN_INFO "%s: Disabling PC-AT compatible 8259 interrupts\n", __FUNCTION__); outb(0xff, 0xA1); outb(0xff, 0x21); } @@ -655,7 +654,7 @@ iosapic_lists[num_iosapic].num_rte = num_rte; num_iosapic++; - printk(KERN_INFO" IOSAPIC v%x.%x, address 0x%lx, GSIs 0x%x-0x%x\n", + printk(KERN_INFO " IOSAPIC v%x.%x, address 0x%lx, GSIs 0x%x-0x%x\n", (ver & 0xf0) >> 4, (ver & 0x0f), phys_addr, gsi_base, gsi_base + num_rte - 1); if ((gsi_base == 0) && pcat_compat) { @@ -692,7 +691,7 @@ idesc = irq_desc(vector); if (idesc->handler != irq_type) { if (idesc->handler != &no_irq_type) - printk("IOSAPIC: changing vector %d from %s to %s\n", + printk(KERN_INFO "IOSAPIC: changing vector %d from %s to %s\n", vector, idesc->handler->typename, irq_type->typename); idesc->handler = irq_type; } @@ -723,7 +722,8 @@ #endif set_rte(vector, dest); - printk("IOSAPIC: %s -> GSI 0x%x -> CPU 0x%04x vector %d\n", pci_id, gsi, dest, vector); + printk(KERN_INFO "IOSAPIC: %s -> GSI 0x%x -> CPU 0x%04x vector %d\n", + pci_id, gsi, dest, vector); } void __init @@ -751,8 +751,8 @@ index = find_iosapic(gsi); if (index < 0) { - printk(KERN_WARNING"IOSAPIC: GSI 0x%x has no IOSAPIC!\n", gsi); - return; + printk(KERN_WARNING "IOSAPIC: GSI 0x%x has no IOSAPIC!\n", gsi); + continue; } addr = iosapic_lists[index].addr; gsi_base = iosapic_lists[index].gsi_base; diff -Nru a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c --- a/arch/ia64/kernel/irq.c Sun Feb 9 21:13:35 2003 +++ b/arch/ia64/kernel/irq.c Sun Feb 9 21:13:35 2003 @@ -108,7 +108,7 @@ * a generic callback i think. */ #if CONFIG_X86 - printk("unexpected IRQ trap at vector %02x\n", irq); + printk(KERN_ERR "unexpected IRQ trap at vector %02x\n", irq); #ifdef CONFIG_X86_LOCAL_APIC /* * Currently unexpected vectors happen only on SMP and APIC. @@ -122,7 +122,7 @@ #endif #endif #if CONFIG_IA64 - printk("Unexpected irq vector 0x%x on CPU %u!\n", irq, smp_processor_id()); + printk(KERN_ERR "Unexpected irq vector 0x%x on CPU %u!\n", irq, smp_processor_id()); #endif } @@ -317,7 +317,7 @@ desc->depth--; break; case 0: - printk("enable_irq(%u) unbalanced from %p\n", + printk(KERN_ERR "enable_irq(%u) unbalanced from %p\n", irq, (void *) __builtin_return_address(0)); } spin_unlock_irqrestore(&desc->lock, flags); @@ -466,7 +466,7 @@ */ if (irqflags & SA_SHIRQ) { if (!dev_id) - printk("Bad boy: %s called us without a dev_id!\n", devname); + printk(KERN_ERR "Bad boy: %s called us without a dev_id!\n", devname); } #endif @@ -547,7 +547,7 @@ kfree(action); return; } - printk("Trying to free free IRQ%d\n",irq); + printk(KERN_ERR "Trying to free free IRQ%d\n",irq); spin_unlock_irqrestore(&desc->lock,flags); return; } diff -Nru a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c --- a/arch/ia64/kernel/irq_ia64.c Sun Feb 9 21:13:31 2003 +++ b/arch/ia64/kernel/irq_ia64.c Sun Feb 9 21:13:31 2003 @@ -178,7 +178,7 @@ register_percpu_irq(IA64_IPI_VECTOR, &ipi_irqaction); #endif #ifdef CONFIG_PERFMON - perfmon_init_percpu(); + pfm_init_percpu(); #endif platform_irq_init(); } diff -Nru a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S --- a/arch/ia64/kernel/ivt.S Sun Feb 9 21:13:29 2003 +++ b/arch/ia64/kernel/ivt.S Sun Feb 9 21:13:29 2003 @@ -192,7 +192,7 @@ rfi END(vhpt_miss) - .align 1024 + .org ia64_ivt+0x400 ///////////////////////////////////////////////////////////////////////////////////////// // 0x0400 Entry 1 (size 64 bundles) ITLB (21) ENTRY(itlb_miss) @@ -206,7 +206,7 @@ mov r16=cr.ifa // get virtual address mov r29=b0 // save b0 mov r31=pr // save predicates -itlb_fault: +.itlb_fault: mov r17=cr.iha // get virtual address of L3 PTE movl r30=1f // load nested fault continuation point ;; @@ -230,7 +230,7 @@ rfi END(itlb_miss) - .align 1024 + .org ia64_ivt+0x0800 ///////////////////////////////////////////////////////////////////////////////////////// // 0x0800 Entry 2 (size 64 bundles) DTLB (9,48) ENTRY(dtlb_miss) @@ -268,7 +268,7 @@ rfi END(dtlb_miss) - .align 1024 + .org ia64_ivt+0x0c00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x0c00 Entry 3 (size 64 bundles) Alt ITLB (19) ENTRY(alt_itlb_miss) @@ -288,7 +288,7 @@ ;; (p8) mov cr.iha=r17 (p8) mov r29=b0 // save b0 -(p8) br.cond.dptk itlb_fault +(p8) br.cond.dptk .itlb_fault #endif extr.u r23=r21,IA64_PSR_CPL0_BIT,2 // extract psr.cpl and r19=r19,r16 // clear ed, reserved bits, and PTE control bits @@ -306,7 +306,7 @@ rfi END(alt_itlb_miss) - .align 1024 + .org ia64_ivt+0x1000 ///////////////////////////////////////////////////////////////////////////////////////// // 0x1000 Entry 4 (size 64 bundles) Alt DTLB (7,46) ENTRY(alt_dtlb_miss) @@ -379,7 +379,7 @@ br.call.sptk.many b6=ia64_do_page_fault // ignore return address END(page_fault) - .align 1024 + .org ia64_ivt+0x1400 ///////////////////////////////////////////////////////////////////////////////////////// // 0x1400 Entry 5 (size 64 bundles) Data nested TLB (6,45) ENTRY(nested_dtlb_miss) @@ -440,7 +440,7 @@ br.sptk.many b0 // return to continuation point END(nested_dtlb_miss) - .align 1024 + .org ia64_ivt+0x1800 ///////////////////////////////////////////////////////////////////////////////////////// // 0x1800 Entry 6 (size 64 bundles) Instruction Key Miss (24) ENTRY(ikey_miss) @@ -448,7 +448,7 @@ FAULT(6) END(ikey_miss) - .align 1024 + .org ia64_ivt+0x1c00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x1c00 Entry 7 (size 64 bundles) Data Key Miss (12,51) ENTRY(dkey_miss) @@ -456,7 +456,7 @@ FAULT(7) END(dkey_miss) - .align 1024 + .org ia64_ivt+0x2000 ///////////////////////////////////////////////////////////////////////////////////////// // 0x2000 Entry 8 (size 64 bundles) Dirty-bit (54) ENTRY(dirty_bit) @@ -512,7 +512,7 @@ rfi END(idirty_bit) - .align 1024 + .org ia64_ivt+0x2400 ///////////////////////////////////////////////////////////////////////////////////////// // 0x2400 Entry 9 (size 64 bundles) Instruction Access-bit (27) ENTRY(iaccess_bit) @@ -571,7 +571,7 @@ rfi END(iaccess_bit) - .align 1024 + .org ia64_ivt+0x2800 ///////////////////////////////////////////////////////////////////////////////////////// // 0x2800 Entry 10 (size 64 bundles) Data Access-bit (15,55) ENTRY(daccess_bit) @@ -618,7 +618,7 @@ rfi END(daccess_bit) - .align 1024 + .org ia64_ivt+0x2c00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x2c00 Entry 11 (size 64 bundles) Break instruction (33) ENTRY(break_fault) @@ -690,7 +690,7 @@ // NOT REACHED END(break_fault) -ENTRY(demine_args) +ENTRY_MIN_ALIGN(demine_args) alloc r2=ar.pfs,8,0,0,0 tnat.nz p8,p0=in0 tnat.nz p9,p0=in1 @@ -719,7 +719,7 @@ br.ret.sptk.many rp END(demine_args) - .align 1024 + .org ia64_ivt+0x3000 ///////////////////////////////////////////////////////////////////////////////////////// // 0x3000 Entry 12 (size 64 bundles) External Interrupt (4) ENTRY(interrupt) @@ -746,19 +746,19 @@ br.call.sptk.many b6=ia64_handle_irq END(interrupt) - .align 1024 + .org ia64_ivt+0x3400 ///////////////////////////////////////////////////////////////////////////////////////// // 0x3400 Entry 13 (size 64 bundles) Reserved DBG_FAULT(13) FAULT(13) - .align 1024 + .org ia64_ivt+0x3800 ///////////////////////////////////////////////////////////////////////////////////////// // 0x3800 Entry 14 (size 64 bundles) Reserved DBG_FAULT(14) FAULT(14) - .align 1024 + .org ia64_ivt+0x3c00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x3c00 Entry 15 (size 64 bundles) Reserved DBG_FAULT(15) @@ -803,7 +803,7 @@ br.sptk.many ia64_leave_kernel END(dispatch_illegal_op_fault) - .align 1024 + .org ia64_ivt+0x4000 ///////////////////////////////////////////////////////////////////////////////////////// // 0x4000 Entry 16 (size 64 bundles) Reserved DBG_FAULT(16) @@ -893,7 +893,7 @@ #endif /* CONFIG_IA32_SUPPORT */ - .align 1024 + .org ia64_ivt+0x4400 ///////////////////////////////////////////////////////////////////////////////////////// // 0x4400 Entry 17 (size 64 bundles) Reserved DBG_FAULT(17) @@ -925,7 +925,7 @@ br.call.sptk.many b6=ia64_bad_break // avoid WAW on CFM and ignore return addr END(non_syscall) - .align 1024 + .org ia64_ivt+0x4800 ///////////////////////////////////////////////////////////////////////////////////////// // 0x4800 Entry 18 (size 64 bundles) Reserved DBG_FAULT(18) @@ -959,7 +959,7 @@ br.sptk.many ia64_prepare_handle_unaligned END(dispatch_unaligned_handler) - .align 1024 + .org ia64_ivt+0x4c00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x4c00 Entry 19 (size 64 bundles) Reserved DBG_FAULT(19) @@ -1005,7 +1005,7 @@ // --- End of long entries, Beginning of short entries // - .align 1024 + .org ia64_ivt+0x5000 ///////////////////////////////////////////////////////////////////////////////////////// // 0x5000 Entry 20 (size 16 bundles) Page Not Present (10,22,49) ENTRY(page_not_present) @@ -1025,7 +1025,7 @@ br.sptk.many page_fault END(page_not_present) - .align 256 + .org ia64_ivt+0x5100 ///////////////////////////////////////////////////////////////////////////////////////// // 0x5100 Entry 21 (size 16 bundles) Key Permission (13,25,52) ENTRY(key_permission) @@ -1038,7 +1038,7 @@ br.sptk.many page_fault END(key_permission) - .align 256 + .org ia64_ivt+0x5200 ///////////////////////////////////////////////////////////////////////////////////////// // 0x5200 Entry 22 (size 16 bundles) Instruction Access Rights (26) ENTRY(iaccess_rights) @@ -1051,7 +1051,7 @@ br.sptk.many page_fault END(iaccess_rights) - .align 256 + .org ia64_ivt+0x5300 ///////////////////////////////////////////////////////////////////////////////////////// // 0x5300 Entry 23 (size 16 bundles) Data Access Rights (14,53) ENTRY(daccess_rights) @@ -1064,7 +1064,7 @@ br.sptk.many page_fault END(daccess_rights) - .align 256 + .org ia64_ivt+0x5400 ///////////////////////////////////////////////////////////////////////////////////////// // 0x5400 Entry 24 (size 16 bundles) General Exception (5,32,34,36,38,39) ENTRY(general_exception) @@ -1079,7 +1079,7 @@ br.sptk.many dispatch_to_fault_handler END(general_exception) - .align 256 + .org ia64_ivt+0x5500 ///////////////////////////////////////////////////////////////////////////////////////// // 0x5500 Entry 25 (size 16 bundles) Disabled FP-Register (35) ENTRY(disabled_fp_reg) @@ -1092,7 +1092,7 @@ br.sptk.many dispatch_to_fault_handler END(disabled_fp_reg) - .align 256 + .org ia64_ivt+0x5600 ///////////////////////////////////////////////////////////////////////////////////////// // 0x5600 Entry 26 (size 16 bundles) Nat Consumption (11,23,37,50) ENTRY(nat_consumption) @@ -1100,7 +1100,7 @@ FAULT(26) END(nat_consumption) - .align 256 + .org ia64_ivt+0x5700 ///////////////////////////////////////////////////////////////////////////////////////// // 0x5700 Entry 27 (size 16 bundles) Speculation (40) ENTRY(speculation_vector) @@ -1137,13 +1137,13 @@ rfi // and go back END(speculation_vector) - .align 256 + .org ia64_ivt+0x5800 ///////////////////////////////////////////////////////////////////////////////////////// // 0x5800 Entry 28 (size 16 bundles) Reserved DBG_FAULT(28) FAULT(28) - .align 256 + .org ia64_ivt+0x5900 ///////////////////////////////////////////////////////////////////////////////////////// // 0x5900 Entry 29 (size 16 bundles) Debug (16,28,56) ENTRY(debug_vector) @@ -1151,7 +1151,7 @@ FAULT(29) END(debug_vector) - .align 256 + .org ia64_ivt+0x5a00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x5a00 Entry 30 (size 16 bundles) Unaligned Reference (57) ENTRY(unaligned_access) @@ -1162,91 +1162,103 @@ br.sptk.many dispatch_unaligned_handler END(unaligned_access) - .align 256 + .org ia64_ivt+0x5b00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x5b00 Entry 31 (size 16 bundles) Unsupported Data Reference (57) +ENTRY(unsupported_data_reference) DBG_FAULT(31) FAULT(31) +END(unsupported_data_reference) - .align 256 + .org ia64_ivt+0x5c00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x5c00 Entry 32 (size 16 bundles) Floating-Point Fault (64) +ENTRY(floating_point_fault) DBG_FAULT(32) FAULT(32) +END(floating_point_fault) - .align 256 + .org ia64_ivt+0x5d00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x5d00 Entry 33 (size 16 bundles) Floating Point Trap (66) +ENTRY(floating_point_trap) DBG_FAULT(33) FAULT(33) +END(floating_point_trap) - .align 256 + .org ia64_ivt+0x5e00 ///////////////////////////////////////////////////////////////////////////////////////// -// 0x5e00 Entry 34 (size 16 bundles) Lower Privilege Tranfer Trap (66) +// 0x5e00 Entry 34 (size 16 bundles) Lower Privilege Transfer Trap (66) +ENTRY(lower_privilege_trap) DBG_FAULT(34) FAULT(34) +END(lower_privilege_trap) - .align 256 + .org ia64_ivt+0x5f00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x5f00 Entry 35 (size 16 bundles) Taken Branch Trap (68) +ENTRY(taken_branch_trap) DBG_FAULT(35) FAULT(35) +END(taken_branch_trap) - .align 256 + .org ia64_ivt+0x6000 ///////////////////////////////////////////////////////////////////////////////////////// // 0x6000 Entry 36 (size 16 bundles) Single Step Trap (69) +ENTRY(single_step_trap) DBG_FAULT(36) FAULT(36) +END(single_step_trap) - .align 256 + .org ia64_ivt+0x6100 ///////////////////////////////////////////////////////////////////////////////////////// // 0x6100 Entry 37 (size 16 bundles) Reserved DBG_FAULT(37) FAULT(37) - .align 256 + .org ia64_ivt+0x6200 ///////////////////////////////////////////////////////////////////////////////////////// // 0x6200 Entry 38 (size 16 bundles) Reserved DBG_FAULT(38) FAULT(38) - .align 256 + .org ia64_ivt+0x6300 ///////////////////////////////////////////////////////////////////////////////////////// // 0x6300 Entry 39 (size 16 bundles) Reserved DBG_FAULT(39) FAULT(39) - .align 256 + .org ia64_ivt+0x6400 ///////////////////////////////////////////////////////////////////////////////////////// // 0x6400 Entry 40 (size 16 bundles) Reserved DBG_FAULT(40) FAULT(40) - .align 256 + .org ia64_ivt+0x6500 ///////////////////////////////////////////////////////////////////////////////////////// // 0x6500 Entry 41 (size 16 bundles) Reserved DBG_FAULT(41) FAULT(41) - .align 256 + .org ia64_ivt+0x6600 ///////////////////////////////////////////////////////////////////////////////////////// // 0x6600 Entry 42 (size 16 bundles) Reserved DBG_FAULT(42) FAULT(42) - .align 256 + .org ia64_ivt+0x6700 ///////////////////////////////////////////////////////////////////////////////////////// // 0x6700 Entry 43 (size 16 bundles) Reserved DBG_FAULT(43) FAULT(43) - .align 256 + .org ia64_ivt+0x6800 ///////////////////////////////////////////////////////////////////////////////////////// // 0x6800 Entry 44 (size 16 bundles) Reserved DBG_FAULT(44) FAULT(44) - .align 256 + .org ia64_ivt+0x6900 ///////////////////////////////////////////////////////////////////////////////////////// // 0x6900 Entry 45 (size 16 bundles) IA-32 Exeception (17,18,29,41,42,43,44,58,60,61,62,72,73,75,76,77) ENTRY(ia32_exception) @@ -1254,7 +1266,7 @@ FAULT(45) END(ia32_exception) - .align 256 + .org ia64_ivt+0x6a00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x6a00 Entry 46 (size 16 bundles) IA-32 Intercept (30,31,59,70,71) ENTRY(ia32_intercept) @@ -1284,7 +1296,7 @@ FAULT(46) END(ia32_intercept) - .align 256 + .org ia64_ivt+0x6b00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x6b00 Entry 47 (size 16 bundles) IA-32 Interrupt (74) ENTRY(ia32_interrupt) @@ -1297,121 +1309,121 @@ #endif END(ia32_interrupt) - .align 256 + .org ia64_ivt+0x6c00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x6c00 Entry 48 (size 16 bundles) Reserved DBG_FAULT(48) FAULT(48) - .align 256 + .org ia64_ivt+0x6d00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x6d00 Entry 49 (size 16 bundles) Reserved DBG_FAULT(49) FAULT(49) - .align 256 + .org ia64_ivt+0x6e00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x6e00 Entry 50 (size 16 bundles) Reserved DBG_FAULT(50) FAULT(50) - .align 256 + .org ia64_ivt+0x6f00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x6f00 Entry 51 (size 16 bundles) Reserved DBG_FAULT(51) FAULT(51) - .align 256 + .org ia64_ivt+0x7000 ///////////////////////////////////////////////////////////////////////////////////////// // 0x7000 Entry 52 (size 16 bundles) Reserved DBG_FAULT(52) FAULT(52) - .align 256 + .org ia64_ivt+0x7100 ///////////////////////////////////////////////////////////////////////////////////////// // 0x7100 Entry 53 (size 16 bundles) Reserved DBG_FAULT(53) FAULT(53) - .align 256 + .org ia64_ivt+0x7200 ///////////////////////////////////////////////////////////////////////////////////////// // 0x7200 Entry 54 (size 16 bundles) Reserved DBG_FAULT(54) FAULT(54) - .align 256 + .org ia64_ivt+0x7300 ///////////////////////////////////////////////////////////////////////////////////////// // 0x7300 Entry 55 (size 16 bundles) Reserved DBG_FAULT(55) FAULT(55) - .align 256 + .org ia64_ivt+0x7400 ///////////////////////////////////////////////////////////////////////////////////////// // 0x7400 Entry 56 (size 16 bundles) Reserved DBG_FAULT(56) FAULT(56) - .align 256 + .org ia64_ivt+0x7500 ///////////////////////////////////////////////////////////////////////////////////////// // 0x7500 Entry 57 (size 16 bundles) Reserved DBG_FAULT(57) FAULT(57) - .align 256 + .org ia64_ivt+0x7600 ///////////////////////////////////////////////////////////////////////////////////////// // 0x7600 Entry 58 (size 16 bundles) Reserved DBG_FAULT(58) FAULT(58) - .align 256 + .org ia64_ivt+0x7700 ///////////////////////////////////////////////////////////////////////////////////////// // 0x7700 Entry 59 (size 16 bundles) Reserved DBG_FAULT(59) FAULT(59) - .align 256 + .org ia64_ivt+0x7800 ///////////////////////////////////////////////////////////////////////////////////////// // 0x7800 Entry 60 (size 16 bundles) Reserved DBG_FAULT(60) FAULT(60) - .align 256 + .org ia64_ivt+0x7900 ///////////////////////////////////////////////////////////////////////////////////////// // 0x7900 Entry 61 (size 16 bundles) Reserved DBG_FAULT(61) FAULT(61) - .align 256 + .org ia64_ivt+0x7a00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x7a00 Entry 62 (size 16 bundles) Reserved DBG_FAULT(62) FAULT(62) - .align 256 + .org ia64_ivt+0x7b00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x7b00 Entry 63 (size 16 bundles) Reserved DBG_FAULT(63) FAULT(63) - .align 256 + .org ia64_ivt+0x7c00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x7c00 Entry 64 (size 16 bundles) Reserved DBG_FAULT(64) FAULT(64) - .align 256 + .org ia64_ivt+0x7d00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x7d00 Entry 65 (size 16 bundles) Reserved DBG_FAULT(65) FAULT(65) - .align 256 + .org ia64_ivt+0x7e00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x7e00 Entry 66 (size 16 bundles) Reserved DBG_FAULT(66) FAULT(66) - .align 256 + .org ia64_ivt+0x7f00 ///////////////////////////////////////////////////////////////////////////////////////// // 0x7f00 Entry 67 (size 16 bundles) Reserved DBG_FAULT(67) diff -Nru a/arch/ia64/kernel/machvec.c b/arch/ia64/kernel/machvec.c --- a/arch/ia64/kernel/machvec.c Sun Feb 9 21:13:32 2003 +++ b/arch/ia64/kernel/machvec.c Sun Feb 9 21:13:32 2003 @@ -47,7 +47,7 @@ panic("generic kernel failed to find machine vector for platform %s!", name); } ia64_mv = *mv; - printk("booting generic kernel on platform %s\n", name); + printk(KERN_INFO "booting generic kernel on platform %s\n", name); } #endif /* CONFIG_IA64_GENERIC */ diff -Nru a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c --- a/arch/ia64/kernel/mca.c Sun Feb 9 21:13:32 2003 +++ b/arch/ia64/kernel/mca.c Sun Feb 9 21:13:32 2003 @@ -231,7 +231,7 @@ { /* Register the CPE interrupt vector with SAL */ if (ia64_sal_mc_set_params(SAL_MC_PARAM_CPE_INT, SAL_MC_PARAM_MECHANISM_INT, cpev, 0, 0)) { - printk("ia64_mca_platform_init: failed to register Corrected " + printk(KERN_ERR "ia64_mca_platform_init: failed to register Corrected " "Platform Error interrupt vector with SAL.\n"); return; } @@ -398,7 +398,7 @@ IA64_MCA_RENDEZ_TIMEOUT, 0))) { - printk("ia64_mca_init: Failed to register rendezvous interrupt " + printk(KERN_ERR "ia64_mca_init: Failed to register rendezvous interrupt " "with SAL. rc = %ld\n", rc); return; } @@ -409,8 +409,8 @@ IA64_MCA_WAKEUP_VECTOR, 0, 0))) { - printk("ia64_mca_init: Failed to register wakeup interrupt with SAL. rc = %ld\n", - rc); + printk(KERN_ERR "ia64_mca_init: Failed to register wakeup interrupt with SAL. " + "rc = %ld\n", rc); return; } @@ -430,8 +430,8 @@ ia64_mc_info.imi_mca_handler_size, 0, 0, 0))) { - printk("ia64_mca_init: Failed to register os mca handler with SAL. rc = %ld\n", - rc); + printk(KERN_ERR "ia64_mca_init: Failed to register os mca handler with SAL. " + "rc = %ld\n", rc); return; } @@ -459,8 +459,8 @@ __pa(ia64_get_gp()), ia64_mc_info.imi_slave_init_handler_size))) { - printk("ia64_mca_init: Failed to register m/s init handlers with SAL. rc = %ld\n", - rc); + printk(KERN_ERR "ia64_mca_init: Failed to register m/s init handlers with SAL. " + "rc = %ld\n", rc); return; } @@ -495,7 +495,8 @@ } ia64_mca_register_cpev(cpev); } else - printk("ia64_mca_init: Failed to get routed CPEI vector from ACPI.\n"); + printk(KERN_ERR + "ia64_mca_init: Failed to get routed CPEI vector from ACPI.\n"); } /* Initialize the areas set aside by the OS to buffer the @@ -511,7 +512,7 @@ mca_test(); #endif /* #if defined(MCA_TEST) */ - printk("Mca related initialization done\n"); + printk(KERN_INFO "Mca related initialization done\n"); /* commented out because this is done elsewhere */ #if 0 @@ -807,7 +808,7 @@ sal_log_processor_info_t *proc_ptr; ia64_err_rec_t *plog_ptr; - printk("Entered OS INIT handler\n"); + printk(KERN_INFO "Entered OS INIT handler\n"); /* Get the INIT processor log */ if (!ia64_log_get(SAL_INFO_TYPE_INIT, (prfunc_t)printk)) @@ -1736,8 +1737,7 @@ /* * Now process processor device error record section */ - ia64_log_proc_dev_err_info_print((sal_log_processor_info_t *)slsh, - printk); + ia64_log_proc_dev_err_info_print((sal_log_processor_info_t *)slsh, printk); } IA64_MCA_DEBUG("ia64_mca_log_print: " diff -Nru a/arch/ia64/kernel/minstate.h b/arch/ia64/kernel/minstate.h --- a/arch/ia64/kernel/minstate.h Sun Feb 9 21:13:35 2003 +++ b/arch/ia64/kernel/minstate.h Sun Feb 9 21:13:35 2003 @@ -30,25 +30,23 @@ * on interrupts. */ #define MINSTATE_START_SAVE_MIN_VIRT \ -(pUser) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \ - dep r1=-1,r1,61,3; /* r1 = current (virtual) */ \ +(pUStk) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \ ;; \ -(pUser) mov.m rARRNAT=ar.rnat; \ -(pUser) addl rKRBS=IA64_RBS_OFFSET,r1; /* compute base of RBS */ \ -(pKern) mov r1=sp; /* get sp */ \ - ;; \ -(pUser) lfetch.fault.excl.nt1 [rKRBS]; \ -(pUser) mov rARBSPSTORE=ar.bspstore; /* save ar.bspstore */ \ -(pUser) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1; /* compute base of memory stack */ \ +(pUStk) mov.m rARRNAT=ar.rnat; \ +(pUStk) addl rKRBS=IA64_RBS_OFFSET,r1; /* compute base of RBS */ \ +(pKStk) mov r1=sp; /* get sp */ \ ;; \ -(pUser) mov ar.bspstore=rKRBS; /* switch to kernel RBS */ \ -(pKern) addl r1=-IA64_PT_REGS_SIZE,r1; /* if in kernel mode, use sp (r12) */ \ +(pUStk) lfetch.fault.excl.nt1 [rKRBS]; \ +(pUStk) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1; /* compute base of memory stack */ \ +(pUStk) mov rARBSPSTORE=ar.bspstore; /* save ar.bspstore */ \ ;; \ -(pUser) mov r18=ar.bsp; \ -(pUser) mov ar.rsc=0x3; /* set eager mode, pl 0, little-endian, loadrs=0 */ \ +(pUStk) mov ar.bspstore=rKRBS; /* switch to kernel RBS */ \ +(pKStk) addl r1=-IA64_PT_REGS_SIZE,r1; /* if in kernel mode, use sp (r12) */ \ + ;; \ +(pUStk) mov r18=ar.bsp; \ +(pUStk) mov ar.rsc=0x3; /* set eager mode, pl 0, little-endian, loadrs=0 */ \ #define MINSTATE_END_SAVE_MIN_VIRT \ - or r13=r13,r14; /* make `current' a kernel virtual address */ \ bsw.1; /* switch back to bank 1 (must be last in insn group) */ \ ;; @@ -57,21 +55,21 @@ * go virtual and dont want to destroy the iip or ipsr. */ #define MINSTATE_START_SAVE_MIN_PHYS \ -(pKern) movl sp=ia64_init_stack+IA64_STK_OFFSET-IA64_PT_REGS_SIZE; \ -(pUser) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \ -(pUser) addl rKRBS=IA64_RBS_OFFSET,r1; /* compute base of register backing store */ \ - ;; \ -(pUser) mov rARRNAT=ar.rnat; \ -(pKern) dep r1=0,sp,61,3; /* compute physical addr of sp */ \ -(pUser) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1; /* compute base of memory stack */ \ -(pUser) mov rARBSPSTORE=ar.bspstore; /* save ar.bspstore */ \ -(pUser) dep rKRBS=-1,rKRBS,61,3; /* compute kernel virtual addr of RBS */\ +(pKStk) movl sp=ia64_init_stack+IA64_STK_OFFSET-IA64_PT_REGS_SIZE; \ +(pUStk) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \ +(pUStk) addl rKRBS=IA64_RBS_OFFSET,r1; /* compute base of register backing store */ \ + ;; \ +(pUStk) mov rARRNAT=ar.rnat; \ +(pKStk) dep r1=0,sp,61,3; /* compute physical addr of sp */ \ +(pUStk) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1; /* compute base of memory stack */ \ +(pUStk) mov rARBSPSTORE=ar.bspstore; /* save ar.bspstore */ \ +(pUStk) dep rKRBS=-1,rKRBS,61,3; /* compute kernel virtual addr of RBS */\ ;; \ -(pKern) addl r1=-IA64_PT_REGS_SIZE,r1; /* if in kernel mode, use sp (r12) */ \ -(pUser) mov ar.bspstore=rKRBS; /* switch to kernel RBS */ \ +(pKStk) addl r1=-IA64_PT_REGS_SIZE,r1; /* if in kernel mode, use sp (r12) */ \ +(pUStk) mov ar.bspstore=rKRBS; /* switch to kernel RBS */ \ ;; \ -(pUser) mov r18=ar.bsp; \ -(pUser) mov ar.rsc=0x3; /* set eager mode, pl 0, little-endian, loadrs=0 */ \ +(pUStk) mov r18=ar.bsp; \ +(pUStk) mov ar.rsc=0x3; /* set eager mode, pl 0, little-endian, loadrs=0 */ \ #define MINSTATE_END_SAVE_MIN_PHYS \ or r12=r12,r14; /* make sp a kernel virtual address */ \ @@ -79,11 +77,13 @@ ;; #ifdef MINSTATE_VIRT +# define MINSTATE_GET_CURRENT(reg) mov reg=IA64_KR(CURRENT) # define MINSTATE_START_SAVE_MIN MINSTATE_START_SAVE_MIN_VIRT # define MINSTATE_END_SAVE_MIN MINSTATE_END_SAVE_MIN_VIRT #endif #ifdef MINSTATE_PHYS +# define MINSTATE_GET_CURRENT(reg) mov reg=IA64_KR(CURRENT);; dep reg=0,reg,61,3 # define MINSTATE_START_SAVE_MIN MINSTATE_START_SAVE_MIN_PHYS # define MINSTATE_END_SAVE_MIN MINSTATE_END_SAVE_MIN_PHYS #endif @@ -110,23 +110,26 @@ * we can pass interruption state as arguments to a handler. */ #define DO_SAVE_MIN(COVER,SAVE_IFS,EXTRA) \ - mov rARRSC=ar.rsc; \ - mov rARPFS=ar.pfs; \ - mov rR1=r1; \ - mov rARUNAT=ar.unat; \ - mov rCRIPSR=cr.ipsr; \ - mov rB6=b6; /* rB6 = branch reg 6 */ \ - mov rCRIIP=cr.iip; \ - mov r1=IA64_KR(CURRENT); /* r1 = current (physical) */ \ - COVER; \ + mov rARRSC=ar.rsc; /* M */ \ + mov rARUNAT=ar.unat; /* M */ \ + mov rR1=r1; /* A */ \ + MINSTATE_GET_CURRENT(r1); /* M (or M;;I) */ \ + mov rCRIPSR=cr.ipsr; /* M */ \ + mov rARPFS=ar.pfs; /* I */ \ + mov rCRIIP=cr.iip; /* M */ \ + mov rB6=b6; /* I */ /* rB6 = branch reg 6 */ \ + COVER; /* B;; (or nothing) */ \ ;; \ - invala; \ - extr.u r16=rCRIPSR,32,2; /* extract psr.cpl */ \ + adds r16=IA64_TASK_THREAD_ON_USTACK_OFFSET,r1; \ ;; \ - cmp.eq pKern,pUser=r0,r16; /* are we in kernel mode already? (psr.cpl==0) */ \ + ld1 r17=[r16]; /* load current->thread.on_ustack flag */ \ + st1 [r16]=r0; /* clear current->thread.on_ustack flag */ \ /* switch from user to kernel RBS: */ \ ;; \ + invala; /* M */ \ SAVE_IFS; \ + cmp.eq pKStk,pUStk=r0,r17; /* are we in kernel mode already? (psr.cpl==0) */ \ + ;; \ MINSTATE_START_SAVE_MIN \ add r17=L1_CACHE_BYTES,r1 /* really: biggest cache-line size */ \ ;; \ @@ -138,23 +141,23 @@ ;; \ lfetch.fault.excl.nt1 [r17]; \ adds r17=8,r1; /* initialize second base pointer */ \ -(pKern) mov r18=r0; /* make sure r18 isn't NaT */ \ +(pKStk) mov r18=r0; /* make sure r18 isn't NaT */ \ ;; \ st8 [r17]=rCRIIP,16; /* save cr.iip */ \ st8 [r16]=rCRIFS,16; /* save cr.ifs */ \ -(pUser) sub r18=r18,rKRBS; /* r18=RSE.ndirty*8 */ \ +(pUStk) sub r18=r18,rKRBS; /* r18=RSE.ndirty*8 */ \ ;; \ st8 [r17]=rARUNAT,16; /* save ar.unat */ \ st8 [r16]=rARPFS,16; /* save ar.pfs */ \ shl r18=r18,16; /* compute ar.rsc to be used for "loadrs" */ \ ;; \ st8 [r17]=rARRSC,16; /* save ar.rsc */ \ -(pUser) st8 [r16]=rARRNAT,16; /* save ar.rnat */ \ -(pKern) adds r16=16,r16; /* skip over ar_rnat field */ \ +(pUStk) st8 [r16]=rARRNAT,16; /* save ar.rnat */ \ +(pKStk) adds r16=16,r16; /* skip over ar_rnat field */ \ ;; /* avoid RAW on r16 & r17 */ \ -(pUser) st8 [r17]=rARBSPSTORE,16; /* save ar.bspstore */ \ +(pUStk) st8 [r17]=rARBSPSTORE,16; /* save ar.bspstore */ \ st8 [r16]=rARPR,16; /* save predicates */ \ -(pKern) adds r17=16,r17; /* skip over ar_bspstore field */ \ +(pKStk) adds r17=16,r17; /* skip over ar_bspstore field */ \ ;; \ st8 [r17]=rB6,16; /* save b6 */ \ st8 [r16]=r18,16; /* save ar.rsc value for "loadrs" */ \ diff -Nru a/arch/ia64/kernel/pal.S b/arch/ia64/kernel/pal.S --- a/arch/ia64/kernel/pal.S Sun Feb 9 21:13:37 2003 +++ b/arch/ia64/kernel/pal.S Sun Feb 9 21:13:37 2003 @@ -4,7 +4,7 @@ * * Copyright (C) 1999 Don Dugger * Copyright (C) 1999 Walt Drummond - * Copyright (C) 1999-2001 Hewlett-Packard Co + * Copyright (C) 1999-2001, 2003 Hewlett-Packard Co * David Mosberger * Stephane Eranian * @@ -114,7 +114,7 @@ ;; rsm psr.i mov b7 = loc2 - ;; + ;; br.call.sptk.many rp=b7 // now make the call .ret0: mov psr.l = loc3 mov ar.pfs = loc1 @@ -131,15 +131,15 @@ * in0 Index of PAL service * in2 - in3 Remaning PAL arguments * - * PSR_DB, PSR_LP, PSR_TB, PSR_ID, PSR_DA are never set by the kernel. + * PSR_LP, PSR_TB, PSR_ID, PSR_DA are never set by the kernel. * So we don't need to clear them. */ -#define PAL_PSR_BITS_TO_CLEAR \ - (IA64_PSR_I | IA64_PSR_IT | IA64_PSR_DT | IA64_PSR_RT | \ - IA64_PSR_DD | IA64_PSR_SS | IA64_PSR_RI | IA64_PSR_ED | \ +#define PAL_PSR_BITS_TO_CLEAR \ + (IA64_PSR_I | IA64_PSR_IT | IA64_PSR_DT | IA64_PSR_DB | IA64_PSR_RT | \ + IA64_PSR_DD | IA64_PSR_SS | IA64_PSR_RI | IA64_PSR_ED | \ IA64_PSR_DFL | IA64_PSR_DFH) -#define PAL_PSR_BITS_TO_SET \ +#define PAL_PSR_BITS_TO_SET \ (IA64_PSR_BN) @@ -161,7 +161,7 @@ ;; mov loc3 = psr // save psr adds r8 = 1f-1b,r8 // calculate return address for call - ;; + ;; mov loc4=ar.rsc // save RSE configuration dep.z loc2=loc2,0,61 // convert pal entry point to physical dep.z r8=r8,0,61 // convert rp to physical @@ -275,7 +275,6 @@ * Inputs: * in0 Address of stack storage for fp regs */ - GLOBAL_ENTRY(ia64_load_scratch_fpregs) alloc r3=ar.pfs,1,0,0,0 add r2=16,in0 diff -Nru a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c --- a/arch/ia64/kernel/palinfo.c Sun Feb 9 21:13:28 2003 +++ b/arch/ia64/kernel/palinfo.c Sun Feb 9 21:13:28 2003 @@ -6,7 +6,7 @@ * Intel IA-64 Architecture Software Developer's Manual v1.0. * * - * Copyright (C) 2000-2001 Hewlett-Packard Co + * Copyright (C) 2000-2001, 2003 Hewlett-Packard Co * Stephane Eranian * * 05/26/2000 S.Eranian initial release @@ -225,15 +225,12 @@ int i,j, k; s64 status; - if ((status=ia64_pal_cache_summary(&levels, &unique_caches)) != 0) { - printk("ia64_pal_cache_summary=%ld\n", status); - return 0; + if ((status = ia64_pal_cache_summary(&levels, &unique_caches)) != 0) { + printk(KERN_ERR "ia64_pal_cache_summary=%ld\n", status); + return 0; } - p += sprintf(p, "Cache levels : %ld\n" \ - "Unique caches : %ld\n\n", - levels, - unique_caches); + p += sprintf(p, "Cache levels : %ld\nUnique caches : %ld\n\n", levels, unique_caches); for (i=0; i < levels; i++) { @@ -308,8 +305,8 @@ int i, j; s64 status; - if ((status=ia64_pal_vm_summary(&vm_info_1, &vm_info_2)) !=0) { - printk("ia64_pal_vm_summary=%ld\n", status); + if ((status = ia64_pal_vm_summary(&vm_info_1, &vm_info_2)) !=0) { + printk(KERN_ERR "ia64_pal_vm_summary=%ld\n", status); return 0; } @@ -339,8 +336,8 @@ } p += sprintf(p, "\n"); - if ((status=ia64_pal_vm_page_size(&tr_pages, &vw_pages)) !=0) { - printk("ia64_pal_vm_page_size=%ld\n", status); + if ((status = ia64_pal_vm_page_size(&tr_pages, &vw_pages)) !=0) { + printk(KERN_ERR "ia64_pal_vm_page_size=%ld\n", status); return 0; } @@ -360,7 +357,7 @@ p = bitvector_process(p, vw_pages); if ((status=ia64_get_ptce(&ptce)) != 0) { - printk("ia64_get_ptce=%ld\n",status); + printk(KERN_ERR "ia64_get_ptce=%ld\n", status); return 0; } @@ -710,8 +707,8 @@ u64 rv2:32; } *rid_reg; - if ((status=ia64_pal_vm_summary(&vm_info_1, &vm_info_2)) !=0) { - printk("ia64_pal_vm_summary=%ld\n", status); + if ((status = ia64_pal_vm_summary(&vm_info_1, &vm_info_2)) !=0) { + printk(KERN_ERR "ia64_pal_vm_summary=%ld\n", status); return 0; } max[0] = vm_info_1.pal_vm_info_1_s.max_itr_entry+1; @@ -722,7 +719,8 @@ status = ia64_pal_tr_read(j, i, tr_buffer, &tr_valid); if (status != 0) { - printk("palinfo: pal call failed on tr[%d:%d]=%ld\n", i, j, status); + printk(KERN_ERR "palinfo: pal call failed on tr[%d:%d]=%ld\n", + i, j, status); continue; } @@ -841,7 +839,7 @@ { palinfo_smp_data_t *data = (palinfo_smp_data_t *)info; if (data == NULL) { - printk("%s palinfo: data pointer is NULL\n", KERN_ERR); + printk(KERN_ERR "palinfo: data pointer is NULL\n"); data->ret = 0; /* no output */ return; } @@ -868,7 +866,8 @@ /* will send IPI to other CPU and wait for completion of remote call */ if ((ret=smp_call_function_single(f->req_cpu, palinfo_smp_call, &ptr, 0, 1))) { - printk("palinfo: remote CPU call from %d to %d on function %d: error %d\n", smp_processor_id(), f->req_cpu, f->func_id, ret); + printk(KERN_ERR "palinfo: remote CPU call from %d to %d on function %d: " + "error %d\n", smp_processor_id(), f->req_cpu, f->func_id, ret); return 0; } return ptr.ret; @@ -877,7 +876,7 @@ static int palinfo_handle_smp(pal_func_cpu_u_t *f, char *page) { - printk("palinfo: should not be called with non SMP kernel\n"); + printk(KERN_ERR "palinfo: should not be called with non SMP kernel\n"); return 0; } #endif /* CONFIG_SMP */ diff -Nru a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c --- a/arch/ia64/kernel/perfmon.c Sun Feb 9 21:13:36 2003 +++ b/arch/ia64/kernel/perfmon.c Sun Feb 9 21:13:36 2003 @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -56,8 +55,8 @@ /* * Reset register flags */ -#define PFM_RELOAD_LONG_RESET 1 -#define PFM_RELOAD_SHORT_RESET 2 +#define PFM_PMD_LONG_RESET 1 +#define PFM_PMD_SHORT_RESET 2 /* * Misc macros and definitions @@ -83,8 +82,10 @@ #define PFM_REG_CONFIG (0x4<<4|PFM_REG_IMPL) /* refine configuration */ #define PFM_REG_BUFFER (0x5<<4|PFM_REG_IMPL) /* PMD used as buffer */ +#define PMC_IS_LAST(i) (pmu_conf.pmc_desc[i].type & PFM_REG_END) +#define PMD_IS_LAST(i) (pmu_conf.pmd_desc[i].type & PFM_REG_END) -#define PFM_IS_DISABLED() pmu_conf.pfm_is_disabled +#define PFM_IS_DISABLED() pmu_conf.disabled #define PMC_OVFL_NOTIFY(ctx, i) ((ctx)->ctx_soft_pmds[i].flags & PFM_REGFL_OVFL_NOTIFY) #define PFM_FL_INHERIT_MASK (PFM_FL_INHERIT_NONE|PFM_FL_INHERIT_ONCE|PFM_FL_INHERIT_ALL) @@ -102,7 +103,6 @@ #define PMD_PMD_DEP(i) pmu_conf.pmd_desc[i].dep_pmd[0] #define PMC_PMD_DEP(i) pmu_conf.pmc_desc[i].dep_pmd[0] - /* k assume unsigned */ #define IBR_IS_IMPL(k) (kctx_soft_pmds[i].val + (ia64_get_pmd(i) & pmu_conf.perf_ovfl_val); + return ctx->ctx_soft_pmds[i].val + (ia64_get_pmd(i) & pmu_conf.ovfl_val); } static inline void pfm_write_soft_counter(pfm_context_t *ctx, int i, unsigned long val) { - ctx->ctx_soft_pmds[i].val = val & ~pmu_conf.perf_ovfl_val; + ctx->ctx_soft_pmds[i].val = val & ~pmu_conf.ovfl_val; /* * writing to unimplemented part is ignore, so we do not need to * mask off top part */ - ia64_set_pmd(i, val & pmu_conf.perf_ovfl_val); + ia64_set_pmd(i, val & pmu_conf.ovfl_val); } /* - * finds the number of PM(C|D) registers given - * the bitvector returned by PAL - */ -static unsigned long __init -find_num_pm_regs(long *buffer) -{ - int i=3; /* 4 words/per bitvector */ - - /* start from the most significant word */ - while (i>=0 && buffer[i] == 0 ) i--; - if (i< 0) { - printk(KERN_ERR "perfmon: No bit set in pm_buffer\n"); - return 0; - } - return 1+ ia64_fls(buffer[i]) + 64 * i; -} - - -/* * Generates a unique (per CPU) timestamp */ static inline unsigned long @@ -562,7 +593,7 @@ pfm_smpl_buffer_desc_t *psb = (pfm_smpl_buffer_desc_t *)vma->vm_private_data; if (psb == NULL) { - printk("perfmon: psb is null in [%d]\n", current->pid); + printk(KERN_DEBUG "perfmon: psb is null in [%d]\n", current->pid); return; } /* @@ -627,7 +658,7 @@ * some sanity checks first */ if (ctx == NULL || task->mm == NULL || ctx->ctx_smpl_vaddr == 0 || ctx->ctx_psb == NULL) { - printk("perfmon: invalid context mm=%p\n", task->mm); + printk(KERN_DEBUG "perfmon: invalid context mm=%p\n", task->mm); return -1; } psb = ctx->ctx_psb; @@ -638,11 +669,11 @@ up_write(&task->mm->mmap_sem); if (r !=0) { - printk("perfmon: pid %d unable to unmap sampling buffer @0x%lx size=%ld\n", - task->pid, ctx->ctx_smpl_vaddr, psb->psb_size); + printk(KERN_DEBUG "perfmon: pid %d unable to unmap sampling buffer " + "@0x%lx size=%ld\n", task->pid, ctx->ctx_smpl_vaddr, psb->psb_size); } - DBprintk(("[%d] do_unmap(0x%lx, %ld)=%d refcnt=%lu psb_flags=0x%x\n", + DBprintk(("[%d] do_unmap(0x%lx, %ld)=%d refcnt=%lu psb_flags=0x%x\n", task->pid, ctx->ctx_smpl_vaddr, psb->psb_size, r, psb->psb_refcnt, psb->psb_flags)); return 0; @@ -677,7 +708,7 @@ page = pfm_kvirt_to_pa(buf); if (remap_page_range(vma, addr, page, PAGE_SIZE, PAGE_READONLY)) return -ENOMEM; - + addr += PAGE_SIZE; buf += PAGE_SIZE; size -= PAGE_SIZE; @@ -834,7 +865,7 @@ vma->vm_end = vma->vm_start + size; DBprintk(("entries=%ld aligned size=%ld, unmapped @0x%lx\n", entries, size, vma->vm_start)); - + /* can only be applied to current, need to have the mm semaphore held when called */ if (pfm_remap_buffer(vma, (unsigned long)smpl_buf, vma->vm_start, size)) { DBprintk(("Can't remap buffer\n")); @@ -875,6 +906,121 @@ return -ENOMEM; } +static int +pfm_reserve_session(struct task_struct *task, int is_syswide, unsigned long cpu_mask) +{ + unsigned long m, undo_mask; + unsigned int n, i; + + /* + * validy checks on cpu_mask have been done upstream + */ + LOCK_PFS(); + + if (is_syswide) { + /* + * cannot mix system wide and per-task sessions + */ + if (pfm_sessions.pfs_task_sessions > 0UL) { + DBprintk(("system wide not possible, %u conflicting task_sessions\n", + pfm_sessions.pfs_task_sessions)); + goto abort; + } + + m = cpu_mask; undo_mask = 0UL; n = 0; + DBprintk(("cpu_mask=0x%lx\n", cpu_mask)); + for(i=0; m; i++, m>>=1) { + + if ((m & 0x1) == 0UL) continue; + + if (pfm_sessions.pfs_sys_session[i]) goto undo; + + DBprintk(("reserving CPU%d currently on CPU%d\n", i, smp_processor_id())); + + pfm_sessions.pfs_sys_session[i] = task; + undo_mask |= 1UL << i; + n++; + } + pfm_sessions.pfs_sys_sessions += n; + } else { + if (pfm_sessions.pfs_sys_sessions) goto abort; + pfm_sessions.pfs_task_sessions++; + } + DBprintk(("task_sessions=%u sys_session[%d]=%d", + pfm_sessions.pfs_task_sessions, + smp_processor_id(), pfm_sessions.pfs_sys_session[smp_processor_id()] ? 1 : 0)); + UNLOCK_PFS(); + return 0; +undo: + DBprintk(("system wide not possible, conflicting session [%d] on CPU%d\n", + pfm_sessions.pfs_sys_session[i]->pid, i)); + + for(i=0; undo_mask; i++, undo_mask >>=1) { + pfm_sessions.pfs_sys_session[i] = NULL; + } +abort: + UNLOCK_PFS(); + + return -EBUSY; + +} + +static int +pfm_unreserve_session(struct task_struct *task, int is_syswide, unsigned long cpu_mask) +{ + pfm_context_t *ctx; + unsigned long m; + unsigned int n, i; + + ctx = task ? task->thread.pfm_context : NULL; + + /* + * validy checks on cpu_mask have been done upstream + */ + LOCK_PFS(); + + DBprintk(("[%d] sys_sessions=%u task_sessions=%u dbregs=%u syswide=%d cpu_mask=0x%lx\n", + task->pid, + pfm_sessions.pfs_sys_sessions, + pfm_sessions.pfs_task_sessions, + pfm_sessions.pfs_sys_use_dbregs, + is_syswide, + cpu_mask)); + + + if (is_syswide) { + m = cpu_mask; n = 0; + for(i=0; m; i++, m>>=1) { + if ((m & 0x1) == 0UL) continue; + pfm_sessions.pfs_sys_session[i] = NULL; + n++; + } + /* + * would not work with perfmon+more than one bit in cpu_mask + */ + if (ctx && ctx->ctx_fl_using_dbreg) { + if (pfm_sessions.pfs_sys_use_dbregs == 0) { + printk(KERN_DEBUG "perfmon: invalid release for [%d] " + "sys_use_dbregs=0\n", task->pid); + } else { + pfm_sessions.pfs_sys_use_dbregs--; + } + } + pfm_sessions.pfs_sys_sessions -= n; + + DBprintk(("CPU%d sys_sessions=%u\n", + smp_processor_id(), pfm_sessions.pfs_sys_sessions)); + } else { + pfm_sessions.pfs_task_sessions--; + DBprintk(("[%d] task_sessions=%u\n", + task->pid, pfm_sessions.pfs_task_sessions)); + } + + UNLOCK_PFS(); + + return 0; +} + /* * XXX: do something better here */ @@ -891,6 +1037,7 @@ static int pfx_is_sane(struct task_struct *task, pfarg_context_t *pfx) { + unsigned long smpl_pmds = pfx->ctx_smpl_regs[0]; int ctx_flags; int cpu; @@ -957,6 +1104,11 @@ } #endif } + /* verify validity of smpl_regs */ + if ((smpl_pmds & pmu_conf.impl_pmds[0]) != smpl_pmds) { + DBprintk(("invalid smpl_regs 0x%lx\n", smpl_pmds)); + return -EINVAL; + } /* probably more to add here */ return 0; @@ -968,7 +1120,7 @@ { pfarg_context_t tmp; void *uaddr = NULL; - int ret, cpu = 0; + int ret; int ctx_flags; pid_t notify_pid; @@ -987,40 +1139,8 @@ ctx_flags = tmp.ctx_flags; - ret = -EBUSY; - - LOCK_PFS(); - - if (ctx_flags & PFM_FL_SYSTEM_WIDE) { - - /* at this point, we know there is at least one bit set */ - cpu = ffz(~tmp.ctx_cpu_mask); - - DBprintk(("requesting CPU%d currently on CPU%d\n",cpu, smp_processor_id())); - - if (pfm_sessions.pfs_task_sessions > 0) { - DBprintk(("system wide not possible, task_sessions=%ld\n", pfm_sessions.pfs_task_sessions)); - goto abort; - } - - if (pfm_sessions.pfs_sys_session[cpu]) { - DBprintk(("system wide not possible, conflicting session [%d] on CPU%d\n",pfm_sessions.pfs_sys_session[cpu]->pid, cpu)); - goto abort; - } - pfm_sessions.pfs_sys_session[cpu] = task; - /* - * count the number of system wide sessions - */ - pfm_sessions.pfs_sys_sessions++; - - } else if (pfm_sessions.pfs_sys_sessions == 0) { - pfm_sessions.pfs_task_sessions++; - } else { - /* no per-process monitoring while there is a system wide session */ - goto abort; - } - - UNLOCK_PFS(); + ret = pfm_reserve_session(task, ctx_flags & PFM_FL_SYSTEM_WIDE, tmp.ctx_cpu_mask); + if (ret) goto abort; ret = -ENOMEM; @@ -1103,6 +1223,7 @@ ctx->ctx_fl_inherit = ctx_flags & PFM_FL_INHERIT_MASK; ctx->ctx_fl_block = (ctx_flags & PFM_FL_NOTIFY_BLOCK) ? 1 : 0; ctx->ctx_fl_system = (ctx_flags & PFM_FL_SYSTEM_WIDE) ? 1: 0; + ctx->ctx_fl_excl_idle = (ctx_flags & PFM_FL_EXCL_IDLE) ? 1: 0; ctx->ctx_fl_frozen = 0; /* * setting this flag to 0 here means, that the creator or the task that the @@ -1113,14 +1234,10 @@ ctx->ctx_fl_protected = 0; /* for system wide mode only (only 1 bit set) */ - ctx->ctx_cpu = cpu; + ctx->ctx_cpu = ffz(~tmp.ctx_cpu_mask); atomic_set(&ctx->ctx_last_cpu,-1); /* SMP only, means no CPU */ - /* may be redudant with memset() but at least it's easier to remember */ - atomic_set(&ctx->ctx_saving_in_progress, 0); - atomic_set(&ctx->ctx_is_busy, 0); - sema_init(&ctx->ctx_restart_sem, 0); /* init this semaphore to locked */ if (__copy_to_user(req, &tmp, sizeof(tmp))) { @@ -1131,9 +1248,9 @@ DBprintk(("context=%p, pid=%d notify_task=%p\n", (void *)ctx, task->pid, ctx->ctx_notify_task)); - DBprintk(("context=%p, pid=%d flags=0x%x inherit=%d block=%d system=%d\n", + DBprintk(("context=%p, pid=%d flags=0x%x inherit=%d block=%d system=%d excl_idle=%d\n", (void *)ctx, task->pid, ctx_flags, ctx->ctx_fl_inherit, - ctx->ctx_fl_block, ctx->ctx_fl_system)); + ctx->ctx_fl_block, ctx->ctx_fl_system, ctx->ctx_fl_excl_idle)); /* * when no notification is required, we can make this visible at the last moment @@ -1146,8 +1263,8 @@ */ if (ctx->ctx_fl_system) { ctx->ctx_saved_cpus_allowed = task->cpus_allowed; - set_cpus_allowed(task, 1UL << cpu); - DBprintk(("[%d] rescheduled allowed=0x%lx\n", task->pid,task->cpus_allowed)); + set_cpus_allowed(task, tmp.ctx_cpu_mask); + DBprintk(("[%d] rescheduled allowed=0x%lx\n", task->pid, task->cpus_allowed)); } return 0; @@ -1155,20 +1272,8 @@ buffer_error: pfm_context_free(ctx); error: - /* - * undo session reservation - */ - LOCK_PFS(); - - if (ctx_flags & PFM_FL_SYSTEM_WIDE) { - pfm_sessions.pfs_sys_session[cpu] = NULL; - pfm_sessions.pfs_sys_sessions--; - } else { - pfm_sessions.pfs_task_sessions--; - } + pfm_unreserve_session(task, ctx_flags & PFM_FL_SYSTEM_WIDE , tmp.ctx_cpu_mask); abort: - UNLOCK_PFS(); - /* make sure we don't leave anything behind */ task->thread.pfm_context = NULL; @@ -1200,9 +1305,7 @@ unsigned long mask = ovfl_regs[0]; unsigned long reset_others = 0UL; unsigned long val; - int i, is_long_reset = (flag & PFM_RELOAD_LONG_RESET); - - DBprintk(("masks=0x%lx\n", mask)); + int i, is_long_reset = (flag == PFM_PMD_LONG_RESET); /* * now restore reset value on sampling overflowed counters @@ -1213,7 +1316,7 @@ val = pfm_new_counter_value(ctx->ctx_soft_pmds + i, is_long_reset); reset_others |= ctx->ctx_soft_pmds[i].reset_pmds[0]; - DBprintk(("[%d] %s reset soft_pmd[%d]=%lx\n", current->pid, + DBprintk_ovfl(("[%d] %s reset soft_pmd[%d]=%lx\n", current->pid, is_long_reset ? "long" : "short", i, val)); /* upper part is ignored on rval */ @@ -1235,7 +1338,7 @@ } else { ia64_set_pmd(i, val); } - DBprintk(("[%d] %s reset_others pmd[%d]=%lx\n", current->pid, + DBprintk_ovfl(("[%d] %s reset_others pmd[%d]=%lx\n", current->pid, is_long_reset ? "long" : "short", i, val)); } ia64_srlz_d(); @@ -1246,7 +1349,7 @@ { struct thread_struct *th = &task->thread; pfarg_reg_t tmp, *req = (pfarg_reg_t *)arg; - unsigned long value; + unsigned long value, reset_pmds; unsigned int cnum, reg_flags, flags; int i; int ret = -EINVAL; @@ -1262,10 +1365,11 @@ if (__copy_from_user(&tmp, req, sizeof(tmp))) return -EFAULT; - cnum = tmp.reg_num; - reg_flags = tmp.reg_flags; - value = tmp.reg_value; - flags = 0; + cnum = tmp.reg_num; + reg_flags = tmp.reg_flags; + value = tmp.reg_value; + reset_pmds = tmp.reg_reset_pmds[0]; + flags = 0; /* * we reject all non implemented PMC as well @@ -1283,6 +1387,8 @@ * any other configuration is rejected. */ if (PMC_IS_MONITOR(cnum) || PMC_IS_COUNTING(cnum)) { + DBprintk(("pmc[%u].pm=%ld\n", cnum, PMC_PM(cnum, value))); + if (ctx->ctx_fl_system ^ PMC_PM(cnum, value)) { DBprintk(("pmc_pm=%ld fl_system=%d\n", PMC_PM(cnum, value), ctx->ctx_fl_system)); goto error; @@ -1310,6 +1416,11 @@ if (reg_flags & PFM_REGFL_RANDOM) flags |= PFM_REGFL_RANDOM; + /* verify validity of reset_pmds */ + if ((reset_pmds & pmu_conf.impl_pmds[0]) != reset_pmds) { + DBprintk(("invalid reset_pmds 0x%lx for pmc%u\n", reset_pmds, cnum)); + goto error; + } } else if (reg_flags & (PFM_REGFL_OVFL_NOTIFY|PFM_REGFL_RANDOM)) { DBprintk(("cannot set ovfl_notify or random on pmc%u\n", cnum)); goto error; @@ -1348,13 +1459,10 @@ ctx->ctx_soft_pmds[cnum].flags = flags; if (PMC_IS_COUNTING(cnum)) { - /* - * copy reset vector - */ - ctx->ctx_soft_pmds[cnum].reset_pmds[0] = tmp.reg_reset_pmds[0]; - ctx->ctx_soft_pmds[cnum].reset_pmds[1] = tmp.reg_reset_pmds[1]; - ctx->ctx_soft_pmds[cnum].reset_pmds[2] = tmp.reg_reset_pmds[2]; - ctx->ctx_soft_pmds[cnum].reset_pmds[3] = tmp.reg_reset_pmds[3]; + ctx->ctx_soft_pmds[cnum].reset_pmds[0] = reset_pmds; + + /* mark all PMDS to be accessed as used */ + CTX_USED_PMD(ctx, reset_pmds); } /* @@ -1397,7 +1505,7 @@ unsigned long value, hw_value; unsigned int cnum; int i; - int ret; + int ret = 0; /* we don't quite support this right now */ if (task != current) return -EINVAL; @@ -1448,9 +1556,9 @@ /* update virtualized (64bits) counter */ if (PMD_IS_COUNTING(cnum)) { ctx->ctx_soft_pmds[cnum].lval = value; - ctx->ctx_soft_pmds[cnum].val = value & ~pmu_conf.perf_ovfl_val; + ctx->ctx_soft_pmds[cnum].val = value & ~pmu_conf.ovfl_val; - hw_value = value & pmu_conf.perf_ovfl_val; + hw_value = value & pmu_conf.ovfl_val; ctx->ctx_soft_pmds[cnum].long_reset = tmp.reg_long_reset; ctx->ctx_soft_pmds[cnum].short_reset = tmp.reg_short_reset; @@ -1478,7 +1586,7 @@ ctx->ctx_soft_pmds[cnum].val, ctx->ctx_soft_pmds[cnum].short_reset, ctx->ctx_soft_pmds[cnum].long_reset, - ia64_get_pmd(cnum) & pmu_conf.perf_ovfl_val, + ia64_get_pmd(cnum) & pmu_conf.ovfl_val, PMC_OVFL_NOTIFY(ctx, cnum) ? 'Y':'N', ctx->ctx_used_pmds[0], ctx->ctx_soft_pmds[cnum].reset_pmds[0])); @@ -1504,15 +1612,18 @@ return ret; } - static int pfm_read_pmds(struct task_struct *task, pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) { struct thread_struct *th = &task->thread; - unsigned long val = 0UL; + unsigned long val, lval; pfarg_reg_t *req = (pfarg_reg_t *)arg; unsigned int cnum, reg_flags = 0; - int i, ret = -EINVAL; + int i, ret = 0; + +#if __GNUC__ < 3 + int foo; +#endif if (!CTX_IS_ENABLED(ctx)) return -EINVAL; @@ -1528,9 +1639,16 @@ DBprintk(("ctx_last_cpu=%d for [%d]\n", atomic_read(&ctx->ctx_last_cpu), task->pid)); for (i = 0; i < count; i++, req++) { - +#if __GNUC__ < 3 + foo = __get_user(cnum, &req->reg_num); + if (foo) return -EFAULT; + foo = __get_user(reg_flags, &req->reg_flags); + if (foo) return -EFAULT; +#else if (__get_user(cnum, &req->reg_num)) return -EFAULT; if (__get_user(reg_flags, &req->reg_flags)) return -EFAULT; +#endif + lval = 0UL; if (!PMD_IS_IMPL(cnum)) goto abort_mission; /* @@ -1553,34 +1671,16 @@ val = ia64_get_pmd(cnum); DBprintk(("reading pmd[%u]=0x%lx from hw\n", cnum, val)); } else { -#ifdef CONFIG_SMP - int cpu; - /* - * for SMP system, the context may still be live on another - * CPU so we need to fetch it before proceeding with the read - * This call we only be made once for the whole loop because - * of ctx_last_cpu becoming == -1. - * - * We cannot reuse ctx_last_cpu as it may change before we get to the - * actual IPI call. In this case, we will do the call for nothing but - * there is no way around it. The receiving side will simply do nothing. - */ - cpu = atomic_read(&ctx->ctx_last_cpu); - if (cpu != -1) { - DBprintk(("must fetch on CPU%d for [%d]\n", cpu, task->pid)); - pfm_fetch_regs(cpu, task, ctx); - } -#endif - /* context has been saved */ val = th->pmd[cnum]; } if (PMD_IS_COUNTING(cnum)) { /* * XXX: need to check for overflow */ - - val &= pmu_conf.perf_ovfl_val; + val &= pmu_conf.ovfl_val; val += ctx->ctx_soft_pmds[cnum].val; + + lval = ctx->ctx_soft_pmds[cnum].lval; } /* @@ -1592,10 +1692,11 @@ val = v; } - PFM_REG_RETFLAG_SET(reg_flags, 0); + PFM_REG_RETFLAG_SET(reg_flags, ret); DBprintk(("read pmd[%u] ret=%d value=0x%lx pmc=0x%lx\n", - cnum, ret, val, ia64_get_pmc(cnum))); + cnum, ret, val, ia64_get_pmc(cnum))); + /* * update register return value, abort all if problem during copy. * we only modify the reg_flags field. no check mode is fine because @@ -1604,16 +1705,19 @@ if (__put_user(cnum, &req->reg_num)) return -EFAULT; if (__put_user(val, &req->reg_value)) return -EFAULT; if (__put_user(reg_flags, &req->reg_flags)) return -EFAULT; + if (__put_user(lval, &req->reg_last_reset_value)) return -EFAULT; } return 0; abort_mission: PFM_REG_RETFLAG_SET(reg_flags, PFM_REG_RETFL_EINVAL); + /* + * XXX: if this fails, we stick with the original failure, flag not updated! + */ + __put_user(reg_flags, &req->reg_flags); - if (__put_user(reg_flags, &req->reg_flags)) ret = -EFAULT; - - return ret; + return -EINVAL; } #ifdef PFM_PMU_USES_DBR @@ -1655,7 +1759,7 @@ else pfm_sessions.pfs_ptrace_use_dbregs++; - DBprintk(("ptrace_use_dbregs=%lu sys_use_dbregs=%lu by [%d] ret = %d\n", + DBprintk(("ptrace_use_dbregs=%u sys_use_dbregs=%u by [%d] ret = %d\n", pfm_sessions.pfs_ptrace_use_dbregs, pfm_sessions.pfs_sys_use_dbregs, task->pid, ret)); @@ -1673,7 +1777,6 @@ * perfmormance monitoring, so we only decrement the number * of "ptraced" debug register users to keep the count up to date */ - int pfm_release_debug_registers(struct task_struct *task) { @@ -1681,7 +1784,8 @@ LOCK_PFS(); if (pfm_sessions.pfs_ptrace_use_dbregs == 0) { - printk("perfmon: invalid release for [%d] ptrace_use_dbregs=0\n", task->pid); + printk(KERN_DEBUG "perfmon: invalid release for [%d] ptrace_use_dbregs=0\n", + task->pid); ret = -1; } else { pfm_sessions.pfs_ptrace_use_dbregs--; @@ -1702,6 +1806,7 @@ { return 0; } + int pfm_release_debug_registers(struct task_struct *task) { @@ -1721,9 +1826,12 @@ if (!CTX_IS_ENABLED(ctx)) return -EINVAL; if (task == current) { - DBprintk(("restarting self %d frozen=%d \n", current->pid, ctx->ctx_fl_frozen)); + DBprintk(("restarting self %d frozen=%d ovfl_regs=0x%lx\n", + task->pid, + ctx->ctx_fl_frozen, + ctx->ctx_ovfl_regs[0])); - pfm_reset_regs(ctx, ctx->ctx_ovfl_regs, PFM_RELOAD_LONG_RESET); + pfm_reset_regs(ctx, ctx->ctx_ovfl_regs, PFM_PMD_LONG_RESET); ctx->ctx_ovfl_regs[0] = 0UL; @@ -1739,8 +1847,7 @@ } /* simply unfreeze */ - ia64_set_pmc(0, 0); - ia64_srlz_d(); + pfm_unfreeze_pmu(); return 0; } @@ -1806,18 +1913,18 @@ ia64_set_dcr(ia64_get_dcr() & ~IA64_DCR_PP); /* stop monitoring */ - __asm__ __volatile__ ("rsm psr.pp;;"::: "memory"); + pfm_clear_psr_pp(); ia64_srlz_i(); - __get_cpu_var(pfm_dcr_pp) = 0; + PFM_CPUINFO_CLEAR(PFM_CPUINFO_DCR_PP); ia64_psr(regs)->pp = 0; } else { /* stop monitoring */ - __asm__ __volatile__ ("rum psr.up;;"::: "memory"); + pfm_clear_psr_up(); ia64_srlz_i(); @@ -1939,7 +2046,7 @@ pfm_sysctl.debug = mode == 0 ? 0 : 1; - printk("perfmon debugging %s\n", pfm_sysctl.debug ? "on" : "off"); + printk(KERN_INFO "perfmon debugging %s\n", pfm_sysctl.debug ? "on" : "off"); return 0; } @@ -1979,14 +2086,9 @@ int i, ret = 0; /* - * for range restriction: psr.db must be cleared or the - * the PMU will ignore the debug registers. - * - * XXX: may need more in system wide mode, - * no task can have this bit set? + * we do not need to check for ipsr.db because we do clear ibr.x, dbr.r, and dbr.w + * ensuring that no real breakpoint can be installed via this call. */ - if (ia64_psr(regs)->db == 1) return -EINVAL; - first_time = ctx->ctx_fl_using_dbreg == 0; @@ -2055,7 +2157,6 @@ * Now install the values into the registers */ for (i = 0; i < count; i++, req++) { - if (__copy_from_user(&tmp, req, sizeof(tmp))) goto abort_mission; @@ -2145,7 +2246,7 @@ * XXX: for now we can only come here on EINVAL */ PFM_REG_RETFLAG_SET(tmp.dbreg_flags, PFM_REG_RETFL_EINVAL); - __put_user(tmp.dbreg_flags, &req->dbreg_flags); + if (__put_user(tmp.dbreg_flags, &req->dbreg_flags)) ret = -EFAULT; } return ret; } @@ -2209,19 +2310,19 @@ current)); if (PMU_OWNER() != task) { - printk("perfmon: pfm_start task [%d] not pmu owner\n", task->pid); + printk(KERN_DEBUG "perfmon: pfm_start task [%d] not pmu owner\n", task->pid); return -EINVAL; } if (ctx->ctx_fl_system) { - __get_cpu_var(pfm_dcr_pp) = 1; + PFM_CPUINFO_SET(PFM_CPUINFO_DCR_PP); /* set user level psr.pp */ ia64_psr(regs)->pp = 1; /* start monitoring at kernel level */ - __asm__ __volatile__ ("ssm psr.pp;;"::: "memory"); + pfm_set_psr_pp(); /* enable dcr pp */ ia64_set_dcr(ia64_get_dcr()|IA64_DCR_PP); @@ -2230,14 +2331,15 @@ } else { if ((task->thread.flags & IA64_THREAD_PM_VALID) == 0) { - printk("perfmon: pfm_start task flag not set for [%d]\n", task->pid); + printk(KERN_DEBUG "perfmon: pfm_start task flag not set for [%d]\n", + task->pid); return -EINVAL; } /* set user level psr.up */ ia64_psr(regs)->up = 1; /* start monitoring at kernel level */ - __asm__ __volatile__ ("sum psr.up;;"::: "memory"); + pfm_set_psr_up(); ia64_srlz_i(); } @@ -2264,11 +2366,12 @@ ia64_psr(regs)->up = 0; /* just to make sure! */ /* make sure monitoring is stopped */ - __asm__ __volatile__ ("rsm psr.pp;;"::: "memory"); + pfm_clear_psr_pp(); ia64_srlz_i(); - __get_cpu_var(pfm_dcr_pp) = 0; - __get_cpu_var(pfm_syst_wide) = 1; + PFM_CPUINFO_CLEAR(PFM_CPUINFO_DCR_PP); + PFM_CPUINFO_SET(PFM_CPUINFO_SYST_WIDE); + if (ctx->ctx_fl_excl_idle) PFM_CPUINFO_SET(PFM_CPUINFO_EXCL_IDLE); } else { /* * needed in case the task was a passive task during @@ -2279,7 +2382,7 @@ ia64_psr(regs)->up = 0; /* make sure monitoring is stopped */ - __asm__ __volatile__ ("rum psr.up;;"::: "memory"); + pfm_clear_psr_up(); ia64_srlz_i(); DBprintk(("clearing psr.sp for [%d]\n", current->pid)); @@ -2297,8 +2400,7 @@ atomic_set(&ctx->ctx_last_cpu, smp_processor_id()); /* simply unfreeze */ - ia64_set_pmc(0, 0); - ia64_srlz_d(); + pfm_unfreeze_pmu(); return 0; } @@ -2331,6 +2433,7 @@ abort_mission: PFM_REG_RETFLAG_SET(tmp.reg_flags, PFM_REG_RETFL_EINVAL); if (__copy_to_user(req, &tmp, sizeof(tmp))) ret = -EFAULT; + return ret; } @@ -2400,7 +2503,7 @@ return ret; } -asmlinkage int +asmlinkage long sys_perfmonctl (pid_t pid, int cmd, void *arg, int count, long arg5, long arg6, long arg7, long arg8, long stack) { @@ -2503,7 +2606,7 @@ * do some sanity checks first */ if (!ctx) { - printk("perfmon: [%d] has no PFM context\n", current->pid); + printk(KERN_DEBUG "perfmon: [%d] has no PFM context\n", current->pid); return; } @@ -2532,7 +2635,7 @@ * use the local reference */ - pfm_reset_regs(ctx, ctx->ctx_ovfl_regs, PFM_RELOAD_LONG_RESET); + pfm_reset_regs(ctx, ctx->ctx_ovfl_regs, PFM_PMD_LONG_RESET); ctx->ctx_ovfl_regs[0] = 0UL; @@ -2545,8 +2648,7 @@ ctx->ctx_psb->psb_index = 0; } - ia64_set_pmc(0, 0); - ia64_srlz_d(); + pfm_unfreeze_pmu(); /* state restored, can go back to work (user mode) */ } @@ -2591,19 +2693,11 @@ h->pid = current->pid; h->cpu = smp_processor_id(); h->last_reset_value = ovfl_mask ? ctx->ctx_soft_pmds[ffz(~ovfl_mask)].lval : 0UL; - /* - * where did the fault happen - */ - h->ip = regs ? regs->cr_iip | ((regs->cr_ipsr >> 41) & 0x3): 0x0UL; - - /* - * which registers overflowed - */ - h->regs = ovfl_mask; + h->ip = regs ? regs->cr_iip | ((regs->cr_ipsr >> 41) & 0x3): 0x0UL; + h->regs = ovfl_mask; /* which registers overflowed */ /* guaranteed to monotonically increase on each cpu */ h->stamp = pfm_get_stamp(); - h->period = 0UL; /* not yet used */ /* position for first pmd */ e = (unsigned long *)(h+1); @@ -2683,16 +2777,16 @@ * Don't think this could happen given upfront tests */ if ((t->flags & IA64_THREAD_PM_VALID) == 0 && ctx->ctx_fl_system == 0) { - printk("perfmon: Spurious overflow interrupt: process %d not using perfmon\n", - task->pid); + printk(KERN_DEBUG "perfmon: Spurious overflow interrupt: process %d not " + "using perfmon\n", task->pid); return 0x1; } /* * sanity test. Should never happen */ if ((pmc0 & 0x1) == 0) { - printk("perfmon: pid %d pmc0=0x%lx assumption error for freeze bit\n", - task->pid, pmc0); + printk(KERN_DEBUG "perfmon: pid %d pmc0=0x%lx assumption error for freeze bit\n", + task->pid, pmc0); return 0x0; } @@ -2724,7 +2818,7 @@ * pfm_read_pmds(). */ old_val = ctx->ctx_soft_pmds[i].val; - ctx->ctx_soft_pmds[i].val += 1 + pmu_conf.perf_ovfl_val; + ctx->ctx_soft_pmds[i].val += 1 + pmu_conf.ovfl_val; /* * check for overflow condition @@ -2739,9 +2833,7 @@ } DBprintk_ovfl(("soft_pmd[%d].val=0x%lx old_val=0x%lx pmd=0x%lx ovfl_pmds=0x%lx ovfl_notify=0x%lx\n", i, ctx->ctx_soft_pmds[i].val, old_val, - ia64_get_pmd(i) & pmu_conf.perf_ovfl_val, ovfl_pmds, ovfl_notify)); - - + ia64_get_pmd(i) & pmu_conf.ovfl_val, ovfl_pmds, ovfl_notify)); } /* @@ -2776,7 +2868,7 @@ */ if (ovfl_notify == 0UL) { if (ovfl_pmds) - pfm_reset_regs(ctx, &ovfl_pmds, PFM_RELOAD_SHORT_RESET); + pfm_reset_regs(ctx, &ovfl_pmds, PFM_PMD_SHORT_RESET); return 0x0; } @@ -2859,8 +2951,8 @@ * this call is safe in an interrupt handler, so does read_lock() on tasklist_lock */ ret = send_sig_info(SIGPROF, &si, ctx->ctx_notify_task); - if (ret != 0) - printk("send_sig_info(process %d, SIGPROF)=%d\n", + if (ret != 0) + printk(KERN_DEBUG "send_sig_info(process %d, SIGPROF)=%d\n", ctx->ctx_notify_task->pid, ret); /* * now undo the protections in order @@ -2924,7 +3016,7 @@ } static void -perfmon_interrupt (int irq, void *arg, struct pt_regs *regs) +pfm_interrupt_handler(int irq, void *arg, struct pt_regs *regs) { u64 pmc0; struct task_struct *task; @@ -2932,6 +3024,14 @@ pfm_stats[smp_processor_id()].pfm_ovfl_intr_count++; + /* + * if an alternate handler is registered, just bypass the default one + */ + if (pfm_alternate_intr_handler) { + (*pfm_alternate_intr_handler->handler)(irq, arg, regs); + return; + } + /* * srlz.d done before arriving here * @@ -2951,23 +3051,10 @@ /* sanity check */ if (!ctx) { - printk("perfmon: Spurious overflow interrupt: process %d has no PFM context\n", - task->pid); + printk(KERN_DEBUG "perfmon: Spurious overflow interrupt: process %d has " + "no PFM context\n", task->pid); return; } -#ifdef CONFIG_SMP - /* - * Because an IPI has higher priority than the PMU overflow interrupt, it is - * possible that the handler be interrupted by a request from another CPU to fetch - * the PMU state of the currently active context. The task may have just been - * migrated to another CPU which is trying to restore the context. If there was - * a pending overflow interrupt when the task left this CPU, it is possible for - * the handler to get interrupt by the IPI. In which case, we fetch request - * MUST be postponed until the interrupt handler is done. The ctx_is_busy - * flag indicates such a condition. The other CPU must busy wait until it's cleared. - */ - atomic_set(&ctx->ctx_is_busy, 1); -#endif /* * assume PMC[0].fr = 1 at this point @@ -2981,12 +3068,6 @@ ia64_set_pmc(0, pmc0); ia64_srlz_d(); -#ifdef CONFIG_SMP - /* - * announce that we are doing with the context - */ - atomic_set(&ctx->ctx_is_busy, 0); -#endif } else { pfm_stats[smp_processor_id()].pfm_spurious_ovfl_intr_count++; } @@ -2994,14 +3075,13 @@ /* for debug only */ static int -perfmon_proc_info(char *page) +pfm_proc_info(char *page) { char *p = page; int i; - p += sprintf(p, "enabled : %s\n", pmu_conf.pfm_is_disabled ? "No": "Yes"); p += sprintf(p, "fastctxsw : %s\n", pfm_sysctl.fastctxsw > 0 ? "Yes": "No"); - p += sprintf(p, "ovfl_mask : 0x%lx\n", pmu_conf.perf_ovfl_val); + p += sprintf(p, "ovfl_mask : 0x%lx\n", pmu_conf.ovfl_val); for(i=0; i < NR_CPUS; i++) { if (cpu_is_online(i) == 0) continue; @@ -3009,16 +3089,18 @@ p += sprintf(p, "CPU%-2d spurious intrs : %lu\n", i, pfm_stats[i].pfm_spurious_ovfl_intr_count); p += sprintf(p, "CPU%-2d recorded samples : %lu\n", i, pfm_stats[i].pfm_recorded_samples_count); p += sprintf(p, "CPU%-2d smpl buffer full : %lu\n", i, pfm_stats[i].pfm_full_smpl_buffer_count); + p += sprintf(p, "CPU%-2d syst_wide : %d\n", i, per_cpu(pfm_syst_info, i) & PFM_CPUINFO_SYST_WIDE ? 1 : 0); + p += sprintf(p, "CPU%-2d dcr_pp : %d\n", i, per_cpu(pfm_syst_info, i) & PFM_CPUINFO_DCR_PP ? 1 : 0); + p += sprintf(p, "CPU%-2d exclude idle : %d\n", i, per_cpu(pfm_syst_info, i) & PFM_CPUINFO_EXCL_IDLE ? 1 : 0); p += sprintf(p, "CPU%-2d owner : %d\n", i, pmu_owners[i].owner ? pmu_owners[i].owner->pid: -1); - p += sprintf(p, "CPU%-2d syst_wide : %d\n", i, per_cpu(pfm_syst_wide, i)); - p += sprintf(p, "CPU%-2d dcr_pp : %d\n", i, per_cpu(pfm_dcr_pp, i)); } LOCK_PFS(); - p += sprintf(p, "proc_sessions : %lu\n" - "sys_sessions : %lu\n" - "sys_use_dbregs : %lu\n" - "ptrace_use_dbregs : %lu\n", + + p += sprintf(p, "proc_sessions : %u\n" + "sys_sessions : %u\n" + "sys_use_dbregs : %u\n" + "ptrace_use_dbregs : %u\n", pfm_sessions.pfs_task_sessions, pfm_sessions.pfs_sys_sessions, pfm_sessions.pfs_sys_use_dbregs, @@ -3033,7 +3115,7 @@ static int perfmon_read_entry(char *page, char **start, off_t off, int count, int *eof, void *data) { - int len = perfmon_proc_info(page); + int len = pfm_proc_info(page); if (len <= off+count) *eof = 1; @@ -3046,24 +3128,66 @@ return len; } +/* + * we come here as soon as PFM_CPUINFO_SYST_WIDE is set. This happens + * during pfm_enable() hence before pfm_start(). We cannot assume monitoring + * is active or inactive based on mode. We must rely on the value in + * cpu_data(i)->pfm_syst_info + */ void -pfm_syst_wide_update_task(struct task_struct *task, int mode) +pfm_syst_wide_update_task(struct task_struct *task, unsigned long info, int is_ctxswin) { - struct pt_regs *regs = (struct pt_regs *)((unsigned long) task + IA64_STK_OFFSET); + struct pt_regs *regs; + unsigned long dcr; + unsigned long dcr_pp; - regs--; + dcr_pp = info & PFM_CPUINFO_DCR_PP ? 1 : 0; /* - * propagate the value of the dcr_pp bit to the psr + * pid 0 is guaranteed to be the idle task. There is one such task with pid 0 + * on every CPU, so we can rely on the pid to identify the idle task. + */ + if ((info & PFM_CPUINFO_EXCL_IDLE) == 0 || task->pid) { + regs = (struct pt_regs *)((unsigned long) task + IA64_STK_OFFSET); + regs--; + ia64_psr(regs)->pp = is_ctxswin ? dcr_pp : 0; + return; + } + /* + * if monitoring has started */ - ia64_psr(regs)->pp = mode ? __get_cpu_var(pfm_dcr_pp) : 0; + if (dcr_pp) { + dcr = ia64_get_dcr(); + /* + * context switching in? + */ + if (is_ctxswin) { + /* mask monitoring for the idle task */ + ia64_set_dcr(dcr & ~IA64_DCR_PP); + pfm_clear_psr_pp(); + ia64_srlz_i(); + return; + } + /* + * context switching out + * restore monitoring for next task + * + * Due to inlining this odd if-then-else construction generates + * better code. + */ + ia64_set_dcr(dcr |IA64_DCR_PP); + pfm_set_psr_pp(); + ia64_srlz_i(); + } } void pfm_save_regs (struct task_struct *task) { pfm_context_t *ctx; + unsigned long mask; u64 psr; + int i; ctx = task->thread.pfm_context; @@ -3071,7 +3195,7 @@ /* * save current PSR: needed because we modify it */ - __asm__ __volatile__ ("mov %0=psr;;": "=r"(psr) :: "memory"); + psr = pfm_get_psr(); /* * stop monitoring: @@ -3080,129 +3204,61 @@ * We do not need to set psr.sp because, it is irrelevant in kernel. * It will be restored from ipsr when going back to user level */ - __asm__ __volatile__ ("rum psr.up;;"::: "memory"); + pfm_clear_psr_up(); ia64_srlz_i(); ctx->ctx_saved_psr = psr; - //ctx->ctx_last_cpu = smp_processor_id(); - -} - -static void -pfm_lazy_save_regs (struct task_struct *task) -{ - pfm_context_t *ctx; - struct thread_struct *t; - unsigned long mask; - int i; - - DBprintk(("on [%d] by [%d]\n", task->pid, current->pid)); - - t = &task->thread; - ctx = task->thread.pfm_context; - #ifdef CONFIG_SMP - /* - * announce we are saving this PMU state - * This will cause other CPU, to wait until we're done - * before using the context.h + /* + * We do not use a lazy scheme in SMP because + * of the new scheduler which masks interrupts + * during low-level context switch. So we save + * all the PMD register we use and restore on + * ctxsw in. * - * must be an atomic operation + * release ownership of this PMU. + * must be done before we save the registers. */ - atomic_set(&ctx->ctx_saving_in_progress, 1); - - /* - * if owner is NULL, it means that the other CPU won the race - * and the IPI has caused the context to be saved in pfm_handle_fectch_regs() - * instead of here. We have nothing to do - * - * note that this is safe, because the other CPU NEVER modifies saving_in_progress. - */ - if (PMU_OWNER() == NULL) goto do_nothing; -#endif + SET_PMU_OWNER(NULL); /* - * do not own the PMU + * save PMDs */ - SET_PMU_OWNER(NULL); - ia64_srlz_d(); - /* - * XXX needs further optimization. - * Also must take holes into account - */ mask = ctx->ctx_used_pmds[0]; for (i=0; mask; i++, mask>>=1) { - if (mask & 0x1) t->pmd[i] =ia64_get_pmd(i); + if (mask & 0x1) task->thread.pmd[i] =ia64_get_pmd(i); } - /* save pmc0 */ - t->pmc[0] = ia64_get_pmc(0); + /* + * save pmc0 + */ + task->thread.pmc[0] = ia64_get_pmc(0); - /* not owned by this CPU */ + /* + * force a full reload + */ atomic_set(&ctx->ctx_last_cpu, -1); - -#ifdef CONFIG_SMP -do_nothing: #endif - /* - * declare we are done saving this context - * - * must be an atomic operation - */ - atomic_set(&ctx->ctx_saving_in_progress,0); - } -#ifdef CONFIG_SMP -/* - * Handles request coming from other CPUs - */ -static void -pfm_handle_fetch_regs(void *info) +static void +pfm_lazy_save_regs (struct task_struct *task) { - pfm_smp_ipi_arg_t *arg = info; - struct thread_struct *t; pfm_context_t *ctx; + struct thread_struct *t; unsigned long mask; int i; - ctx = arg->task->thread.pfm_context; - t = &arg->task->thread; - - DBprintk(("task=%d owner=%d saving=%d\n", - arg->task->pid, - PMU_OWNER() ? PMU_OWNER()->pid: -1, - atomic_read(&ctx->ctx_saving_in_progress))); - - /* must wait until not busy before retrying whole request */ - if (atomic_read(&ctx->ctx_is_busy)) { - arg->retval = 2; - return; - } - - /* must wait if saving was interrupted */ - if (atomic_read(&ctx->ctx_saving_in_progress)) { - arg->retval = 1; - return; - } - - /* can proceed, done with context */ - if (PMU_OWNER() != arg->task) { - arg->retval = 0; - return; - } + DBprintk(("on [%d] by [%d]\n", task->pid, current->pid)); - DBprintk(("saving state for [%d] used_pmcs=0x%lx reload_pmcs=0x%lx used_pmds=0x%lx\n", - arg->task->pid, - ctx->ctx_used_pmcs[0], - ctx->ctx_reload_pmcs[0], - ctx->ctx_used_pmds[0])); + t = &task->thread; + ctx = task->thread.pfm_context; /* - * XXX: will be replaced with pure assembly call + * do not own the PMU */ SET_PMU_OWNER(NULL); @@ -3210,10 +3266,11 @@ /* * XXX needs further optimization. + * Also must take holes into account */ mask = ctx->ctx_used_pmds[0]; for (i=0; mask; i++, mask>>=1) { - if (mask & 0x1) t->pmd[i] = ia64_get_pmd(i); + if (mask & 0x1) t->pmd[i] =ia64_get_pmd(i); } /* save pmc0 */ @@ -3221,66 +3278,7 @@ /* not owned by this CPU */ atomic_set(&ctx->ctx_last_cpu, -1); - - /* can proceed */ - arg->retval = 0; -} - -/* - * Function call to fetch PMU state from another CPU identified by 'cpu'. - * If the context is being saved on the remote CPU, then we busy wait until - * the saving is done and then we return. In this case, non IPI is sent. - * Otherwise, we send an IPI to the remote CPU, potentially interrupting - * pfm_lazy_save_regs() over there. - * - * If the retval==1, then it means that we interrupted remote save and that we must - * wait until the saving is over before proceeding. - * Otherwise, we did the saving on the remote CPU, and it was done by the time we got there. - * in either case, we can proceed. - */ -static void -pfm_fetch_regs(int cpu, struct task_struct *task, pfm_context_t *ctx) -{ - pfm_smp_ipi_arg_t arg; - int ret; - - arg.task = task; - arg.retval = -1; - - if (atomic_read(&ctx->ctx_is_busy)) { -must_wait_busy: - while (atomic_read(&ctx->ctx_is_busy)); - } - - if (atomic_read(&ctx->ctx_saving_in_progress)) { - DBprintk(("no IPI, must wait for [%d] to be saved on [%d]\n", task->pid, cpu)); -must_wait_saving: - /* busy wait */ - while (atomic_read(&ctx->ctx_saving_in_progress)); - DBprintk(("done saving for [%d] on [%d]\n", task->pid, cpu)); - return; - } - DBprintk(("calling CPU %d from CPU %d\n", cpu, smp_processor_id())); - - if (cpu == -1) { - printk("refusing to use -1 for [%d]\n", task->pid); - return; - } - - /* will send IPI to other CPU and wait for completion of remote call */ - if ((ret=smp_call_function_single(cpu, pfm_handle_fetch_regs, &arg, 0, 1))) { - printk("perfmon: remote CPU call from %d to %d error %d\n", smp_processor_id(), cpu, ret); - return; - } - /* - * we must wait until saving is over on the other CPU - * This is the case, where we interrupted the saving which started just at the time we sent the - * IPI. - */ - if (arg.retval == 1) goto must_wait_saving; - if (arg.retval == 2) goto must_wait_busy; } -#endif /* CONFIG_SMP */ void pfm_load_regs (struct task_struct *task) @@ -3291,14 +3289,16 @@ unsigned long mask; u64 psr; int i; -#ifdef CONFIG_SMP - int cpu; -#endif owner = PMU_OWNER(); ctx = task->thread.pfm_context; t = &task->thread; + if (ctx == NULL) { + printk("perfmon: pfm_load_regs: null ctx for [%d]\n", task->pid); + return; + } + /* * we restore ALL the debug registers to avoid picking up * stale state. @@ -3324,6 +3324,7 @@ /* * if we were the last user, then nothing to do except restore psr + * this path cannot be used in SMP */ if (owner == task) { if (atomic_read(&ctx->ctx_last_cpu) != smp_processor_id()) @@ -3331,32 +3332,19 @@ atomic_read(&ctx->ctx_last_cpu), task->pid)); psr = ctx->ctx_saved_psr; - __asm__ __volatile__ ("mov psr.l=%0;; srlz.i;;"::"r"(psr): "memory"); + pfm_set_psr_l(psr); return; } - DBprintk(("load_regs: must reload for [%d] owner=%d\n", - task->pid, owner ? owner->pid : -1 )); + /* * someone else is still using the PMU, first push it out and * then we'll be able to install our stuff ! + * + * not possible in SMP */ if (owner) pfm_lazy_save_regs(owner); -#ifdef CONFIG_SMP - /* - * check if context on another CPU (-1 means saved) - * We MUST use the variable, as last_cpu may change behind our - * back. If it changes to -1 (not on a CPU anymore), then in cpu - * we have the last CPU the context was on. We may be sending the - * IPI for nothing, but we have no way of verifying this. - */ - cpu = atomic_read(&ctx->ctx_last_cpu); - if (cpu != -1) { - pfm_fetch_regs(cpu, task, ctx); - } -#endif - /* * To avoid leaking information to the user level when psr.sp=0, * we must reload ALL implemented pmds (even the ones we don't use). @@ -3369,7 +3357,7 @@ */ mask = pfm_sysctl.fastctxsw || ctx->ctx_fl_protected ? ctx->ctx_used_pmds[0] : ctx->ctx_reload_pmds[0]; for (i=0; mask; i++, mask>>=1) { - if (mask & 0x1) ia64_set_pmd(i, t->pmd[i] & pmu_conf.perf_ovfl_val); + if (mask & 0x1) ia64_set_pmd(i, t->pmd[i] & pmu_conf.ovfl_val); } /* @@ -3393,8 +3381,7 @@ * fl_frozen==1 when we are in blocking mode waiting for restart */ if (ctx->ctx_fl_frozen == 0) { - ia64_set_pmc(0, 0); - ia64_srlz_d(); + pfm_unfreeze_pmu(); } atomic_set(&ctx->ctx_last_cpu, smp_processor_id()); @@ -3404,8 +3391,7 @@ * restore the psr we changed in pfm_save_regs() */ psr = ctx->ctx_saved_psr; - __asm__ __volatile__ ("mov psr.l=%0;; srlz.i;;"::"r"(psr): "memory"); - + pfm_set_psr_l(psr); } /* @@ -3419,15 +3405,16 @@ int i; if (task != current) { - printk("perfmon: invalid task in ia64_reset_pmu()\n"); + printk("perfmon: invalid task in pfm_reset_pmu()\n"); return; } /* Let's make sure the PMU is frozen */ - ia64_set_pmc(0,1); + pfm_freeze_pmu(); /* * install reset values for PMC. We skip PMC0 (done above) + * XX: good up to 64 PMCS */ for (i=1; (pmu_conf.pmc_desc[i].type & PFM_REG_END) == 0; i++) { if ((pmu_conf.pmc_desc[i].type & PFM_REG_IMPL) == 0) continue; @@ -3444,7 +3431,7 @@ /* * clear reset values for PMD. - * XXX: good up to 64 PMDS. Suppose that zero is a valid value. + * XXX: good up to 64 PMDS. */ for (i=0; (pmu_conf.pmd_desc[i].type & PFM_REG_END) == 0; i++) { if ((pmu_conf.pmd_desc[i].type & PFM_REG_IMPL) == 0) continue; @@ -3477,13 +3464,13 @@ * * We never directly restore PMC0 so we do not include it in the mask. */ - ctx->ctx_reload_pmcs[0] = pmu_conf.impl_regs[0] & ~0x1; + ctx->ctx_reload_pmcs[0] = pmu_conf.impl_pmcs[0] & ~0x1; /* * We must include all the PMD in this mask to avoid picking * up stale value and leak information, especially directly * at the user level when psr.sp=0 */ - ctx->ctx_reload_pmds[0] = pmu_conf.impl_regs[4]; + ctx->ctx_reload_pmds[0] = pmu_conf.impl_pmds[0]; /* * Keep track of the pmds we want to sample @@ -3493,7 +3480,7 @@ * * We ignore the unimplemented pmds specified by the user */ - ctx->ctx_used_pmds[0] = ctx->ctx_smpl_regs[0] & pmu_conf.impl_regs[4]; + ctx->ctx_used_pmds[0] = ctx->ctx_smpl_regs[0]; ctx->ctx_used_pmcs[0] = 1; /* always save/restore PMC[0] */ /* @@ -3547,16 +3534,17 @@ ia64_set_dcr(ia64_get_dcr() & ~IA64_DCR_PP); /* stop monitoring */ - __asm__ __volatile__ ("rsm psr.pp;;"::: "memory"); + pfm_clear_psr_pp(); ia64_srlz_i(); - __get_cpu_var(pfm_syst_wide) = 0; - __get_cpu_var(pfm_dcr_pp) = 0; + PFM_CPUINFO_CLEAR(PFM_CPUINFO_SYST_WIDE); + PFM_CPUINFO_CLEAR(PFM_CPUINFO_DCR_PP); + PFM_CPUINFO_CLEAR(PFM_CPUINFO_EXCL_IDLE); } else { /* stop monitoring */ - __asm__ __volatile__ ("rum psr.up;;"::: "memory"); + pfm_clear_psr_up(); ia64_srlz_i(); @@ -3589,8 +3577,7 @@ * This destroys the overflow information. This is required to make sure * next process does not start with monitoring on if not requested */ - ia64_set_pmc(0, 1); - ia64_srlz_d(); + pfm_freeze_pmu(); /* * We don't need to restore psr, because we are on our way out @@ -3606,8 +3593,9 @@ * */ - if (atomic_read(&ctx->ctx_last_cpu) != smp_processor_id()) - printk("perfmon: [%d] last_cpu=%d\n", task->pid, atomic_read(&ctx->ctx_last_cpu)); + if (atomic_read(&ctx->ctx_last_cpu) != smp_processor_id()) + printk(KERN_DEBUG "perfmon: [%d] last_cpu=%d\n", + task->pid, atomic_read(&ctx->ctx_last_cpu)); /* * we save all the used pmds @@ -3622,10 +3610,14 @@ val = ia64_get_pmd(i); if (PMD_IS_COUNTING(i)) { - DBprintk(("[%d] pmd[%d] soft_pmd=0x%lx hw_pmd=0x%lx\n", task->pid, i, ctx->ctx_soft_pmds[i].val, val & pmu_conf.perf_ovfl_val)); + DBprintk(("[%d] pmd[%d] soft_pmd=0x%lx hw_pmd=0x%lx\n", + task->pid, + i, + ctx->ctx_soft_pmds[i].val, + val & pmu_conf.ovfl_val)); /* collect latest results */ - ctx->ctx_soft_pmds[i].val += val & pmu_conf.perf_ovfl_val; + ctx->ctx_soft_pmds[i].val += val & pmu_conf.ovfl_val; /* * now everything is in ctx_soft_pmds[] and we need @@ -3638,7 +3630,7 @@ * take care of overflow inline */ if (pmc0 & (1UL << i)) { - ctx->ctx_soft_pmds[i].val += 1 + pmu_conf.perf_ovfl_val; + ctx->ctx_soft_pmds[i].val += 1 + pmu_conf.ovfl_val; DBprintk(("[%d] pmd[%d] overflowed soft_pmd=0x%lx\n", task->pid, i, ctx->ctx_soft_pmds[i].val)); } @@ -3771,8 +3763,8 @@ m = nctx->ctx_used_pmds[0] >> PMU_FIRST_COUNTER; for(i = PMU_FIRST_COUNTER ; m ; m>>=1, i++) { if ((m & 0x1) && pmu_conf.pmd_desc[i].type == PFM_REG_COUNTING) { - nctx->ctx_soft_pmds[i].val = nctx->ctx_soft_pmds[i].lval & ~pmu_conf.perf_ovfl_val; - thread->pmd[i] = nctx->ctx_soft_pmds[i].lval & pmu_conf.perf_ovfl_val; + nctx->ctx_soft_pmds[i].val = nctx->ctx_soft_pmds[i].lval & ~pmu_conf.ovfl_val; + thread->pmd[i] = nctx->ctx_soft_pmds[i].lval & pmu_conf.ovfl_val; } else { thread->pmd[i] = 0UL; /* reset to initial state */ } @@ -3811,6 +3803,16 @@ sema_init(&nctx->ctx_restart_sem, 0); /* reset this semaphore to locked */ + /* + * propagate kernel psr in new context (used for first ctxsw in + */ + nctx->ctx_saved_psr = pfm_get_psr(); + + /* + * propagate kernel psr in new context (used for first ctxsw in + */ + nctx->ctx_saved_psr = pfm_get_psr(); + /* link with new task */ thread->pfm_context = nctx; @@ -3939,30 +3941,14 @@ UNLOCK_CTX(ctx); - LOCK_PFS(); + pfm_unreserve_session(task, ctx->ctx_fl_system, 1UL << ctx->ctx_cpu); if (ctx->ctx_fl_system) { - - pfm_sessions.pfs_sys_session[ctx->ctx_cpu] = NULL; - pfm_sessions.pfs_sys_sessions--; - DBprintk(("freeing syswide session on CPU%ld\n", ctx->ctx_cpu)); - - /* update perfmon debug register usage counter */ - if (ctx->ctx_fl_using_dbreg) { - if (pfm_sessions.pfs_sys_use_dbregs == 0) { - printk("perfmon: invalid release for [%d] sys_use_dbregs=0\n", task->pid); - } else - pfm_sessions.pfs_sys_use_dbregs--; - } - /* * remove any CPU pinning */ set_cpus_allowed(task, ctx->ctx_saved_cpus_allowed); - } else { - pfm_sessions.pfs_task_sessions--; - } - UNLOCK_PFS(); + } pfm_context_free(ctx); /* @@ -3983,15 +3969,14 @@ pfm_smpl_buffer_desc_t *tmp, *psb = task->thread.pfm_smpl_buf_list; if (psb == NULL) { - printk("perfmon: psb is null in [%d]\n", current->pid); + printk(KERN_DEBUG "perfmon: psb is null in [%d]\n", current->pid); return -1; } /* * Walk through the list and free the sampling buffer and psb */ while (psb) { - DBprintk(("[%d] freeing smpl @%p size %ld\n", - current->pid, psb->psb_hdr, psb->psb_size)); + DBprintk(("[%d] freeing smpl @%p size %ld\n", current->pid, psb->psb_hdr, psb->psb_size)); pfm_rvfree(psb->psb_hdr, psb->psb_size); tmp = psb->psb_next; @@ -4095,16 +4080,16 @@ if (ctx && ctx->ctx_notify_task == task) { DBprintk(("trying for notifier [%d] in [%d]\n", task->pid, p->pid)); /* - * the spinlock is required to take care of a race condition with - * the send_sig_info() call. We must make sure that either the - * send_sig_info() completes using a valid task, or the - * notify_task is cleared before the send_sig_info() can pick up a - * stale value. Note that by the time this function is executed - * the 'task' is already detached from the tasklist. The problem - * is that the notifiers have a direct pointer to it. It is okay - * to send a signal to a task in this stage, it simply will have - * no effect. But it is better than sending to a completely - * destroyed task or worse to a new task using the same + * the spinlock is required to take care of a race condition + * with the send_sig_info() call. We must make sure that + * either the send_sig_info() completes using a valid task, + * or the notify_task is cleared before the send_sig_info() + * can pick up a stale value. Note that by the time this + * function is executed the 'task' is already detached from the + * tasklist. The problem is that the notifiers have a direct + * pointer to it. It is okay to send a signal to a task in this + * stage, it simply will have no effect. But it is better than sending + * to a completely destroyed task or worse to a new task using the same * task_struct address. */ LOCK_CTX(ctx); @@ -4123,87 +4108,130 @@ } static struct irqaction perfmon_irqaction = { - .handler = perfmon_interrupt, - .flags = SA_INTERRUPT, - .name = "perfmon" + .handler = pfm_interrupt_handler, + .flags = SA_INTERRUPT, + .name = "perfmon" }; +int +pfm_install_alternate_syswide_subsystem(pfm_intr_handler_desc_t *hdl) +{ + int ret; + + /* some sanity checks */ + if (hdl == NULL || hdl->handler == NULL) return -EINVAL; + + /* do the easy test first */ + if (pfm_alternate_intr_handler) return -EBUSY; + + /* reserve our session */ + ret = pfm_reserve_session(NULL, 1, cpu_online_map); + if (ret) return ret; + + if (pfm_alternate_intr_handler) { + printk(KERN_DEBUG "perfmon: install_alternate, intr_handler not NULL " + "after reserve\n"); + return -EINVAL; + } + + pfm_alternate_intr_handler = hdl; + + return 0; +} + +int +pfm_remove_alternate_syswide_subsystem(pfm_intr_handler_desc_t *hdl) +{ + if (hdl == NULL) return -EINVAL; + + /* cannot remove someone else's handler! */ + if (pfm_alternate_intr_handler != hdl) return -EINVAL; + + pfm_alternate_intr_handler = NULL; + + /* + * XXX: assume cpu_online_map has not changed since reservation + */ + pfm_unreserve_session(NULL, 1, cpu_online_map); + + return 0; +} /* * perfmon initialization routine, called from the initcall() table */ int __init -perfmon_init (void) +pfm_init(void) { - pal_perf_mon_info_u_t pm_info; - s64 status; + unsigned int n, n_counters, i; - pmu_conf.pfm_is_disabled = 1; + pmu_conf.disabled = 1; - printk("perfmon: version %u.%u (sampling format v%u.%u) IRQ %u\n", - PFM_VERSION_MAJ, - PFM_VERSION_MIN, - PFM_SMPL_VERSION_MAJ, - PFM_SMPL_VERSION_MIN, - IA64_PERFMON_VECTOR); + printk(KERN_INFO "perfmon: version %u.%u IRQ %u\n", PFM_VERSION_MAJ, PFM_VERSION_MIN, + IA64_PERFMON_VECTOR); - if ((status=ia64_pal_perf_mon_info(pmu_conf.impl_regs, &pm_info)) != 0) { - printk("perfmon: PAL call failed (%ld), perfmon disabled\n", status); - return -1; - } - - pmu_conf.perf_ovfl_val = (1UL << pm_info.pal_perf_mon_info_s.width) - 1; /* - * XXX: use the pfm_*_desc tables instead and simply verify with PAL + * compute the number of implemented PMD/PMC from the + * description tables */ - pmu_conf.max_counters = pm_info.pal_perf_mon_info_s.generic; - pmu_conf.num_pmcs = find_num_pm_regs(pmu_conf.impl_regs); - pmu_conf.num_pmds = find_num_pm_regs(&pmu_conf.impl_regs[4]); + n = 0; + for (i=0; PMC_IS_LAST(i) == 0; i++) { + if (PMC_IS_IMPL(i) == 0) continue; + pmu_conf.impl_pmcs[i>>6] |= 1UL << (i&63); + n++; + } + pmu_conf.num_pmcs = n; - printk("perfmon: %u bits counters\n", pm_info.pal_perf_mon_info_s.width); + n = 0; n_counters = 0; + for (i=0; PMD_IS_LAST(i) == 0; i++) { + if (PMD_IS_IMPL(i) == 0) continue; + pmu_conf.impl_pmds[i>>6] |= 1UL << (i&63); + n++; + if (PMD_IS_COUNTING(i)) n_counters++; + } + pmu_conf.num_pmds = n; + pmu_conf.num_counters = n_counters; - printk("perfmon: %lu PMC/PMD pairs, %lu PMCs, %lu PMDs\n", - pmu_conf.max_counters, pmu_conf.num_pmcs, pmu_conf.num_pmds); + printk(KERN_INFO "perfmon: %u PMCs, %u PMDs, %u counters (%lu bits)\n", + pmu_conf.num_pmcs, + pmu_conf.num_pmds, + pmu_conf.num_counters, + ffz(pmu_conf.ovfl_val)); /* sanity check */ if (pmu_conf.num_pmds >= IA64_NUM_PMD_REGS || pmu_conf.num_pmcs >= IA64_NUM_PMC_REGS) { - printk(KERN_ERR "perfmon: not enough pmc/pmd, perfmon is DISABLED\n"); - return -1; /* no need to continue anyway */ - } - - if (ia64_pal_debug_info(&pmu_conf.num_ibrs, &pmu_conf.num_dbrs)) { - printk(KERN_WARNING "perfmon: unable to get number of debug registers\n"); - pmu_conf.num_ibrs = pmu_conf.num_dbrs = 0; + printk(KERN_ERR "perfmon: not enough pmc/pmd, perfmon disabled\n"); + return -1; } - /* PAL reports the number of pairs */ - pmu_conf.num_ibrs <<=1; - pmu_conf.num_dbrs <<=1; - - /* - * setup the register configuration descriptions for the CPU - */ - pmu_conf.pmc_desc = pfm_pmc_desc; - pmu_conf.pmd_desc = pfm_pmd_desc; - - /* we are all set */ - pmu_conf.pfm_is_disabled = 0; /* * for now here for debug purposes */ perfmon_dir = create_proc_read_entry ("perfmon", 0, 0, perfmon_read_entry, NULL); + if (perfmon_dir == NULL) { + printk(KERN_ERR "perfmon: cannot create /proc entry, perfmon disabled\n"); + return -1; + } + /* + * create /proc/perfmon + */ pfm_sysctl_header = register_sysctl_table(pfm_sysctl_root, 0); + /* + * initialize all our spinlocks + */ spin_lock_init(&pfm_sessions.pfs_lock); + /* we are all set */ + pmu_conf.disabled = 0; + return 0; } - -__initcall(perfmon_init); +__initcall(pfm_init); void -perfmon_init_percpu (void) +pfm_init_percpu(void) { int i; @@ -4222,22 +4250,21 @@ * * On McKinley, this code is ineffective until PMC4 is initialized. */ - for (i=1; (pfm_pmc_desc[i].type & PFM_REG_END) == 0; i++) { - if ((pfm_pmc_desc[i].type & PFM_REG_IMPL) == 0) continue; - ia64_set_pmc(i, pfm_pmc_desc[i].default_value); + for (i=1; PMC_IS_LAST(i) == 0; i++) { + if (PMC_IS_IMPL(i) == 0) continue; + ia64_set_pmc(i, PMC_DFL_VAL(i)); } - for (i=0; (pfm_pmd_desc[i].type & PFM_REG_END) == 0; i++) { - if ((pfm_pmd_desc[i].type & PFM_REG_IMPL) == 0) continue; + + for (i=0; PMD_IS_LAST(i); i++) { + if (PMD_IS_IMPL(i) == 0) continue; ia64_set_pmd(i, 0UL); } - ia64_set_pmc(0,1UL); - ia64_srlz_d(); - + pfm_freeze_pmu(); } #else /* !CONFIG_PERFMON */ -asmlinkage int +asmlinkage long sys_perfmonctl (int pid, int cmd, void *req, int count, long arg5, long arg6, long arg7, long arg8, long stack) { diff -Nru a/arch/ia64/kernel/perfmon_generic.h b/arch/ia64/kernel/perfmon_generic.h --- a/arch/ia64/kernel/perfmon_generic.h Sun Feb 9 21:13:31 2003 +++ b/arch/ia64/kernel/perfmon_generic.h Sun Feb 9 21:13:31 2003 @@ -1,10 +1,17 @@ +/* + * This file contains the architected PMU register description tables + * and pmc checker used by perfmon.c. + * + * Copyright (C) 2002 Hewlett Packard Co + * Stephane Eranian + */ #define RDEP(x) (1UL<<(x)) -#if defined(CONFIG_ITANIUM) || defined(CONFIG_MCKINLEY) -#error "This file should only be used when CONFIG_ITANIUM and CONFIG_MCKINLEY are not defined" +#if defined(CONFIG_ITANIUM) || defined (CONFIG_MCKINLEY) +#error "This file should not be used when CONFIG_ITANIUM or CONFIG_MCKINLEY is defined" #endif -static pfm_reg_desc_t pmc_desc[PMU_MAX_PMCS]={ +static pfm_reg_desc_t pmc_gen_desc[PMU_MAX_PMCS]={ /* pmc0 */ { PFM_REG_CONTROL , 0, 0x1UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc1 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc2 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, @@ -13,10 +20,10 @@ /* pmc5 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {RDEP(5),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc6 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {RDEP(6),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc7 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {RDEP(7),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, - { PFM_REG_END , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */ + { PFM_REG_END , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */ }; -static pfm_reg_desc_t pmd_desc[PMU_MAX_PMDS]={ +static pfm_reg_desc_t pmd_gen_desc[PMU_MAX_PMDS]={ /* pmd0 */ { PFM_REG_NOTIMPL , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* pmd1 */ { PFM_REG_NOTIMPL , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* pmd2 */ { PFM_REG_NOTIMPL , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, @@ -25,5 +32,17 @@ /* pmd5 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(5),0UL, 0UL, 0UL}}, /* pmd6 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(6),0UL, 0UL, 0UL}}, /* pmd7 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(7),0UL, 0UL, 0UL}}, - { PFM_REG_END , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */ + { PFM_REG_END , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */ +}; + +/* + * impl_pmcs, impl_pmds are computed at runtime to minimize errors! + */ +static pmu_config_t pmu_conf={ + .disabled = 1, + .ovfl_val = (1UL << 32) - 1, + .num_ibrs = 8, + .num_dbrs = 8, + .pmd_desc = pfm_gen_pmd_desc, + .pmc_desc = pfm_gen_pmc_desc }; diff -Nru a/arch/ia64/kernel/perfmon_itanium.h b/arch/ia64/kernel/perfmon_itanium.h --- a/arch/ia64/kernel/perfmon_itanium.h Sun Feb 9 21:13:37 2003 +++ b/arch/ia64/kernel/perfmon_itanium.h Sun Feb 9 21:13:37 2003 @@ -15,7 +15,7 @@ static int pfm_ita_pmc_check(struct task_struct *task, unsigned int cnum, unsigned long *val, struct pt_regs *regs); static int pfm_write_ibr_dbr(int mode, struct task_struct *task, void *arg, int count, struct pt_regs *regs); -static pfm_reg_desc_t pfm_pmc_desc[PMU_MAX_PMCS]={ +static pfm_reg_desc_t pfm_ita_pmc_desc[PMU_MAX_PMCS]={ /* pmc0 */ { PFM_REG_CONTROL , 0, 0x1UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc1 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc2 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, @@ -33,7 +33,7 @@ { PFM_REG_END , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */ }; -static pfm_reg_desc_t pfm_pmd_desc[PMU_MAX_PMDS]={ +static pfm_reg_desc_t pfm_ita_pmd_desc[PMU_MAX_PMDS]={ /* pmd0 */ { PFM_REG_BUFFER , 0, 0UL, -1UL, NULL, NULL, {RDEP(1),0UL, 0UL, 0UL}, {RDEP(10),0UL, 0UL, 0UL}}, /* pmd1 */ { PFM_REG_BUFFER , 0, 0UL, -1UL, NULL, NULL, {RDEP(0),0UL, 0UL, 0UL}, {RDEP(10),0UL, 0UL, 0UL}}, /* pmd2 */ { PFM_REG_BUFFER , 0, 0UL, -1UL, NULL, NULL, {RDEP(3)|RDEP(17),0UL, 0UL, 0UL}, {RDEP(11),0UL, 0UL, 0UL}}, @@ -54,6 +54,19 @@ /* pmd17 */ { PFM_REG_BUFFER , 0, 0UL, -1UL, NULL, NULL, {RDEP(2)|RDEP(3),0UL, 0UL, 0UL}, {RDEP(11),0UL, 0UL, 0UL}}, { PFM_REG_END , 0, 0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */ }; + +/* + * impl_pmcs, impl_pmds are computed at runtime to minimize errors! + */ +static pmu_config_t pmu_conf={ + .disabled = 1, + .ovfl_val = (1UL << 32) - 1, + .num_ibrs = 8, + .num_dbrs = 8, + .pmd_desc = pfm_ita_pmd_desc, + .pmc_desc = pfm_ita_pmc_desc +}; + static int pfm_ita_pmc_check(struct task_struct *task, unsigned int cnum, unsigned long *val, struct pt_regs *regs) diff -Nru a/arch/ia64/kernel/perfmon_mckinley.h b/arch/ia64/kernel/perfmon_mckinley.h --- a/arch/ia64/kernel/perfmon_mckinley.h Sun Feb 9 21:13:34 2003 +++ b/arch/ia64/kernel/perfmon_mckinley.h Sun Feb 9 21:13:34 2003 @@ -16,7 +16,7 @@ static int pfm_mck_pmc_check(struct task_struct *task, unsigned int cnum, unsigned long *val, struct pt_regs *regs); static int pfm_write_ibr_dbr(int mode, struct task_struct *task, void *arg, int count, struct pt_regs *regs); -static pfm_reg_desc_t pfm_pmc_desc[PMU_MAX_PMCS]={ +static pfm_reg_desc_t pfm_mck_pmc_desc[PMU_MAX_PMCS]={ /* pmc0 */ { PFM_REG_CONTROL , 0, 0x1UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc1 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc2 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, @@ -36,7 +36,7 @@ { PFM_REG_END , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */ }; -static pfm_reg_desc_t pfm_pmd_desc[PMU_MAX_PMDS]={ +static pfm_reg_desc_t pfm_mck_pmd_desc[PMU_MAX_PMDS]={ /* pmd0 */ { PFM_REG_BUFFER , 0, 0x0UL, -1UL, NULL, NULL, {RDEP(1),0UL, 0UL, 0UL}, {RDEP(10),0UL, 0UL, 0UL}}, /* pmd1 */ { PFM_REG_BUFFER , 0, 0x0UL, -1UL, NULL, NULL, {RDEP(0),0UL, 0UL, 0UL}, {RDEP(10),0UL, 0UL, 0UL}}, /* pmd2 */ { PFM_REG_BUFFER , 0, 0x0UL, -1UL, NULL, NULL, {RDEP(3)|RDEP(17),0UL, 0UL, 0UL}, {RDEP(11),0UL, 0UL, 0UL}}, @@ -59,6 +59,19 @@ }; /* + * impl_pmcs, impl_pmds are computed at runtime to minimize errors! + */ +static pmu_config_t pmu_conf={ + .disabled = 1, + .ovfl_val = (1UL << 47) - 1, + .num_ibrs = 8, + .num_dbrs = 8, + .pmd_desc = pfm_mck_pmd_desc, + .pmc_desc = pfm_mck_pmc_desc +}; + + +/* * PMC reserved fields must have their power-up values preserved */ static int @@ -150,12 +163,12 @@ * i-side events in L1D and L2 caches */ if (check_case1) { - ret = ((val13 >> 45) & 0xf) == 0 + ret = ((val13 >> 45) & 0xf) == 0 && ((val8 & 0x1) == 0) && ((((val14>>1) & 0x3) == 0x2 || ((val14>>1) & 0x3) == 0x0) ||(((val14>>4) & 0x3) == 0x2 || ((val14>>4) & 0x3) == 0x0)); - if (ret) printk("perfmon: failure check_case1\n"); + if (ret) printk(KERN_DEBUG "perfmon: failure check_case1\n"); } return ret ? -EINVAL : 0; diff -Nru a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c --- a/arch/ia64/kernel/process.c Sun Feb 9 21:13:32 2003 +++ b/arch/ia64/kernel/process.c Sun Feb 9 21:13:32 2003 @@ -1,7 +1,7 @@ /* * Architecture-specific setup. * - * Copyright (C) 1998-2002 Hewlett-Packard Co + * Copyright (C) 1998-2003 Hewlett-Packard Co * David Mosberger-Tang */ #define __KERNEL_SYSCALLS__ /* see */ @@ -96,7 +96,7 @@ { unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri; - printk("\nPid: %d, comm: %20s\n", current->pid, current->comm); + printk("\nPid: %d, CPU %d, comm: %20s\n", current->pid, smp_processor_id(), current->comm); printk("psr : %016lx ifs : %016lx ip : [<%016lx>] %s\n", regs->cr_ipsr, regs->cr_ifs, ip, print_tainted()); print_symbol("ip is at %s\n", ip); @@ -144,6 +144,15 @@ void do_notify_resume_user (sigset_t *oldset, struct sigscratch *scr, long in_syscall) { +#ifdef CONFIG_FSYS + if (fsys_mode(current, &scr->pt)) { + /* defer signal-handling etc. until we return to privilege-level 0. */ + if (!ia64_psr(&scr->pt)->lp) + ia64_psr(&scr->pt)->lp = 1; + return; + } +#endif + #ifdef CONFIG_PERFMON if (current->thread.pfm_ovfl_block_reset) pfm_ovfl_block_reset(); @@ -198,6 +207,10 @@ void ia64_save_extra (struct task_struct *task) { +#ifdef CONFIG_PERFMON + unsigned long info; +#endif + if ((task->thread.flags & IA64_THREAD_DBG_VALID) != 0) ia64_save_debug_regs(&task->thread.dbr[0]); @@ -205,8 +218,9 @@ if ((task->thread.flags & IA64_THREAD_PM_VALID) != 0) pfm_save_regs(task); - if (__get_cpu_var(pfm_syst_wide)) - pfm_syst_wide_update_task(task, 0); + info = __get_cpu_var(pfm_syst_info); + if (info & PFM_CPUINFO_SYST_WIDE) + pfm_syst_wide_update_task(task, info, 0); #endif #ifdef CONFIG_IA32_SUPPORT @@ -218,6 +232,10 @@ void ia64_load_extra (struct task_struct *task) { +#ifdef CONFIG_PERFMON + unsigned long info; +#endif + if ((task->thread.flags & IA64_THREAD_DBG_VALID) != 0) ia64_load_debug_regs(&task->thread.dbr[0]); @@ -225,8 +243,9 @@ if ((task->thread.flags & IA64_THREAD_PM_VALID) != 0) pfm_load_regs(task); - if (__get_cpu_var(pfm_syst_wide)) - pfm_syst_wide_update_task(task, 1); + info = __get_cpu_var(pfm_syst_info); + if (info & PFM_CPUINFO_SYST_WIDE) + pfm_syst_wide_update_task(task, info, 1); #endif #ifdef CONFIG_IA32_SUPPORT diff -Nru a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c --- a/arch/ia64/kernel/ptrace.c Sun Feb 9 21:13:37 2003 +++ b/arch/ia64/kernel/ptrace.c Sun Feb 9 21:13:37 2003 @@ -833,21 +833,19 @@ return -1; } #ifdef CONFIG_PERFMON - /* - * Check if debug registers are used - * by perfmon. This test must be done once we know that we can - * do the operation, i.e. the arguments are all valid, but before - * we start modifying the state. + /* + * Check if debug registers are used by perfmon. This test must be done + * once we know that we can do the operation, i.e. the arguments are all + * valid, but before we start modifying the state. * - * Perfmon needs to keep a count of how many processes are - * trying to modify the debug registers for system wide monitoring - * sessions. + * Perfmon needs to keep a count of how many processes are trying to + * modify the debug registers for system wide monitoring sessions. * - * We also include read access here, because they may cause - * the PMU-installed debug register state (dbr[], ibr[]) to - * be reset. The two arrays are also used by perfmon, but - * we do not use IA64_THREAD_DBG_VALID. The registers are restored - * by the PMU context switch code. + * We also include read access here, because they may cause the + * PMU-installed debug register state (dbr[], ibr[]) to be reset. The two + * arrays are also used by perfmon, but we do not use + * IA64_THREAD_DBG_VALID. The registers are restored by the PMU context + * switch code. */ if (pfm_use_debug_registers(child)) return -1; #endif diff -Nru a/arch/ia64/kernel/sal.c b/arch/ia64/kernel/sal.c --- a/arch/ia64/kernel/sal.c Sun Feb 9 21:13:36 2003 +++ b/arch/ia64/kernel/sal.c Sun Feb 9 21:13:36 2003 @@ -1,7 +1,7 @@ /* * System Abstraction Layer (SAL) interface routines. * - * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co + * Copyright (C) 1998, 1999, 2001, 2003 Hewlett-Packard Co * David Mosberger-Tang * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond @@ -96,17 +96,17 @@ int i; if (!systab) { - printk("Hmm, no SAL System Table.\n"); + printk(KERN_WARNING "Hmm, no SAL System Table.\n"); return; } if (strncmp(systab->signature, "SST_", 4) != 0) - printk("bad signature in system table!"); + printk(KERN_ERR "bad signature in system table!"); /* * revisions are coded in BCD, so %x does the job for us */ - printk("SAL v%x.%02x: oem=%.32s, product=%.32s\n", + printk(KERN_INFO "SAL v%x.%02x: oem=%.32s, product=%.32s\n", systab->sal_rev_major, systab->sal_rev_minor, systab->oem_id, systab->product_id); @@ -121,7 +121,7 @@ switch (*p) { case SAL_DESC_ENTRY_POINT: ep = (struct ia64_sal_desc_entry_point *) p; - printk("SAL: entry: pal_proc=0x%lx, sal_proc=0x%lx\n", + printk(KERN_INFO "SAL: entry: pal_proc=0x%lx, sal_proc=0x%lx\n", ep->pal_proc, ep->sal_proc); ia64_pal_handler_init(__va(ep->pal_proc)); ia64_sal_handler_init(__va(ep->sal_proc), __va(ep->gp)); @@ -139,12 +139,12 @@ switch (ap->mechanism) { case IA64_SAL_AP_EXTERNAL_INT: ap_wakeup_vector = ap->vector; - printk("SAL: AP wakeup using external interrupt " + printk(KERN_INFO "SAL: AP wakeup using external interrupt " "vector 0x%lx\n", ap_wakeup_vector); break; default: - printk("SAL: AP wakeup mechanism unsupported!\n"); + printk(KERN_ERR "SAL: AP wakeup mechanism unsupported!\n"); break; } break; @@ -154,7 +154,7 @@ { struct ia64_sal_desc_platform_feature *pf = (void *) p; sal_platform_features = pf->feature_mask; - printk("SAL: Platform features "); + printk(KERN_INFO "SAL: Platform features "); if (pf->feature_mask & IA64_SAL_PLATFORM_FEATURE_BUS_LOCK) printk("BusLock "); diff -Nru a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c --- a/arch/ia64/kernel/setup.c Sun Feb 9 21:13:29 2003 +++ b/arch/ia64/kernel/setup.c Sun Feb 9 21:13:29 2003 @@ -1,7 +1,7 @@ /* * Architecture-specific setup. * - * Copyright (C) 1998-2001 Hewlett-Packard Co + * Copyright (C) 1998-2001, 2003 Hewlett-Packard Co * David Mosberger-Tang * Stephane Eranian * Copyright (C) 2000, Rohit Seth @@ -171,7 +171,7 @@ #if IGNORE_PFN0 if (start == PAGE_OFFSET) { - printk("warning: skipping physical page 0\n"); + printk(KERN_WARNING "warning: skipping physical page 0\n"); start += PAGE_SIZE; if (start >= end) return 0; } @@ -341,7 +341,7 @@ initrd_start = (unsigned long)__va(ia64_boot_param->initrd_start); initrd_end = initrd_start+ia64_boot_param->initrd_size; - printk("Initial ramdisk at: 0x%lx (%lu bytes)\n", + printk(KERN_INFO "Initial ramdisk at: 0x%lx (%lu bytes)\n", initrd_start, ia64_boot_param->initrd_size); } #endif @@ -409,8 +409,9 @@ ia64_set_kr(IA64_KR_IO_BASE, phys_iobase); else { phys_iobase = ia64_get_kr(IA64_KR_IO_BASE); - printk("No I/O port range found in EFI memory map, falling back to AR.KR0\n"); - printk("I/O port base = 0x%lx\n", phys_iobase); + printk(KERN_INFO "No I/O port range found in EFI memory map, falling back " + "to AR.KR0\n"); + printk(KERN_INFO "I/O port base = 0x%lx\n", phys_iobase); } ia64_iobase = (unsigned long) ioremap(phys_iobase, 0); @@ -615,7 +616,7 @@ impl_va_msb = vm2.pal_vm_info_2_s.impl_va_msb; phys_addr_size = vm1.pal_vm_info_1_s.phys_add_size; } - printk("CPU %d: %lu virtual and %lu physical address bits\n", + printk(KERN_INFO "CPU %d: %lu virtual and %lu physical address bits\n", smp_processor_id(), impl_va_msb + 1, phys_addr_size); c->unimpl_va_mask = ~((7L<<61) | ((1L << (impl_va_msb + 1)) - 1)); c->unimpl_pa_mask = ~((1L<<63) | ((1L << phys_addr_size) - 1)); @@ -738,7 +739,7 @@ if (ia64_pal_vm_summary(NULL, &vmi) == 0) max_ctx = (1U << (vmi.pal_vm_info_2_s.rid_size - 3)) - 1; else { - printk("cpu_init: PAL VM summary failed, assuming 18 RID bits\n"); + printk(KERN_WARNING "cpu_init: PAL VM summary failed, assuming 18 RID bits\n"); max_ctx = (1U << 15) - 1; /* use architected minimum */ } while (max_ctx < ia64_ctx.max_ctx) { @@ -748,10 +749,39 @@ } if (ia64_pal_rse_info(&num_phys_stacked, 0) != 0) { - printk ("cpu_init: PAL RSE info failed, assuming 96 physical stacked regs\n"); + printk(KERN_WARNING "cpu_init: PAL RSE info failed; assuming 96 physical " + "stacked regs\n"); num_phys_stacked = 96; } /* size of physical stacked register partition plus 8 bytes: */ __get_cpu_var(ia64_phys_stacked_size_p8) = num_phys_stacked*8 + 8; platform_cpu_init(); +} + +void +check_bugs (void) +{ + extern int __start___mckinley_e9_bundles[]; + extern int __end___mckinley_e9_bundles[]; + u64 *bundle; + int *wp; + + if (local_cpu_data->family == 0x1f && local_cpu_data->model == 0) + printk(KERN_INFO "check_bugs: leaving McKinley Errata 9 workaround enabled\n"); + else { + printk(KERN_INFO "check_bugs: McKinley Errata 9 workaround not needed; " + "disabling it\n"); + for (wp = __start___mckinley_e9_bundles; wp < __end___mckinley_e9_bundles; ++wp) { + bundle = (u64 *) ((char *) wp + *wp); + /* install a bundle of NOPs: */ + bundle[0] = 0x0000000100000000; + bundle[1] = 0x0004000000000200; + ia64_fc(bundle); + } + ia64_insn_group_barrier(); + ia64_sync_i(); + ia64_insn_group_barrier(); + ia64_srlz_i(); + ia64_insn_group_barrier(); + } } diff -Nru a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c --- a/arch/ia64/kernel/signal.c Sun Feb 9 21:13:32 2003 +++ b/arch/ia64/kernel/signal.c Sun Feb 9 21:13:32 2003 @@ -68,13 +68,13 @@ sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); { oldset = current->blocked; current->blocked = set; recalc_sigpending(); } - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); /* * The return below usually returns to the signal handler. We need to @@ -274,12 +274,12 @@ sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); { current->blocked = set; recalc_sigpending(); } - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext(sc, scr)) goto give_sigsegv; @@ -465,13 +465,13 @@ ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); { sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); sigaddset(¤t->blocked, sig); recalc_sigpending(); } - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } return 1; } diff -Nru a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c --- a/arch/ia64/kernel/smpboot.c Sun Feb 9 21:13:29 2003 +++ b/arch/ia64/kernel/smpboot.c Sun Feb 9 21:13:29 2003 @@ -1,7 +1,7 @@ /* * SMP boot-related support * - * Copyright (C) 1998-2002 Hewlett-Packard Co + * Copyright (C) 1998-2003 Hewlett-Packard Co * David Mosberger-Tang * * 01/05/16 Rohit Seth Moved SMP booting functions from smp.c to here. @@ -204,7 +204,7 @@ go[MASTER] = 1; if (smp_call_function_single(master, sync_master, NULL, 1, 0) < 0) { - printk("sync_itc: failed to get attention of CPU %u!\n", master); + printk(KERN_ERR "sync_itc: failed to get attention of CPU %u!\n", master); return; } @@ -244,8 +244,8 @@ t[i].rt, t[i].master, t[i].diff, t[i].lat); #endif - printk("CPU %d: synchronized ITC with CPU %u (last diff %ld cycles, maxerr %lu cycles)\n", - smp_processor_id(), master, delta, rt); + printk(KERN_INFO "CPU %d: synchronized ITC with CPU %u (last diff %ld cycles, " + "maxerr %lu cycles)\n", smp_processor_id(), master, delta, rt); } /* @@ -265,14 +265,15 @@ extern void ia64_init_itm(void); #ifdef CONFIG_PERFMON - extern void perfmon_init_percpu(void); + extern void pfm_init_percpu(void); #endif cpuid = smp_processor_id(); phys_id = hard_smp_processor_id(); if (test_and_set_bit(cpuid, &cpu_online_map)) { - printk("huh, phys CPU#0x%x, CPU#0x%x already present??\n", phys_id, cpuid); + printk(KERN_ERR "huh, phys CPU#0x%x, CPU#0x%x already present??\n", + phys_id, cpuid); BUG(); } @@ -300,7 +301,7 @@ #endif #ifdef CONFIG_PERFMON - perfmon_init_percpu(); + pfm_init_percpu(); #endif local_irq_enable(); @@ -380,9 +381,7 @@ if (test_bit(cpu, &cpu_callin_map)) { /* number CPUs logically, starting from 1 (BSP is 0) */ - printk("CPU%d: ", cpu); - /*print_cpu_info(&cpu_data[cpu]); */ - printk("CPU has booted.\n"); + printk(KERN_INFO "CPU%d: CPU has booted.\n", cpu); } else { printk(KERN_ERR "Processor 0x%x/0x%x is stuck.\n", cpu, sapicid); ia64_cpu_to_sapicid[cpu] = -1; @@ -399,7 +398,7 @@ { cache_decay_ticks = 10; /* XXX base this on PAL info and cache-bandwidth estimate */ - printk("task migration cache decay timeout: %ld msecs.\n", + printk(KERN_INFO "task migration cache decay timeout: %ld msecs.\n", (cache_decay_ticks + 1) * 1000 / HZ); } @@ -491,7 +490,7 @@ local_cpu_data->loops_per_jiffy = loops_per_jiffy; ia64_cpu_to_sapicid[0] = boot_cpu_id; - printk("Boot processor id 0x%x/0x%x\n", 0, boot_cpu_id); + printk(KERN_INFO "Boot processor id 0x%x/0x%x\n", 0, boot_cpu_id); current_thread_info()->cpu = 0; smp_tune_scheduling(); @@ -526,7 +525,7 @@ if (cpu_online(cpu)) bogosum += cpu_data(cpu)->loops_per_jiffy; - printk(KERN_INFO"Total of %d processors activated (%lu.%02lu BogoMIPS).\n", + printk(KERN_INFO "Total of %d processors activated (%lu.%02lu BogoMIPS).\n", num_online_cpus(), bogosum/(500000/HZ), (bogosum/(5000/HZ))%100); } @@ -552,7 +551,7 @@ } /* - * Assume that CPU's have been discovered by some platform-dependant interface. For + * Assume that CPU's have been discovered by some platform-dependent interface. For * SoftSDV/Lion, that would be ACPI. * * Setup of the IPI irq handler is done in irq.c:init_IRQ_SMP(). @@ -571,5 +570,6 @@ sal_ret = ia64_sal_set_vectors(SAL_VECTOR_OS_BOOT_RENDEZ, __pa(ap_startup->fp), __pa(ap_startup->gp), 0, 0, 0, 0); if (sal_ret < 0) - printk("SMP: Can't set SAL AP Boot Rendezvous: %s\n", ia64_sal_strerror(sal_ret)); + printk(KERN_ERR "SMP: Can't set SAL AP Boot Rendezvous: %s\n", + ia64_sal_strerror(sal_ret)); } diff -Nru a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c --- a/arch/ia64/kernel/sys_ia64.c Sun Feb 9 21:13:32 2003 +++ b/arch/ia64/kernel/sys_ia64.c Sun Feb 9 21:13:32 2003 @@ -16,11 +16,11 @@ #include #include #include +#include #include #include - unsigned long arch_get_unmapped_area (struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) @@ -31,6 +31,20 @@ if (len > RGN_MAP_LIMIT) return -ENOMEM; + +#ifdef CONFIG_HUGETLB_PAGE +#define COLOR_HALIGN(addr) ((addr + HPAGE_SIZE - 1) & ~(HPAGE_SIZE - 1)) +#define TASK_HPAGE_BASE ((REGION_HPAGE << REGION_SHIFT) | HPAGE_SIZE) + if (filp && is_file_hugepages(filp)) { + if ((REGION_NUMBER(addr) != REGION_HPAGE) || (addr & (HPAGE_SIZE -1))) + addr = TASK_HPAGE_BASE; + addr = COLOR_HALIGN(addr); + } + else { + if (REGION_NUMBER(addr) == REGION_HPAGE) + addr = 0; + } +#endif if (!addr) addr = TASK_UNMAPPED_BASE; diff -Nru a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c --- a/arch/ia64/kernel/time.c Sun Feb 9 21:13:29 2003 +++ b/arch/ia64/kernel/time.c Sun Feb 9 21:13:29 2003 @@ -1,7 +1,7 @@ /* * linux/arch/ia64/kernel/time.c * - * Copyright (C) 1998-2002 Hewlett-Packard Co + * Copyright (C) 1998-2003 Hewlett-Packard Co * Stephane Eranian * David Mosberger * Copyright (C) 1999 Don Dugger @@ -24,7 +24,6 @@ #include #include -extern rwlock_t xtime_lock; extern unsigned long wall_jiffies; extern unsigned long last_time_offset; @@ -76,10 +75,8 @@ now = ia64_get_itc(); if ((long) (now - last_tick) < 0) { -# if 1 - printk("CPU %d: now < last_tick (now=0x%lx,last_tick=0x%lx)!\n", + printk(KERN_ERR "CPU %d: now < last_tick (now=0x%lx,last_tick=0x%lx)!\n", smp_processor_id(), now, last_tick); -# endif return last_time_offset; } elapsed_cycles = now - last_tick; @@ -89,7 +86,7 @@ void do_settimeofday (struct timeval *tv) { - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); { /* * This is revolting. We need to set "xtime" correctly. However, the value @@ -112,21 +109,21 @@ time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; } - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } void do_gettimeofday (struct timeval *tv) { - unsigned long flags, usec, sec, old; + unsigned long seq, usec, sec, old; - read_lock_irqsave(&xtime_lock, flags); - { + do { + seq = read_seqbegin(&xtime_lock); usec = gettimeoffset(); /* - * Ensure time never goes backwards, even when ITC on different CPUs are - * not perfectly synchronized. + * Ensure time never goes backwards, even when ITC on + * different CPUs are not perfectly synchronized. */ do { old = last_time_offset; @@ -138,8 +135,8 @@ sec = xtime.tv_sec; usec += xtime.tv_nsec / 1000; - } - read_unlock_irqrestore(&xtime_lock, flags); + } while (read_seqend(&xtime_lock, seq)); + while (usec >= 1000000) { usec -= 1000000; @@ -158,7 +155,7 @@ new_itm = local_cpu_data->itm_next; if (!time_after(ia64_get_itc(), new_itm)) - printk("Oops: timer tick before it's due (itc=%lx,itm=%lx)\n", + printk(KERN_ERR "Oops: timer tick before it's due (itc=%lx,itm=%lx)\n", ia64_get_itc(), new_itm); while (1) { @@ -182,10 +179,10 @@ * another CPU. We need to avoid to SMP race by acquiring the * xtime_lock. */ - write_lock(&xtime_lock); + write_seqlock(&xtime_lock); do_timer(regs); local_cpu_data->itm_next = new_itm; - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); } else local_cpu_data->itm_next = new_itm; @@ -247,21 +244,22 @@ */ status = ia64_sal_freq_base(SAL_FREQ_BASE_PLATFORM, &platform_base_freq, &drift); if (status != 0) { - printk("SAL_FREQ_BASE_PLATFORM failed: %s\n", ia64_sal_strerror(status)); + printk(KERN_ERR "SAL_FREQ_BASE_PLATFORM failed: %s\n", ia64_sal_strerror(status)); } else { status = ia64_pal_freq_ratios(&proc_ratio, 0, &itc_ratio); if (status != 0) - printk("PAL_FREQ_RATIOS failed with status=%ld\n", status); + printk(KERN_ERR "PAL_FREQ_RATIOS failed with status=%ld\n", status); } if (status != 0) { /* invent "random" values */ - printk("SAL/PAL failed to obtain frequency info---inventing reasonably values\n"); + printk(KERN_ERR + "SAL/PAL failed to obtain frequency info---inventing reasonably values\n"); platform_base_freq = 100000000; itc_ratio.num = 3; itc_ratio.den = 1; } if (platform_base_freq < 40000000) { - printk("Platform base frequency %lu bogus---resetting to 75MHz!\n", + printk(KERN_ERR "Platform base frequency %lu bogus---resetting to 75MHz!\n", platform_base_freq); platform_base_freq = 75000000; } @@ -272,8 +270,8 @@ itc_freq = (platform_base_freq*itc_ratio.num)/itc_ratio.den; local_cpu_data->itm_delta = (itc_freq + HZ/2) / HZ; - printk("CPU %d: base freq=%lu.%03luMHz, ITC ratio=%lu/%lu, ITC freq=%lu.%03luMHz\n", - smp_processor_id(), + printk(KERN_INFO "CPU %d: base freq=%lu.%03luMHz, ITC ratio=%lu/%lu, " + "ITC freq=%lu.%03luMHz\n", smp_processor_id(), platform_base_freq / 1000000, (platform_base_freq / 1000) % 1000, itc_ratio.num, itc_ratio.den, itc_freq / 1000000, (itc_freq / 1000) % 1000); diff -Nru a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c --- a/arch/ia64/kernel/traps.c Sun Feb 9 21:13:36 2003 +++ b/arch/ia64/kernel/traps.c Sun Feb 9 21:13:36 2003 @@ -1,7 +1,7 @@ /* * Architecture-specific trap handling. * - * Copyright (C) 1998-2002 Hewlett-Packard Co + * Copyright (C) 1998-2003 Hewlett-Packard Co * David Mosberger-Tang * * 05/12/00 grao : added isr in siginfo for SIGFPE @@ -57,7 +57,8 @@ major = fpswa_interface->revision >> 16; minor = fpswa_interface->revision & 0xffff; } - printk("fpswa interface at %lx (rev %d.%d)\n", ia64_boot_param->fpswa, major, minor); + printk(KERN_INFO "fpswa interface at %lx (rev %d.%d)\n", + ia64_boot_param->fpswa, major, minor); } /* @@ -142,7 +143,7 @@ switch (break_num) { case 0: /* unknown error (used by GCC for __builtin_abort()) */ - die_if_kernel("bad break", regs, break_num); + die_if_kernel("bugcheck!", regs, break_num); sig = SIGILL; code = ILL_ILLOPC; break; @@ -222,7 +223,7 @@ { struct pt_regs *regs = (struct pt_regs *) &stack; - printk("%s(%d): \n", current->comm, current->pid, + printk(KERN_DEBUG "%s(%d): \n", current->comm, current->pid, regs->r15, arg0, arg1, arg2, arg3); return -ENOSYS; } @@ -346,7 +347,7 @@ /* emulation was successful */ ia64_increment_ip(regs); } else if (exception == -1) { - printk("handle_fpu_swa: fp_emulate() returned -1\n"); + printk(KERN_ERR "handle_fpu_swa: fp_emulate() returned -1\n"); return -1; } else { /* is next instruction a trap? */ @@ -369,7 +370,7 @@ } } else { if (exception == -1) { - printk("handle_fpu_swa: fp_emulate() returned -1\n"); + printk(KERN_ERR "handle_fpu_swa: fp_emulate() returned -1\n"); return -1; } else if (exception != 0) { /* raise exception */ @@ -467,7 +468,9 @@ ? " (RSE access)" : " (data access)") : ""); if (code == 8) { # ifdef CONFIG_IA64_PRINT_HAZARDS - printk("%016lx:possible hazard, pr = %016lx\n", regs->cr_iip, regs->pr); + printk("%s[%d]: possible hazard @ ip=%016lx (pr = %016lx)\n", + current->comm, current->pid, regs->cr_iip + ia64_psr(regs)->ri, + regs->pr); # endif return; } @@ -524,6 +527,25 @@ case 29: /* Debug */ case 35: /* Taken Branch Trap */ case 36: /* Single Step Trap */ +#ifdef CONFIG_FSYS + if (fsys_mode(current, regs)) { + extern char syscall_via_break[], __start_gate_section[]; + /* + * Got a trap in fsys-mode: Taken Branch Trap and Single Step trap + * need special handling; Debug trap is not supposed to happen. + */ + if (unlikely(vector == 29)) { + die("Got debug trap in fsys-mode---not supposed to happen!", + regs, 0); + return; + } + /* re-do the system call via break 0x100000: */ + regs->cr_iip = GATE_ADDR + (syscall_via_break - __start_gate_section); + ia64_psr(regs)->ri = 0; + ia64_psr(regs)->cpl = 3; + return; + } +#endif switch (vector) { case 29: siginfo.si_code = TRAP_HWBKPT; @@ -563,19 +585,31 @@ } return; - case 34: /* Unimplemented Instruction Address Trap */ - if (user_mode(regs)) { - siginfo.si_signo = SIGILL; - siginfo.si_code = ILL_BADIADDR; - siginfo.si_errno = 0; - siginfo.si_flags = 0; - siginfo.si_isr = 0; - siginfo.si_imm = 0; - siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri); - force_sig_info(SIGILL, &siginfo, current); + case 34: + if (isr & 0x2) { + /* Lower-Privilege Transfer Trap */ + /* + * Just clear PSR.lp and then return immediately: all the + * interesting work (e.g., signal delivery is done in the kernel + * exit path). + */ + ia64_psr(regs)->lp = 0; return; + } else { + /* Unimplemented Instr. Address Trap */ + if (user_mode(regs)) { + siginfo.si_signo = SIGILL; + siginfo.si_code = ILL_BADIADDR; + siginfo.si_errno = 0; + siginfo.si_flags = 0; + siginfo.si_isr = 0; + siginfo.si_imm = 0; + siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri); + force_sig_info(SIGILL, &siginfo, current); + return; + } + sprintf(buf, "Unimplemented Instruction Address fault"); } - sprintf(buf, "Unimplemented Instruction Address fault"); break; case 45: @@ -583,8 +617,9 @@ if (ia32_exception(regs, isr) == 0) return; #endif - printk("Unexpected IA-32 exception (Trap 45)\n"); - printk(" iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx\n", regs->cr_iip, ifa, isr); + printk(KERN_ERR "Unexpected IA-32 exception (Trap 45)\n"); + printk(KERN_ERR " iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx\n", + regs->cr_iip, ifa, isr); force_sig(SIGSEGV, current); break; @@ -593,8 +628,8 @@ if (ia32_intercept(regs, isr) == 0) return; #endif - printk("Unexpected IA-32 intercept trap (Trap 46)\n"); - printk(" iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx, iim - 0x%lx\n", + printk(KERN_ERR "Unexpected IA-32 intercept trap (Trap 46)\n"); + printk(KERN_ERR " iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx, iim - 0x%lx\n", regs->cr_iip, ifa, isr, iim); force_sig(SIGSEGV, current); return; diff -Nru a/arch/ia64/kernel/unaligned.c b/arch/ia64/kernel/unaligned.c --- a/arch/ia64/kernel/unaligned.c Sun Feb 9 21:13:36 2003 +++ b/arch/ia64/kernel/unaligned.c Sun Feb 9 21:13:36 2003 @@ -331,12 +331,8 @@ return; } - /* - * Avoid using user_mode() here: with "epc", we cannot use the privilege level to - * infer whether the interrupt task was running on the kernel backing store. - */ - if (regs->r12 >= TASK_SIZE) { - DPRINT("ignoring kernel write to r%lu; register isn't on the RBS!", r1); + if (!user_stack(current, regs)) { + DPRINT("ignoring kernel write to r%lu; register isn't on the kernel RBS!", r1); return; } @@ -406,11 +402,7 @@ return; } - /* - * Avoid using user_mode() here: with "epc", we cannot use the privilege level to - * infer whether the interrupt task was running on the kernel backing store. - */ - if (regs->r12 >= TASK_SIZE) { + if (!user_stack(current, regs)) { DPRINT("ignoring kernel read of r%lu; register isn't on the RBS!", r1); goto fail; } @@ -1302,12 +1294,12 @@ void ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs) { - struct exception_fixup fix = { 0 }; struct ia64_psr *ipsr = ia64_psr(regs); mm_segment_t old_fs = get_fs(); unsigned long bundle[2]; unsigned long opcode; struct siginfo si; + const struct exception_table_entry *eh = NULL; union { unsigned long l; load_store_t insn; @@ -1325,10 +1317,9 @@ * user-level unaligned accesses. Otherwise, a clever program could trick this * handler into reading an arbitrary kernel addresses... */ - if (!user_mode(regs)) { - fix = SEARCH_EXCEPTION_TABLE(regs); - } - if (user_mode(regs) || fix.cont) { + if (!user_mode(regs)) + eh = SEARCH_EXCEPTION_TABLE(regs); + if (user_mode(regs) || eh) { if ((current->thread.flags & IA64_THREAD_UAC_SIGBUS) != 0) goto force_sigbus; @@ -1494,8 +1485,8 @@ failure: /* something went wrong... */ if (!user_mode(regs)) { - if (fix.cont) { - handle_exception(regs, fix); + if (eh) { + handle_exception(regs, eh); goto done; } die_if_kernel("error during unaligned kernel access\n", regs, ret); diff -Nru a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c --- a/arch/ia64/kernel/unwind.c Sun Feb 9 21:13:37 2003 +++ b/arch/ia64/kernel/unwind.c Sun Feb 9 21:13:37 2003 @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2002 Hewlett-Packard Co + * Copyright (C) 1999-2003 Hewlett-Packard Co * David Mosberger-Tang */ /* @@ -532,7 +532,7 @@ rs = alloc_reg_state(); if (!rs) { - printk("unwind: cannot stack reg state!\n"); + printk(KERN_ERR "unwind: cannot stack reg state!\n"); return; } memcpy(rs, &sr->curr, sizeof(*rs)); @@ -545,7 +545,7 @@ struct unw_reg_state *rs = sr->curr.next; if (!rs) { - printk("unwind: stack underflow!\n"); + printk(KERN_ERR "unwind: stack underflow!\n"); return; } memcpy(&sr->curr, rs, sizeof(*rs)); @@ -561,7 +561,7 @@ while (rs) { copy = alloc_reg_state(); if (!copy) { - printk ("unwind.dup_state_stack: out of memory\n"); + printk(KERN_ERR "unwind.dup_state_stack: out of memory\n"); return NULL; } memcpy(copy, rs, sizeof(*copy)); @@ -951,7 +951,7 @@ return; } } - printk("unwind: failed to find state labeled 0x%lx\n", label); + printk(KERN_ERR "unwind: failed to find state labeled 0x%lx\n", label); } static inline void @@ -961,7 +961,7 @@ ls = alloc_labeled_state(); if (!ls) { - printk("unwind.desc_label_state(): out of memory\n"); + printk(KERN_ERR "unwind.desc_label_state(): out of memory\n"); return; } ls->label = label; @@ -1055,7 +1055,8 @@ r->val = 4*spoff; } -#define UNW_DEC_BAD_CODE(code) printk("unwind: unknown code 0x%02x\n", code); +#define UNW_DEC_BAD_CODE(code) printk(KERN_ERR "unwind: unknown code 0x%02x\n", \ + code); /* * region headers: @@ -1997,23 +1998,25 @@ { extern char __start_gate_section[], __stop_gate_section[]; unsigned long *lp, start, end, segbase = unw.kernel_table.segment_base; - const struct unw_table_entry *entry, *first; + const struct unw_table_entry *entry, *first, *unw_table_end; + extern int ia64_unw_end; size_t info_size, size; char *info; start = (unsigned long) __start_gate_section - segbase; end = (unsigned long) __stop_gate_section - segbase; + unw_table_end = (struct unw_table_entry *) &ia64_unw_end; size = 0; first = lookup(&unw.kernel_table, start); - for (entry = first; entry->start_offset < end; ++entry) + for (entry = first; entry < unw_table_end && entry->start_offset < end; ++entry) size += 3*8 + 8 + 8*UNW_LENGTH(*(u64 *) (segbase + entry->info_offset)); size += 8; /* reserve space for "end of table" marker */ unw.gate_table = alloc_bootmem(size); if (!unw.gate_table) { unw.gate_table_size = 0; - printk("unwind: unable to create unwind data for gate page!\n"); + printk(KERN_ERR "unwind: unable to create unwind data for gate page!\n"); return; } unw.gate_table_size = size; @@ -2021,7 +2024,7 @@ lp = unw.gate_table; info = (char *) unw.gate_table + size; - for (entry = first; entry->start_offset < end; ++entry, lp += 3) { + for (entry = first; entry < unw_table_end && entry->start_offset < end; ++entry, lp += 3) { info_size = 8 + 8*UNW_LENGTH(*(u64 *) (segbase + entry->info_offset)); info -= info_size; memcpy(info, (char *) segbase + entry->info_offset, info_size); diff -Nru a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile --- a/arch/ia64/lib/Makefile Sun Feb 9 21:13:36 2003 +++ b/arch/ia64/lib/Makefile Sun Feb 9 21:13:36 2003 @@ -4,8 +4,6 @@ L_TARGET = lib.a -export-objs := swiotlb.o - obj-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \ __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o \ checksum.o clear_page.o csum_partial_copy.o copy_page.o \ diff -Nru a/arch/ia64/lib/memcpy_mck.S b/arch/ia64/lib/memcpy_mck.S --- a/arch/ia64/lib/memcpy_mck.S Sun Feb 9 21:13:32 2003 +++ b/arch/ia64/lib/memcpy_mck.S Sun Feb 9 21:13:32 2003 @@ -159,7 +159,7 @@ mov ar.ec=2 (p10) br.dpnt.few .aligned_src_tail ;; - .align 32 +// .align 32 1: EX(.ex_handler, (p16) ld8 r34=[src0],16) EK(.ex_handler, (p16) ld8 r38=[src1],16) @@ -316,7 +316,7 @@ (p7) mov ar.lc = r21 (p8) mov ar.lc = r0 ;; - .align 32 +// .align 32 1: lfetch.fault [src_pre_mem], 128 lfetch.fault.excl [dst_pre_mem], 128 br.cloop.dptk.few 1b @@ -522,7 +522,7 @@ shrp r21=r22,r38,shift; /* speculative work */ \ br.sptk.few .unaligned_src_tail /* branch out of jump table */ \ ;; - .align 32 +// .align 32 .jump_table: COPYU(8) // unaligned cases .jmp1: diff -Nru a/arch/ia64/lib/memset.S b/arch/ia64/lib/memset.S --- a/arch/ia64/lib/memset.S Sun Feb 9 21:13:32 2003 +++ b/arch/ia64/lib/memset.S Sun Feb 9 21:13:32 2003 @@ -125,7 +125,7 @@ (p_zr) br.cond.dptk.many .l1b // Jump to use stf.spill ;; } - .align 32 // -------------------------- // L1A: store ahead into cache lines; fill later +// .align 32 // -------------------------- // L1A: store ahead into cache lines; fill later { .mmi and tmp = -(LINE_SIZE), cnt // compute end of range mov ptr9 = ptr1 // used for prefetching @@ -194,7 +194,7 @@ br.cond.dpnt.many .move_bytes_from_alignment // Branch no. 3 ;; } - .align 32 +// .align 32 .l1b: // ------------------------------------ // L1B: store ahead into cache lines; fill later { .mmi and tmp = -(LINE_SIZE), cnt // compute end of range @@ -261,7 +261,7 @@ and cnt = 0x1f, cnt // compute the remaining cnt mov.i ar.lc = loopcnt ;; } - .align 32 +// .align 32 .l2: // ------------------------------------ // L2A: store 32B in 2 cycles { .mmb stf8 [ptr1] = fvalue, 8 diff -Nru a/arch/ia64/lib/swiotlb.c b/arch/ia64/lib/swiotlb.c --- a/arch/ia64/lib/swiotlb.c Sun Feb 9 21:13:34 2003 +++ b/arch/ia64/lib/swiotlb.c Sun Feb 9 21:13:34 2003 @@ -113,7 +113,7 @@ io_tlb_index = 0; io_tlb_orig_addr = alloc_bootmem(io_tlb_nslabs * sizeof(char *)); - printk("Placing software IO TLB between 0x%p - 0x%p\n", + printk(KERN_INFO "Placing software IO TLB between 0x%p - 0x%p\n", (void *) io_tlb_start, (void *) io_tlb_end); } diff -Nru a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c --- a/arch/ia64/mm/discontig.c Sun Feb 9 21:13:35 2003 +++ b/arch/ia64/mm/discontig.c Sun Feb 9 21:13:35 2003 @@ -215,7 +215,7 @@ int node; if (numnodes == 0) { - printk("node info missing!\n"); + printk(KERN_ERR "node info missing!\n"); numnodes = 1; } diff -Nru a/arch/ia64/mm/extable.c b/arch/ia64/mm/extable.c --- a/arch/ia64/mm/extable.c Sun Feb 9 21:13:30 2003 +++ b/arch/ia64/mm/extable.c Sun Feb 9 21:13:30 2003 @@ -10,20 +10,19 @@ #include #include -extern const struct exception_table_entry __start___ex_table[]; -extern const struct exception_table_entry __stop___ex_table[]; - -static inline const struct exception_table_entry * -search_one_table (const struct exception_table_entry *first, - const struct exception_table_entry *last, - unsigned long ip, unsigned long gp) +const struct exception_table_entry * +search_extable (const struct exception_table_entry *first, + const struct exception_table_entry *last, + unsigned long ip) { - while (first <= last) { - const struct exception_table_entry *mid; - long diff; + const struct exception_table_entry *mid; + unsigned long mid_ip; + long diff; + while (first <= last) { mid = &first[(last - first)/2]; - diff = (mid->addr + gp) - ip; + mid_ip = (u64) &mid->addr + mid->addr; + diff = mid_ip - ip; if (diff == 0) return mid; else if (diff < 0) @@ -34,50 +33,14 @@ return 0; } -#ifndef CONFIG_MODULES -register unsigned long main_gp __asm__("gp"); -#endif - -struct exception_fixup -search_exception_table (unsigned long addr) -{ - const struct exception_table_entry *entry; - struct exception_fixup fix = { 0 }; - -#ifndef CONFIG_MODULES - /* There is only the kernel to search. */ - entry = search_one_table(__start___ex_table, __stop___ex_table - 1, addr, main_gp); - if (entry) - fix.cont = entry->cont + main_gp; - return fix; -#else - struct archdata *archdata; - struct module *mp; - - /* The kernel is the last "module" -- no need to treat it special. */ - for (mp = module_list; mp; mp = mp->next) { - if (!mp->ex_table_start) - continue; - archdata = (struct archdata *) mp->archdata_start; - if (!archdata) - continue; - entry = search_one_table(mp->ex_table_start, mp->ex_table_end - 1, - addr, (unsigned long) archdata->gp); - if (entry) { - fix.cont = entry->cont + (unsigned long) archdata->gp; - return fix; - } - } -#endif - return fix; -} - void -handle_exception (struct pt_regs *regs, struct exception_fixup fix) +handle_exception (struct pt_regs *regs, const struct exception_table_entry *e) { + long fix = (u64) &e->cont + e->cont; + regs->r8 = -EFAULT; - if (fix.cont & 4) + if (fix & 4) regs->r9 = 0; - regs->cr_iip = (long) fix.cont & ~0xf; - ia64_psr(regs)->ri = fix.cont & 0x3; /* set continuation slot number */ + regs->cr_iip = fix & ~0xf; + ia64_psr(regs)->ri = fix & 0x3; /* set continuation slot number */ } diff -Nru a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c --- a/arch/ia64/mm/fault.c Sun Feb 9 21:13:36 2003 +++ b/arch/ia64/mm/fault.c Sun Feb 9 21:13:36 2003 @@ -196,7 +196,7 @@ yield(); goto survive; } - printk("VM: killing process %s\n", current->comm); + printk(KERN_CRIT "VM: killing process %s\n", current->comm); if (user_mode(regs)) do_exit(SIGKILL); goto no_context; diff -Nru a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c --- a/arch/ia64/mm/hugetlbpage.c Sun Feb 9 21:13:32 2003 +++ b/arch/ia64/mm/hugetlbpage.c Sun Feb 9 21:13:32 2003 @@ -12,71 +12,41 @@ #include #include #include - #include #include #include #include -static struct vm_operations_struct hugetlb_vm_ops; -struct list_head htlbpage_freelist; -spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED; -extern long htlbpagemem; +#include + +static long htlbpagemem; +int htlbpage_max; +static long htlbzone_pages; -static void zap_hugetlb_resources (struct vm_area_struct *); +static LIST_HEAD(htlbpage_freelist); +static spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED; -static struct page * -alloc_hugetlb_page (void) +static struct page *alloc_hugetlb_page(void) { - struct list_head *curr, *head; + int i; struct page *page; spin_lock(&htlbpage_lock); - - head = &htlbpage_freelist; - curr = head->next; - - if (curr == head) { + if (list_empty(&htlbpage_freelist)) { spin_unlock(&htlbpage_lock); return NULL; } - page = list_entry(curr, struct page, list); - list_del(curr); + + page = list_entry(htlbpage_freelist.next, struct page, list); + list_del(&page->list); htlbpagemem--; spin_unlock(&htlbpage_lock); set_page_count(page, 1); - memset(page_address(page), 0, HPAGE_SIZE); + for (i = 0; i < (HPAGE_SIZE/PAGE_SIZE); ++i) + clear_highpage(&page[i]); return page; } -static void -free_hugetlb_page (struct page *page) -{ - spin_lock(&htlbpage_lock); - if ((page->mapping != NULL) && (page_count(page) == 2)) { - struct inode *inode = page->mapping->host; - int i; - - ClearPageDirty(page); - remove_from_page_cache(page); - set_page_count(page, 1); - if ((inode->i_size -= HPAGE_SIZE) == 0) { - for (i = 0; i < MAX_ID; i++) - if (htlbpagek[i].key == inode->i_ino) { - htlbpagek[i].key = 0; - htlbpagek[i].in = NULL; - break; - } - kfree(inode); - } - } - if (put_page_testzero(page)) { - list_add(&page->list, &htlbpage_freelist); - htlbpagemem++; - } - spin_unlock(&htlbpage_lock); -} - static pte_t * huge_pte_alloc (struct mm_struct *mm, unsigned long addr) { @@ -126,63 +96,8 @@ return; } -static int -anon_get_hugetlb_page (struct mm_struct *mm, struct vm_area_struct *vma, - int write_access, pte_t * page_table) -{ - struct page *page; - - page = alloc_hugetlb_page(); - if (page == NULL) - return -1; - set_huge_pte(mm, vma, page, page_table, write_access); - return 1; -} - -static int -make_hugetlb_pages_present (unsigned long addr, unsigned long end, int flags) -{ - int write; - struct mm_struct *mm = current->mm; - struct vm_area_struct *vma; - pte_t *pte; - - vma = find_vma(mm, addr); - if (!vma) - goto out_error1; - - write = (vma->vm_flags & VM_WRITE) != 0; - if ((vma->vm_end - vma->vm_start) & (HPAGE_SIZE - 1)) - goto out_error1; - spin_lock(&mm->page_table_lock); - do { - pte = huge_pte_alloc(mm, addr); - if ((pte) && (pte_none(*pte))) { - if (anon_get_hugetlb_page(mm, vma, write ? VM_WRITE : VM_READ, pte) == -1) - goto out_error; - } else - goto out_error; - addr += HPAGE_SIZE; - } while (addr < end); - spin_unlock(&mm->page_table_lock); - vma->vm_flags |= (VM_HUGETLB | VM_RESERVED); - if (flags & MAP_PRIVATE) - vma->vm_flags |= VM_DONTCOPY; - vma->vm_ops = &hugetlb_vm_ops; - return 0; -out_error: - if (addr > vma->vm_start) { - vma->vm_end = addr; - zap_hugetlb_resources(vma); - vma->vm_end = end; - } - spin_unlock(&mm->page_table_lock); -out_error1: - return -1; -} - -int -copy_hugetlb_page_range (struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma) +int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, + struct vm_area_struct *vma) { pte_t *src_pte, *dst_pte, entry; struct page *ptepage; @@ -202,15 +117,14 @@ addr += HPAGE_SIZE; } return 0; - - nomem: +nomem: return -ENOMEM; } int -follow_hugetlb_page (struct mm_struct *mm, struct vm_area_struct *vma, - struct page **pages, struct vm_area_struct **vmas, - unsigned long *st, int *length, int i) +follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, + struct page **pages, struct vm_area_struct **vmas, + unsigned long *st, int *length, int i) { pte_t *ptep, pte; unsigned long start = *st; @@ -227,6 +141,7 @@ page = pte_page(pte); if (pages) { page += ((start & ~HPAGE_MASK) >> PAGE_SHIFT); + get_page(page); pages[i] = page; } if (vmas) @@ -234,8 +149,8 @@ i++; len--; start += PAGE_SIZE; - if (((start & HPAGE_MASK) == pstart) && len - && (start < vma->vm_end)) + if (((start & HPAGE_MASK) == pstart) && len && + (start < vma->vm_end)) goto back1; } while (len && start < vma->vm_end); *length = len; @@ -243,51 +158,149 @@ return i; } -static void -zap_hugetlb_resources (struct vm_area_struct *mpnt) +void free_huge_page(struct page *page) { - struct mm_struct *mm = mpnt->vm_mm; - unsigned long len, addr, end; - pte_t *ptep; + BUG_ON(page_count(page)); + BUG_ON(page->mapping); + + INIT_LIST_HEAD(&page->list); + + spin_lock(&htlbpage_lock); + list_add(&page->list, &htlbpage_freelist); + htlbpagemem++; + spin_unlock(&htlbpage_lock); +} + +void huge_page_release(struct page *page) +{ + if (!put_page_testzero(page)) + return; + + free_huge_page(page); +} + +void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) +{ + struct mm_struct *mm = vma->vm_mm; + unsigned long address; + pte_t *pte; struct page *page; - addr = mpnt->vm_start; - end = mpnt->vm_end; - len = end - addr; - do { - ptep = huge_pte_offset(mm, addr); - page = pte_page(*ptep); - pte_clear(ptep); - free_hugetlb_page(page); - addr += HPAGE_SIZE; - } while (addr < end); - mm->rss -= (len >> PAGE_SHIFT); - mpnt->vm_ops = NULL; - flush_tlb_range(mpnt, end - len, end); + BUG_ON(start & (HPAGE_SIZE - 1)); + BUG_ON(end & (HPAGE_SIZE - 1)); + + spin_lock(&htlbpage_lock); + spin_unlock(&htlbpage_lock); + for (address = start; address < end; address += HPAGE_SIZE) { + pte = huge_pte_offset(mm, address); + if (pte_none(*pte)) + continue; + page = pte_page(*pte); + huge_page_release(page); + pte_clear(pte); + } + mm->rss -= (end - start) >> PAGE_SHIFT; + flush_tlb_range(vma, start, end); } -static void -unlink_vma (struct vm_area_struct *mpnt) +void zap_hugepage_range(struct vm_area_struct *vma, unsigned long start, unsigned long length) +{ + struct mm_struct *mm = vma->vm_mm; + spin_lock(&mm->page_table_lock); + unmap_hugepage_range(vma, start, start + length); + spin_unlock(&mm->page_table_lock); +} + +int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma) { struct mm_struct *mm = current->mm; - struct vm_area_struct *vma; + unsigned long addr; + int ret = 0; + + BUG_ON(vma->vm_start & ~HPAGE_MASK); + BUG_ON(vma->vm_end & ~HPAGE_MASK); + + spin_lock(&mm->page_table_lock); + for (addr = vma->vm_start; addr < vma->vm_end; addr += HPAGE_SIZE) { + unsigned long idx; + pte_t *pte = huge_pte_alloc(mm, addr); + struct page *page; + + if (!pte) { + ret = -ENOMEM; + goto out; + } + if (!pte_none(*pte)) + continue; - vma = mm->mmap; - if (vma == mpnt) { - mm->mmap = vma->vm_next; - } else { - while (vma->vm_next != mpnt) { - vma = vma->vm_next; + idx = ((addr - vma->vm_start) >> HPAGE_SHIFT) + + (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT)); + page = find_get_page(mapping, idx); + if (!page) { + page = alloc_hugetlb_page(); + if (!page) { + ret = -ENOMEM; + goto out; + } + add_to_page_cache(page, mapping, idx, GFP_ATOMIC); + unlock_page(page); } - vma->vm_next = mpnt->vm_next; + set_huge_pte(mm, vma, page, pte, vma->vm_flags & VM_WRITE); } - rb_erase(&mpnt->vm_rb, &mm->mm_rb); - mm->mmap_cache = NULL; - mm->map_count--; +out: + spin_unlock(&mm->page_table_lock); + return ret; } -int -set_hugetlb_mem_size (int count) +void update_and_free_page(struct page *page) +{ + int j; + struct page *map; + + map = page; + htlbzone_pages--; + for (j = 0; j < (HPAGE_SIZE / PAGE_SIZE); j++) { + map->flags &= ~(1 << PG_locked | 1 << PG_error | 1 << PG_referenced | + 1 << PG_dirty | 1 << PG_active | 1 << PG_reserved | + 1 << PG_private | 1<< PG_writeback); + set_page_count(map, 0); + map++; + } + set_page_count(page, 1); + __free_pages(page, HUGETLB_PAGE_ORDER); +} + +int try_to_free_low(int count) +{ + struct list_head *p; + struct page *page, *map; + + map = NULL; + spin_lock(&htlbpage_lock); + list_for_each(p, &htlbpage_freelist) { + if (map) { + list_del(&map->list); + update_and_free_page(map); + htlbpagemem--; + map = NULL; + if (++count == 0) + break; + } + page = list_entry(p, struct page, list); + if ((page_zone(page))->name[0] != 'H') // Look for non-Highmem + map = page; + } + if (map) { + list_del(&map->list); + update_and_free_page(map); + htlbpagemem--; + count++; + } + spin_unlock(&htlbpage_lock); + return count; +} + +int set_hugetlb_mem_size(int count) { int j, lcount; struct page *page, *map; @@ -298,16 +311,14 @@ lcount = count; else lcount = count - htlbzone_pages; - if (lcount > 0) { /*Increase the mem size. */ + + if (lcount == 0) + return (int)htlbzone_pages; + if (lcount > 0) { /* Increase the mem size. */ while (lcount--) { page = alloc_pages(__GFP_HIGHMEM, HUGETLB_PAGE_ORDER); if (page == NULL) break; - map = page; - for (j = 0; j < (HPAGE_SIZE / PAGE_SIZE); j++) { - SetPageReserved(map); - map++; - } spin_lock(&htlbpage_lock); list_add(&page->list, &htlbpage_freelist); htlbpagemem++; @@ -316,27 +327,80 @@ } return (int) htlbzone_pages; } - /*Shrink the memory size. */ + /* Shrink the memory size. */ + lcount = try_to_free_low(lcount); while (lcount++) { page = alloc_hugetlb_page(); if (page == NULL) break; spin_lock(&htlbpage_lock); - htlbzone_pages--; + update_and_free_page(page); spin_unlock(&htlbpage_lock); - map = page; - for (j = 0; j < (HPAGE_SIZE / PAGE_SIZE); j++) { - map->flags &= ~(1 << PG_locked | 1 << PG_error | 1 << PG_referenced | - 1 << PG_dirty | 1 << PG_active | 1 << PG_reserved | - 1 << PG_private | 1<< PG_writeback); - map++; - } - set_page_count(page, 1); - __free_pages(page, HUGETLB_PAGE_ORDER); } return (int) htlbzone_pages; } -static struct vm_operations_struct hugetlb_vm_ops = { - .close = zap_hugetlb_resources +int hugetlb_sysctl_handler(ctl_table *table, int write, struct file *file, void *buffer, size_t *length) +{ + proc_dointvec(table, write, file, buffer, length); + htlbpage_max = set_hugetlb_mem_size(htlbpage_max); + return 0; +} + +static int __init hugetlb_setup(char *s) +{ + if (sscanf(s, "%d", &htlbpage_max) <= 0) + htlbpage_max = 0; + return 1; +} +__setup("hugepages=", hugetlb_setup); + +static int __init hugetlb_init(void) +{ + int i, j; + struct page *page; + + for (i = 0; i < htlbpage_max; ++i) { + page = alloc_pages(__GFP_HIGHMEM, HUGETLB_PAGE_ORDER); + if (!page) + break; + for (j = 0; j < HPAGE_SIZE/PAGE_SIZE; ++j) + SetPageReserved(&page[j]); + spin_lock(&htlbpage_lock); + list_add(&page->list, &htlbpage_freelist); + spin_unlock(&htlbpage_lock); + } + htlbpage_max = htlbpagemem = htlbzone_pages = i; + printk("Total HugeTLB memory allocated, %ld\n", htlbpagemem); + return 0; +} +module_init(hugetlb_init); + +int hugetlb_report_meminfo(char *buf) +{ + return sprintf(buf, + "HugePages_Total: %5lu\n" + "HugePages_Free: %5lu\n" + "Hugepagesize: %5lu kB\n", + htlbzone_pages, + htlbpagemem, + HPAGE_SIZE/1024); +} + +int is_hugepage_mem_enough(size_t size) +{ + if (size > (htlbpagemem << HPAGE_SHIFT)) + return 0; + return 1; +} + +static struct page *hugetlb_nopage(struct vm_area_struct * area, unsigned long address, int unused) +{ + BUG(); + return NULL; +} + +struct vm_operations_struct hugetlb_vm_ops = { + .nopage = hugetlb_nopage, + .close = zap_hugetlb_resources, }; diff -Nru a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c --- a/arch/ia64/mm/init.c Sun Feb 9 21:13:31 2003 +++ b/arch/ia64/mm/init.c Sun Feb 9 21:13:31 2003 @@ -234,7 +234,7 @@ pte_t *pte; if (!PageReserved(page)) - printk("put_gate_page: gate page at 0x%p not in reserved memory\n", + printk(KERN_ERR "put_gate_page: gate page at 0x%p not in reserved memory\n", page_address(page)); pgd = pgd_offset_k(address); /* note: this is NOT pgd_offset()! */ @@ -342,13 +342,6 @@ * Set up the page tables. */ -#ifdef CONFIG_HUGETLB_PAGE -long htlbpagemem; -int htlbpage_max; -extern long htlbzone_pages; -extern struct list_head htlbpage_freelist; -#endif - #ifdef CONFIG_DISCONTIGMEM void paging_init (void) @@ -438,10 +431,10 @@ datasize = (unsigned long) &_edata - (unsigned long) &_etext; initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; - printk("Memory: %luk/%luk available (%luk code, %luk reserved, %luk data, %luk init)\n", - (unsigned long) nr_free_pages() << (PAGE_SHIFT - 10), - num_physpages << (PAGE_SHIFT - 10), codesize >> 10, reserved_pages << (PAGE_SHIFT - 10), - datasize >> 10, initsize >> 10); + printk(KERN_INFO "Memory: %luk/%luk available (%luk code, %luk reserved, " + "%luk data, %luk init)\n", (unsigned long) nr_free_pages() << (PAGE_SHIFT - 10), + num_physpages << (PAGE_SHIFT - 10), codesize >> 10, + reserved_pages << (PAGE_SHIFT - 10), datasize >> 10, initsize >> 10); /* * Allow for enough (cached) page table pages so that we can map the entire memory @@ -461,30 +454,5 @@ #ifdef CONFIG_IA32_SUPPORT ia32_gdt_init(); -#endif -#ifdef CONFIG_HUGETLB_PAGE - { - long i; - int j; - struct page *page, *map; - - if ((htlbzone_pages << (HPAGE_SHIFT - PAGE_SHIFT)) >= max_low_pfn) - htlbzone_pages = (max_low_pfn >> ((HPAGE_SHIFT - PAGE_SHIFT) + 1)); - INIT_LIST_HEAD(&htlbpage_freelist); - for (i = 0; i < htlbzone_pages; i++) { - page = alloc_pages(__GFP_HIGHMEM, HUGETLB_PAGE_ORDER); - if (!page) - break; - map = page; - for (j = 0; j < (HPAGE_SIZE/PAGE_SIZE); j++) { - SetPageReserved(map); - map++; - } - list_add(&page->list, &htlbpage_freelist); - } - printk("Total Huge_TLB_Page memory pages allocated %ld \n", i); - htlbzone_pages = htlbpagemem = i; - htlbpage_max = (int)i; - } #endif } diff -Nru a/arch/ia64/scripts/check-gas b/arch/ia64/scripts/check-gas --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/ia64/scripts/check-gas Sun Feb 9 21:13:38 2003 @@ -0,0 +1,11 @@ +#!/bin/sh +dir=$(dirname $0) +CC=$1 +$CC -c $dir/check-gas-asm.S +res=$(objdump -r --section .data check-gas-asm.o | fgrep 00004 | tr -s ' ' |cut -f3 -d' ') +if [ $res != ".text" ]; then + echo buggy +else + echo good +fi +exit 0 diff -Nru a/arch/ia64/scripts/check-gas-asm.S b/arch/ia64/scripts/check-gas-asm.S --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/ia64/scripts/check-gas-asm.S Sun Feb 9 21:13:38 2003 @@ -0,0 +1,2 @@ +[1:] nop 0 + .xdata4 ".data", 0, 1b-. diff -Nru a/arch/ia64/scripts/unwcheck.sh b/arch/ia64/scripts/unwcheck.sh --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/ia64/scripts/unwcheck.sh Sun Feb 9 21:13:38 2003 @@ -0,0 +1,109 @@ +#!/bin/sh +# Usage: unwcheck.sh +# Pre-requisite: readelf [from Gnu binutils package] +# Purpose: Check the following invariant +# For each code range in the input binary: +# Sum[ lengths of unwind regions] = Number of slots in code range. +# Author : Harish Patil +# First version: January 2002 +# Modified : 2/13/2002 +# Modified : 3/15/2002: duplicate detection +readelf -u $1 | gawk '\ + function todec(hexstr){ + dec = 0; + l = length(hexstr); + for (i = 1; i <= l; i++) + { + c = substr(hexstr, i, 1); + if (c == "A") + dec = dec*16 + 10; + else if (c == "B") + dec = dec*16 + 11; + else if (c == "C") + dec = dec*16 + 12; + else if (c == "D") + dec = dec*16 + 13; + else if (c == "E") + dec = dec*16 + 14; + else if (c == "F") + dec = dec*16 + 15; + else + dec = dec*16 + c; + } + return dec; + } + BEGIN { first = 1; sum_rlen = 0; no_slots = 0; errors=0; no_code_ranges=0; } + { + if (NF==5 && $3=="info") + { + no_code_ranges += 1; + if (first == 0) + { + if (sum_rlen != no_slots) + { + print full_code_range; + print " ", "lo = ", lo, " hi =", hi; + print " ", "sum_rlen = ", sum_rlen, "no_slots = " no_slots; + print " "," ", "*******ERROR ***********"; + print " "," ", "sum_rlen:", sum_rlen, " != no_slots:" no_slots; + errors += 1; + } + sum_rlen = 0; + } + full_code_range = $0; + code_range = $2; + gsub("..$", "", code_range); + gsub("^.", "", code_range); + split(code_range, addr, "-"); + lo = toupper(addr[1]); + + code_range_lo[no_code_ranges] = addr[1]; + occurs[addr[1]] += 1; + full_range[addr[1]] = $0; + + gsub("0X.[0]*", "", lo); + hi = toupper(addr[2]); + gsub("0X.[0]*", "", hi); + no_slots = (todec(hi) - todec(lo))/ 16*3 + first = 0; + } + if (index($0,"rlen") > 0 ) + { + rlen_str = substr($0, index($0,"rlen")); + rlen = rlen_str; + gsub("rlen=", "", rlen); + gsub(")", "", rlen); + sum_rlen = sum_rlen + rlen; + } + } + END { + if (first == 0) + { + if (sum_rlen != no_slots) + { + print "code_range=", code_range; + print " ", "lo = ", lo, " hi =", hi; + print " ", "sum_rlen = ", sum_rlen, "no_slots = " no_slots; + print " "," ", "*******ERROR ***********"; + print " "," ", "sum_rlen:", sum_rlen, " != no_slots:" no_slots; + errors += 1; + } + } + no_duplicates = 0; + for (i=1; i<=no_code_ranges; i++) + { + cr = code_range_lo[i]; + if (reported_cr[cr]==1) continue; + if ( occurs[cr] > 1) + { + reported_cr[cr] = 1; + print "Code range low ", code_range_lo[i], ":", full_range[cr], " occurs: ", occurs[cr], " times."; + print " "; + no_duplicates++; + } + } + print "======================================" + print "Total errors:", errors, "/", no_code_ranges, " duplicates:", no_duplicates; + print "======================================" + } + ' diff -Nru a/arch/ia64/sn/io/Makefile b/arch/ia64/sn/io/Makefile --- a/arch/ia64/sn/io/Makefile Sun Feb 9 21:13:30 2003 +++ b/arch/ia64/sn/io/Makefile Sun Feb 9 21:13:30 2003 @@ -13,8 +13,6 @@ EXTRA_CFLAGS += -DSHUB_SWAP_WAR endif -export-objs := hcl.o pci_dma.o - obj-$(CONFIG_IA64_SGI_SN) += stubs.o sgi_if.o xswitch.o klgraph_hack.o \ hcl.o labelcl.o invent.o sgi_io_sim.o \ klgraph_hack.o hcl_util.o cdl.o hubdev.o hubspc.o \ diff -Nru a/arch/ia64/sn/io/sn1/pcibr.c b/arch/ia64/sn/io/sn1/pcibr.c --- a/arch/ia64/sn/io/sn1/pcibr.c Sun Feb 9 21:13:33 2003 +++ b/arch/ia64/sn/io/sn1/pcibr.c Sun Feb 9 21:13:33 2003 @@ -4811,7 +4811,7 @@ /* Device is capable of A64 operations, * and the attributes of the DMA are - * consistant with any previous DMA + * consistent with any previous DMA * mappings using shared resources. */ @@ -4853,7 +4853,7 @@ if (!pcibr_try_set_device(pcibr_soft, slot, flags, BRIDGE_DEV_D32_BITS)) { /* User desires DIRECT A32 operations, * and the attributes of the DMA are - * consistant with any previous DMA + * consistent with any previous DMA * mappings using shared resources. * Mapping calls may fail if target * is outside the direct32 range. diff -Nru a/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c --- a/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c Sun Feb 9 21:13:37 2003 +++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c Sun Feb 9 21:13:37 2003 @@ -3216,7 +3216,7 @@ /* Device is capable of A64 operations, * and the attributes of the DMA are - * consistant with any previous DMA + * consistent with any previous DMA * mappings using shared resources. */ @@ -3266,7 +3266,7 @@ if (!pcibr_try_set_device(pcibr_soft, slot, flags, BRIDGE_DEV_D32_BITS)) { /* User desires DIRECT A32 operations, * and the attributes of the DMA are - * consistant with any previous DMA + * consistent with any previous DMA * mappings using shared resources. * Mapping calls may fail if target * is outside the direct32 range. diff -Nru a/arch/ia64/sn/kernel/Makefile b/arch/ia64/sn/kernel/Makefile --- a/arch/ia64/sn/kernel/Makefile Sun Feb 9 21:13:29 2003 +++ b/arch/ia64/sn/kernel/Makefile Sun Feb 9 21:13:29 2003 @@ -38,8 +38,6 @@ .S.o: $(CC) $(AFLAGS) $(AFLAGS_KERNEL) -c -o $*.o $< -export-objs = sn_ksyms.o iomv.o - obj-y = probe.o setup.o sn_asm.o sv.o bte.o iomv.o obj-$(CONFIG_IA64_SGI_SN1) += irq.o mca.o obj-$(CONFIG_IA64_SGI_SN2) += irq.o mca.o diff -Nru a/arch/ia64/tools/Makefile b/arch/ia64/tools/Makefile --- a/arch/ia64/tools/Makefile Sun Feb 9 21:13:32 2003 +++ b/arch/ia64/tools/Makefile Sun Feb 9 21:13:32 2003 @@ -4,14 +4,7 @@ src = $(obj) -all: - -fastdep: - -mrproper: clean - -clean: - rm -f $(obj)/print_offsets.s $(obj)/print_offsets $(obj)/offsets.h +clean-files := print_offsets.s print_offsets offsets.h $(TARGET): $(obj)/offsets.h @if ! cmp -s $(obj)/offsets.h ${TARGET}; then \ diff -Nru a/arch/ia64/tools/print_offsets.c b/arch/ia64/tools/print_offsets.c --- a/arch/ia64/tools/print_offsets.c Sun Feb 9 21:13:36 2003 +++ b/arch/ia64/tools/print_offsets.c Sun Feb 9 21:13:36 2003 @@ -1,7 +1,7 @@ /* * Utility to generate asm-ia64/offsets.h. * - * Copyright (C) 1999-2002 Hewlett-Packard Co + * Copyright (C) 1999-2003 Hewlett-Packard Co * David Mosberger-Tang * * Note that this file has dual use: when building the kernel @@ -52,8 +52,13 @@ { "SIGFRAME_SIZE", sizeof (struct sigframe) }, { "UNW_FRAME_INFO_SIZE", sizeof (struct unw_frame_info) }, { "", 0 }, /* spacer */ - { "IA64_TASK_THREAD_KSP_OFFSET", offsetof (struct task_struct, thread.ksp) }, + { "IA64_TASK_CLEAR_CHILD_TID_OFFSET",offsetof (struct task_struct, clear_child_tid) }, + { "IA64_TASK_GROUP_LEADER_OFFSET", offsetof (struct task_struct, group_leader) }, { "IA64_TASK_PID_OFFSET", offsetof (struct task_struct, pid) }, + { "IA64_TASK_REAL_PARENT_OFFSET", offsetof (struct task_struct, real_parent) }, + { "IA64_TASK_TGID_OFFSET", offsetof (struct task_struct, tgid) }, + { "IA64_TASK_THREAD_KSP_OFFSET", offsetof (struct task_struct, thread.ksp) }, + { "IA64_TASK_THREAD_ON_USTACK_OFFSET", offsetof (struct task_struct, thread.on_ustack) }, { "IA64_PT_REGS_CR_IPSR_OFFSET", offsetof (struct pt_regs, cr_ipsr) }, { "IA64_PT_REGS_CR_IIP_OFFSET", offsetof (struct pt_regs, cr_iip) }, { "IA64_PT_REGS_CR_IFS_OFFSET", offsetof (struct pt_regs, cr_ifs) }, diff -Nru a/arch/ia64/vmlinux.lds.S b/arch/ia64/vmlinux.lds.S --- a/arch/ia64/vmlinux.lds.S Sun Feb 9 21:13:35 2003 +++ b/arch/ia64/vmlinux.lds.S Sun Feb 9 21:13:35 2003 @@ -6,7 +6,7 @@ #define LOAD_OFFSET PAGE_OFFSET #include - + OUTPUT_FORMAT("elf64-ia64-little") OUTPUT_ARCH(ia64) ENTRY(phys_start) @@ -29,6 +29,7 @@ _text = .; _stext = .; + .text : AT(ADDR(.text) - PAGE_OFFSET) { *(.text.ivt) @@ -44,33 +45,46 @@ /* Read-only data */ - /* Global data */ - _data = .; - /* Exception table */ . = ALIGN(16); - __start___ex_table = .; __ex_table : AT(ADDR(__ex_table) - PAGE_OFFSET) - { *(__ex_table) } - __stop___ex_table = .; + { + __start___ex_table = .; + *(__ex_table) + __stop___ex_table = .; + } + + __mckinley_e9_bundles : AT(ADDR(__mckinley_e9_bundles) - PAGE_OFFSET) + { + __start___mckinley_e9_bundles = .; + *(__mckinley_e9_bundles) + __end___mckinley_e9_bundles = .; + } + + /* Global data */ + _data = .; #if defined(CONFIG_IA64_GENERIC) /* Machine Vector */ . = ALIGN(16); - machvec_start = .; .machvec : AT(ADDR(.machvec) - PAGE_OFFSET) - { *(.machvec) } - machvec_end = .; + { + machvec_start = .; + *(.machvec) + machvec_end = .; + } #endif /* Unwind info & table: */ . = ALIGN(8); .IA_64.unwind_info : AT(ADDR(.IA_64.unwind_info) - PAGE_OFFSET) { *(.IA_64.unwind_info*) } - ia64_unw_start = .; .IA_64.unwind : AT(ADDR(.IA_64.unwind) - PAGE_OFFSET) - { *(.IA_64.unwind*) } - ia64_unw_end = .; + { + ia64_unw_start = .; + *(.IA_64.unwind*) + ia64_unw_end = .; + } RODATA @@ -87,32 +101,38 @@ .init.data : AT(ADDR(.init.data) - PAGE_OFFSET) { *(.init.data) } - __initramfs_start = .; .init.ramfs : AT(ADDR(.init.ramfs) - PAGE_OFFSET) - { *(.init.ramfs) } - __initramfs_end = .; + { + __initramfs_start = .; + *(.init.ramfs) + __initramfs_end = .; + } . = ALIGN(16); - __setup_start = .; .init.setup : AT(ADDR(.init.setup) - PAGE_OFFSET) - { *(.init.setup) } - __setup_end = .; - __start___param = .; + { + __setup_start = .; + *(.init.setup) + __setup_end = .; + } __param : AT(ADDR(__param) - PAGE_OFFSET) - { *(__param) } - __stop___param = .; - __initcall_start = .; + { + __start___param = .; + *(__param) + __stop___param = .; + } .initcall.init : AT(ADDR(.initcall.init) - PAGE_OFFSET) { - *(.initcall1.init) - *(.initcall2.init) - *(.initcall3.init) - *(.initcall4.init) - *(.initcall5.init) - *(.initcall6.init) - *(.initcall7.init) + __initcall_start = .; + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + __initcall_end = .; } - __initcall_end = .; . = ALIGN(PAGE_SIZE); __init_end = .; @@ -130,10 +150,6 @@ . = ALIGN(SMP_CACHE_BYTES); .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - PAGE_OFFSET) { *(.data.cacheline_aligned) } - - /* Kernel symbol names for modules: */ - .kstrtab : AT(ADDR(.kstrtab) - PAGE_OFFSET) - { *(.kstrtab) } /* Per-cpu data: */ . = ALIGN(PERCPU_PAGE_SIZE); diff -Nru a/arch/m68k/Kconfig b/arch/m68k/Kconfig --- a/arch/m68k/Kconfig Sun Feb 9 21:13:33 2003 +++ b/arch/m68k/Kconfig Sun Feb 9 21:13:33 2003 @@ -73,8 +73,8 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - When compiled this way, there will be modules called pcmcia_core.o - and ds.o. If you want to compile it as a module, say M here and + When compiled this way, there will be modules called pcmcia_core + and ds. If you want to compile it as a module, say M here and read . config AMIGA @@ -398,7 +398,7 @@ QMAGIC support" then you'll have to say Y here. You may answer M to compile a.out support as a module and later load the module when you want to use a program or library in a.out format. The module will be - called binfmt_aout.o. Saying M or N here is dangerous though, + called binfmt_aout. Saying M or N here is dangerous though, because some crucial programs on your system might still be in A.OUT format. @@ -428,7 +428,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called binfmt_elf.o. Saying M or N here is dangerous because + will be called binfmt_elf. Saying M or N here is dangerous because some crucial programs on your system might be in ELF format. config BINFMT_MISC @@ -453,7 +453,7 @@ use this part of the kernel. You may say M here for module support and later load the module when - you have use for it; the module is called binfmt_misc.o. If you + you have use for it; the module is called binfmt_misc. If you don't know what to answer at this point, say Y. config ZORRO @@ -541,7 +541,7 @@ ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module will be called - parport.o. If you have more than one parallel port and want to + parport. If you have more than one parallel port and want to specify which port and IRQ to be used by this driver at module load time, take a look at . @@ -553,7 +553,7 @@ help Say Y here if you need support for the parallel port hardware on Amiga machines. This code is also available as a module (say M), - called parport_amiga.o. If in doubt, saying N is the safe plan. + called parport_amiga. If in doubt, saying N is the safe plan. config PARPORT_MFC3 tristate "Multiface III parallel port" @@ -561,7 +561,7 @@ help Say Y here if you need parallel port support for the MFC3 card. This code is also available as a module (say M), called - parport_mfc3.o. If in doubt, saying N is the safe plan. + parport_mfc3. If in doubt, saying N is the safe plan. config PARPORT_PC bool @@ -576,7 +576,7 @@ as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module will be called - parport_pc.o. + parport_pc. If unsure, say Y. @@ -586,7 +586,7 @@ help Say Y here if you need support for the parallel port hardware on Atari machines. This code is also available as a module (say M), - called parport_atari.o. If in doubt, saying N is the safe plan. + called parport_atari. If in doubt, saying N is the safe plan. config PRINTER tristate "Parallel printer support" @@ -604,7 +604,7 @@ driver as a module however ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read and - . The module will be called lp.o. + . The module will be called lp. If you have several parallel ports, you can specify which ports to use with the "lp" kernel command line option. (Try "man bootparam" @@ -702,7 +702,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called ide.o. + will be called ide. For further information, please read . @@ -729,7 +729,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called scsi_mod.o. If you want to compile it as + The module will be called scsi_mod. If you want to compile it as a module, say M here and read and . However, do not compile this as a module if your root file system (the one containing the directory /) @@ -750,7 +750,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called sd_mod.o. If you want to compile it as a + The module will be called sd_mod. If you want to compile it as a module, say M here and read and . Do not compile this driver as a module if your root file system (the one containing the directory /) @@ -786,7 +786,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called st.o. If you want to compile it as a + The module will be called st. If you want to compile it as a module, say M here and read and . @@ -818,7 +818,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called sr_mod.o. If you want to compile it as a + The module will be called sr_mod. If you want to compile it as a module, say M here and read and . @@ -871,7 +871,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read and - . The module will be called sg.o. + . The module will be called sg. If unsure, say N. comment "Some SCSI devices (e.g. CD jukebox) support multiple LUNs" @@ -934,7 +934,7 @@ built-in SCSI controller, say Y. Otherwise, say N. This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). The module is - called wd33c93.o. If you want to compile it as a module, say M here + called wd33c93. If you want to compile it as a module, say M here and read . config A4000T_SCSI @@ -950,7 +950,7 @@ If you have a Commodore A2091 SCSI controller, say Y. Otherwise, say N. This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you - want). The module is called wd33c93.o. If you want to compile it as + want). The module is called wd33c93. If you want to compile it as a module, say M here and read . config GVP11_SCSI @@ -965,7 +965,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you - want). The module will be called gvp11.o. If you want to compile it + want). The module will be called gvp11. If you want to compile it as a module, say M here and read . config CYBERSTORM_SCSI @@ -1050,7 +1050,7 @@ a compatible SCSI controller (e.g. for Medusa). This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). The module is called - atari_scsi.o. If you want to compile it as a module, say M here and + atari_scsi. If you want to compile it as a module, say M here and read . This driver supports both styles of NCR integration into the system: the TT style (separate DMA), and the Falcon style (via ST-DMA, replacing ACSI). It does @@ -1101,7 +1101,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called mac_esp.o. If you want to compile it as + The module will be called mac_esp. If you want to compile it as a module, say M here and read . # dep_tristate 'SCSI debugging host adapter' CONFIG_SCSI_DEBUG $CONFIG_SCSI @@ -1169,7 +1169,7 @@ If you want to compile this driver as a module, say M here and read . The module will be called - serial.o. + serial. [WARNING: Do not compile this driver as a module if you are using non-standard serial ports, since the configuration information will be lost when the driver is unloaded. This limitation may be lifted @@ -1315,7 +1315,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called nvram.o. If you want to compile it as a + The module will be called nvram. If you want to compile it as a module, say M here and read . config ATARI_MFPSER @@ -1426,9 +1426,9 @@ for which 8 pin to DB25 adapters were supplied. The card also had jumpers internally to toggle various pinning configurations. - This driver can be built as a module; but then "generic_serial.o" + This driver can be built as a module; but then "generic_serial" will also be built as a module. This has to be loaded before - "ser_a2232.o". If you want to do this, answer M here and read + "ser_a2232". If you want to do this, answer M here and read "". config GVPIOEXT @@ -1686,7 +1686,7 @@ inserted in and removed from the running kernel whenever you want). If you want to compile it as a module, say M here and read . The module will be called - softdog.o. + softdog. config RTC bool "Enhanced Real Time Clock Support" @@ -1713,7 +1713,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module is called rtc.o. If you want to compile it as a module, + The module is called rtc. If you want to compile it as a module, say M here and read . config GEN_RTC @@ -1734,7 +1734,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module is called genrtc.o. If you want to compile it as a module, + The module is called genrtc. If you want to compile it as a module, say M here and read . To load the module automatically add 'alias char-major-10-135 genrtc' to your /etc/modules.conf diff -Nru a/arch/m68k/Makefile b/arch/m68k/Makefile --- a/arch/m68k/Makefile Sun Feb 9 21:13:36 2003 +++ b/arch/m68k/Makefile Sun Feb 9 21:13:36 2003 @@ -54,9 +54,9 @@ endif ifndef CONFIG_SUN3 -HEAD := arch/m68k/kernel/head.o +head-y := arch/m68k/kernel/head.o else -HEAD := arch/m68k/kernel/sun3-head.o +head-y := arch/m68k/kernel/sun3-head.o endif core-y += arch/m68k/kernel/ arch/m68k/mm/ @@ -113,5 +113,3 @@ archclean: rm -f vmlinux.gz vmlinux.bz2 rm -f arch/m68k/kernel/m68k_defs.h arch/m68k/kernel/m68k_defs.d - -archmrproper: diff -Nru a/arch/m68k/amiga/Makefile b/arch/m68k/amiga/Makefile --- a/arch/m68k/amiga/Makefile Sun Feb 9 21:13:37 2003 +++ b/arch/m68k/amiga/Makefile Sun Feb 9 21:13:37 2003 @@ -2,8 +2,6 @@ # Makefile for Linux arch/m68k/amiga source directory # -export-objs := amiga_ksyms.o - obj-y := config.o amiints.o cia.o chipram.o amisound.o amiga_ksyms.o obj-$(CONFIG_AMIGA_PCMCIA) += pcmcia.o diff -Nru a/arch/m68k/atari/Makefile b/arch/m68k/atari/Makefile --- a/arch/m68k/atari/Makefile Sun Feb 9 21:13:34 2003 +++ b/arch/m68k/atari/Makefile Sun Feb 9 21:13:34 2003 @@ -2,8 +2,6 @@ # Makefile for Linux arch/m68k/atari source directory # -export-objs := atari_ksyms.o - obj-y := config.o time.o debug.o ataints.o stdma.o \ atasound.o stram.o atari_ksyms.o diff -Nru a/arch/m68k/atari/hades-pci.c b/arch/m68k/atari/hades-pci.c --- a/arch/m68k/atari/hades-pci.c Sun Feb 9 21:13:32 2003 +++ b/arch/m68k/atari/hades-pci.c Sun Feb 9 21:13:32 2003 @@ -375,7 +375,7 @@ memset(bus, 0, sizeof(struct pci_bus_info)); /* - * Claim resources. The m68k has no seperate I/O space, both + * Claim resources. The m68k has no separate I/O space, both * PCI memory space and PCI I/O space are in memory space. Therefore * the I/O resources are requested in memory space as well. */ diff -Nru a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile --- a/arch/m68k/kernel/Makefile Sun Feb 9 21:13:34 2003 +++ b/arch/m68k/kernel/Makefile Sun Feb 9 21:13:34 2003 @@ -8,8 +8,6 @@ EXTRA_TARGETS := sun3-head.o endif -export-objs := setup.o m68k_ksyms.o - obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \ sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o diff -Nru a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c --- a/arch/m68k/kernel/time.c Sun Feb 9 21:13:30 2003 +++ b/arch/m68k/kernel/time.c Sun Feb 9 21:13:30 2003 @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -129,25 +130,27 @@ mach_sched_init(timer_interrupt); } -extern rwlock_t xtime_lock; - /* * This version of gettimeofday has near microsecond resolution. */ void do_gettimeofday(struct timeval *tv) { - extern unsigned long wall_jiffies; unsigned long flags; + extern unsigned long wall_jiffies; + unsigned long seq; unsigned long usec, sec, lost; - read_lock_irqsave(&xtime_lock, flags); - usec = mach_gettimeoffset(); - lost = jiffies - wall_jiffies; - if (lost) - usec += lost * (1000000/HZ); - sec = xtime.tv_sec; - usec += xtime.tv_nsec/1000; - read_unlock_irqrestore(&xtime_lock, flags); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); + + usec = mach_gettimeoffset(); + lost = jiffies - wall_jiffies; + if (lost) + usec += lost * (1000000/HZ); + sec = xtime.tv_sec; + usec += xtime.tv_nsec/1000; + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); + while (usec >= 1000000) { usec -= 1000000; @@ -162,7 +165,7 @@ { extern unsigned long wall_jiffies; - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); /* This is revolting. We need to set the xtime.tv_nsec * correctly. However, the value in this location is * is value at the last tick. @@ -183,5 +186,5 @@ time_status |= STA_UNSYNC; time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } diff -Nru a/arch/m68k/mac/Makefile b/arch/m68k/mac/Makefile --- a/arch/m68k/mac/Makefile Sun Feb 9 21:13:37 2003 +++ b/arch/m68k/mac/Makefile Sun Feb 9 21:13:37 2003 @@ -2,7 +2,5 @@ # Makefile for Linux arch/m68k/mac source directory # -export-objs := mac_ksyms.o - obj-y := config.o bootparse.o macints.o iop.o via.o oss.o psc.o \ baboon.o macboing.o debug.o misc.o mac_ksyms.o diff -Nru a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c --- a/arch/m68k/mac/macints.c Sun Feb 9 21:13:35 2003 +++ b/arch/m68k/mac/macints.c Sun Feb 9 21:13:35 2003 @@ -749,7 +749,7 @@ /* */ /* Note that we're ignoring scc_mask for now. */ /* If we actually mask the ints then we tend to */ - /* get hammered by very persistant SCC irqs, */ + /* get hammered by very persistent SCC irqs, */ /* and since they're autovector interrupts they */ /* pretty much kill the system. */ diff -Nru a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c --- a/arch/m68k/mac/via.c Sun Feb 9 21:13:31 2003 +++ b/arch/m68k/mac/via.c Sun Feb 9 21:13:31 2003 @@ -48,7 +48,7 @@ * just hit the combined register (ie, vIER|rIER) but that seems to * break on AV Macs...probably because they actually decode more than * eight address bits. Why can't Apple engineers at least be - * _consistantly_ lazy? - 1999-05-21 (jmt) + * _consistently_ lazy? - 1999-05-21 (jmt) */ static int gIER,gIFR,gBufA,gBufB; diff -Nru a/arch/m68k/math-emu/fp_decode.h b/arch/m68k/math-emu/fp_decode.h --- a/arch/m68k/math-emu/fp_decode.h Sun Feb 9 21:13:28 2003 +++ b/arch/m68k/math-emu/fp_decode.h Sun Feb 9 21:13:28 2003 @@ -68,7 +68,7 @@ do_fscc=0 | first decoding of the instr type -| this seperates the conditional instr +| this separates the conditional instr .macro fp_decode_cond_instr_type bfextu %d2{#8,#2},%d0 jmp ([0f:w,%pc,%d0*4]) @@ -80,7 +80,7 @@ .endm | second decoding of the instr type -| this seperates most move instr +| this separates most move instr .macro fp_decode_move_instr_type bfextu %d2{#16,#3},%d0 jmp ([0f:w,%pc,%d0*4]) diff -Nru a/arch/m68k/math-emu/fp_scan.S b/arch/m68k/math-emu/fp_scan.S --- a/arch/m68k/math-emu/fp_scan.S Sun Feb 9 21:13:32 2003 +++ b/arch/m68k/math-emu/fp_scan.S Sun Feb 9 21:13:32 2003 @@ -74,13 +74,13 @@ | first two instruction words are kept in %d2 getuser.l (%a0)+,%d2,fp_err_ua1,%a0 fp_put_pc %a0 -fp_decode_cond: | seperate conditional instr +fp_decode_cond: | separate conditional instr fp_decode_cond_instr_type .long fp_decode_move, fp_fscc .long fp_fbccw, fp_fbccl -fp_decode_move: | seperate move instr +fp_decode_move: | separate move instr fp_decode_move_instr_type .long fp_fgen_fp, fp_ill diff -Nru a/arch/m68k/mvme16x/Makefile b/arch/m68k/mvme16x/Makefile --- a/arch/m68k/mvme16x/Makefile Sun Feb 9 21:13:34 2003 +++ b/arch/m68k/mvme16x/Makefile Sun Feb 9 21:13:34 2003 @@ -2,6 +2,4 @@ # Makefile for Linux arch/m68k/mvme16x source directory # -export-objs := mvme16x_ksyms.o - obj-y := config.o 16xints.o rtc.o mvme16x_ksyms.o diff -Nru a/arch/m68k/sun3/Makefile b/arch/m68k/sun3/Makefile --- a/arch/m68k/sun3/Makefile Sun Feb 9 21:13:28 2003 +++ b/arch/m68k/sun3/Makefile Sun Feb 9 21:13:28 2003 @@ -2,8 +2,6 @@ # Makefile for Linux arch/m68k/sun3 source directory # -export-objs := sun3_ksyms.o - obj-y := sun3_ksyms.o sun3ints.o sun3dvma.o sbus.o idprom.o obj-$(CONFIG_SUN3) += config.o mmu_emu.o leds.o dvma.o \ diff -Nru a/arch/m68k/sun3x/Makefile b/arch/m68k/sun3x/Makefile --- a/arch/m68k/sun3x/Makefile Sun Feb 9 21:13:31 2003 +++ b/arch/m68k/sun3x/Makefile Sun Feb 9 21:13:31 2003 @@ -2,6 +2,4 @@ # Makefile for Linux arch/m68k/sun3x source directory # -export-objs := sun3x_ksyms.o - obj-y := config.o time.o dvma.o prom.o diff -Nru a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig --- a/arch/m68knommu/Kconfig Sun Feb 9 21:13:34 2003 +++ b/arch/m68knommu/Kconfig Sun Feb 9 21:13:34 2003 @@ -658,7 +658,7 @@ and load that module after the PnP configuration is finished. To do this, say M here and read as well as ; the module will be - called soundcore.o. + called soundcore. I'm told that even without a sound card, you can make your computer say more than an occasional beep, by programming the PC speaker. diff -Nru a/arch/m68knommu/Makefile b/arch/m68knommu/Makefile --- a/arch/m68knommu/Makefile Sun Feb 9 21:13:34 2003 +++ b/arch/m68knommu/Makefile Sun Feb 9 21:13:34 2003 @@ -84,7 +84,7 @@ LDFLAGS_BLOB := --format binary --oformat elf32-m68k -HEAD := arch/m68knommu/platform/$(platform-y)/$(board-y)/crt0_$(model-y).o +head-y := arch/m68knommu/platform/$(platform-y)/$(board-y)/crt0_$(model-y).o CLEAN_FILES := include/asm-$(ARCH)/asm-offsets.h.tmp \ include/asm-$(ARCH)/asm-offsets.h \ @@ -97,8 +97,6 @@ libs-y += arch/m68knommu/lib/ prepare: include/asm-$(ARCH)/asm-offsets.h - -archmrproper: archclean: $(call descend arch/$(ARCH)/boot, subdirclean) diff -Nru a/arch/m68knommu/kernel/Makefile b/arch/m68knommu/kernel/Makefile --- a/arch/m68knommu/kernel/Makefile Sun Feb 9 21:13:30 2003 +++ b/arch/m68knommu/kernel/Makefile Sun Feb 9 21:13:30 2003 @@ -2,8 +2,6 @@ # Makefile for arch/m68knommu/kernel. # -export-objs := m68k_ksyms.o - obj-y += entry.o init_task.o ints.o m68k_ksyms.o process.o ptrace.o \ semaphore.o setup.o signal.o syscalltable.o sys_m68k.o time.o \ traps.o diff -Nru a/arch/m68knommu/kernel/signal.c b/arch/m68knommu/kernel/signal.c --- a/arch/m68knommu/kernel/signal.c Sun Feb 9 21:13:33 2003 +++ b/arch/m68knommu/kernel/signal.c Sun Feb 9 21:13:33 2003 @@ -63,11 +63,11 @@ sigset_t saveset; mask &= _BLOCKABLE; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; siginitset(¤t->blocked, mask); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->d0 = -EINTR; while (1) { @@ -93,11 +93,11 @@ return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->d0 = -EINTR; while (1) { @@ -370,10 +370,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext(regs, &frame->sc, frame + 1, &d0)) goto badframe; @@ -399,10 +399,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (rt_restore_ucontext(regs, sw, &frame->uc, &d0)) goto badframe; @@ -738,11 +738,11 @@ ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked,sig); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } } diff -Nru a/arch/m68knommu/kernel/time.c b/arch/m68knommu/kernel/time.c --- a/arch/m68knommu/kernel/time.c Sun Feb 9 21:13:33 2003 +++ b/arch/m68knommu/kernel/time.c Sun Feb 9 21:13:33 2003 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -126,21 +127,23 @@ mach_sched_init(timer_interrupt); } -extern rwlock_t xtime_lock; - /* * This version of gettimeofday has near microsecond resolution. */ void do_gettimeofday(struct timeval *tv) { unsigned long flags; + unsigned long seq; unsigned long usec, sec; - read_lock_irqsave(&xtime_lock, flags); - usec = mach_gettimeoffset ? mach_gettimeoffset() : 0; - sec = xtime.tv_sec; - usec += (xtime.tv_nsec / 1000); - read_unlock_irqrestore(&xtime_lock, flags); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); + + usec = mach_gettimeoffset ? mach_gettimeoffset() : 0; + sec = xtime.tv_sec; + usec += (xtime.tv_nsec / 1000); + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); + while (usec >= 1000000) { usec -= 1000000; @@ -153,7 +156,7 @@ void do_settimeofday(struct timeval *tv) { - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); /* This is revolting. We need to set the xtime.tv_usec * correctly. However, the value in this location is * is value at the last tick. @@ -174,5 +177,5 @@ time_status |= STA_UNSYNC; time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } diff -Nru a/arch/m68knommu/platform/68360/uCquicc/crt0_ram.S b/arch/m68knommu/platform/68360/uCquicc/crt0_ram.S --- a/arch/m68knommu/platform/68360/uCquicc/crt0_ram.S Sun Feb 9 21:13:37 2003 +++ b/arch/m68knommu/platform/68360/uCquicc/crt0_ram.S Sun Feb 9 21:13:37 2003 @@ -358,7 +358,7 @@ .long 0 /* (Unassigned, Reserved) - 62. */ .long 0 /* (Unassigned, Reserved) - 63. */ /* The assignment of these vectors to the CPM is */ - /* dependant on the configuration of the CPM vba */ + /* dependent on the configuration of the CPM vba */ /* fields. */ .long 0 /* (User-Defined Vectors 1) CPM Error - 64. */ .long 0 /* (User-Defined Vectors 2) CPM Parallel IO PC11- 65. */ diff -Nru a/arch/m68knommu/platform/68360/uCquicc/crt0_rom.S b/arch/m68knommu/platform/68360/uCquicc/crt0_rom.S --- a/arch/m68knommu/platform/68360/uCquicc/crt0_rom.S Sun Feb 9 21:13:36 2003 +++ b/arch/m68knommu/platform/68360/uCquicc/crt0_rom.S Sun Feb 9 21:13:36 2003 @@ -367,7 +367,7 @@ .long 0 /* (Unassigned, Reserved) - 62. */ .long 0 /* (Unassigned, Reserved) - 63. */ /* The assignment of these vectors to the CPM is */ - /* dependant on the configuration of the CPM vba */ + /* dependent on the configuration of the CPM vba */ /* fields. */ .long 0 /* (User-Defined Vectors 1) CPM Error - 64. */ .long 0 /* (User-Defined Vectors 2) CPM Parallel IO PC11- 65. */ diff -Nru a/arch/mips/Kconfig b/arch/mips/Kconfig --- a/arch/mips/Kconfig Sun Feb 9 21:13:32 2003 +++ b/arch/mips/Kconfig Sun Feb 9 21:13:32 2003 @@ -724,7 +724,7 @@ QMAGIC support" then you'll have to say Y here. You may answer M to compile a.out support as a module and later load the module when you want to use a program or library in a.out format. The module will be - called binfmt_aout.o. Saying M or N here is dangerous though, + called binfmt_aout. Saying M or N here is dangerous though, because some crucial programs on your system might still be in A.OUT format. @@ -755,7 +755,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called binfmt_elf.o. Saying M or N here is dangerous because + will be called binfmt_elf. Saying M or N here is dangerous because some crucial programs on your system might be in ELF format. config BINFMT_MISC @@ -780,7 +780,7 @@ use this part of the kernel. You may say M here for module support and later load the module when - you have use for it; the module is called binfmt_misc.o. If you + you have use for it; the module is called binfmt_misc. If you don't know what to answer at this point, say Y. source "drivers/pci/Kconfig" @@ -875,7 +875,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called ide.o. + will be called ide. For further information, please read . @@ -902,7 +902,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called scsi_mod.o. If you want to compile it as + The module will be called scsi_mod. If you want to compile it as a module, say M here and read and . However, do not compile this as a module if your root file system (the one containing the directory /) @@ -994,7 +994,7 @@ If you want to compile this driver as a module, say M here and read . The module will be called - serial.o. + serial. [WARNING: Do not compile this driver as a module if you are using non-standard serial ports, since the configuration information will be lost when the driver is unloaded. This limitation may be lifted @@ -1157,7 +1157,7 @@ and load that module after the PnP configuration is finished. To do this, say M here and read as well as ; the module will be - called soundcore.o. + called soundcore. I'm told that even without a sound card, you can make your computer say more than an occasional beep, by programming the PC speaker. diff -Nru a/arch/mips/Makefile b/arch/mips/Makefile --- a/arch/mips/Makefile Sun Feb 9 21:13:28 2003 +++ b/arch/mips/Makefile Sun Feb 9 21:13:28 2003 @@ -256,7 +256,7 @@ AFLAGS_vmlinux.lds.o := -DLOADADDR=$(LOADADDR) -HEAD := arch/mips/kernel/head.o arch/mips/kernel/init_task.o +head-y := arch/mips/kernel/head.o arch/mips/kernel/init_task.o SUBDIRS := arch/mips/tools diff -Nru a/arch/mips/au1000/common/Makefile b/arch/mips/au1000/common/Makefile --- a/arch/mips/au1000/common/Makefile Sun Feb 9 21:13:36 2003 +++ b/arch/mips/au1000/common/Makefile Sun Feb 9 21:13:36 2003 @@ -6,8 +6,6 @@ # Makefile for the Alchemy Au1000 CPU, generic files. # -export-objs := serial.o - obj-y := prom.o dbg_io.o int-handler.o irq.o puts.o time.o reset.o obj-$(CONFIG_AU1000_UART) += serial.o diff -Nru a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c --- a/arch/mips/au1000/common/time.c Sun Feb 9 21:13:30 2003 +++ b/arch/mips/au1000/common/time.c Sun Feb 9 21:13:30 2003 @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -44,7 +45,6 @@ static unsigned long r4k_offset; /* Amount to increment compare reg each time */ static unsigned long r4k_cur; /* What counter should be at next timer irq */ -extern rwlock_t xtime_lock; #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5) @@ -150,10 +150,10 @@ set_cp0_status(ALLINTS); /* Read time from the RTC chipset. */ - write_lock_irqsave (&xtime_lock, flags); + write_seqlock_irqsave (&xtime_lock, flags); xtime.tv_sec = get_mips_time(); xtime.tv_usec = 0; - write_unlock_irqrestore(&xtime_lock, flags); + write_sequnlock_irqrestore(&xtime_lock, flags); } /* This is for machines which generate the exact clock. */ @@ -229,20 +229,24 @@ void do_gettimeofday(struct timeval *tv) { - unsigned int flags; + unsigned long flags; + unsigned long seq; - read_lock_irqsave (&xtime_lock, flags); - *tv = xtime; - tv->tv_usec += do_fast_gettimeoffset(); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); - /* - * xtime is atomically updated in timer_bh. jiffies - wall_jiffies - * is nonzero if the timer bottom half hasnt executed yet. - */ - if (jiffies - wall_jiffies) - tv->tv_usec += USECS_PER_JIFFY; + *tv = xtime; + tv->tv_usec += do_fast_gettimeoffset(); + + /* + * xtime is atomically updated in timer_bh. jiffies - wall_jiffies + * is nonzero if the timer bottom half hasnt executed yet. + */ + if (jiffies - wall_jiffies) + tv->tv_usec += USECS_PER_JIFFY; + + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); - read_unlock_irqrestore (&xtime_lock, flags); if (tv->tv_usec >= 1000000) { tv->tv_usec -= 1000000; @@ -252,7 +256,7 @@ void do_settimeofday(struct timeval *tv) { - write_lock_irq (&xtime_lock); + write_seqlock_irq (&xtime_lock); /* This is revolting. We need to set the xtime.tv_usec correctly. * However, the value in this location is is value at the last tick. @@ -272,7 +276,7 @@ time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq (&xtime_lock); + write_sequnlock_irq (&xtime_lock); } /* diff -Nru a/arch/mips/baget/Makefile b/arch/mips/baget/Makefile --- a/arch/mips/baget/Makefile Sun Feb 9 21:13:37 2003 +++ b/arch/mips/baget/Makefile Sun Feb 9 21:13:37 2003 @@ -3,7 +3,6 @@ # under Linux. # -export-objs := vacserial.o obj-y := baget.o print.o setup.o time.o irq.o bagetIRQ.o \ reset.o wbflush.o obj-$(CONFIG_SERIAL) += vacserial.o diff -Nru a/arch/mips/baget/time.c b/arch/mips/baget/time.c --- a/arch/mips/baget/time.c Sun Feb 9 21:13:28 2003 +++ b/arch/mips/baget/time.c Sun Feb 9 21:13:28 2003 @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -23,8 +24,6 @@ #include -extern rwlock_t xtime_lock; - /* * To have precision clock, we need to fix available clock frequency */ @@ -79,20 +78,21 @@ void do_gettimeofday(struct timeval *tv) { - unsigned long flags; + unsigned long seq; - read_lock_irqsave (&xtime_lock, flags); - *tv = xtime; - read_unlock_irqrestore (&xtime_lock, flags); + do { + seq = read_seqbegin(&xtime_lock); + *tv = xtime; + } while (read_seqretry(&xtime_lock, seq)); } void do_settimeofday(struct timeval *tv) { - write_lock_irq (&xtime_lock); + write_seqlock_irq (&xtime_lock); xtime = *tv; time_adjust = 0; /* stop active adjtime() */ time_status |= STA_UNSYNC; time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq (&xtime_lock); + write_sequnlock_irq (&xtime_lock); } diff -Nru a/arch/mips/dec/Makefile b/arch/mips/dec/Makefile --- a/arch/mips/dec/Makefile Sun Feb 9 21:13:30 2003 +++ b/arch/mips/dec/Makefile Sun Feb 9 21:13:30 2003 @@ -2,8 +2,6 @@ # Makefile for the DECstation family specific parts of the kernel # -export-objs := wbflush.o - obj-y := int-handler.o setup.o irq.o time.o reset.o rtc-dec.o wbflush.o obj-$(CONFIG_PROM_CONSOLE) += promcon.o diff -Nru a/arch/mips/dec/time.c b/arch/mips/dec/time.c --- a/arch/mips/dec/time.c Sun Feb 9 21:13:35 2003 +++ b/arch/mips/dec/time.c Sun Feb 9 21:13:35 2003 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -35,7 +36,6 @@ extern void (*board_time_init)(struct irqaction *irq); extern volatile unsigned long wall_jiffies; -extern rwlock_t xtime_lock; /* * Change this if you have some constant time drift @@ -211,19 +211,22 @@ void do_gettimeofday(struct timeval *tv) { unsigned long flags; + unsigned long seq; - read_lock_irqsave(&xtime_lock, flags); - *tv = xtime; - tv->tv_usec += do_gettimeoffset(); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); + *tv = xtime; + tv->tv_usec += do_gettimeoffset(); - /* - * xtime is atomically updated in timer_bh. jiffies - wall_jiffies - * is nonzero if the timer bottom half hasnt executed yet. - */ - if (jiffies - wall_jiffies) - tv->tv_usec += USECS_PER_JIFFY; + /* + * xtime is atomically updated in timer_bh. jiffies - wall_jiffies + * is nonzero if the timer bottom half hasnt executed yet. + */ + if (jiffies - wall_jiffies) + tv->tv_usec += USECS_PER_JIFFY; + + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); - read_unlock_irqrestore(&xtime_lock, flags); if (tv->tv_usec >= 1000000) { tv->tv_usec -= 1000000; @@ -233,7 +236,7 @@ void do_settimeofday(struct timeval *tv) { - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); /* This is revolting. We need to set the xtime.tv_usec * correctly. However, the value in this location is @@ -254,7 +257,7 @@ time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } /* @@ -330,6 +333,7 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { volatile unsigned char dummy; + unsigned long seq; dummy = CMOS_READ(RTC_REG_C); /* ACK RTC Interrupt */ @@ -357,23 +361,27 @@ * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be * called as close as possible to 500 ms before the new second starts. */ - read_lock(&xtime_lock); - if ((time_status & STA_UNSYNC) == 0 - && xtime.tv_sec > last_rtc_update + 660 - && xtime.tv_usec >= 500000 - tick / 2 - && xtime.tv_usec <= 500000 + tick / 2) { - if (set_rtc_mmss(xtime.tv_sec) == 0) - last_rtc_update = xtime.tv_sec; - else - /* do it again in 60 s */ - last_rtc_update = xtime.tv_sec - 600; - } + do { + seq = read_seqbegin(&xtime_lock); + + if ((time_status & STA_UNSYNC) == 0 + && xtime.tv_sec > last_rtc_update + 660 + && xtime.tv_usec >= 500000 - tick / 2 + && xtime.tv_usec <= 500000 + tick / 2) { + if (set_rtc_mmss(xtime.tv_sec) == 0) + last_rtc_update = xtime.tv_sec; + else + /* do it again in 60 s */ + last_rtc_update = xtime.tv_sec - 600; + } + } while (read_seqretry(&xtime_lock, seq)); + /* As we return to user mode fire off the other CPU schedulers.. this is basically because we don't yet share IRQ's around. This message is rigged to be safe on the 386 - basically it's a hack, so don't look closely for now.. */ /*smp_message_pass(MSG_ALL_BUT_SELF, MSG_RESCHEDULE, 0L, 0); */ - read_unlock(&xtime_lock); + } static void r4k_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) @@ -470,10 +478,10 @@ real_year = CMOS_READ(RTC_DEC_YEAR); year += real_year - 72 + 2000; - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); xtime.tv_sec = mktime(year, mon, day, hour, min, sec); xtime.tv_usec = 0; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); if (mips_cpu.options & MIPS_CPU_COUNTER) { write_32bit_cp0_register(CP0_COUNT, 0); diff -Nru a/arch/mips/ite-boards/generic/time.c b/arch/mips/ite-boards/generic/time.c --- a/arch/mips/ite-boards/generic/time.c Sun Feb 9 21:13:31 2003 +++ b/arch/mips/ite-boards/generic/time.c Sun Feb 9 21:13:31 2003 @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -38,7 +39,6 @@ extern void enable_cpu_timer(void); extern volatile unsigned long wall_jiffies; -extern rwlock_t xtime_lock; unsigned long missed_heart_beats = 0; static long last_rtc_update = 0; @@ -119,6 +119,8 @@ */ void mips_timer_interrupt(struct pt_regs *regs) { + unsigned long seq; + if (r4k_offset == 0) goto null; @@ -133,18 +135,22 @@ * within 500ms before the * next second starts, * thus the following code. */ - read_lock(&xtime_lock); - if ((time_status & STA_UNSYNC) == 0 - && xtime.tv_sec > last_rtc_update + 660 - && xtime.tv_usec >= 500000 - (tick >> 1) - && xtime.tv_usec <= 500000 + (tick >> 1)) - if (set_rtc_mmss(xtime.tv_sec) == 0) - last_rtc_update = xtime.tv_sec; - else { - /* do it again in 60 s */ - last_rtc_update = xtime.tv_sec - 600; - } - read_unlock(&xtime_lock); + do { + seq = read_seqbegin(&xtime_lock); + + + if ((time_status & STA_UNSYNC) == 0 + && xtime.tv_sec > last_rtc_update + 660 + && xtime.tv_usec >= 500000 - (tick >> 1) + && xtime.tv_usec <= 500000 + (tick >> 1)) + if (set_rtc_mmss(xtime.tv_sec) == 0) + last_rtc_update = xtime.tv_sec; + else { + /* do it again in 60 s */ + last_rtc_update = xtime.tv_sec - 600; + } + + } while (read_seqretry(&xtime_lock, seq)); r4k_cur += r4k_offset; ack_r4ktimer(r4k_cur); @@ -247,10 +253,10 @@ enable_cpu_timer(); /* Read time from the RTC chipset. */ - write_lock_irqsave (&xtime_lock, flags); + write_seqlock_irqsave (&xtime_lock, flags); xtime.tv_sec = get_mips_time(); xtime.tv_usec = 0; - write_unlock_irqrestore(&xtime_lock, flags); + write_sequnlock_irqrestore(&xtime_lock, flags); } /* This is for machines which generate the exact clock. */ @@ -332,20 +338,24 @@ void do_gettimeofday(struct timeval *tv) { - unsigned int flags; + unsigned long flags; + unsigned int seq; - read_lock_irqsave (&xtime_lock, flags); - *tv = xtime; - tv->tv_usec += do_fast_gettimeoffset(); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); - /* - * xtime is atomically updated in timer_bh. jiffies - wall_jiffies - * is nonzero if the timer bottom half hasnt executed yet. - */ - if (jiffies - wall_jiffies) - tv->tv_usec += USECS_PER_JIFFY; + *tv = xtime; + tv->tv_usec += do_fast_gettimeoffset(); + + /* + * xtime is atomically updated in timer_bh. + * jiffies - wall_jiffies + * is nonzero if the timer bottom half hasnt executed yet. + */ + if (jiffies - wall_jiffies) + tv->tv_usec += USECS_PER_JIFFY; - read_unlock_irqrestore (&xtime_lock, flags); + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); if (tv->tv_usec >= 1000000) { tv->tv_usec -= 1000000; @@ -355,7 +365,7 @@ void do_settimeofday(struct timeval *tv) { - write_lock_irq (&xtime_lock); + write_seqlock_irq (&xtime_lock); /* This is revolting. We need to set the xtime.tv_usec correctly. * However, the value in this location is is value at the last tick. @@ -375,5 +385,5 @@ time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq (&xtime_lock); + write_sequnlock_irq (&xtime_lock); } diff -Nru a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile --- a/arch/mips/kernel/Makefile Sun Feb 9 21:13:31 2003 +++ b/arch/mips/kernel/Makefile Sun Feb 9 21:13:31 2003 @@ -5,8 +5,6 @@ # EXTRA_AFLAGS = -mips3 -mcpu=r4000 # not used? EXTRA_TARGETS := head.o init_task.o -export-objs := mips_ksyms.o - obj-y += branch.o process.o signal.o entry.o \ traps.o ptrace.o vm86.o ioport.o reset.o \ semaphore.o setup.o syscall.o sysmips.o \ diff -Nru a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c --- a/arch/mips/kernel/sysirix.c Sun Feb 9 21:13:36 2003 +++ b/arch/mips/kernel/sysirix.c Sun Feb 9 21:13:36 2003 @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -615,19 +616,17 @@ return current->gid; } -extern rwlock_t xtime_lock; - asmlinkage int irix_stime(int value) { if (!capable(CAP_SYS_TIME)) return -EPERM; - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); xtime.tv_sec = value; xtime.tv_usec = 0; time_maxerror = MAXPHASE; time_esterror = MAXPHASE; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); return 0; } diff -Nru a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c --- a/arch/mips/kernel/time.c Sun Feb 9 21:13:31 2003 +++ b/arch/mips/kernel/time.c Sun Feb 9 21:13:31 2003 @@ -37,7 +37,6 @@ /* * forward reference */ -extern rwlock_t xtime_lock; extern volatile unsigned long wall_jiffies; /* @@ -63,19 +62,23 @@ void do_gettimeofday(struct timeval *tv) { unsigned long flags; + unsigned long seq; - read_lock_irqsave (&xtime_lock, flags); - *tv = xtime; - tv->tv_usec += do_gettimeoffset(); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); - /* - * xtime is atomically updated in timer_bh. jiffies - wall_jiffies - * is nonzero if the timer bottom half hasnt executed yet. - */ - if (jiffies - wall_jiffies) - tv->tv_usec += USECS_PER_JIFFY; + *tv = xtime; + tv->tv_usec += do_gettimeoffset(); + + /* + * xtime is atomically updated in timer_bh. + * jiffies - wall_jiffies + * is nonzero if the timer bottom half hasnt executed yet. + */ + if (jiffies - wall_jiffies) + tv->tv_usec += USECS_PER_JIFFY; + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); - read_unlock_irqrestore (&xtime_lock, flags); if (tv->tv_usec >= 1000000) { tv->tv_usec -= 1000000; @@ -85,7 +88,7 @@ void do_settimeofday(struct timeval *tv) { - write_lock_irq (&xtime_lock); + write_seqlock_irq (&xtime_lock); /* This is revolting. We need to set the xtime.tv_usec * correctly. However, the value in this location is @@ -105,7 +108,7 @@ time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq (&xtime_lock); + write_sequnlock_irq (&xtime_lock); } @@ -291,6 +294,8 @@ */ void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { + unsigned long seq; + if (mips_cpu.options & MIPS_CPU_COUNTER) { unsigned int count; @@ -340,19 +345,21 @@ * CMOS clock accordingly every ~11 minutes. rtc_set_time() has to be * called as close as possible to 500 ms before the new second starts. */ - read_lock (&xtime_lock); - if ((time_status & STA_UNSYNC) == 0 && - xtime.tv_sec > last_rtc_update + 660 && - xtime.tv_usec >= 500000 - ((unsigned) tick) / 2 && - xtime.tv_usec <= 500000 + ((unsigned) tick) / 2) { - if (rtc_set_time(xtime.tv_sec) == 0) { - last_rtc_update = xtime.tv_sec; - } else { - last_rtc_update = xtime.tv_sec - 600; - /* do it again in 60 s */ + do { + seq = read_seqbegin(&xtime_lock); + + if ((time_status & STA_UNSYNC) == 0 && + xtime.tv_sec > last_rtc_update + 660 && + xtime.tv_usec >= 500000 - ((unsigned) tick) / 2 && + xtime.tv_usec <= 500000 + ((unsigned) tick) / 2) { + if (rtc_set_time(xtime.tv_sec) == 0) { + last_rtc_update = xtime.tv_sec; + } else { + last_rtc_update = xtime.tv_sec - 600; + /* do it again in 60 s */ + } } - } - read_unlock (&xtime_lock); + } while (read_seqretry(&xtime_lock, seq)); /* * If jiffies has overflowed in this timer_interrupt we must diff -Nru a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c --- a/arch/mips/mips-boards/generic/time.c Sun Feb 9 21:13:33 2003 +++ b/arch/mips/mips-boards/generic/time.c Sun Feb 9 21:13:33 2003 @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -45,7 +46,6 @@ static unsigned long r4k_offset; /* Amount to increment compare reg each time */ static unsigned long r4k_cur; /* What counter should be at next timer irq */ -extern rwlock_t xtime_lock; #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5) @@ -133,7 +133,9 @@ */ void mips_timer_interrupt(struct pt_regs *regs) { + unsigned long flags; int irq = 7; + unsigned long seq; if (r4k_offset == 0) goto null; @@ -149,18 +151,21 @@ * within 500ms before the * next second starts, * thus the following code. */ - read_lock(&xtime_lock); - if ((time_status & STA_UNSYNC) == 0 - && xtime.tv_sec > last_rtc_update + 660 - && xtime.tv_usec >= 500000 - (tick >> 1) - && xtime.tv_usec <= 500000 + (tick >> 1)) - if (set_rtc_mmss(xtime.tv_sec) == 0) - last_rtc_update = xtime.tv_sec; - else - /* do it again in 60 s */ - last_rtc_update = xtime.tv_sec - 600; - read_unlock(&xtime_lock); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); + + if ((time_status & STA_UNSYNC) == 0 + && xtime.tv_sec > last_rtc_update + 660 + && xtime.tv_usec >= 500000 - (tick >> 1) + && xtime.tv_usec <= 500000 + (tick >> 1)) + if (set_rtc_mmss(xtime.tv_sec) == 0) + last_rtc_update = xtime.tv_sec; + else + /* do it again in 60 s */ + last_rtc_update = xtime.tv_sec - 600; + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); + if ((timer_tick_count++ % HZ) == 0) { mips_display_message(&display_string[display_count++]); if (display_count == MAX_DISPLAY_COUNT) @@ -267,10 +272,10 @@ change_cp0_status(ST0_IM, ALLINTS); /* Read time from the RTC chipset. */ - write_lock_irqsave (&xtime_lock, flags); + write_seqlock_irqsave (&xtime_lock, flags); xtime.tv_sec = get_mips_time(); xtime.tv_usec = 0; - write_unlock_irqrestore(&xtime_lock, flags); + write_sequnlock_irqrestore(&xtime_lock, flags); } /* This is for machines which generate the exact clock. */ @@ -363,20 +368,24 @@ void do_gettimeofday(struct timeval *tv) { - unsigned int flags; + unsigned long flags; + unsigned long seq; + + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); - read_lock_irqsave (&xtime_lock, flags); - *tv = xtime; - tv->tv_usec += do_fast_gettimeoffset(); + *tv = xtime; + tv->tv_usec += do_fast_gettimeoffset(); - /* - * xtime is atomically updated in timer_bh. jiffies - wall_jiffies - * is nonzero if the timer bottom half hasnt executed yet. - */ - if (jiffies - wall_jiffies) - tv->tv_usec += USECS_PER_JIFFY; + /* + * xtime is atomically updated in timer_bh. + * jiffies - wall_jiffies + * is nonzero if the timer bottom half hasnt executed yet. + */ + if (jiffies - wall_jiffies) + tv->tv_usec += USECS_PER_JIFFY; - read_unlock_irqrestore (&xtime_lock, flags); + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); if (tv->tv_usec >= 1000000) { tv->tv_usec -= 1000000; @@ -386,7 +395,7 @@ void do_settimeofday(struct timeval *tv) { - write_lock_irq (&xtime_lock); + write_seqlock_irq (&xtime_lock); /* This is revolting. We need to set the xtime.tv_usec correctly. * However, the value in this location is is value at the last tick. @@ -406,5 +415,5 @@ time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq (&xtime_lock); + write_sequnlock_irq (&xtime_lock); } diff -Nru a/arch/mips/mm/Makefile b/arch/mips/mm/Makefile --- a/arch/mips/mm/Makefile Sun Feb 9 21:13:33 2003 +++ b/arch/mips/mm/Makefile Sun Feb 9 21:13:33 2003 @@ -2,7 +2,6 @@ # Makefile for the Linux/MIPS-specific parts of the memory manager. # -export-objs += ioremap.o umap.o obj-y += extable.o init.o ioremap.o fault.o loadmmu.o obj-$(CONFIG_CPU_R3000) += r2300.o diff -Nru a/arch/mips/philips/nino/time.c b/arch/mips/philips/nino/time.c --- a/arch/mips/philips/nino/time.c Sun Feb 9 21:13:28 2003 +++ b/arch/mips/philips/nino/time.c Sun Feb 9 21:13:28 2003 @@ -19,12 +19,12 @@ #include #include #include +#include #include #include #include extern volatile unsigned long wall_jiffies; -extern rwlock_t xtime_lock; static struct timeval xbase; @@ -62,29 +62,31 @@ void do_gettimeofday(struct timeval *tv) { unsigned long flags; + unsigned long seq; unsigned long high, low; - read_lock_irqsave(&xtime_lock, flags); - // 40 bit RTC, driven by 32khz source: - // +-----------+-----------------------------------------+ - // | HHHH.HHHH | LLLL.LLLL.LLLL.LLLL.LMMM.MMMM.MMMM.MMMM | - // +-----------+-----------------------------------------+ - readRTC(&high,&low); - tv->tv_sec = (high << 17) | (low >> 15); - tv->tv_usec = (low % 32768) * 1953 / 64; - tv->tv_sec += xbase.tv_sec; - tv->tv_usec += xbase.tv_usec; + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); - tv->tv_usec += do_gettimeoffset(); - - /* - * xtime is atomically updated in timer_bh. lost_ticks is - * nonzero if the timer bottom half hasnt executed yet. - */ - if (jiffies - wall_jiffies) - tv->tv_usec += USECS_PER_JIFFY; - - read_unlock_irqrestore(&xtime_lock, flags); + // 40 bit RTC, driven by 32khz source: + // +-----------+-----------------------------------------+ + // | HHHH.HHHH | LLLL.LLLL.LLLL.LLLL.LMMM.MMMM.MMMM.MMMM | + // +-----------+-----------------------------------------+ + readRTC(&high,&low); + tv->tv_sec = (high << 17) | (low >> 15); + tv->tv_usec = (low % 32768) * 1953 / 64; + tv->tv_sec += xbase.tv_sec; + tv->tv_usec += xbase.tv_usec; + + tv->tv_usec += do_gettimeoffset(); + + /* + * xtime is atomically updated in timer_bh. lost_ticks is + * nonzero if the timer bottom half hasnt executed yet. + */ + if (jiffies - wall_jiffies) + tv->tv_usec += USECS_PER_JIFFY; + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); if (tv->tv_usec >= 1000000) { tv->tv_usec -= 1000000; @@ -94,7 +96,7 @@ void do_settimeofday(struct timeval *tv) { - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); /* This is revolting. We need to set the xtime.tv_usec * correctly. However, the value in this location is * is value at the last tick. @@ -118,7 +120,7 @@ time_state = TIME_BAD; time_maxerror = MAXPHASE; time_esterror = MAXPHASE; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } static int set_rtc_mmss(unsigned long nowtime) diff -Nru a/arch/mips64/Kconfig b/arch/mips64/Kconfig --- a/arch/mips64/Kconfig Sun Feb 9 21:13:30 2003 +++ b/arch/mips64/Kconfig Sun Feb 9 21:13:30 2003 @@ -361,7 +361,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called binfmt_elf.o. Saying M or N here is dangerous because + will be called binfmt_elf. Saying M or N here is dangerous because some crucial programs on your system might be in ELF format. config MIPS32_COMPAT @@ -406,7 +406,7 @@ use this part of the kernel. You may say M here for module support and later load the module when - you have use for it; the module is called binfmt_misc.o. If you + you have use for it; the module is called binfmt_misc. If you don't know what to answer at this point, say Y. endmenu @@ -464,7 +464,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called ide.o. + will be called ide. For further information, please read . @@ -491,7 +491,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called scsi_mod.o. If you want to compile it as + The module will be called scsi_mod. If you want to compile it as a module, say M here and read and . However, do not compile this as a module if your root file system (the one containing the directory /) @@ -608,7 +608,7 @@ and load that module after the PnP configuration is finished. To do this, say M here and read as well as ; the module will be - called soundcore.o. + called soundcore. I'm told that even without a sound card, you can make your computer say more than an occasional beep, by programming the PC speaker. diff -Nru a/arch/mips64/Makefile b/arch/mips64/Makefile --- a/arch/mips64/Makefile Sun Feb 9 21:13:30 2003 +++ b/arch/mips64/Makefile Sun Feb 9 21:13:30 2003 @@ -128,7 +128,7 @@ LDFLAGS_vmlinux += -Ttext $(LOADADDR) -HEAD := arch/mips64/kernel/head.o arch/mips64/kernel/init_task.o +head-y := arch/mips64/kernel/head.o arch/mips64/kernel/init_task.o SUBDIRS := arch/mips64/tools $(SUBDIRS) core-y += arch/mips64/kernel/ arch/mips64/mm/ diff -Nru a/arch/mips64/kernel/Makefile b/arch/mips64/kernel/Makefile --- a/arch/mips64/kernel/Makefile Sun Feb 9 21:13:31 2003 +++ b/arch/mips64/kernel/Makefile Sun Feb 9 21:13:31 2003 @@ -4,8 +4,6 @@ EXTRA_TARGETS := head.o init_task.o -export-objs := mips64_ksyms.o - obj-y := branch.o entry.o proc.o process.o ptrace.o r4k_cache.o r4k_fpu.o \ r4k_genex.o r4k_switch.o r4k_tlb.o r4k_tlb_debug.o r4k_tlb_glue.o \ scall_64.o semaphore.o setup.o signal.o softfp.o syscall.o \ diff -Nru a/arch/mips64/mips-boards/generic/time.c b/arch/mips64/mips-boards/generic/time.c --- a/arch/mips64/mips-boards/generic/time.c Sun Feb 9 21:13:29 2003 +++ b/arch/mips64/mips-boards/generic/time.c Sun Feb 9 21:13:29 2003 @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -44,7 +45,6 @@ static unsigned long r4k_offset; /* Amount to increment compare reg each time */ static unsigned long r4k_cur; /* What counter should be at next timer irq */ -extern rwlock_t xtime_lock; #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5) @@ -132,6 +132,8 @@ */ void mips_timer_interrupt(struct pt_regs *regs) { + unsigned long flags; + unsigned long seq; int irq = 7; if (r4k_offset == 0) @@ -148,17 +150,20 @@ * within 500ms before the * next second starts, * thus the following code. */ - read_lock(&xtime_lock); - if ((time_status & STA_UNSYNC) == 0 - && xtime.tv_sec > last_rtc_update + 660 - && xtime.tv_usec >= 500000 - (tick >> 1) - && xtime.tv_usec <= 500000 + (tick >> 1)) - if (set_rtc_mmss(xtime.tv_sec) == 0) - last_rtc_update = xtime.tv_sec; - else - /* do it again in 60 s */ - last_rtc_update = xtime.tv_sec - 600; - read_unlock(&xtime_lock); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); + + if ((time_status & STA_UNSYNC) == 0 + && xtime.tv_sec > last_rtc_update + 660 + && xtime.tv_usec >= 500000 - (tick >> 1) + && xtime.tv_usec <= 500000 + (tick >> 1)) + if (set_rtc_mmss(xtime.tv_sec) == 0) + last_rtc_update = xtime.tv_sec; + else + /* do it again in 60 s */ + last_rtc_update = xtime.tv_sec - 600; + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); + if ((timer_tick_count++ % HZ) == 0) { mips_display_message(&display_string[display_count++]); @@ -266,10 +271,10 @@ set_cp0_status(ST0_IM, ALLINTS); /* Read time from the RTC chipset. */ - write_lock_irqsave (&xtime_lock, flags); + write_seqlock_irqsave (&xtime_lock, flags); xtime.tv_sec = get_mips_time(); xtime.tv_usec = 0; - write_unlock_irqrestore(&xtime_lock, flags); + write_sequnlock_irqrestore(&xtime_lock, flags); } /* This is for machines which generate the exact clock. */ @@ -352,20 +357,25 @@ void do_gettimeofday(struct timeval *tv) { - unsigned int flags; + unsigned long flags; + unsigned long seq; - read_lock_irqsave (&xtime_lock, flags); - *tv = xtime; - tv->tv_usec += do_fast_gettimeoffset(); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); - /* - * xtime is atomically updated in timer_bh. jiffies - wall_jiffies - * is nonzero if the timer bottom half hasnt executed yet. - */ - if (jiffies - wall_jiffies) - tv->tv_usec += USECS_PER_JIFFY; + *tv = xtime; + tv->tv_usec += do_fast_gettimeoffset(); + + /* + * xtime is atomically updated in timer_bh. + * jiffies - wall_jiffies + * is nonzero if the timer bottom half hasnt executed yet. + */ + if (jiffies - wall_jiffies) + tv->tv_usec += USECS_PER_JIFFY; + + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); - read_unlock_irqrestore (&xtime_lock, flags); if (tv->tv_usec >= 1000000) { tv->tv_usec -= 1000000; @@ -375,7 +385,7 @@ void do_settimeofday(struct timeval *tv) { - write_lock_irq (&xtime_lock); + write_seqlock_irq (&xtime_lock); /* This is revolting. We need to set the xtime.tv_usec correctly. * However, the value in this location is is value at the last tick. @@ -395,5 +405,5 @@ time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq (&xtime_lock); + write_sequnlock_irq (&xtime_lock); } diff -Nru a/arch/mips64/mm/Makefile b/arch/mips64/mm/Makefile --- a/arch/mips64/mm/Makefile Sun Feb 9 21:13:28 2003 +++ b/arch/mips64/mm/Makefile Sun Feb 9 21:13:28 2003 @@ -2,8 +2,6 @@ # Makefile for the Linux/MIPS-specific parts of the memory manager. # -export-objs += umap.o - obj-y := extable.o init.o fault.o loadmmu.o obj-$(CONFIG_CPU_R4300) += r4xx0.o diff -Nru a/arch/mips64/sgi-ip22/ip22-timer.c b/arch/mips64/sgi-ip22/ip22-timer.c --- a/arch/mips64/sgi-ip22/ip22-timer.c Sun Feb 9 21:13:32 2003 +++ b/arch/mips64/sgi-ip22/ip22-timer.c Sun Feb 9 21:13:32 2003 @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -32,8 +33,6 @@ static unsigned long r4k_offset; /* Amount to increment compare reg each time */ static unsigned long r4k_cur; /* What counter should be at next timer irq */ -extern rwlock_t xtime_lock; - static inline void ack_r4ktimer(unsigned long newval) { write_32bit_cp0_register(CP0_COMPARE, newval); @@ -86,7 +85,7 @@ unsigned long count; int irq = 7; - write_lock(&xtime_lock); + write_seqlock(&xtime_lock); /* Ack timer and compute new compare. */ count = read_32bit_cp0_register(CP0_COUNT); /* This has races. */ @@ -116,7 +115,7 @@ /* do it again in 60s */ last_rtc_update = xtime.tv_sec - 600; } - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); } static unsigned long dosample(volatile unsigned char *tcwp, @@ -224,10 +223,10 @@ set_cp0_status(ST0_IM, ALLINTS); sti(); - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); xtime.tv_sec = get_indy_time(); /* Read time from RTC. */ xtime.tv_usec = 0; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } void indy_8254timer_irq(void) @@ -243,20 +242,21 @@ void do_gettimeofday(struct timeval *tv) { - unsigned long flags; + unsigned long seq; - read_lock_irqsave(&xtime_lock, flags); - *tv = xtime; - read_unlock_irqrestore(&xtime_lock, flags); + do { + seq = read_seqbegin(&xtime_lock); + *tv = xtime; + } while (read_seqretry(&xtime_lock, seq)); } void do_settimeofday(struct timeval *tv) { - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); xtime = *tv; time_adjust = 0; /* stop active adjtime() */ time_status |= STA_UNSYNC; time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } diff -Nru a/arch/mips64/sgi-ip27/ip27-timer.c b/arch/mips64/sgi-ip27/ip27-timer.c --- a/arch/mips64/sgi-ip27/ip27-timer.c Sun Feb 9 21:13:31 2003 +++ b/arch/mips64/sgi-ip27/ip27-timer.c Sun Feb 9 21:13:31 2003 @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -40,7 +41,6 @@ static unsigned long ct_cur[NR_CPUS]; /* What counter should be at next timer irq */ static long last_rtc_update; /* Last time the rtc clock got updated */ -extern rwlock_t xtime_lock; extern volatile unsigned long wall_jiffies; @@ -94,7 +94,7 @@ int cpuA = ((cputoslice(cpu)) == 0); int irq = 7; /* XXX Assign number */ - write_lock(&xtime_lock); + write_seqlock(&xtime_lock); again: LOCAL_HUB_S(cpuA ? PI_RT_PEND_A : PI_RT_PEND_B, 0); /* Ack */ @@ -145,7 +145,7 @@ } } - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); if (softirq_pending(cpu)) do_softirq(); @@ -162,17 +162,20 @@ { unsigned long flags; unsigned long usec, sec; + unsigned long seq; - read_lock_irqsave(&xtime_lock, flags); - usec = do_gettimeoffset(); - { - unsigned long lost = jiffies - wall_jiffies; - if (lost) - usec += lost * (1000000 / HZ); - } - sec = xtime.tv_sec; - usec += xtime.tv_usec; - read_unlock_irqrestore(&xtime_lock, flags); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); + + usec = do_gettimeoffset(); + { + unsigned long lost = jiffies - wall_jiffies; + if (lost) + usec += lost * (1000000 / HZ); + } + sec = xtime.tv_sec; + usec += xtime.tv_usec; + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); while (usec >= 1000000) { usec -= 1000000; @@ -185,7 +188,7 @@ void do_settimeofday(struct timeval *tv) { - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); tv->tv_usec -= do_gettimeoffset(); tv->tv_usec -= (jiffies - wall_jiffies) * (1000000 / HZ); @@ -199,7 +202,7 @@ time_status |= STA_UNSYNC; time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } /* Includes for ioc3_init(). */ diff -Nru a/arch/parisc/Kconfig b/arch/parisc/Kconfig --- a/arch/parisc/Kconfig Sun Feb 9 21:13:33 2003 +++ b/arch/parisc/Kconfig Sun Feb 9 21:13:33 2003 @@ -199,7 +199,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called binfmt_elf.o. Saying M or N here is dangerous because + will be called binfmt_elf. Saying M or N here is dangerous because some crucial programs on your system might be in ELF format. config BINFMT_MISC @@ -224,7 +224,7 @@ use this part of the kernel. You may say M here for module support and later load the module when - you have use for it; the module is called binfmt_misc.o. If you + you have use for it; the module is called binfmt_misc. If you don't know what to answer at this point, say Y. endmenu @@ -260,7 +260,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called scsi_mod.o. If you want to compile it as + The module will be called scsi_mod. If you want to compile it as a module, say M here and read and . However, do not compile this as a module if your root file system (the one containing the directory /) @@ -327,7 +327,7 @@ and load that module after the PnP configuration is finished. To do this, say M here and read as well as ; the module will be - called soundcore.o. + called soundcore. I'm told that even without a sound card, you can make your computer say more than an occasional beep, by programming the PC speaker. diff -Nru a/arch/parisc/Makefile b/arch/parisc/Makefile --- a/arch/parisc/Makefile Sun Feb 9 21:13:36 2003 +++ b/arch/parisc/Makefile Sun Feb 9 21:13:36 2003 @@ -33,10 +33,10 @@ OBJCOPY_FLAGS =-O binary -R .note -R .comment -S -cflags-y := -D__linux__ -pipe -fno-strength-reduce +cflags-y := -pipe -# These should be on for older toolchains or SOM toolchains that don't -# enable them by default. +# These flags should be implied by an hppa-linux configuration, but they +# are not in gcc 3.2. cflags-y += -mno-space-regs -mfast-indirect-calls # No fixed-point multiply @@ -56,7 +56,6 @@ head-$(CONFIG_PARISC64) := arch/parisc/kernel/head64.o CFLAGS += $(cflags-y) -HEAD := $(head-y) core-y += $(addprefix arch/parisc/, kernel/pdc_cons.o kernel/process.o \ mm/ kernel/ hpux/ math-emu/ kernel/init_task.o ) @@ -95,9 +94,6 @@ @echo -n ' Generating $@' @$(generate-asm-offsets.h) < $< > $@.tmp @$(update-if-changed) - -archclean: -archmrproper: CLEAN_FILES += palo.conf lifimage include/asm-parisc/offsets.h \ include/asm-parisc/offsets.h.tmp diff -Nru a/arch/parisc/kernel/Makefile b/arch/parisc/kernel/Makefile --- a/arch/parisc/kernel/Makefile Sun Feb 9 21:13:30 2003 +++ b/arch/parisc/kernel/Makefile Sun Feb 9 21:13:30 2003 @@ -9,8 +9,6 @@ AFLAGS_entry.o := -traditional AFLAGS_pacache.o := -traditional -export-objs := parisc_ksyms.o - obj-y := cache.o pacache.o setup.o traps.o time.o irq.o \ pa7300lc.o syscall.o entry.o sys_parisc.o firmware.o \ ptrace.o hardware.o inventory.o drivers.o semaphore.o \ diff -Nru a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S --- a/arch/parisc/kernel/entry.S Sun Feb 9 21:13:29 2003 +++ b/arch/parisc/kernel/entry.S Sun Feb 9 21:13:29 2003 @@ -689,7 +689,7 @@ * (we don't store them in the sigcontext), so set them * to "proper" values now (otherwise we'll wind up restoring * whatever was last stored in the task structure, which might - * be inconsistant if an interrupt occured while on the gateway + * be inconsistent if an interrupt occured while on the gateway * page) Note that we may be "trashing" values the user put in * them, but we don't support the the user changing them. */ diff -Nru a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c --- a/arch/parisc/kernel/irq.c Sun Feb 9 21:13:31 2003 +++ b/arch/parisc/kernel/irq.c Sun Feb 9 21:13:31 2003 @@ -243,7 +243,7 @@ for (i = 0; i <= MAX_CPU_IRQ; i++) { struct irqaction *action = ®ion->action[i]; unsigned int irq_no = IRQ_FROM_REGION(regnr) + i; - int j=0; + int j = 0; if (!action->handler) continue; @@ -251,7 +251,7 @@ #ifdef CONFIG_SMP for (; j < NR_CPUS; j++) #endif - seq_printf(p, "%10u ", kstat_cpu(j).irqs[regnr][irq_no]); + seq_printf(p, "%10u ", kstat_cpu(j).irqs[irq_no]); seq_printf(p, " %14s", region->data.name ? region->data.name : "N/A"); @@ -373,7 +373,7 @@ /* XXX FIXME : bits_wide indicates how wide the transaction ** data is allowed to be...we may need a different virt_irq ** if this one won't work. Another reason to index virtual - ** irq's into a table which can manage CPU/IRQ bit seperately. + ** irq's into a table which can manage CPU/IRQ bit separately. */ if (IRQ_OFFSET(virt_irq) > (1 << (bits_wide -1))) { @@ -388,7 +388,7 @@ int cpu = smp_processor_id(); irq_enter(); - ++kstat_cpu(cpu).irqs[IRQ_REGION(irq)][IRQ_OFFSET(irq)]; + ++kstat_cpu(cpu).irqs[irq]; DBG_IRQ(irq, ("do_irq(%d) %d+%d\n", irq, IRQ_REGION(irq), IRQ_OFFSET(irq))); diff -Nru a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c --- a/arch/parisc/kernel/module.c Sun Feb 9 21:13:37 2003 +++ b/arch/parisc/kernel/module.c Sun Feb 9 21:13:37 2003 @@ -13,6 +13,12 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + (c) 2003 Randolph Chung + + The best reference for this stuff is probably the Processor- + Specific ELF Supplement for PA-RISC: + http://ftp.parisc-linux.org/docs/elf-pa-hp.pdf */ #include #include @@ -21,19 +27,92 @@ #include #include -#if 0 +#if 1 #define DEBUGP printk #else #define DEBUGP(fmt...) #endif -enum parisc_fsel { - e_fsel, - e_lsel, - e_rsel, - e_lrsel, - e_rrsel + +#ifndef __LP64__ +struct got_entry { + Elf32_Addr addr; +}; + +struct fdesc_entry { + Elf32_Addr gp; + Elf32_Addr addr; +}; + +struct stub_entry { + Elf32_Word insns[2]; /* each stub entry has two insns */ +}; +#else +struct got_entry { + Elf64_Addr addr; +}; + +struct fdesc_entry { + Elf64_Addr dummy[2]; + Elf64_Addr gp; + Elf64_Addr addr; +}; + +struct stub_entry { + Elf64_Word insns[4]; /* each stub entry has four insns */ }; +#endif + +/* Field selection types defined by hppa */ +#define rnd(x) (((x)+0x1000)&~0x1fff) +/* fsel: full 32 bits */ +#define fsel(v,a) ((v)+(a)) +/* lsel: select left 21 bits */ +#define lsel(v,a) (((v)+(a))>>11) +/* rsel: select right 11 bits */ +#define rsel(v,a) (((v)+(a))&0x7ff) +/* lrsel with rounding of addend to nearest 8k */ +#define lrsel(v,a) (((v)+rnd(a))>>11) +/* rrsel with rounding of addend to nearest 8k */ +#define rrsel(v,a) ((((v)+rnd(a))&0x7ff)+((a)-rnd(a))) + +#define mask(x,sz) ((x) & ~((1<<(sz))-1)) + + +/* The reassemble_* functions prepare an immediate value for + insertion into an opcode. pa-risc uses all sorts of weird bitfields + in the instruction to hold the value. */ +static inline int reassemble_14(int as14) +{ + return (((as14 & 0x1fff) << 1) | + ((as14 & 0x2000) >> 13)); +} + +static inline int reassemble_17(int as17) +{ + return (((as17 & 0x10000) >> 16) | + ((as17 & 0x0f800) << 5) | + ((as17 & 0x00400) >> 8) | + ((as17 & 0x003ff) << 3)); +} + +static inline int reassemble_21(int as21) +{ + return (((as21 & 0x100000) >> 20) | + ((as21 & 0x0ffe00) >> 8) | + ((as21 & 0x000180) << 7) | + ((as21 & 0x00007c) << 14) | + ((as21 & 0x000003) << 12)); +} + +static inline int reassemble_22(int as22) +{ + return (((as22 & 0x200000) >> 21) | + ((as22 & 0x1f0000) << 5) | + ((as22 & 0x00f800) << 5) | + ((as22 & 0x000400) >> 8) | + ((as22 & 0x0003ff) << 3)); +} void *module_alloc(unsigned long size) { @@ -42,6 +121,81 @@ return vmalloc(size); } +#ifndef __LP64__ +static inline unsigned long count_gots(const Elf_Rela *rela, unsigned long n) +{ + return 0; +} + +static inline unsigned long count_fdescs(const Elf_Rela *rela, unsigned long n) +{ + return 0; +} + +static inline unsigned long count_stubs(const Elf_Rela *rela, unsigned long n) +{ + unsigned long cnt = 0; + + for (; n > 0; n--, rela++) + { + switch (ELF32_R_TYPE(rela->r_info)) { + case R_PARISC_PCREL17F: + case R_PARISC_PCREL22F: + cnt++; + } + } + + return cnt; +} +#else +static inline unsigned long count_gots(const Elf_Rela *rela, unsigned long n) +{ + unsigned long cnt = 0; + + for (; n > 0; n--, rela++) + { + switch (ELF64_R_TYPE(rela->r_info)) { + case R_PARISC_LTOFF21L: + case R_PARISC_LTOFF14R: + case R_PARISC_PCREL22F: + cnt++; + } + } + + return cnt; +} + +static inline unsigned long count_fdescs(const Elf_Rela *rela, unsigned long n) +{ + unsigned long cnt = 3; /* 3 for finalize */ + + for (; n > 0; n--, rela++) + { + switch (ELF64_R_TYPE(rela->r_info)) { + case R_PARISC_FPTR64: + cnt++; + } + } + + return cnt; +} + +static inline unsigned long count_stubs(const Elf_Rela *rela, unsigned long n) +{ + unsigned long cnt = 0; + + for (; n > 0; n--, rela++) + { + switch (ELF64_R_TYPE(rela->r_info)) { + case R_PARISC_PCREL22F: + cnt++; + } + } + + return cnt; +} +#endif + /* Free memory returned from module_alloc */ void module_free(struct module *mod, void *module_region) @@ -51,35 +205,145 @@ table entries. */ } -/* We don't need anything special. */ -long module_core_size(const Elf_Ehdr *hdr, - const Elf_Shdr *sechdrs, - const char *secstrings, - struct module *module) +#define CONST +int module_frob_arch_sections(CONST Elf_Ehdr *hdr, + CONST Elf_Shdr *sechdrs, + CONST char *secstrings, + struct module *me) { - return module->core_size; + unsigned long gots = 0, fdescs = 0, stubs = 0; + unsigned int i; + + for (i = 1; i < hdr->e_shnum; i++) { + const Elf_Rela *rels = (void *)hdr + sechdrs[i].sh_offset; + unsigned long nrels = sechdrs[i].sh_size / sizeof(*rels); + + if (sechdrs[i].sh_type != SHT_RELA) + continue; + + /* some of these are not relevant for 32-bit/64-bit + * we leave them here to make the code common. the + * compiler will do its thing and optimize out the + * stuff we don't need + */ + gots += count_gots(rels, nrels); + fdescs += count_fdescs(rels, nrels); + stubs += count_stubs(rels, nrels); + } + + /* align things a bit */ + me->core_size = ALIGN(me->core_size, 16); + me->arch.got_offset = me->core_size; + me->core_size += gots * sizeof(struct got_entry); + + me->core_size = ALIGN(me->core_size, 16); + me->arch.fdesc_offset = me->core_size; + me->core_size += stubs * sizeof(struct fdesc_entry); + + me->core_size = ALIGN(me->core_size, 16); + me->arch.stub_offset = me->core_size; + me->core_size += stubs * sizeof(struct stub_entry); + + return 0; } -long module_init_size(const Elf_Ehdr *hdr, - const Elf_Shdr *sechdrs, - const char *secstrings, - struct module *module) +static Elf_Addr get_got(struct module *me, unsigned long value, long addend) { - return module->init_size; + unsigned int i; + struct got_entry *got; + + value += addend; + + BUG_ON(value == 0); + + got = me->module_core + me->arch.got_offset; + for (i = 0; got[i].addr; i++) + if (got[i].addr == value) + return i * sizeof(struct got_entry); + + got[i].addr = value; + return i * sizeof(struct got_entry); } -int module_frob_arch_sections(Elf_Ehdr *hdr, - Elf_Shdr *sechdrs, - char *secstrings, - struct module *mod) +static Elf_Addr get_fdesc(struct module *me, unsigned long value) { - /* parisc should not need this ... */ - printk(KERN_ERR "module %s: %s not yet implemented.\n", - mod->name, __FUNCTION__); - return 0; + struct fdesc_entry *fdesc = me->module_core + me->arch.fdesc_offset; + + if (!value) { + printk(KERN_ERR "%s: zero OPD requested!\n", me->name); + return 0; + } + + /* Look for existing fdesc entry. */ + while (fdesc->addr) { + if (fdesc->addr == value) + return (Elf_Addr)fdesc; + fdesc++; + } + + /* Create new one */ + fdesc->addr = value; + fdesc->gp = (Elf_Addr)me->module_core + me->arch.got_offset; + return (Elf_Addr)fdesc; } +static Elf_Addr get_stub(struct module *me, unsigned long value, long addend, + int millicode) +{ + unsigned long i; + struct stub_entry *stub; + i = me->arch.stub_count++; + stub = me->module_core + me->arch.stub_offset + + i * sizeof(struct stub_entry); + +#ifndef __LP64__ +/* for 32-bit the stub looks like this: + * ldil L'XXX,%r1 + * be,n R'XXX(%sr4,%r1) + */ + stub->insns[0] = 0x20200000; /* ldil L'XXX,%r1 */ + stub->insns[1] = 0xe0202002; /* be,n R'XXX(%sr4,%r1) */ + + stub->insns[0] |= reassemble_21(lrsel(value, addend)); + stub->insns[1] |= reassemble_17(rrsel(value, addend) / 4); +#else +/* for 64-bit we have two kinds of stubs: + * for normal function calls: + * ldd 0(%dp),%dp + * ldd 10(%dp), %r1 + * bve (%r1) + * ldd 18(%dp), %dp + * + * for millicode: + * ldil 0, %r1 + * ldo 0(%r1), %r1 + * ldd 10(%r1), %r1 + * bve,n (%r1) + */ + if (!millicode) + { + stub->insns[0] = 0x537b0000; /* ldd 0(%dp),%dp */ + stub->insns[1] = 0x53610020; /* ldd 10(%dp),%r1 */ + stub->insns[2] = 0xe820d000; /* bve (%r1) */ + stub->insns[3] = 0x537b0030; /* ldd 18(%dp),%dp */ + + stub->insns[0] |= reassemble_21(get_got(me, value, addend)); + } + else + { + stub->insns[0] = 0x20200000; /* ldil 0,%r1 */ + stub->insns[1] = 0x34210000; /* ldo 0(%r1), %r1 */ + stub->insns[2] = 0x50210020; /* ldd 10(%r1),%r1 */ + stub->insns[3] = 0xe820d002; /* bve,n (%r1) */ + + stub->insns[0] |= reassemble_21(lrsel(value, addend)); + stub->insns[1] |= reassemble_14(rrsel(value, addend)); + } +#endif + + return (Elf_Addr)stub; +} int apply_relocate(Elf_Shdr *sechdrs, const char *strtab, @@ -104,7 +368,10 @@ Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr; Elf32_Sym *sym; Elf32_Word *loc; - Elf32_Addr value; + Elf32_Addr val; + Elf32_Sword addend; + Elf32_Addr dot; + register unsigned long dp asm ("r27"); DEBUGP("Applying relocate section %u to %u\n", relsec, sechdrs[relsec].sh_info); @@ -120,59 +387,81 @@ me->name, strtab + sym->st_name); return -ENOENT; } + dot = (sechdrs[relsec].sh_addr + rel->r_offset) & ~0x03; - value = sym->st_value + rel[i].r_addend; + val = sym->st_value; + addend = rel[i].r_addend; - DEBUGP("Symbol %s loc 0x%lx value 0x%lx: ", +#if 0 +#define r(t) ELF32_R_TYPE(rel[i].r_info)==t ? #t : + DEBUGP("Symbol %s loc 0x%x val 0x%x addend 0x%x: %s\n", strtab + sym->st_name, - (uint32_t)loc, value); + (uint32_t)loc, val, addend, + r(R_PARISC_PLABEL32) + r(R_PARISC_DIR32) + r(R_PARISC_DIR21L) + r(R_PARISC_DIR14R) + r(R_PARISC_SEGREL32) + r(R_PARISC_DPREL21L) + r(R_PARISC_DPREL14R) + r(R_PARISC_PCREL17F) + r(R_PARISC_PCREL22F) + "UNKNOWN"); +#undef r +#endif switch (ELF32_R_TYPE(rel[i].r_info)) { case R_PARISC_PLABEL32: /* 32-bit function address */ - DEBUGP("R_PARISC_PLABEL32\n"); + /* no function descriptors... */ + *loc = fsel(val, addend); break; case R_PARISC_DIR32: /* direct 32-bit ref */ - DEBUGP("R_PARISC_DIR32\n"); + *loc = fsel(val, addend); break; case R_PARISC_DIR21L: /* left 21 bits of effective address */ - DEBUGP("R_PARISC_DIR21L\n"); + *loc = mask(*loc, 21) | reassemble_21(lrsel(val, addend)); break; case R_PARISC_DIR14R: /* right 14 bits of effective address */ - DEBUGP("R_PARISC_DIR14R\n"); + *loc = mask(*loc, 14) | reassemble_14(rrsel(val, addend)); break; case R_PARISC_SEGREL32: /* 32-bit segment relative address */ - DEBUGP("R_PARISC_SEGREL32\n"); + val -= (uint32_t)me->module_core; + *loc = fsel(val, addend); break; case R_PARISC_DPREL21L: /* left 21 bit of relative address */ - DEBUGP("R_PARISC_DPREL21L\n"); + val -= dp; + *loc = mask(*loc, 21) | reassemble_21(lrsel(val, addend) - dp); break; case R_PARISC_DPREL14R: /* right 14 bit of relative address */ - DEBUGP("R_PARISC_DPREL14R\n"); + val -= dp; + *loc = mask(*loc, 14) | reassemble_14(rrsel(val, addend) - dp); break; case R_PARISC_PCREL17F: /* 17-bit PC relative address */ - DEBUGP("R_PARISC_PCREL17F\n"); + val = get_stub(me, val, addend, 0) - dot - 8; + *loc = (*loc&0x1f1ffd) | reassemble_17(val); break; case R_PARISC_PCREL22F: - /* 22-bit PC relative address */ - DEBUGP("R_PARISC_PCREL22F\n"); + /* 22-bit PC relative address; only defined for pa20 */ + val = get_stub(me, val, addend, 0) - dot - 8; + *loc = (*loc&0x3ff1ffd) | reassemble_22(val); break; default: - printk(KERN_ERR "module %s: Unknown relocation: %Lu\n", + printk(KERN_ERR "module %s: Unknown relocation: %u\n", me->name, ELF32_R_TYPE(rel[i].r_info)); return -ENOEXEC; } } - return -ENOEXEC; + return 0; } #else @@ -186,7 +475,9 @@ Elf64_Rela *rel = (void *)sechdrs[relsec].sh_addr; Elf64_Sym *sym; Elf64_Word *loc; - Elf64_Addr value; + Elf64_Addr val; + Elf64_Sxword addend; + Elf64_Addr dot; DEBUGP("Applying relocate section %u to %u\n", relsec, sechdrs[relsec].sh_info); @@ -202,38 +493,56 @@ me->name, strtab + sym->st_name); return -ENOENT; } + dot = (sechdrs[relsec].sh_addr + rel->r_offset) & ~0x03; - value = sym->st_value + rel[i].r_addend; + val = sym->st_value; + addend = rel[i].r_addend; - DEBUGP("Symbol %s loc 0x%Lx value 0x%Lx: ", +#if 1 +#define r(t) ELF64_R_TYPE(rel[i].r_info)==t ? #t : + DEBUGP("Symbol %s loc %p val 0x%Lx addend 0x%Lx: %s\n", strtab + sym->st_name, - (uint64_t)loc, value); + loc, val, addend, + r(R_PARISC_LTOFF14R) + r(R_PARISC_LTOFF21L) + r(R_PARISC_PCREL22F) + r(R_PARISC_DIR64) + r(R_PARISC_SEGREL32) + r(R_PARISC_FPTR64) + "UNKNOWN"); +#undef r +#endif switch (ELF64_R_TYPE(rel[i].r_info)) { - case R_PARISC_LTOFF14R: - /* LT-relative; right 14 bits */ - DEBUGP("R_PARISC_LTOFF14R\n"); - break; case R_PARISC_LTOFF21L: /* LT-relative; left 21 bits */ - DEBUGP("R_PARISC_LTOFF21L\n"); + *loc = mask(*loc, 21) | reassemble_21(get_got(me, val, addend)); + break; + case R_PARISC_LTOFF14R: + /* L(ltoff(val+addend)) */ + /* LT-relative; right 14 bits */ + *loc = mask(*loc, 14) | reassemble_14(get_got(me, val, addend)); break; case R_PARISC_PCREL22F: /* PC-relative; 22 bits */ - DEBUGP("R_PARISC_PCREL22F\n"); + if (strncmp(strtab + sym->st_name, "$$", 2) == 0) + val = get_stub(me, val, addend, 1) - dot - 8; + else + val = get_stub(me, val, addend, 0) - dot - 8; + *loc = (*loc&0x3ff1ffd) | reassemble_22(val); break; case R_PARISC_DIR64: /* 64-bit effective address */ - DEBUGP("R_PARISC_DIR64\n"); - *loc = value; + *loc = fsel(val, addend); break; case R_PARISC_SEGREL32: /* 32-bit segment relative address */ - DEBUGP("R_PARISC_SEGREL32\n"); + val -= (uint64_t)me->module_core; + *loc = fsel(val, addend); break; case R_PARISC_FPTR64: /* 64-bit function address */ - DEBUGP("R_PARISC_FPTR64\n"); + *loc = get_fdesc(me, val+addend); break; default: @@ -242,7 +551,7 @@ return -ENOEXEC; } } - return -ENOEXEC; + return 0; } #endif @@ -250,5 +559,14 @@ const Elf_Shdr *sechdrs, struct module *me) { +#ifdef __LP64__ + me->init = (void *)get_fdesc(me, (Elf_Addr)me->init); +#ifdef CONFIG_MODULE_UNLOAD + if (me->cleanup) + me->cleanup = (void *)get_fdesc(me, (Elf_Addr)me->cleanup); + if (me->destroy) + me->destroy = (void *)get_fdesc(me, (Elf_Addr)me->destroy); +#endif +#endif return 0; } diff -Nru a/arch/parisc/kernel/parisc_ksyms.c b/arch/parisc/kernel/parisc_ksyms.c --- a/arch/parisc/kernel/parisc_ksyms.c Sun Feb 9 21:13:37 2003 +++ b/arch/parisc/kernel/parisc_ksyms.c Sun Feb 9 21:13:37 2003 @@ -31,10 +31,6 @@ EXPORT_SYMBOL(get_pci_node_path); #endif -#ifdef CONFIG_IOMMU_CCIO -EXPORT_SYMBOL(ccio_get_fake); -#endif - #include #include EXPORT_SYMBOL(enable_irq); diff -Nru a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c --- a/arch/parisc/kernel/signal.c Sun Feb 9 21:13:36 2003 +++ b/arch/parisc/kernel/signal.c Sun Feb 9 21:13:36 2003 @@ -118,11 +118,11 @@ #endif sigdelsetmask(&newset, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->gr[28] = -EINTR; while (1) { @@ -177,10 +177,10 @@ goto give_sigsegv; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); /* Good thing we saved the old gr[30], eh? */ if (restore_sigcontext(&frame->uc.uc_mcontext, regs)) @@ -407,11 +407,11 @@ ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked,sig); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } return 1; } diff -Nru a/arch/parisc/kernel/signal32.c b/arch/parisc/kernel/signal32.c --- a/arch/parisc/kernel/signal32.c Sun Feb 9 21:13:29 2003 +++ b/arch/parisc/kernel/signal32.c Sun Feb 9 21:13:29 2003 @@ -17,59 +17,6 @@ struct sigaction32 sa; }; -typedef unsigned int old_sigset_t32; - -static int -put_old_sigset32(old_sigset_t32 *up, old_sigset_t *set) -{ - old_sigset_t32 set32 = *set; - return put_user(set32, up); -} - -static int -get_old_segset32(old_sigset_t32 *up, old_sigset_t *set) -{ - old_sigset_t32 set32; - int r; - - if ((r = get_user(set32, up)) == 0) - *set = set32; - - return r; -} - -long -sys32_sigpending(old_sigset_t32 *set) -{ - extern long sys_sigpending(old_sigset_t *set); - old_sigset_t pending; - int ret; - - KERNEL_SYSCALL(ret, sys_sigpending, &pending); - - /* can't put_user an old_sigset_t -- it is too big */ - if (put_old_sigset32(set, &pending)) - return -EFAULT; - - return ret; -} - -int sys32_sigprocmask(int how, old_sigset_t32 *set, - old_sigset_t32 *oset) -{ - extern int sys_sigprocmask(int how, old_sigset_t *set, - old_sigset_t *oset); - old_sigset_t s; - int ret; - - if (set && get_old_segset32 (set, &s)) - return -EFAULT; - KERNEL_SYSCALL(ret, sys_sigprocmask, how, set ? &s : NULL, oset ? &s : NULL); - if (!ret && oset && put_old_sigset32(oset, &s)) - return -EFAULT; - return ret; -} - static inline void sigset_32to64(sigset_t *s64, sigset_t32 *s32) { diff -Nru a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c --- a/arch/parisc/kernel/sys_parisc32.c Sun Feb 9 21:13:30 2003 +++ b/arch/parisc/kernel/sys_parisc32.c Sun Feb 9 21:13:30 2003 @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -314,74 +315,6 @@ return -ENOSYS; } -/* 32-bit user apps use struct statfs which uses 'long's */ -struct statfs32 { - __s32 f_type; - __s32 f_bsize; - __s32 f_blocks; - __s32 f_bfree; - __s32 f_bavail; - __s32 f_files; - __s32 f_ffree; - __kernel_fsid_t f_fsid; - __s32 f_namelen; - __s32 f_spare[6]; -}; - -/* convert statfs struct to statfs32 struct and copy result to user */ -static unsigned long statfs32_to_user(struct statfs32 *ust32, struct statfs *st) -{ - struct statfs32 st32; -#undef CP -#define CP(a) st32.a = st->a - CP(f_type); - CP(f_bsize); - CP(f_blocks); - CP(f_bfree); - CP(f_bavail); - CP(f_files); - CP(f_ffree); - CP(f_fsid); - CP(f_namelen); - return copy_to_user(ust32, &st32, sizeof st32); -} - -/* The following statfs calls are copies of code from linux/fs/open.c and - * should be checked against those from time to time */ -asmlinkage long sys32_statfs(const char * path, struct statfs32 * buf) -{ - struct nameidata nd; - int error; - - error = user_path_walk(path, &nd); - if (!error) { - struct statfs tmp; - error = vfs_statfs(nd.dentry->d_inode->i_sb, &tmp); - if (!error && statfs32_to_user(buf, &tmp)) - error = -EFAULT; - path_release(&nd); - } - return error; -} - -asmlinkage long sys32_fstatfs(unsigned int fd, struct statfs32 * buf) -{ - struct file * file; - struct statfs tmp; - int error; - - error = -EBADF; - file = fget(fd); - if (!file) - goto out; - error = vfs_statfs(file->f_dentry->d_inode->i_sb, &tmp); - if (!error && statfs32_to_user(buf, &tmp)) - error = -EFAULT; - fput(file); -out: - return error; -} - extern asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg); asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg) @@ -2429,21 +2362,23 @@ { struct sysinfo val; int err; - extern rwlock_t xtime_lock; + unsigned long seq; /* We don't need a memset here because we copy the * struct to userspace once element at a time. */ - read_lock_irq(&xtime_lock); - val.uptime = jiffies / HZ; + do { + seq = read_seqbegin(&xtime_lock); + val.uptime = jiffies / HZ; + + val.loads[0] = avenrun[0] << (SI_LOAD_SHIFT - FSHIFT); + val.loads[1] = avenrun[1] << (SI_LOAD_SHIFT - FSHIFT); + val.loads[2] = avenrun[2] << (SI_LOAD_SHIFT - FSHIFT); - val.loads[0] = avenrun[0] << (SI_LOAD_SHIFT - FSHIFT); - val.loads[1] = avenrun[1] << (SI_LOAD_SHIFT - FSHIFT); - val.loads[2] = avenrun[2] << (SI_LOAD_SHIFT - FSHIFT); + val.procs = nr_threads; + } while (read_seqretry(&xtime_lock, seq)); - val.procs = nr_threads; - read_unlock_irq(&xtime_lock); si_meminfo(&val); si_swapinfo(&val); diff -Nru a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S --- a/arch/parisc/kernel/syscall.S Sun Feb 9 21:13:37 2003 +++ b/arch/parisc/kernel/syscall.S Sun Feb 9 21:13:37 2003 @@ -425,30 +425,27 @@ /* I don't like this */ ENTRY_UHOH(sgetmask) ENTRY_UHOH(ssetmask) - ENTRY_SAME(setreuid) /* 70 */ + ENTRY_SAME(setreuid) /* 70 */ ENTRY_SAME(setregid) ENTRY_SAME(mincore) - ENTRY_DIFF(sigpending) + ENTRY_COMP(sigpending) ENTRY_SAME(sethostname) /* Following 3 have linux-common-code structs containing longs -( */ - ENTRY_DIFF(setrlimit) /* 75 */ + ENTRY_DIFF(setrlimit) /* 75 */ ENTRY_DIFF(getrlimit) ENTRY_DIFF(getrusage) /* struct timeval and timezone are maybe?? consistent wide and narrow */ ENTRY_DIFF(gettimeofday) ENTRY_DIFF(settimeofday) - ENTRY_SAME(getgroups) /* 80 */ + ENTRY_SAME(getgroups) /* 80 */ ENTRY_SAME(setgroups) /* struct socketaddr... */ ENTRY_SAME(sendto) ENTRY_SAME(symlink) /* see stat comment */ ENTRY_COMP(newlstat) - ENTRY_SAME(readlink) /* 85 */ - /* suspect we'll need some work for narrow shlibs on wide kernel */ - /* NOTE this doesn't get used when I boot 32-bit userspace */ - /* containing working shlib apps -- can this be nuked? */ - ENTRY_UHOH(uselib) + ENTRY_SAME(readlink) /* 85 */ + ENTRY_SAME(ni_syscall) /* was uselib */ ENTRY_SAME(swapon) ENTRY_SAME(reboot) ENTRY_SAME(mmap2) @@ -461,17 +458,15 @@ ENTRY_SAME(getpriority) ENTRY_SAME(setpriority) ENTRY_SAME(recv) - ENTRY_DIFF(statfs) - ENTRY_DIFF(fstatfs) /* 100 */ + ENTRY_COMP(statfs) + ENTRY_COMP(fstatfs) /* 100 */ ENTRY_SAME(stat64) - /* don't think hppa glibc even provides an entry pt for this - * so disable for now */ - ENTRY_UHOH(socketcall) + ENTRY_SAME(ni_syscall) /* was socketcall */ ENTRY_SAME(syslog) /* even though manpage says struct timeval contains longs, ours has * time_t and suseconds_t -- both of which are safe wide/narrow */ ENTRY_COMP(setitimer) - ENTRY_COMP(getitimer) /* 105 */ + ENTRY_COMP(getitimer) /* 105 */ ENTRY_SAME(capget) ENTRY_SAME(capset) ENTRY_OURS(pread64) @@ -494,10 +489,10 @@ ENTRY_SAME(recvfrom) /* struct timex contains longs */ ENTRY_DIFF(adjtimex) - ENTRY_SAME(mprotect) /* 125 */ + ENTRY_SAME(mprotect) /* 125 */ /* old_sigset_t forced to 32 bits. Beware glibc sigset_t */ - ENTRY_DIFF(sigprocmask) - ENTRY_SAME(ni_syscall) /* create_module */ + ENTRY_COMP(sigprocmask) + ENTRY_SAME(ni_syscall) /* create_module */ ENTRY_SAME(init_module) ENTRY_SAME(delete_module) ENTRY_SAME(ni_syscall) /* 130: get_kernel_syms */ @@ -547,13 +542,13 @@ ENTRY_COMP(nanosleep) ENTRY_SAME(mremap) ENTRY_SAME(setresuid) - ENTRY_SAME(getresuid) /* 165 */ + ENTRY_SAME(getresuid) /* 165 */ ENTRY_DIFF(sigaltstack_wrapper) ENTRY_SAME(ni_syscall) /* query_module */ ENTRY_SAME(poll) /* structs contain pointers and an in_addr... */ ENTRY_DIFF(nfsservctl) - ENTRY_SAME(setresgid) /* 170 */ + ENTRY_SAME(setresgid) /* 170 */ ENTRY_SAME(getresgid) ENTRY_SAME(prctl) /* signals need a careful review */ @@ -594,15 +589,9 @@ ENTRY_OURS(ftruncate64) /* 200 */ ENTRY_SAME(getdents64) ENTRY_DIFF(fcntl64) -#ifdef CONFIG_XFS_FS - ENTRY_SAME(attrctl) - ENTRY_SAME(acl_get) - ENTRY_SAME(acl_set) /* 205 */ -#else ENTRY_SAME(ni_syscall) ENTRY_SAME(ni_syscall) ENTRY_SAME(ni_syscall) /* 205 */ -#endif ENTRY_SAME(gettid) ENTRY_SAME(readahead) ENTRY_SAME(ni_syscall) /* tkill */ diff -Nru a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c --- a/arch/parisc/kernel/time.c Sun Feb 9 21:13:31 2003 +++ b/arch/parisc/kernel/time.c Sun Feb 9 21:13:31 2003 @@ -36,7 +36,6 @@ /* xtime and wall_jiffies keep wall-clock time */ extern unsigned long wall_jiffies; -extern rwlock_t xtime_lock; static long clocktick; /* timer cycles per tick */ static long halftick; @@ -115,9 +114,9 @@ smp_do_timer(regs); #endif if (cpu == 0) { - write_lock(&xtime_lock); + write_seqlock(&xtime_lock); do_timer(regs); - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); } } @@ -172,16 +171,14 @@ void do_gettimeofday (struct timeval *tv) { - unsigned long flags, usec, sec; + unsigned long flags, seq, usec, sec; - read_lock_irqsave(&xtime_lock, flags); - { + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); usec = gettimeoffset(); - sec = xtime.tv_sec; usec += (xtime.tv_nsec / 1000); - } - read_unlock_irqrestore(&xtime_lock, flags); + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); while (usec >= 1000000) { usec -= 1000000; @@ -195,7 +192,7 @@ void do_settimeofday (struct timeval *tv) { - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); { /* * This is revolting. We need to set "xtime" @@ -219,7 +216,7 @@ time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; } - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } @@ -241,10 +238,10 @@ mtctl(next_tick, 16); if(pdc_tod_read(&tod_data) == 0) { - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); xtime.tv_sec = tod_data.tod_sec; xtime.tv_nsec = tod_data.tod_usec * 1000; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } else { printk(KERN_ERR "Error reading tod clock\n"); xtime.tv_sec = 0; diff -Nru a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c --- a/arch/parisc/kernel/traps.c Sun Feb 9 21:13:37 2003 +++ b/arch/parisc/kernel/traps.c Sun Feb 9 21:13:37 2003 @@ -123,7 +123,11 @@ } -static int kstack_depth_to_print = 48; +#ifndef __LP64__ +static int kstack_depth_to_print = 64 * 4; +#else +static int kstack_depth_to_print = 128 * 4; +#endif void show_stack(unsigned long *sp) { diff -Nru a/arch/ppc/8xx_io/Makefile b/arch/ppc/8xx_io/Makefile --- a/arch/ppc/8xx_io/Makefile Sun Feb 9 21:13:37 2003 +++ b/arch/ppc/8xx_io/Makefile Sun Feb 9 21:13:37 2003 @@ -2,8 +2,6 @@ # Makefile for the linux MPC8xx ppc-specific parts of comm processor # -export-objs := fec.o - obj-y := commproc.o uart.o obj-$(CONFIG_FEC_ENET) += fec.o diff -Nru a/arch/ppc/Kconfig b/arch/ppc/Kconfig --- a/arch/ppc/Kconfig Sun Feb 9 21:13:37 2003 +++ b/arch/ppc/Kconfig Sun Feb 9 21:13:37 2003 @@ -776,7 +776,7 @@ use this part of the kernel. You may say M here for module support and later load the module when - you have use for it; the module is called binfmt_misc.o. If you + you have use for it; the module is called binfmt_misc. If you don't know what to answer at this point, say Y. source "drivers/pci/Kconfig" @@ -989,9 +989,9 @@ for which 8 pin to DB25 adapters were supplied. The card also had jumpers internally to toggle various pinning configurations. - This driver can be built as a module; but then "generic_serial.o" + This driver can be built as a module; but then "generic_serial" will also be built as a module. This has to be loaded before - "ser_a2232.o". If you want to do this, answer M here and read + "ser_a2232". If you want to do this, answer M here and read "". config WHIPPET_SERIAL @@ -1010,7 +1010,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you - want). The module is called apne.o. If you want to compile it as a + want). The module is called apne. If you want to compile it as a module, say M here and read . config SERIAL_CONSOLE @@ -1192,7 +1192,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called ide.o. + will be called ide. For further information, please read . @@ -1219,7 +1219,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called scsi_mod.o. If you want to compile it as + The module will be called scsi_mod. If you want to compile it as a module, say M here and read and . However, do not compile this as a module if your root file system (the one containing the directory /) @@ -1428,7 +1428,7 @@ and load that module after the PnP configuration is finished. To do this, say M here and read as well as ; the module will be - called soundcore.o. + called soundcore. I'm told that even without a sound card, you can make your computer say more than an occasional beep, by programming the PC speaker. diff -Nru a/arch/ppc/Makefile b/arch/ppc/Makefile --- a/arch/ppc/Makefile Sun Feb 9 21:13:28 2003 +++ b/arch/ppc/Makefile Sun Feb 9 21:13:28 2003 @@ -36,15 +36,12 @@ CFLAGS += $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g') endif -head-y := head.o -head-$(CONFIG_8xx) := head_8xx.o -head-$(CONFIG_4xx) := head_4xx.o -head-$(CONFIG_440) := head_44x.o - -HEAD := arch/ppc/kernel/$(head-y) -ifdef CONFIG_6xx - HEAD += arch/ppc/kernel/idle_6xx.o -endif +head-y := arch/ppc/kernel/head.o +head-$(CONFIG_8xx) := arch/ppc/kernel/head_8xx.o +head-$(CONFIG_4xx) := arch/ppc/kernel/head_4xx.o +head-$(CONFIG_440) := arch/ppc/kernel/head_44x.o + +head-$(CONFIG_6xx) += arch/ppc/kernel/idle_6xx.o core-y += arch/ppc/kernel/ arch/ppc/platforms/ \ arch/ppc/mm/ arch/ppc/lib/ arch/ppc/syslib/ @@ -59,7 +56,7 @@ BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd pImage vmlinux.sm -.PHONY: $(BOOT_TARGETS) clean archclean archmrproper +.PHONY: $(BOOT_TARGETS) all: zImage @@ -77,8 +74,6 @@ archclean: $(Q)$(MAKE) $(clean)=arch/ppc/boot - -archmrproper: prepare: include/asm-$(ARCH)/offsets.h checkbin diff -Nru a/arch/ppc/amiga/Makefile b/arch/ppc/amiga/Makefile --- a/arch/ppc/amiga/Makefile Sun Feb 9 21:13:31 2003 +++ b/arch/ppc/amiga/Makefile Sun Feb 9 21:13:31 2003 @@ -2,8 +2,6 @@ # Makefile for Linux arch/m68k/amiga source directory # -export-objs := amiga_ksyms.o - obj-y := config.o amiints.o cia.o time.o bootinfo.o amisound.o \ chipram.o amiga_ksyms.o diff -Nru a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile --- a/arch/ppc/boot/simple/Makefile Sun Feb 9 21:13:28 2003 +++ b/arch/ppc/boot/simple/Makefile Sun Feb 9 21:13:28 2003 @@ -19,7 +19,7 @@ # ENTRYPOINT which the image should be loaded at. The optimal setting # for ENTRYPOINT is the link address. # (4) It is advisable to pass in the memory size using BI_MEMSIZE and -# get_mem_size(), which is memory controller dependant. Add in the correct +# get_mem_size(), which is memory controller dependent. Add in the correct # XXX_memory.o file for this to work, as well as editing the $(MISC) file. boot: zImage diff -Nru a/arch/ppc/boot/simple/misc.c b/arch/ppc/boot/simple/misc.c --- a/arch/ppc/boot/simple/misc.c Sun Feb 9 21:13:35 2003 +++ b/arch/ppc/boot/simple/misc.c Sun Feb 9 21:13:35 2003 @@ -82,7 +82,7 @@ #if defined(CONFIG_LOPEC) || defined(CONFIG_PAL4) /* - * Call get_mem_size(), which is memory controller dependant, + * Call get_mem_size(), which is memory controller dependent, * and we must have the correct file linked in here. */ TotalMemory = get_mem_size(); diff -Nru a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile --- a/arch/ppc/kernel/Makefile Sun Feb 9 21:13:35 2003 +++ b/arch/ppc/kernel/Makefile Sun Feb 9 21:13:35 2003 @@ -17,8 +17,6 @@ EXTRA_TARGETS := $(HEAD-y) -export-objs := ppc_ksyms.o time.o - obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ process.o signal.o ptrace.o align.o \ semaphore.o syscalls.o setup.o \ diff -Nru a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c --- a/arch/ppc/kernel/pci.c Sun Feb 9 21:13:32 2003 +++ b/arch/ppc/kernel/pci.c Sun Feb 9 21:13:32 2003 @@ -1069,7 +1069,7 @@ if (ppc_md.pci_swizzle && ppc_md.pci_map_irq) pci_fixup_irqs(ppc_md.pci_swizzle, ppc_md.pci_map_irq); - /* Call machine dependant fixup */ + /* Call machine dependent fixup */ if (ppc_md.pcibios_fixup) ppc_md.pcibios_fixup(); diff -Nru a/arch/ppc/kernel/signal.c b/arch/ppc/kernel/signal.c --- a/arch/ppc/kernel/signal.c Sun Feb 9 21:13:37 2003 +++ b/arch/ppc/kernel/signal.c Sun Feb 9 21:13:37 2003 @@ -65,11 +65,11 @@ sigset_t saveset; mask &= _BLOCKABLE; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; siginitset(¤t->blocked, mask); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->result = -EINTR; regs->ccr |= 0x10000000; @@ -96,11 +96,11 @@ return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->result = -EINTR; regs->ccr |= 0x10000000; @@ -208,10 +208,10 @@ || copy_from_user(&st, &rt_sf->uc.uc_stack, sizeof(st))) goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (regs->msr & MSR_FP) giveup_fpu(current); @@ -311,10 +311,10 @@ set.sig[1] = sigctx._unused[3]; #endif sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (regs->msr & MSR_FP ) giveup_fpu(current); @@ -450,11 +450,11 @@ ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked,sig); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } return; diff -Nru a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c --- a/arch/ppc/kernel/time.c Sun Feb 9 21:13:34 2003 +++ b/arch/ppc/kernel/time.c Sun Feb 9 21:13:34 2003 @@ -76,7 +76,6 @@ /* keep track of when we need to update the rtc */ time_t last_rtc_update; -extern rwlock_t xtime_lock; /* The decrementer counts down by 128 every 128ns on a 601. */ #define DECREMENTER_COUNT_601 (1000000000 / HZ) @@ -161,7 +160,7 @@ continue; /* We are in an interrupt, no need to save/restore flags */ - write_lock(&xtime_lock); + write_seqlock(&xtime_lock); tb_last_stamp = jiffy_stamp; do_timer(regs); @@ -191,7 +190,7 @@ /* Try again one minute later */ last_rtc_update += 60; } - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); } if ( !disarm_decr[smp_processor_id()] ) set_dec(next_dec); @@ -213,21 +212,23 @@ void do_gettimeofday(struct timeval *tv) { unsigned long flags; + unsigned long seq; unsigned delta, lost_ticks, usec, sec; - read_lock_irqsave(&xtime_lock, flags); - sec = xtime.tv_sec; - usec = (xtime.tv_nsec / 1000); - delta = tb_ticks_since(tb_last_stamp); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); + sec = xtime.tv_sec; + usec = (xtime.tv_nsec / 1000); + delta = tb_ticks_since(tb_last_stamp); #ifdef CONFIG_SMP - /* As long as timebases are not in sync, gettimeofday can only - * have jiffy resolution on SMP. - */ - if (!smp_tb_synchronized) - delta = 0; + /* As long as timebases are not in sync, gettimeofday can only + * have jiffy resolution on SMP. + */ + if (!smp_tb_synchronized) + delta = 0; #endif /* CONFIG_SMP */ - lost_ticks = jiffies - wall_jiffies; - read_unlock_irqrestore(&xtime_lock, flags); + lost_ticks = jiffies - wall_jiffies; + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); usec += mulhwu(tb_to_us, tb_ticks_per_jiffy * lost_ticks + delta); while (usec >= 1000000) { @@ -243,7 +244,7 @@ unsigned long flags; int tb_delta, new_usec, new_sec; - write_lock_irqsave(&xtime_lock, flags); + write_seqlock_irqsave(&xtime_lock, flags); /* Updating the RTC is not the job of this code. If the time is * stepped under NTP, the RTC will be update after STA_UNSYNC * is cleared. Tool like clock/hwclock either copy the RTC @@ -283,7 +284,7 @@ time_state = TIME_ERROR; /* p. 24, (a) */ time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irqrestore(&xtime_lock, flags); + write_sequnlock_irqrestore(&xtime_lock, flags); } /* This function is only called on the boot processor */ diff -Nru a/arch/ppc/lib/Makefile b/arch/ppc/lib/Makefile --- a/arch/ppc/lib/Makefile Sun Feb 9 21:13:28 2003 +++ b/arch/ppc/lib/Makefile Sun Feb 9 21:13:28 2003 @@ -2,8 +2,6 @@ # Makefile for ppc-specific library files.. # -export-objs := dec_and_lock.o - obj-y := checksum.o string.o strcase.o dec_and_lock.o div64.o obj-$(CONFIG_SMP) += locks.o diff -Nru a/arch/ppc/ocp/Makefile b/arch/ppc/ocp/Makefile --- a/arch/ppc/ocp/Makefile Sun Feb 9 21:13:30 2003 +++ b/arch/ppc/ocp/Makefile Sun Feb 9 21:13:30 2003 @@ -9,6 +9,5 @@ # # NB: cribbed from the drivers/sbus/Makefile -- PMM -export-objs := ocp.o ocp-driver.o ocp-probe.o obj-y += ocp.o ocp-driver.o ocp-probe.o diff -Nru a/arch/ppc/platforms/4xx/Makefile b/arch/ppc/platforms/4xx/Makefile --- a/arch/ppc/platforms/4xx/Makefile Sun Feb 9 21:13:35 2003 +++ b/arch/ppc/platforms/4xx/Makefile Sun Feb 9 21:13:35 2003 @@ -1,8 +1,6 @@ # # Makefile for the PowerPC 4xx linux kernel. -export-objs := ibm405lp.o - obj-$(CONFIG_ASH) += ash.o obj-$(CONFIG_BEECH) += beech.o obj-$(CONFIG_CEDAR) += cedar.o diff -Nru a/arch/ppc/platforms/Makefile b/arch/ppc/platforms/Makefile --- a/arch/ppc/platforms/Makefile Sun Feb 9 21:13:37 2003 +++ b/arch/ppc/platforms/Makefile Sun Feb 9 21:13:37 2003 @@ -12,8 +12,6 @@ # Extra CFLAGS so we don't have to do relative includes CFLAGS_pmac_setup.o += -I$(TOPDIR)/arch/$(ARCH)/mm -export-objs := prep_setup.o - obj-$(CONFIG_APUS) += apus_setup.o ifeq ($(CONFIG_APUS),y) obj-$(CONFIG_PCI) += apus_pci.o diff -Nru a/arch/ppc/platforms/pmac_time.c b/arch/ppc/platforms/pmac_time.c --- a/arch/ppc/platforms/pmac_time.c Sun Feb 9 21:13:30 2003 +++ b/arch/ppc/platforms/pmac_time.c Sun Feb 9 21:13:30 2003 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -29,8 +30,6 @@ #include #include -extern rwlock_t xtime_lock; - /* Apparently the RTC stores seconds since 1 Jan 1904 */ #define RTC_OFFSET 2082844800 @@ -215,19 +214,21 @@ { static unsigned long time_diff; unsigned long flags; + unsigned long seq; switch (when) { case PBOOK_SLEEP_NOW: - read_lock_irqsave(&xtime_lock, flags); - time_diff = xtime.tv_sec - pmac_get_rtc_time(); - read_unlock_irqrestore(&xtime_lock, flags); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); + time_diff = xtime.tv_sec - pmac_get_rtc_time(); + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); break; case PBOOK_WAKE: - write_lock_irqsave(&xtime_lock, flags); + write_seqlock_irqsave(&xtime_lock, flags); xtime.tv_sec = pmac_get_rtc_time() + time_diff; xtime.tv_nsec = 0; last_rtc_update = xtime.tv_sec; - write_unlock_irqrestore(&xtime_lock, flags); + write_sequnlock_irqrestore(&xtime_lock, flags); break; } return PBOOK_SLEEP_OK; diff -Nru a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile --- a/arch/ppc/syslib/Makefile Sun Feb 9 21:13:28 2003 +++ b/arch/ppc/syslib/Makefile Sun Feb 9 21:13:28 2003 @@ -12,8 +12,6 @@ CFLAGS_prom_init.o += -mrelocatable-lib CFLAGS_btext.o += -mrelocatable-lib -export-objs := ppc4xx_dma.o ppc4xx_pm.o - obj-$(CONFIG_PPCBUG_NVRAM) += prep_nvram.o ifeq ($(CONFIG_4xx),y) obj-$(CONFIG_4xx) += ppc4xx_pic.o diff -Nru a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig --- a/arch/ppc64/Kconfig Sun Feb 9 21:13:32 2003 +++ b/arch/ppc64/Kconfig Sun Feb 9 21:13:32 2003 @@ -128,6 +128,10 @@ tristate "Firmware flash interface" depends on !PPC_ISERIES +config PPC_RTAS + bool "Proc interface to RTAS" + depends on !PPC_ISERIES + endmenu @@ -208,7 +212,7 @@ use this part of the kernel. You may say M here for module support and later load the module when - you have use for it; the module is called binfmt_misc.o. If you + you have use for it; the module is called binfmt_misc. If you don't know what to answer at this point, say Y. source "drivers/pci/Kconfig" @@ -307,7 +311,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called ide.o. + will be called ide. For further information, please read . @@ -334,7 +338,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called scsi_mod.o. If you want to compile it as + The module will be called scsi_mod. If you want to compile it as a module, say M here and read and . However, do not compile this as a module if your root file system (the one containing the directory /) @@ -400,7 +404,7 @@ and load that module after the PnP configuration is finished. To do this, say M here and read as well as ; the module will be - called soundcore.o. + called soundcore. I'm told that even without a sound card, you can make your computer say more than an occasional beep, by programming the PC speaker. diff -Nru a/arch/ppc64/Makefile b/arch/ppc64/Makefile --- a/arch/ppc64/Makefile Sun Feb 9 21:13:29 2003 +++ b/arch/ppc64/Makefile Sun Feb 9 21:13:29 2003 @@ -22,7 +22,7 @@ -Wno-uninitialized -mminimal-toc -mtraceback=full \ -finline-limit-2000 -mcpu=power4 -HEAD := arch/ppc64/kernel/head.o +head-y := arch/ppc64/kernel/head.o libs-y += arch/ppc64/lib/ core-y += arch/ppc64/kernel/ diff -Nru a/arch/ppc64/defconfig b/arch/ppc64/defconfig --- a/arch/ppc64/defconfig Sun Feb 9 21:13:30 2003 +++ b/arch/ppc64/defconfig Sun Feb 9 21:13:30 2003 @@ -18,10 +18,10 @@ # # General setup # -CONFIG_NET=y CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y +CONFIG_LOG_BUF_SHIFT=15 # # Loadable module support @@ -41,6 +41,7 @@ # CONFIG_HMT is not set # CONFIG_DISCONTIGMEM is not set # CONFIG_RTAS_FLASH is not set +CONFIG_PPC_RTAS=y # # General setup @@ -50,6 +51,7 @@ CONFIG_BINFMT_ELF=y CONFIG_BINFMT_ELF32=y # CONFIG_BINFMT_MISC is not set +CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y # CONFIG_HOTPLUG is not set CONFIG_PROC_DEVICETREE=y @@ -182,6 +184,11 @@ # CONFIG_I2O is not set # +# Networking support +# +CONFIG_NET=y + +# # Networking options # CONFIG_PACKET=y @@ -233,10 +240,6 @@ # Network testing # # CONFIG_NET_PKTGEN is not set - -# -# Network device support -# CONFIG_NETDEVICES=y # @@ -258,8 +261,6 @@ # CONFIG_SUNGEM is not set CONFIG_NET_VENDOR_3COM=y CONFIG_VORTEX=y -# CONFIG_NET_VENDOR_SMC is not set -# CONFIG_NET_VENDOR_RACAL is not set # # Tulip family network device support @@ -268,6 +269,7 @@ # CONFIG_HP100 is not set CONFIG_NET_PCI=y CONFIG_PCNET32=y +# CONFIG_AMD8111_ETH is not set # CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_B44 is not set # CONFIG_DGRS is not set @@ -283,7 +285,6 @@ # CONFIG_SUNDANCE is not set # CONFIG_TLAN is not set # CONFIG_VIA_RHINE is not set -# CONFIG_NET_POCKET is not set # # Ethernet (1000 Mbit) @@ -429,6 +430,11 @@ # CONFIG_QIC02_TAPE is not set # +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# # Watchdog Cards # # CONFIG_WATCHDOG is not set @@ -516,6 +522,7 @@ # CONFIG_NFSD_V4 is not set CONFIG_NFSD_TCP=y CONFIG_SUNRPC=y +# CONFIG_SUNRPC_GSS is not set CONFIG_LOCKD=y CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=y @@ -580,6 +587,7 @@ # CONFIG_FB_CLGEN is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set +CONFIG_FB_OF=y # CONFIG_FB_CT65550 is not set # CONFIG_FB_IMSTT is not set # CONFIG_FB_S3TRIO is not set diff -Nru a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile --- a/arch/ppc64/kernel/Makefile Sun Feb 9 21:13:36 2003 +++ b/arch/ppc64/kernel/Makefile Sun Feb 9 21:13:36 2003 @@ -4,8 +4,6 @@ EXTRA_CFLAGS += -mno-minimal-toc EXTRA_TARGETS := head.o -export-objs := ppc_ksyms.o - obj-y := setup.o entry.o traps.o irq.o idle.o \ time.o process.o signal.o syscalls.o misc.o ptrace.o \ align.o semaphore.o bitops.o stab.o htab.o pacaData.o \ @@ -25,9 +23,10 @@ # Change this to pSeries only once we've got iSeries up to date obj-y += open_pic.o xics.o pSeries_htab.o rtas.o \ - rtas-proc.o chrp_setup.o i8259.o ras.o prom.o + chrp_setup.o i8259.o ras.o prom.o obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_PROFILING) += profile.o obj-$(CONFIG_MODULES) += module.o ppc_ksyms.o +obj-$(CONFIG_PPC_RTAS) += rtas-proc.o diff -Nru a/arch/ppc64/kernel/entry.S b/arch/ppc64/kernel/entry.S --- a/arch/ppc64/kernel/entry.S Sun Feb 9 21:13:28 2003 +++ b/arch/ppc64/kernel/entry.S Sun Feb 9 21:13:28 2003 @@ -57,6 +57,7 @@ * Handle a system call. */ _GLOBAL(DoSyscall) + std r3,ORIG_GPR3(r1) ld r11,_CCR(r1) /* Clear SO bit in CR */ lis r10,0x1000 andc r11,r11,r10 @@ -226,6 +227,10 @@ _GLOBAL(ppc32_rt_sigreturn) bl .sys32_rt_sigreturn + b 80f + +_GLOBAL(ppc64_sigreturn) + bl .sys_sigreturn b 80f _GLOBAL(ppc64_rt_sigreturn) diff -Nru a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S --- a/arch/ppc64/kernel/head.S Sun Feb 9 21:13:32 2003 +++ b/arch/ppc64/kernel/head.S Sun Feb 9 21:13:32 2003 @@ -31,6 +31,7 @@ #include #include #include +#include #ifdef CONFIG_PPC_ISERIES #define DO_SOFT_DISABLE @@ -789,7 +790,6 @@ beq+ HardwareInterrupt_entry 1: #endif - std r3,ORIG_GPR3(r1) #ifdef DO_SOFT_DISABLE ld r20,SOFTE(r1) #else @@ -1141,9 +1141,9 @@ * If from user state, update THREAD.regs */ beq 2f /* Modify THREAD.regs if from user */ - addi r24,r1,STACK_FRAME_OVERHEAD + addi r23,r1,STACK_FRAME_OVERHEAD ld r22, PACACURRENT(r13) - std r24,THREAD+PT_REGS(r22) + std r23,THREAD+PT_REGS(r22) 2: SET_REG_TO_CONST(r22, MSR_KERNEL) diff -Nru a/arch/ppc64/kernel/htab.c b/arch/ppc64/kernel/htab.c --- a/arch/ppc64/kernel/htab.c Sun Feb 9 21:13:33 2003 +++ b/arch/ppc64/kernel/htab.c Sun Feb 9 21:13:33 2003 @@ -333,7 +333,7 @@ hpteflags, 0, large); /* Primary is full, try the secondary */ - if (slot == -1) { + if (unlikely(slot == -1)) { pte_val(new_pte) |= 1 << 15; hpte_group = ((~hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL; @@ -393,6 +393,7 @@ mm = &init_mm; vsid = get_kernel_vsid(ea); break; +#if 0 case EEH_REGION_ID: /* * Should only be hit if there is an access to MMIO space @@ -404,6 +405,7 @@ * Should never get here - entire 0xC0... region is bolted. * Send the problem up to do_page_fault */ +#endif default: /* Not a valid range * Send the problem up to do_page_fault diff -Nru a/arch/ppc64/kernel/init_task.c b/arch/ppc64/kernel/init_task.c --- a/arch/ppc64/kernel/init_task.c Sun Feb 9 21:13:29 2003 +++ b/arch/ppc64/kernel/init_task.c Sun Feb 9 21:13:29 2003 @@ -8,6 +8,7 @@ static struct fs_struct init_fs = INIT_FS; static struct files_struct init_files = INIT_FILES; static struct signal_struct init_signals = INIT_SIGNALS(init_signals); +static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); struct mm_struct init_mm = INIT_MM(init_mm); /* diff -Nru a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S --- a/arch/ppc64/kernel/misc.S Sun Feb 9 21:13:35 2003 +++ b/arch/ppc64/kernel/misc.S Sun Feb 9 21:13:35 2003 @@ -443,26 +443,61 @@ * kernel_thread(fn, arg, flags) */ _GLOBAL(kernel_thread) - /* XXX fix this when we optimise syscall entry to not save volatiles */ - mr r6,r3 /* function */ - mr r7,r4 /* arg */ + std r29,-24(r1) + std r30,-16(r1) + stdu r1,-STACK_FRAME_OVERHEAD(r1) + mr r29,r3 + mr r30,r4 ori r3,r5,CLONE_VM /* flags */ oris r3,r3,(CLONE_UNTRACED>>16) li r4,0 /* new sp (unused) */ li r0,__NR_clone sc cmpi 0,r3,0 /* parent or child? */ - bnelr /* return if parent */ + bne 1f /* return if parent */ li r0,0 stdu r0,-STACK_FRAME_OVERHEAD(r1) - ld r2,8(r6) - ld r6,0(r6) - mtlr r6 /* fn addr in lr */ - mr r3,r7 /* load arg and call fn */ + ld r2,8(r29) + ld r29,0(r29) + mtlr r29 /* fn addr in lr */ + mr r3,r30 /* load arg and call fn */ blrl li r0,__NR_exit /* exit after child exits */ li r3,0 sc +1: addi r1,r1,STACK_FRAME_OVERHEAD + ld r29,-24(r1) + ld r30,-16(r1) + blr + + .section ".toc","aw" +.SYSCALL_ERRNO: + .tc errno[TC],errno + + .section ".text" + .align 3 + +#define SYSCALL(name) \ +_GLOBAL(name) \ + li r0,__NR_##name; \ + sc; \ + bnslr; \ + ld r4,.SYSCALL_ERRNO@toc(2); \ + std r3,0(r4); \ + li r3,-1; \ + blr + +#define __NR__exit __NR_exit + +SYSCALL(setsid) +SYSCALL(open) +SYSCALL(read) +SYSCALL(write) +SYSCALL(lseek) +SYSCALL(close) +SYSCALL(dup) +SYSCALL(execve) +SYSCALL(waitpid) #ifdef CONFIG_BINFMT_ELF32 /* Why isn't this a) automatic, b) written in 'C'? */ @@ -540,8 +575,8 @@ .llong .sys32_ssetmask .llong .sys_setreuid /* 70 */ .llong .sys_setregid - .llong .sys32_sigsuspend - .llong .sys32_sigpending + .llong .sys_sigsuspend + .llong .compat_sys_sigpending .llong .sys32_sethostname .llong .sys32_setrlimit /* 75 */ .llong .sys32_old_getrlimit @@ -594,7 +629,7 @@ .llong .sys_ni_syscall /* old modify_ldt syscall */ .llong .sys32_adjtimex .llong .sys_mprotect /* 125 */ - .llong .sys32_sigprocmask + .llong .compat_sys_sigprocmask .llong .sys_ni_syscall /* old create_module syscall */ .llong .sys32_init_module .llong .sys32_delete_module @@ -783,13 +818,13 @@ .llong .sys_getppid .llong .sys_getpgrp /* 65 */ .llong .sys_setsid - .llong .sys_ni_syscall /* 32 bit only sigaction */ + .llong .sys_sigaction .llong .sys_sgetmask .llong .sys_ssetmask .llong .sys_setreuid /* 70 */ .llong .sys_setregid - .llong .sys_ni_syscall /* 32bit only sigsuspend */ - .llong .sys_ni_syscall /* 32bit only sigpending */ + .llong .sys_sigsuspend + .llong .sys_sigpending .llong .sys_sethostname .llong .sys_setrlimit /* 75 */ .llong .sys_ni_syscall /* old getrlimit syscall */ @@ -835,14 +870,14 @@ .llong .sys_sysinfo .llong .sys_ipc .llong .sys_fsync - .llong .sys_ni_syscall /* 32bit only sigreturn */ + .llong .ppc64_sigreturn .llong .sys_clone /* 120 */ .llong .sys_setdomainname .llong .ppc64_newuname .llong .sys_ni_syscall /* old modify_ldt syscall */ .llong .sys_adjtimex .llong .sys_mprotect /* 125 */ - .llong .sys_ni_syscall /* 32bit only sigprocmask */ + .llong .sys_sigprocmask .llong .sys_ni_syscall /* old create_module syscall */ .llong .sys_init_module .llong .sys_delete_module diff -Nru a/arch/ppc64/kernel/module.c b/arch/ppc64/kernel/module.c --- a/arch/ppc64/kernel/module.c Sun Feb 9 21:13:36 2003 +++ b/arch/ppc64/kernel/module.c Sun Feb 9 21:13:36 2003 @@ -136,6 +136,20 @@ return relocs * sizeof(struct ppc64_stub_entry); } +/* Undefined symbols which refer to .funcname, hack to funcname */ +static void dedotify(Elf64_Sym *syms, unsigned int numsyms, char *strtab) +{ + unsigned int i; + + for (i = 1; i < numsyms; i++) { + if (syms[i].st_shndx == SHN_UNDEF) { + char *name = strtab + syms[i].st_name; + if (name[0] == '.') + memmove(name, name+1, strlen(name)); + } + } +} + int module_frob_arch_sections(Elf64_Ehdr *hdr, Elf64_Shdr *sechdrs, char *secstrings, @@ -143,7 +157,7 @@ { unsigned int i; - /* Find .toc and .stubs sections */ + /* Find .toc and .stubs sections, symtab and strtab */ for (i = 1; i < hdr->e_shnum; i++) { char *p; if (strcmp(secstrings + sechdrs[i].sh_name, ".stubs") == 0) @@ -154,6 +168,12 @@ /* We don't handle .init for the moment: rename to _init */ while ((p = strstr(secstrings + sechdrs[i].sh_name, ".init"))) p[0] = '_'; + + if (sechdrs[i].sh_type == SHT_SYMTAB) + dedotify((void *)hdr + sechdrs[i].sh_offset, + sechdrs[i].sh_size / sizeof(Elf64_Sym), + (void *)hdr + + sechdrs[sechdrs[i].sh_link].sh_offset); } if (!me->arch.stubs_section || !me->arch.toc_section) { printk("%s: doesn't contain .toc or .stubs.\n", me->name); @@ -175,6 +195,14 @@ return -ENOEXEC; } +/* r2 is the TOC pointer: it actually points 0x8000 into the TOC (this + gives the value maximum span in an instruction which uses a signed + offset) */ +static inline unsigned long my_r2(Elf64_Shdr *sechdrs, struct module *me) +{ + return sechdrs[me->arch.toc_section].sh_addr + 0x8000; +} + /* Both low and high 16 bits are added as SIGNED additions, so if low 16 bits has high bit set, high 16 bits must be adjusted. These macros do that (stolen from binutils). */ @@ -183,10 +211,10 @@ #define PPC_HA(v) PPC_HI ((v) + 0x8000) /* Patch stub to reference function and correct r2 value. */ -static inline int create_stub(struct ppc64_stub_entry *entry, - unsigned long my_r2, - unsigned long func, - unsigned long r2) +static inline int create_stub(Elf64_Shdr *sechdrs, + struct ppc64_stub_entry *entry, + struct ppc64_opd_entry *opd, + struct module *me) { Elf64_Half *loc1, *loc2; long reladdr; @@ -196,72 +224,32 @@ loc1 = (Elf64_Half *)&entry->jump[2]; loc2 = (Elf64_Half *)&entry->jump[6]; - /* Stub uses address relative to r2, which is set to the TOC + - 0x8000. */ - reladdr = (unsigned long)entry - my_r2; + /* Stub uses address relative to r2. */ + reladdr = (unsigned long)entry - my_r2(sechdrs, me); if (reladdr > 0x7FFFFFFF || reladdr < -(0x80000000L)) { - printk("Address %p of stub out of range of %p.\n", - (void *)reladdr, (void *)my_r2); + printk("%s: Address %p of stub out of range of %p.\n", + me->name, (void *)reladdr, (void *)my_r2); return 0; } DEBUGP("Stub %p get data from reladdr %li\n", entry, reladdr); *loc1 = PPC_HA(reladdr); *loc2 = PPC_LO(reladdr); - entry->opd.funcaddr = func; - entry->opd.r2 = r2; - - DEBUGP("Stub: %08X %08X %08X %08X %08X %08X %08X: %p %p\n", - ((unsigned int *)entry->jump)[0], - ((unsigned int *)entry->jump)[1], - ((unsigned int *)entry->jump)[2], - ((unsigned int *)entry->jump)[3], - ((unsigned int *)entry->jump)[4], - ((unsigned int *)entry->jump)[5], - ((unsigned int *)entry->jump)[6], - (void *)entry->opd.funcaddr, - (void *)entry->opd.r2); + entry->opd.funcaddr = opd->funcaddr; + entry->opd.r2 = opd->r2; return 1; } -/* Given ".function" reference, return address of "function" opd entry */ -static struct ppc64_opd_entry *find_function(const char *name, - Elf64_Shdr *sechdrs, - unsigned int symindex, - const char *strtab, - struct module *me, - struct kernel_symbol_group **ksg) -{ - unsigned long val; - - if (name[0] != '.') - return 0; - - val = find_symbol_internal(sechdrs, symindex, strtab, name+1, me, ksg); - - DEBUGP("Function %s is at %p\n", name+1, (void *)val); - return (void *)val; -} - -/* r2 is the TOC pointer: it actually points 0x8000 into the TOC (this - gives the value maximum span in an instruction which uses a signed - offset) */ -static inline unsigned long my_r2(Elf64_Shdr *sechdrs, struct module *me) -{ - return sechdrs[me->arch.toc_section].sh_addr + 0x8000; -} - -/* Create stub for this OPD address */ +/* Create stub to jump to function described in this OPD: we need the + stub to set up the TOC ptr (r2) for the function. */ static unsigned long stub_for_addr(Elf64_Shdr *sechdrs, - unsigned long addr, - unsigned long r2, + unsigned long opdaddr, struct module *me) { struct ppc64_stub_entry *stubs; + struct ppc64_opd_entry *opd = (void *)opdaddr; unsigned int i, num_stubs; - DEBUGP("Looking for stub for %p\n", (void *)addr); - num_stubs = sechdrs[me->arch.stubs_section].sh_size / sizeof(*stubs); /* Find this stub, or if that fails, the next avail. entry */ @@ -269,50 +257,23 @@ for (i = 0; stubs[i].opd.funcaddr; i++) { BUG_ON(i >= num_stubs); - if (stubs[i].opd.funcaddr == addr) { - DEBUGP("Reusing stub %u (%p) for %p\n", - i, &stubs[i], (void *)addr); + if (stubs[i].opd.funcaddr == opd->funcaddr) return (unsigned long)&stubs[i]; - } } - DEBUGP("Here for %p\n", (void *)addr); - - if (!create_stub(&stubs[i], my_r2(sechdrs, me), addr, r2)) - return (unsigned long)-EINVAL; - DEBUGP("CREATED stub %u for %p\n", i, (void *)addr); + if (!create_stub(sechdrs, &stubs[i], opd, me)) + return 0; return (unsigned long)&stubs[i]; } -/* We need a stub to set the toc ptr when we make external calls. */ -static unsigned long do_stub_call(Elf64_Shdr *sechdrs, - const char *strtab, - unsigned int symindex, - void *location, - const char *funcname, - struct module *me) -{ - struct ppc64_opd_entry *opd; - struct kernel_symbol_group *ksg; - - DEBUGP("Doing stub for %lu (%s)\n", - (unsigned long)location, funcname); - opd = find_function(funcname, sechdrs, symindex, strtab, me, &ksg); - if (!opd) { - printk("%s: Can't find function `%s'\n", me->name, funcname); - return (unsigned long)-ENOENT; - } - - return stub_for_addr(sechdrs, opd->funcaddr, opd->r2, me); -} - /* We expect a noop next: if it is, replace it with instruction to restore r2. */ -static int restore_r2(u32 *instruction) +static int restore_r2(u32 *instruction, struct module *me) { if (*instruction != 0x60000000) { - printk("Expect noop after relocate, got %08x\n", *instruction); + printk("%s: Expect noop after relocate, got %08x\n", + me->name, *instruction); return 0; } *instruction = 0xe8410028; /* ld r2,40(r1) */ @@ -346,31 +307,18 @@ strtab + sym->st_name, (unsigned long)sym->st_value, (long)rela[i].r_addend); - /* REL24 references to (external) .function won't - resolve; deal with that below */ - if (!sym->st_value - && ELF64_R_TYPE(rela[i].r_info) != R_PPC_REL24) { - printk("%s: Unknown symbol %s (index %u)\n", - me->name, strtab + sym->st_name, - sym->st_shndx); - return -ENOENT; - } /* `Everything is relative'. */ value = sym->st_value + rela[i].r_addend; switch (ELF64_R_TYPE(rela[i].r_info)) { case R_PPC64_ADDR32: /* Simply set it */ - DEBUGP("Setting location %p to 32-bit value %u\n", - location, (unsigned int)value); *(u32 *)location = value; break; case R_PPC64_ADDR64: /* Simply set it */ *(unsigned long *)location = value; - DEBUGP("Setting location %p to 64-bit value %p\n", - location, (void *)value); break; case R_PPC64_TOC: @@ -381,37 +329,31 @@ /* Subtact TOC pointer */ value -= my_r2(sechdrs, me); if ((value & 3) != 0 || value + 0x8000 > 0xffff) { - DEBUGP("%s: bad TOC16_DS relocation (%lu)\n", + printk("%s: bad TOC16_DS relocation (%lu)\n", me->name, value); return -ENOEXEC; } *((uint16_t *) location) = (*((uint16_t *) location) & ~0xfffc) | (value & 0xfffc); - DEBUGP("Modifying location %p by TOC (%p) => %i\n", - location, - (void *)my_r2(sechdrs, me), - *(uint16_t *)location); break; case R_PPC_REL24: /* FIXME: Handle weak symbols here --RR */ if (sym->st_shndx == SHN_UNDEF) { - value = do_stub_call(sechdrs, strtab, - symindex, location, - strtab+sym->st_name, me); - if (IS_ERR((void *)value)) - return value; - value += rela[i].r_addend; - if (!restore_r2((u32 *)location + 1)) + /* External: go via stub */ + value = stub_for_addr(sechdrs, value, me); + if (!value) + return -ENOENT; + if (!restore_r2((u32 *)location + 1, me)) return -ENOEXEC; } /* Convert value to relative */ value -= (unsigned long)location; if (value + 0x2000000 > 0x3ffffff || (value & 3) != 0){ - printk("REL24 relocation %li out of range!\n", - (long int)value); + printk("%s: REL24 %li out of range!\n", + me->name, (long int)value); return -ENOEXEC; } @@ -422,7 +364,8 @@ break; default: - printk("Unknown ADD relocation: %lu\n", + printk("%s: Unknown ADD relocation: %lu\n", + me->name, (unsigned long)ELF64_R_TYPE(rela[i].r_info)); return -ENOEXEC; } @@ -439,25 +382,6 @@ const Elf_Shdr *sechdrs, struct module *me) { - struct ppc64_stub_entry *stubs; - unsigned int i; - - /* Here is where we copy the OPD entry into the stub: we don't - do it ealier in case it's actually in the same module, and - hasn't been relocated yet. */ - stubs = (void *)sechdrs[me->arch.stubs_section].sh_addr; - for (i = 0; stubs[i].opd.funcaddr; i++) { - struct ppc64_opd_entry *opd; - - /* We mark opd pointers by setting r2 to 0: otherwise - it's a function pointer already. */ - if (stubs[i].opd.r2 == 0) { - /* We put the opd entry ptr in the funcaddr member. */ - opd = (void *)stubs[i].opd.funcaddr; - stubs[i].opd = *opd; - } - } - sort_ex_table(me->extable.entry, me->extable.entry + me->extable.num_entries); return 0; diff -Nru a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c --- a/arch/ppc64/kernel/pci.c Sun Feb 9 21:13:35 2003 +++ b/arch/ppc64/kernel/pci.c Sun Feb 9 21:13:35 2003 @@ -413,7 +413,7 @@ next_busno = hose->last_busno+1; } - /* Call machine dependant fixup */ + /* Call machine dependent fixup */ if (ppc_md.pcibios_fixup) { ppc_md.pcibios_fixup(); } diff -Nru a/arch/ppc64/kernel/process.c b/arch/ppc64/kernel/process.c --- a/arch/ppc64/kernel/process.c Sun Feb 9 21:13:33 2003 +++ b/arch/ppc64/kernel/process.c Sun Feb 9 21:13:33 2003 @@ -163,6 +163,11 @@ void flush_thread(void) { + struct thread_info *t = current_thread_info(); + + if (t->flags & _TIF_ABI_PENDING) + t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT); + if (last_task_used_math == current) last_task_used_math = NULL; } diff -Nru a/arch/ppc64/kernel/rtas-proc.c b/arch/ppc64/kernel/rtas-proc.c --- a/arch/ppc64/kernel/rtas-proc.c Sun Feb 9 21:13:32 2003 +++ b/arch/ppc64/kernel/rtas-proc.c Sun Feb 9 21:13:32 2003 @@ -115,9 +115,10 @@ /* Globals */ -static struct proc_dir_entry *proc_rtas; +extern struct proc_dir_entry *proc_rtas; + static struct rtas_sensors sensors; -static struct device_node *rtas_node; +static struct device_node *rtas_node = NULL; static unsigned long power_on_time = 0; /* Save the time the user set */ static char progress_led[MAX_LINELENGTH]; @@ -200,13 +201,18 @@ struct proc_dir_entry *entry; rtas_node = find_devices("rtas"); - if ((rtas_node == 0) || (naca->platform == PLATFORM_ISERIES_LPAR)) { + if ((rtas_node == NULL) || (naca->platform == PLATFORM_ISERIES_LPAR)) { return; } - proc_rtas = proc_mkdir("rtas", 0); - if (proc_rtas == 0) + if (proc_rtas == NULL) { + proc_rtas = proc_mkdir("rtas", 0); + } + + if (proc_rtas == NULL) { + printk(KERN_ERR "Failed to create /proc/rtas in proc_rtas_init\n"); return; + } /* /proc/rtas entries */ @@ -405,10 +411,14 @@ j = sensors.sensor[i].quant; /* A sensor may have multiple instances */ while (j >= 0) { + error = rtas_call(get_sensor_state, 2, 2, &ret, - sensors.sensor[i].token, sensors.sensor[i].quant-j); + sensors.sensor[i].token, + sensors.sensor[i].quant - j); + state = (int) ret; - n += ppc_rtas_process_sensor(sensors.sensor[i], state, error, buffer+n ); + n += ppc_rtas_process_sensor(sensors.sensor[i], state, + error, buffer+n ); n += sprintf (buffer+n, "\n"); j--; } /* while */ @@ -426,6 +436,7 @@ n = count; else *eof = 1; + memcpy(buf, buffer + off, n); *start = buf; kfree(buffer); @@ -436,10 +447,10 @@ int ppc_rtas_find_all_sensors (void) { - unsigned long *utmp; - int len, i, j; + unsigned int *utmp; + int len, i; - utmp = (unsigned long *) get_property(rtas_node, "rtas-sensors", &len); + utmp = (unsigned int *) get_property(rtas_node, "rtas-sensors", &len); if (utmp == NULL) { printk (KERN_ERR "error: could not get rtas-sensors\n"); return 1; @@ -447,9 +458,9 @@ sensors.quant = len / 8; /* int + int */ - for (i=0, j=0; jproc_fops = &proc_rtas_log_operations; else diff -Nru a/arch/ppc64/kernel/signal.c b/arch/ppc64/kernel/signal.c --- a/arch/ppc64/kernel/signal.c Sun Feb 9 21:13:28 2003 +++ b/arch/ppc64/kernel/signal.c Sun Feb 9 21:13:28 2003 @@ -99,6 +99,40 @@ extern int do_signal(sigset_t *oldset, struct pt_regs *regs); +/* + * Atomically swap in the new signal mask, and wait for a signal. + */ +long sys_sigsuspend(old_sigset_t mask, int p2, int p3, int p4, int p6, int p7, + struct pt_regs *regs) +{ + sigset_t saveset; + + mask &= _BLOCKABLE; + spin_lock_irq(¤t->sighand->siglock); + saveset = current->blocked; + siginitset(¤t->blocked, mask); + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); + + regs->result = -EINTR; + regs->gpr[3] = EINTR; + regs->ccr |= 0x10000000; + while (1) { + current->state = TASK_INTERRUPTIBLE; + schedule(); + if (do_signal(&saveset, regs)) + /* + * If a signal handler needs to be called, + * do_signal() has set R3 to the signal number (the + * first argument of the signal handler), so don't + * overwrite that with EINTR ! + * In the other cases, do_signal() doesn't touch + * R3, so it's still set to -EINTR (see above). + */ + return regs->gpr[3]; + } +} + long sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, int p3, int p4, int p6, int p7, struct pt_regs *regs) { @@ -112,11 +146,11 @@ return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->result = -EINTR; regs->gpr[3] = EINTR; @@ -136,6 +170,37 @@ return do_sigaltstack(uss, uoss, regs->gpr[1]); } +long sys_sigaction(int sig, const struct old_sigaction *act, + struct old_sigaction *oact) +{ + struct k_sigaction new_ka, old_ka; + int ret; + + if (act) { + old_sigset_t mask; + + if (verify_area(VERIFY_READ, act, sizeof(*act)) || + __get_user(new_ka.sa.sa_handler, &act->sa_handler) || + __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) + return -EFAULT; + __get_user(new_ka.sa.sa_flags, &act->sa_flags); + __get_user(mask, &act->sa_mask); + siginitset(&new_ka.sa.sa_mask, mask); + } + + ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); + if (!ret && oact) { + if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || + __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || + __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) + return -EFAULT; + __put_user(old_ka.sa.sa_flags, &oact->sa_flags); + __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); + } + + return ret; +} + /* * When we have rt signals to deliver, we set up on the * user stack, going down from the original stack pointer: @@ -164,10 +229,10 @@ || copy_from_user(&st, &rt_sf->uc.uc_stack, sizeof(st))) goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (regs->msr & MSR_FP) giveup_fpu(current); @@ -264,6 +329,116 @@ } /* + * Do a signal return; undo the signal stack. + */ +long sys_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, + unsigned long r6, unsigned long r7, unsigned long r8, + struct pt_regs *regs) +{ + struct sigcontext *sc, sigctx; + struct sigregs *sr; + elf_gregset_t saved_regs; /* an array of ELF_NGREG unsigned longs */ + sigset_t set; + + sc = (struct sigcontext *)(regs->gpr[1] + __SIGNAL_FRAMESIZE); + if (copy_from_user(&sigctx, sc, sizeof(sigctx))) + goto badframe; + + set.sig[0] = sigctx.oldmask; +#if _NSIG_WORDS > 1 + set.sig[1] = sigctx._unused[3]; +#endif + sigdelsetmask(&set, ~_BLOCKABLE); + spin_lock_irq(¤t->sighand->siglock); + current->blocked = set; + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); + if (regs->msr & MSR_FP) + giveup_fpu(current); + + /* restore registers */ + sr = (struct sigregs *)sigctx.regs; + if (copy_from_user(saved_regs, &sr->gp_regs, sizeof(sr->gp_regs))) + goto badframe; + saved_regs[PT_MSR] = (regs->msr & ~MSR_USERCHANGE) + | (saved_regs[PT_MSR] & MSR_USERCHANGE); + saved_regs[PT_SOFTE] = regs->softe; + memcpy(regs, saved_regs, GP_REGS_SIZE); + + if (copy_from_user(current->thread.fpr, &sr->fp_regs, + sizeof(sr->fp_regs))) + goto badframe; + + return regs->result; + +badframe: + do_exit(SIGSEGV); +} + +/* + * Set up a signal frame. + */ +static void setup_frame(struct pt_regs *regs, struct sigregs *frame, + unsigned long newsp) +{ + + /* Handler is *really* a pointer to the function descriptor for + * the signal routine. The first entry in the function + * descriptor is the entry address of signal and the second + * entry is the TOC value we need to use. + */ + struct funct_descr_entry { + unsigned long entry; + unsigned long toc; + }; + + struct funct_descr_entry * funct_desc_ptr; + unsigned long temp_ptr; + + struct sigcontext *sc = (struct sigcontext *)newsp; + + if (verify_area(VERIFY_WRITE, frame, sizeof(*frame))) + goto badframe; + if (regs->msr & MSR_FP) + giveup_fpu(current); + if (__copy_to_user(&frame->gp_regs, regs, GP_REGS_SIZE) + || __copy_to_user(&frame->fp_regs, current->thread.fpr, + ELF_NFPREG * sizeof(double)) + /* li r0, __NR_sigreturn */ + || __put_user(0x38000000UL + __NR_sigreturn, &frame->tramp[0]) + /* sc */ + || __put_user(0x44000002UL, &frame->tramp[1])) + goto badframe; + flush_icache_range((unsigned long)&frame->tramp[0], + (unsigned long)&frame->tramp[2]); + current->thread.fpscr = 0; /* turn off all fp exceptions */ + + newsp -= __SIGNAL_FRAMESIZE; + if (get_user(temp_ptr, &sc->handler)) + goto badframe; + + funct_desc_ptr = (struct funct_descr_entry *)temp_ptr; + + if (put_user(regs->gpr[1], (unsigned long *)newsp) + || get_user(regs->nip, &funct_desc_ptr ->entry) + || get_user(regs->gpr[2],&funct_desc_ptr->toc) + || get_user(regs->gpr[3], &sc->signal)) + goto badframe; + regs->gpr[1] = newsp; + regs->gpr[4] = (unsigned long)sc; + regs->link = (unsigned long)frame->tramp; + + return; + +badframe: +#if DEBUG_SIG + printk("badframe in setup_frame, regs=%p frame=%p newsp=%lx\n", + regs, frame, newsp); +#endif + do_exit(SIGSEGV); +} + +/* * OK, we're invoking a handler */ static void handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset, @@ -271,7 +446,7 @@ { struct sigcontext *sc; struct rt_sigframe *rt_sf; - struct k_sigaction *ka = ¤t->sig->action[sig-1]; + struct k_sigaction *ka = ¤t->sighand->action[sig-1]; if (regs->trap == 0x0C00 /* System Call! */ && ((int)regs->result == -ERESTARTNOHAND || @@ -333,11 +508,11 @@ ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked,sig); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } return; @@ -378,7 +553,7 @@ signr = get_signal_to_deliver(&info, regs); if (signr > 0) { - ka = ¤t->sig->action[signr-1]; + ka = ¤t->sighand->action[signr-1]; if ((ka->sa.sa_flags & SA_ONSTACK) && (!on_sig_stack(regs->gpr[1]))) newsp = (current->sas_ss_sp + current->sas_ss_size); @@ -407,7 +582,10 @@ if (newsp == frame) return 0; /* no signals delivered */ - setup_rt_frame(regs, (struct sigregs *)frame, newsp); - + /* Invoke correct stack setup routine */ + if (ka->sa.sa_flags & SA_SIGINFO) + setup_rt_frame(regs, (struct sigregs *)frame, newsp); + else + setup_frame(regs, (struct sigregs *)frame, newsp); return 1; } diff -Nru a/arch/ppc64/kernel/signal32.c b/arch/ppc64/kernel/signal32.c --- a/arch/ppc64/kernel/signal32.c Sun Feb 9 21:13:36 2003 +++ b/arch/ppc64/kernel/signal32.c Sun Feb 9 21:13:36 2003 @@ -104,8 +104,6 @@ * * System Calls * sigaction sys32_sigaction - * sigpending sys32_sigpending - * sigprocmask sys32_sigprocmask * sigreturn sys32_sigreturn * * Note sigsuspend has no special 32 bit routine - uses the 64 bit routine @@ -114,43 +112,6 @@ * setup_frame32 */ -/* - * Atomically swap in the new signal mask, and wait for a signal. - */ - -extern int do_signal(sigset_t *oldset, struct pt_regs *regs); - -long sys32_sigsuspend(old_sigset_t mask, int p2, int p3, int p4, int p6, - int p7, struct pt_regs *regs) -{ - sigset_t saveset; - - mask &= _BLOCKABLE; - spin_lock_irq(¤t->sig->siglock); - saveset = current->blocked; - siginitset(¤t->blocked, mask); - recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); - - regs->result = -EINTR; - regs->gpr[3] = EINTR; - regs->ccr |= 0x10000000; - while (1) { - current->state = TASK_INTERRUPTIBLE; - schedule(); - if (do_signal(&saveset, regs)) - /* - * If a signal handler needs to be called, - * do_signal() has set R3 to the signal number (the - * first argument of the signal handler), so don't - * overwrite that with EINTR ! - * In the other cases, do_signal() doesn't touch - * R3, so it's still set to -EINTR (see above). - */ - return regs->gpr[3]; - } -} - long sys32_sigaction(int sig, struct old_sigaction32 *act, struct old_sigaction32 *oact) { @@ -161,7 +122,7 @@ sig = -sig; if (act) { - old_sigset_t32 mask; + compat_old_sigset_t mask; if (get_user((long)new_ka.sa.sa_handler, &act->sa_handler) || __get_user((long)new_ka.sa.sa_restorer, &act->sa_restorer) || @@ -184,54 +145,6 @@ } -extern long sys_sigpending(old_sigset_t *set); - -long sys32_sigpending(old_sigset_t32 *set) -{ - old_sigset_t s; - int ret; - mm_segment_t old_fs = get_fs(); - - set_fs(KERNEL_DS); - ret = sys_sigpending(&s); - set_fs(old_fs); - if (put_user(s, set)) - return -EFAULT; - return ret; -} - - -extern long sys_sigprocmask(int how, old_sigset_t *set, - old_sigset_t *oset); - -/* - * Note: it is necessary to treat how as an unsigned int, with the - * corresponding cast to a signed int to insure that the proper - * conversion (sign extension) between the register representation - * of a signed int (msr in 32-bit mode) and the register representation - * of a signed int (msr in 64-bit mode) is performed. - */ -long sys32_sigprocmask(u32 how, old_sigset_t32 *set, - old_sigset_t32 *oset) -{ - old_sigset_t s; - int ret; - mm_segment_t old_fs = get_fs(); - - if (set && get_user(s, set)) - return -EFAULT; - set_fs(KERNEL_DS); - ret = sys_sigprocmask((int)how, set ? &s : NULL, oset ? &s : NULL); - set_fs(old_fs); - if (ret) - return ret; - if (oset && put_user (s, oset)) - return -EFAULT; - return 0; -} - - - /* * When we have signals to deliver, we set up on the * user stack, going down from the original stack pointer: @@ -268,10 +181,10 @@ */ set.sig[0] = sigctx.oldmask + ((long)(sigctx._unused[3]) << 32); sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (regs->msr & MSR_FP ) giveup_fpu(current); /* Last stacked signal - restore registers */ @@ -487,10 +400,10 @@ */ sigdelsetmask(&set, ~_BLOCKABLE); /* update the current based on the sigmask found in the rt_stackframe */ - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); /* If currently owning the floating point - give them up */ if (regs->msr & MSR_FP) @@ -565,16 +478,16 @@ { struct k_sigaction new_ka, old_ka; int ret; - sigset32_t set32; + compat_sigset_t set32; /* XXX: Don't preclude handling different sized sigset_t's. */ - if (sigsetsize != sizeof(sigset32_t)) + if (sigsetsize != sizeof(compat_sigset_t)) return -EINVAL; if (act) { ret = get_user((long)new_ka.sa.sa_handler, &act->sa_handler); ret |= __copy_from_user(&set32, &act->sa_mask, - sizeof(sigset32_t)); + sizeof(compat_sigset_t)); switch (_NSIG_WORDS) { case 4: new_ka.sa.sa_mask.sig[3] = set32.sig[6] | (((long)set32.sig[7]) << 32); @@ -608,7 +521,7 @@ } ret = put_user((long)old_ka.sa.sa_handler, &oact->sa_handler); ret |= __copy_to_user(&oact->sa_mask, &set32, - sizeof(sigset32_t)); + sizeof(compat_sigset_t)); ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); } return ret; @@ -625,16 +538,16 @@ * of a signed int (msr in 32-bit mode) and the register representation * of a signed int (msr in 64-bit mode) is performed. */ -long sys32_rt_sigprocmask(u32 how, sigset32_t *set, - sigset32_t *oset, size_t sigsetsize) +long sys32_rt_sigprocmask(u32 how, compat_sigset_t *set, + compat_sigset_t *oset, size_t sigsetsize) { sigset_t s; - sigset32_t s32; + compat_sigset_t s32; int ret; mm_segment_t old_fs = get_fs(); if (set) { - if (copy_from_user (&s32, set, sizeof(sigset32_t))) + if (copy_from_user (&s32, set, sizeof(compat_sigset_t))) return -EFAULT; switch (_NSIG_WORDS) { @@ -658,7 +571,7 @@ case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1]; case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0]; } - if (copy_to_user (oset, &s32, sizeof(sigset32_t))) + if (copy_to_user (oset, &s32, sizeof(compat_sigset_t))) return -EFAULT; } return 0; @@ -668,10 +581,10 @@ extern long sys_rt_sigpending(sigset_t *set, size_t sigsetsize); -long sys32_rt_sigpending(sigset32_t *set, compat_size_t sigsetsize) +long sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize) { sigset_t s; - sigset32_t s32; + compat_sigset_t s32; int ret; mm_segment_t old_fs = get_fs(); @@ -685,7 +598,7 @@ case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1]; case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0]; } - if (copy_to_user (set, &s32, sizeof(sigset32_t))) + if (copy_to_user (set, &s32, sizeof(compat_sigset_t))) return -EFAULT; } return ret; @@ -739,17 +652,17 @@ siginfo_t *uinfo, const struct timespec *uts, size_t sigsetsize); -long sys32_rt_sigtimedwait(sigset32_t *uthese, siginfo_t32 *uinfo, +long sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo, struct compat_timespec *uts, compat_size_t sigsetsize) { sigset_t s; - sigset32_t s32; + compat_sigset_t s32; struct timespec t; int ret; mm_segment_t old_fs = get_fs(); siginfo_t info; - if (copy_from_user(&s32, uthese, sizeof(sigset32_t))) + if (copy_from_user(&s32, uthese, sizeof(compat_sigset_t))) return -EFAULT; switch (_NSIG_WORDS) { case 4: s.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32); @@ -837,11 +750,11 @@ return ret; } -int sys32_rt_sigsuspend(sigset32_t* unewset, size_t sigsetsize, int p3, +int sys32_rt_sigsuspend(compat_sigset_t* unewset, size_t sigsetsize, int p3, int p4, int p6, int p7, struct pt_regs *regs) { sigset_t saveset, newset; - sigset32_t s32; + compat_sigset_t s32; /* XXX: Don't preclude handling different sized sigset_t's. */ if (sigsetsize != sizeof(sigset_t)) @@ -863,11 +776,11 @@ sigdelsetmask(&newset, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->result = -EINTR; regs->gpr[3] = EINTR; @@ -991,7 +904,7 @@ { struct sigcontext32 *sc; struct rt_sigframe_32 *rt_sf; - struct k_sigaction *ka = ¤t->sig->action[sig-1]; + struct k_sigaction *ka = ¤t->sighand->action[sig-1]; if (regs->trap == 0x0C00 /* System Call! */ && ((int)regs->result == -ERESTARTNOHAND || @@ -1055,11 +968,11 @@ ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked,sig); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } return; @@ -1152,7 +1065,7 @@ signr = get_signal_to_deliver(&info, regs); if (signr > 0) { - ka = ¤t->sig->action[signr-1]; + ka = ¤t->sighand->action[signr-1]; if ((ka->sa.sa_flags & SA_ONSTACK) && (!on_sig_stack(regs->gpr[1]))) newsp = (current->sas_ss_sp + current->sas_ss_size); diff -Nru a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c --- a/arch/ppc64/kernel/smp.c Sun Feb 9 21:13:34 2003 +++ b/arch/ppc64/kernel/smp.c Sun Feb 9 21:13:34 2003 @@ -494,8 +494,10 @@ while (atomic_read(&data.started) != cpus) { HMT_low(); if (--timeout == 0) { +#ifdef CONFIG_DEBUG_KERNEL if (debugger) debugger(0); +#endif printk("smp_call_function on cpu %d: other cpus not " "responding (%d)\n", smp_processor_id(), atomic_read(&data.started)); @@ -508,8 +510,10 @@ while (atomic_read(&data.finished) != cpus) { HMT_low(); if (--timeout == 0) { +#ifdef CONFIG_DEBUG_KERNEL if (debugger) debugger(0); +#endif printk("smp_call_function on cpu %d: other " "cpus not finishing (%d/%d)\n", smp_processor_id(), diff -Nru a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c --- a/arch/ppc64/kernel/sys_ppc32.c Sun Feb 9 21:13:34 2003 +++ b/arch/ppc64/kernel/sys_ppc32.c Sun Feb 9 21:13:34 2003 @@ -2756,10 +2756,27 @@ __get_user(kcmsg32->cmsg_type, &ucmsg->cmsg_type); clen64 = kcmsg32->cmsg_len; - copy_from_user(CMSG32_DATA(kcmsg32), CMSG_DATA(ucmsg), - clen64 - CMSG_ALIGN(sizeof(*ucmsg))); - clen32 = ((clen64 - CMSG_ALIGN(sizeof(*ucmsg))) + - CMSG32_ALIGN(sizeof(struct cmsghdr32))); + if (kcmsg32->cmsg_level == SOL_SOCKET && + kcmsg32->cmsg_type == SO_TIMESTAMP) { + struct timeval tv; + struct compat_timeval *tv32; + + if (clen64 != CMSG_LEN(sizeof(struct timeval))) { + kfree(workbuf); + goto fail; + } + copy_from_user(&tv, CMSG_DATA(ucmsg), sizeof(tv)); + tv32 = (struct compat_timeval *) CMSG32_DATA(kcmsg32); + tv32->tv_sec = tv.tv_sec; + tv32->tv_usec = tv.tv_usec; + clen32 = sizeof(*tv32) + + CMSG32_ALIGN(sizeof(struct cmsghdr32)); + } else { + copy_from_user(CMSG32_DATA(kcmsg32), CMSG_DATA(ucmsg), + clen64 - CMSG_ALIGN(sizeof(*ucmsg))); + clen32 = ((clen64 - CMSG_ALIGN(sizeof(*ucmsg))) + + CMSG32_ALIGN(sizeof(struct cmsghdr32))); + } kcmsg32->cmsg_len = clen32; switch (kcmsg32->cmsg_type) { diff -Nru a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c --- a/arch/ppc64/kernel/time.c Sun Feb 9 21:13:36 2003 +++ b/arch/ppc64/kernel/time.c Sun Feb 9 21:13:36 2003 @@ -69,7 +69,6 @@ /* keep track of when we need to update the rtc */ time_t last_rtc_update; -extern rwlock_t xtime_lock; extern int piranha_simulator; #ifdef CONFIG_PPC_ISERIES unsigned long iSeries_recal_titan = 0; @@ -284,12 +283,12 @@ smp_local_timer_interrupt(regs); #endif if (cpu == boot_cpuid) { - write_lock(&xtime_lock); + write_seqlock(&xtime_lock); tb_last_stamp = lpaca->next_jiffy_update_tb; do_timer(regs); timer_sync_xtime( cur_tb ); timer_check_rtc(); - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); if ( adjusting_time && (time_adjust == 0) ) ppc_adjtimex(); } @@ -348,7 +347,7 @@ long int tb_delta, new_usec, new_sec; unsigned long new_xsec; - write_lock_irqsave(&xtime_lock, flags); + write_seqlock_irqsave(&xtime_lock, flags); /* Updating the RTC is not the job of this code. If the time is * stepped under NTP, the RTC will be update after STA_UNSYNC * is cleared. Tool like clock/hwclock either copy the RTC @@ -399,7 +398,7 @@ do_gtod.tb_orig_stamp = tb_last_stamp; } - write_unlock_irqrestore(&xtime_lock, flags); + write_sequnlock_irqrestore(&xtime_lock, flags); } /* @@ -465,7 +464,7 @@ #endif ppc_md.get_boot_time(&tm); - write_lock_irqsave(&xtime_lock, flags); + write_seqlock_irqsave(&xtime_lock, flags); xtime.tv_sec = mktime(tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); tb_last_stamp = get_tb(); @@ -484,7 +483,7 @@ xtime.tv_nsec = 0; last_rtc_update = xtime.tv_sec; - write_unlock_irqrestore(&xtime_lock, flags); + write_sequnlock_irqrestore(&xtime_lock, flags); /* Not exact, but the timer interrupt takes care of this */ set_dec(tb_ticks_per_jiffy); @@ -587,7 +586,7 @@ new_tb_to_xs = divres.result_low; new_xsec = mulhdu( tb_ticks, new_tb_to_xs ); - write_lock_irqsave( &xtime_lock, flags ); + write_seqlock_irqsave( &xtime_lock, flags ); old_xsec = mulhdu( tb_ticks, do_gtod.varp->tb_to_xs ); new_stamp_xsec = do_gtod.varp->stamp_xsec + old_xsec - new_xsec; @@ -609,7 +608,7 @@ do_gtod.varp = temp_varp; do_gtod.var_idx = temp_idx; - write_unlock_irqrestore( &xtime_lock, flags ); + write_sequnlock_irqrestore( &xtime_lock, flags ); } diff -Nru a/arch/ppc64/kernel/traps.c b/arch/ppc64/kernel/traps.c --- a/arch/ppc64/kernel/traps.c Sun Feb 9 21:13:32 2003 +++ b/arch/ppc64/kernel/traps.c Sun Feb 9 21:13:32 2003 @@ -81,8 +81,10 @@ _exception(int signr, siginfo_t *info, struct pt_regs *regs) { if (!user_mode(regs)) { +#ifdef CONFIG_DEBUG_KERNEL if (debugger) debugger(regs); +#endif die("Exception in kernel mode\n", regs, signr); } @@ -133,8 +135,10 @@ FWNMI_release_errinfo(); } +#ifdef CONFIG_DEBUG_KERNEL if (debugger) debugger(regs); +#endif #ifdef PANIC_ON_ERROR panic("System Reset"); @@ -174,13 +178,14 @@ return; } +#ifdef CONFIG_DEBUG_KERNEL if (debugger_fault_handler) { debugger_fault_handler(regs); return; } if (debugger) debugger(regs); - +#endif console_verbose(); spin_lock_irq(&die_lock); bust_spinlocks(1); @@ -223,9 +228,10 @@ { siginfo_t info; +#ifdef CONFIG_DEBUG_KERNEL if (debugger_iabr_match && debugger_iabr_match(regs)) return; - +#endif info.si_signo = SIGTRAP; info.si_errno = 0; info.si_code = TRAP_BRKPT; @@ -292,9 +298,10 @@ } else if (regs->msr & 0x20000) { /* trap exception */ +#ifdef CONFIG_DEBUG_KERNEL if (debugger_bpt && debugger_bpt(regs)) return; - +#endif info.si_signo = SIGTRAP; info.si_errno = 0; info.si_code = TRAP_BRKPT; @@ -318,9 +325,10 @@ regs->msr &= ~MSR_SE; /* Turn off 'trace' bit */ +#ifdef CONFIG_DEBUG_KERNEL if (debugger_sstep && debugger_sstep(regs)) return; - +#endif info.si_signo = SIGTRAP; info.si_errno = 0; info.si_code = TRAP_TRACE; diff -Nru a/arch/ppc64/lib/Makefile b/arch/ppc64/lib/Makefile --- a/arch/ppc64/lib/Makefile Sun Feb 9 21:13:28 2003 +++ b/arch/ppc64/lib/Makefile Sun Feb 9 21:13:28 2003 @@ -4,7 +4,5 @@ L_TARGET = lib.a -export-objs := dec_and_lock.o - obj-y := checksum.o dec_and_lock.o string.o strcase.o obj-y += copypage.o memcpy.o copyuser.o diff -Nru a/arch/s390/Makefile b/arch/s390/Makefile --- a/arch/s390/Makefile Sun Feb 9 21:13:29 2003 +++ b/arch/s390/Makefile Sun Feb 9 21:13:29 2003 @@ -20,7 +20,7 @@ CFLAGS += -pipe -fno-strength-reduce -HEAD := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o +head-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o core-y += arch/$(ARCH)/mm/ arch/$(ARCH)/kernel/ libs-y += arch/$(ARCH)/lib/ @@ -38,7 +38,6 @@ install: vmlinux $(call makeboot, $@) -archmrproper: archclean: $(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/$(ARCH)/boot diff -Nru a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile --- a/arch/s390/kernel/Makefile Sun Feb 9 21:13:36 2003 +++ b/arch/s390/kernel/Makefile Sun Feb 9 21:13:36 2003 @@ -5,7 +5,6 @@ EXTRA_TARGETS := head.o init_task.o EXTRA_AFLAGS := -traditional -export-objs := debug.o ebcdic.o s390_ext.o smp.o s390_ksyms.o obj-y := entry.o bitmap.o traps.o time.o process.o \ setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ semaphore.o reipl.o s390_ext.o debug.o diff -Nru a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c --- a/arch/s390/kernel/signal.c Sun Feb 9 21:13:35 2003 +++ b/arch/s390/kernel/signal.c Sun Feb 9 21:13:35 2003 @@ -61,11 +61,11 @@ sigset_t saveset; mask &= _BLOCKABLE; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; siginitset(¤t->blocked, mask); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->gprs[2] = -EINTR; while (1) { @@ -89,11 +89,11 @@ return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->gprs[2] = -EINTR; while (1) { @@ -194,10 +194,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigregs(regs, &frame->sregs)) goto badframe; @@ -220,10 +220,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigregs(regs, &frame->uc.uc_mcontext)) goto badframe; @@ -427,11 +427,11 @@ ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked,sig); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } } diff -Nru a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c --- a/arch/s390/kernel/time.c Sun Feb 9 21:13:28 2003 +++ b/arch/s390/kernel/time.c Sun Feb 9 21:13:28 2003 @@ -52,7 +52,6 @@ static uint64_t xtime_cc; static uint64_t init_timer_cc; -extern rwlock_t xtime_lock; extern unsigned long wall_jiffies; void tod_to_timeval(__u64 todval, struct timespec *xtime) @@ -83,12 +82,15 @@ void do_gettimeofday(struct timeval *tv) { unsigned long flags; + unsigned long seq; unsigned long usec, sec; - read_lock_irqsave(&xtime_lock, flags); - sec = xtime.tv_sec; - usec = xtime.tv_nsec / 1000 + do_gettimeoffset(); - read_unlock_irqrestore(&xtime_lock, flags); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); + + sec = xtime.tv_sec; + usec = xtime.tv_nsec / 1000 + do_gettimeoffset(); + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); while (usec >= 1000000) { usec -= 1000000; @@ -102,7 +104,7 @@ void do_settimeofday(struct timeval *tv) { - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); /* This is revolting. We need to set the xtime.tv_nsec * correctly. However, the value in this location is * is value at the last tick. @@ -122,7 +124,7 @@ time_status |= STA_UNSYNC; time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } static inline __u32 div64_32(__u64 dividend, __u32 divisor) @@ -166,7 +168,7 @@ * Do not rely on the boot cpu to do the calls to do_timer. * Spread it over all cpus instead. */ - write_lock(&xtime_lock); + write_seqlock(&xtime_lock); if (S390_lowcore.jiffy_timer > xtime_cc) { __u32 xticks; @@ -181,7 +183,7 @@ while (xticks--) do_timer(regs); } - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); while (ticks--) update_process_times(user_mode(regs)); #else diff -Nru a/arch/s390x/Makefile b/arch/s390x/Makefile --- a/arch/s390x/Makefile Sun Feb 9 21:13:32 2003 +++ b/arch/s390x/Makefile Sun Feb 9 21:13:32 2003 @@ -21,7 +21,7 @@ CFLAGS += -pipe -fno-strength-reduce -HEAD := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o +head-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o core-y += arch/$(ARCH)/mm/ arch/$(ARCH)/kernel/ libs-y += arch/$(ARCH)/lib/ @@ -38,7 +38,6 @@ install: vmlinux $(call makeboot, $@) -archmrproper: archclean: $(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/$(ARCH)/boot diff -Nru a/arch/s390x/kernel/Makefile b/arch/s390x/kernel/Makefile --- a/arch/s390x/kernel/Makefile Sun Feb 9 21:13:31 2003 +++ b/arch/s390x/kernel/Makefile Sun Feb 9 21:13:31 2003 @@ -5,9 +5,6 @@ EXTRA_TARGETS := head.o init_task.o EXTRA_AFLAGS := -traditional -export-objs := debug.o ebcdic.o s390_ext.o smp.o s390_ksyms.o \ - exec32.o - obj-y := entry.o bitmap.o traps.o time.o process.o \ setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ semaphore.o reipl.o s390_ext.o debug.o diff -Nru a/arch/s390x/kernel/linux32.c b/arch/s390x/kernel/linux32.c --- a/arch/s390x/kernel/linux32.c Sun Feb 9 21:13:34 2003 +++ b/arch/s390x/kernel/linux32.c Sun Feb 9 21:13:34 2003 @@ -1725,7 +1725,7 @@ return -EINVAL; } - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sig = dequeue_signal(&these, &info); if (!sig) { /* None ready -- temporarily unblock those we're interested @@ -1733,7 +1733,7 @@ current->real_blocked = current->blocked; sigandsets(¤t->blocked, ¤t->blocked, &these); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); timeout = MAX_SCHEDULE_TIMEOUT; if (uts) @@ -1743,13 +1743,13 @@ current->state = TASK_INTERRUPTIBLE; timeout = schedule_timeout(timeout); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sig = dequeue_signal(&these, &info); current->blocked = current->real_blocked; siginitset(¤t->real_blocked, 0); recalc_sigpending(); } - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (sig) { ret = sig; diff -Nru a/arch/s390x/kernel/signal.c b/arch/s390x/kernel/signal.c --- a/arch/s390x/kernel/signal.c Sun Feb 9 21:13:33 2003 +++ b/arch/s390x/kernel/signal.c Sun Feb 9 21:13:33 2003 @@ -60,11 +60,11 @@ sigset_t saveset; mask &= _BLOCKABLE; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; siginitset(¤t->blocked, mask); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->gprs[2] = -EINTR; while (1) { @@ -88,11 +88,11 @@ return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->gprs[2] = -EINTR; while (1) { @@ -188,10 +188,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigregs(regs, &frame->sregs)) goto badframe; @@ -214,10 +214,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigregs(regs, &frame->uc.uc_mcontext)) goto badframe; @@ -421,11 +421,11 @@ ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked,sig); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } } diff -Nru a/arch/s390x/kernel/signal32.c b/arch/s390x/kernel/signal32.c --- a/arch/s390x/kernel/signal32.c Sun Feb 9 21:13:31 2003 +++ b/arch/s390x/kernel/signal32.c Sun Feb 9 21:13:31 2003 @@ -112,11 +112,11 @@ sigset_t saveset; mask &= _BLOCKABLE; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; siginitset(¤t->blocked, mask); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->gprs[2] = -EINTR; while (1) { @@ -147,11 +147,11 @@ } sigdelsetmask(&newset, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->gprs[2] = -EINTR; while (1) { @@ -345,10 +345,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigregs32(regs, &frame->sregs)) goto badframe; @@ -375,10 +375,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigregs32(regs, &frame->uc.uc_mcontext)) goto badframe; @@ -588,11 +588,11 @@ ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked,sig); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } } diff -Nru a/arch/s390x/kernel/time.c b/arch/s390x/kernel/time.c --- a/arch/s390x/kernel/time.c Sun Feb 9 21:13:35 2003 +++ b/arch/s390x/kernel/time.c Sun Feb 9 21:13:35 2003 @@ -51,7 +51,6 @@ static uint64_t xtime_cc; static uint64_t init_timer_cc; -extern rwlock_t xtime_lock; extern unsigned long wall_jiffies; void tod_to_timeval(__u64 todval, struct timespec *xtime) @@ -78,12 +77,14 @@ void do_gettimeofday(struct timeval *tv) { unsigned long flags; + unsigned long seq; unsigned long usec, sec; - read_lock_irqsave(&xtime_lock, flags); - sec = xtime.tv_sec; - usec = xtime.tv_nsec + do_gettimeoffset(); - read_unlock_irqrestore(&xtime_lock, flags); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); + sec = xtime.tv_sec; + usec = xtime.tv_nsec + do_gettimeoffset(); + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); while (usec >= 1000000) { usec -= 1000000; @@ -97,7 +98,7 @@ void do_settimeofday(struct timeval *tv) { - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); /* This is revolting. We need to set the xtime.tv_usec * correctly. However, the value in this location is * is value at the last tick. @@ -117,7 +118,7 @@ time_status |= STA_UNSYNC; time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } /* @@ -152,7 +153,7 @@ * Do not rely on the boot cpu to do the calls to do_timer. * Spread it over all cpus instead. */ - write_lock(&xtime_lock); + write_seqlock(&xtime_lock); if (S390_lowcore.jiffy_timer > xtime_cc) { __u32 xticks; @@ -167,7 +168,7 @@ while (xticks--) do_timer(regs); } - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); while (ticks--) update_process_times(user_mode(regs)); #else diff -Nru a/arch/sh/Kconfig b/arch/sh/Kconfig --- a/arch/sh/Kconfig Sun Feb 9 21:13:37 2003 +++ b/arch/sh/Kconfig Sun Feb 9 21:13:37 2003 @@ -623,7 +623,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called binfmt_elf.o. Saying M or N here is dangerous because + will be called binfmt_elf. Saying M or N here is dangerous because some crucial programs on your system might be in ELF format. config BINFMT_MISC @@ -648,7 +648,7 @@ use this part of the kernel. You may say M here for module support and later load the module when - you have use for it; the module is called binfmt_misc.o. If you + you have use for it; the module is called binfmt_misc. If you don't know what to answer at this point, say Y. source "drivers/parport/Kconfig" @@ -704,7 +704,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called ide.o. + will be called ide. For further information, please read . @@ -731,7 +731,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called scsi_mod.o. If you want to compile it as + The module will be called scsi_mod. If you want to compile it as a module, say M here and read and . However, do not compile this as a module if your root file system (the one containing the directory /) @@ -855,7 +855,7 @@ If you want to compile this driver as a module, say M here and read . The module will be called - serial.o. + serial. [WARNING: Do not compile this driver as a module if you are using non-standard serial ports, since the configuration information will be lost when the driver is unloaded. This limitation may be lifted @@ -992,7 +992,7 @@ driver as a module however ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read and - . The module will be called lp.o. + . The module will be called lp. If you have several parallel ports, you can specify which ports to use with the "lp" kernel command line option. (Try "man bootparam" @@ -1036,7 +1036,7 @@ This support is also available as a module. If you want to compile it as a module, say M here and read . The module will be called - ppdev.o. + ppdev. If unsure, say N. @@ -1108,7 +1108,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module is called shwdt.o. If you want to compile it as a module, + The module is called shwdt. If you want to compile it as a module, say M here and read Documentation/modules.txt. endmenu @@ -1137,7 +1137,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module is called rtc.o. If you want to compile it as a module, + The module is called rtc. If you want to compile it as a module, say M here and read . source "drivers/char/pcmcia/Kconfig" @@ -1175,7 +1175,7 @@ and load that module after the PnP configuration is finished. To do this, say M here and read as well as ; the module will be - called soundcore.o. + called soundcore. I'm told that even without a sound card, you can make your computer say more than an occasional beep, by programming the PC speaker. diff -Nru a/arch/sh/Makefile b/arch/sh/Makefile --- a/arch/sh/Makefile Sun Feb 9 21:13:33 2003 +++ b/arch/sh/Makefile Sun Feb 9 21:13:33 2003 @@ -53,7 +53,7 @@ # CFLAGS += -pipe -HEAD := arch/sh/kernel/head.o arch/sh/kernel/init_task.o +head-y := arch/sh/kernel/head.o arch/sh/kernel/init_task.o LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) @@ -80,6 +80,4 @@ $(MAKE) -C arch/$(ARCH)/kernel clean $(MAKE) -C arch/$(ARCH)/stboards clean # $(MAKE) -C arch/$(ARCH)/tools clean - -archmrproper: diff -Nru a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile --- a/arch/sh/kernel/Makefile Sun Feb 9 21:13:33 2003 +++ b/arch/sh/kernel/Makefile Sun Feb 9 21:13:33 2003 @@ -4,9 +4,6 @@ EXTRA_TARGETS := head.o init_task.o -export-objs := io.o io_generic.o io_hd64465.o setup_hd64465.o sh_ksyms.o \ - io_adx.o io_bigsur.o io_cat68701.o hd64465_gpio.o - obj-y := process.o signal.o entry.o traps.o irq.o irq_ipr.o \ ptrace.o setup.o time.o sys_sh.o semaphore.o \ irq_imask.o io.o io_generic.o sh_ksyms.o diff -Nru a/arch/sh/kernel/io.c b/arch/sh/kernel/io.c --- a/arch/sh/kernel/io.c Sun Feb 9 21:13:31 2003 +++ b/arch/sh/kernel/io.c Sun Feb 9 21:13:31 2003 @@ -4,7 +4,7 @@ * Copyright (C) 2000 Stuart Menefy * * Provide real functions which expand to whatever the header file defined. - * Also definitions of machine independant IO functions. + * Also definitions of machine independent IO functions. */ #include diff -Nru a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c --- a/arch/sh/kernel/time.c Sun Feb 9 21:13:28 2003 +++ b/arch/sh/kernel/time.c Sun Feb 9 21:13:28 2003 @@ -72,7 +72,6 @@ u64 jiffies_64; -extern rwlock_t xtime_lock; extern unsigned long wall_jiffies; #define TICK_SIZE tick @@ -128,18 +127,20 @@ void do_gettimeofday(struct timeval *tv) { unsigned long flags; + unsigned long seq; unsigned long usec, sec; - read_lock_irqsave(&xtime_lock, flags); - usec = do_gettimeoffset(); - { - unsigned long lost = jiffies - wall_jiffies; - if (lost) - usec += lost * (1000000 / HZ); - } - sec = xtime.tv_sec; - usec += xtime.tv_usec; - read_unlock_irqrestore(&xtime_lock, flags); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); + usec = do_gettimeoffset(); + { + unsigned long lost = jiffies - wall_jiffies; + if (lost) + usec += lost * (1000000 / HZ); + } + sec = xtime.tv_sec; + usec += xtime.tv_usec; + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); while (usec >= 1000000) { usec -= 1000000; @@ -152,7 +153,7 @@ void do_settimeofday(struct timeval *tv) { - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); /* * This is revolting. We need to set "xtime" correctly. However, the * value in this location is the value at the most recent update of @@ -172,7 +173,7 @@ time_status |= STA_UNSYNC; time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } /* last time the RTC clock got updated */ @@ -231,9 +232,9 @@ * the irq version of write_lock because as just said we have irq * locally disabled. -arca */ - write_lock(&xtime_lock); + write_seqlock(&xtime_lock); do_timer_interrupt(irq, NULL, regs); - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); } static unsigned int __init get_timer_frequency(void) diff -Nru a/arch/sparc/Kconfig b/arch/sparc/Kconfig --- a/arch/sparc/Kconfig Sun Feb 9 21:13:28 2003 +++ b/arch/sparc/Kconfig Sun Feb 9 21:13:28 2003 @@ -182,8 +182,8 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - When compiled this way, there will be modules called pcmcia_core.o - and ds.o. If you want to compile it as a module, say M here and + When compiled this way, there will be modules called pcmcia_core + and ds. If you want to compile it as a module, say M here and read . config SBUS @@ -276,7 +276,7 @@ code which can be inserted in and removed from the running kernel whenever you want), say M here and read . - The module will be called openpromfs.o. If unsure, say M. + The module will be called openpromfs. If unsure, say M. config KCORE_ELF bool @@ -319,7 +319,7 @@ QMAGIC support" then you'll have to say Y here. You may answer M to compile a.out support as a module and later load the module when you want to use a program or library in a.out format. The module will be - called binfmt_aout.o. Saying M or N here is dangerous though, + called binfmt_aout. Saying M or N here is dangerous though, because some crucial programs on your system might still be in A.OUT format. @@ -349,7 +349,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called binfmt_elf.o. Saying M or N here is dangerous because + will be called binfmt_elf. Saying M or N here is dangerous because some crucial programs on your system might be in ELF format. config BINFMT_MISC @@ -374,7 +374,7 @@ use this part of the kernel. You may say M here for module support and later load the module when - you have use for it; the module is called binfmt_misc.o. If you + you have use for it; the module is called binfmt_misc. If you don't know what to answer at this point, say Y. config SUNOS_EMUL @@ -404,7 +404,7 @@ driver as a module however ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read and - . The module will be called lp.o. + . The module will be called lp. If you have several parallel ports, you can specify which ports to use with the "lp" kernel command line option. (Try "man bootparam" @@ -442,7 +442,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called floppy.o. If you want to compile it as a + The module will be called floppy. If you want to compile it as a module, say M here and read . config BLK_DEV_LOOP @@ -492,7 +492,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called loop.o. + will be called loop. Most users will answer N here. @@ -521,7 +521,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called nbd.o. + will be called nbd. If unsure, say N. @@ -543,7 +543,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M and read . The module will be - called rd.o. + called rd. Most normal users won't need the RAM disk functionality, and can thus say N here. @@ -613,7 +613,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called ide.o. + will be called ide. For further information, please read . @@ -644,7 +644,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called scsi_mod.o. If you want to compile it as + The module will be called scsi_mod. If you want to compile it as a module, say M here and read and . However, do not compile this as a module if your root file system (the one containing the directory /) @@ -665,7 +665,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called sd_mod.o. If you want to compile it as a + The module will be called sd_mod. If you want to compile it as a module, say M here and read and . Do not compile this driver as a module if your root file system (the one containing the directory /) @@ -701,7 +701,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called st.o. If you want to compile it as a + The module will be called st. If you want to compile it as a module, say M here and read and . @@ -726,7 +726,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called osst.o. If you want to compile it as a + The module will be called osst. If you want to compile it as a module, say M here and read and . @@ -741,7 +741,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called sr_mod.o. If you want to compile it as a + The module will be called sr_mod. If you want to compile it as a module, say M here and read and . @@ -794,7 +794,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read and - . The module will be called sg.o. + . The module will be called sg. If unsure, say N. comment "Some SCSI devices (e.g. CD jukebox) support multiple LUNs" @@ -856,7 +856,7 @@ This is the driver for the Sun ESP SCSI host adapter. The ESP chipset is present in most SPARC SBUS-based computers. - This support is also available as a module called esp.o ( = code + This support is also available as a module called esp ( = code which can be inserted in and removed from the running kernel whenever you want). If you want to compile it as a module, say M here and read . @@ -870,7 +870,7 @@ PTI,ptisp or QLGC,isp. Note that PCI QLogic SCSI controllers are driven by a different driver. - This support is also available as a module called qlogicpti.o ( = + This support is also available as a module called qlogicpti ( = code which can be inserted in and removed from the running kernel whenever you want). If you want to compile it as a module, say M here and read . @@ -963,7 +963,7 @@ and load that module after the PnP configuration is finished. To do this, say M here and read as well as ; the module will be - called soundcore.o. + called soundcore. I'm told that even without a sound card, you can make your computer say more than an occasional beep, by programming the PC speaker. @@ -992,7 +992,7 @@ inserted in and removed from the running kernel whenever you want). If you want to compile it as a module, say M here and read . The module will be called - softdog.o. + softdog. endmenu diff -Nru a/arch/sparc/Makefile b/arch/sparc/Makefile --- a/arch/sparc/Makefile Sun Feb 9 21:13:29 2003 +++ b/arch/sparc/Makefile Sun Feb 9 21:13:29 2003 @@ -37,7 +37,8 @@ # Actual linking is done with "make image". LDFLAGS_vmlinux = -r -HEAD := arch/sparc/kernel/head.o arch/sparc/kernel/init_task.o +head-y := arch/sparc/kernel/head.o arch/sparc/kernel/init_task.o +HEAD := $(head-y) core-y += arch/sparc/kernel/ arch/sparc/mm/ arch/sparc/math-emu/ libs-y += arch/sparc/prom/ arch/sparc/lib/ @@ -60,8 +61,6 @@ archclean: $(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/$(ARCH)/boot - -archmrproper: prepare: include/asm-$(ARCH)/asm_offsets.h diff -Nru a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile --- a/arch/sparc/kernel/Makefile Sun Feb 9 21:13:35 2003 +++ b/arch/sparc/kernel/Makefile Sun Feb 9 21:13:35 2003 @@ -6,7 +6,6 @@ EXTRA_AFLAGS := -ansi -export-objs := sparc_ksyms.o IRQ_OBJS := irq.o sun4m_irq.o sun4c_irq.o sun4d_irq.o obj-y := entry.o wof.o wuf.o etrap.o rtrap.o traps.o $(IRQ_OBJS) \ process.o signal.o ioport.o setup.o idprom.o \ diff -Nru a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S --- a/arch/sparc/kernel/entry.S Sun Feb 9 21:13:32 2003 +++ b/arch/sparc/kernel/entry.S Sun Feb 9 21:13:32 2003 @@ -1808,6 +1808,15 @@ retl nop + .globl C_LABEL(ndelay) +C_LABEL(ndelay): + save %sp, -REGWIN_SZ, %sp + mov %i0, %o0 + call .umul + mov 5, %o1 + ba delay_continue + nop + .globl C_LABEL(udelay) C_LABEL(udelay): save %sp, -REGWIN_SZ, %sp @@ -1815,6 +1824,7 @@ sethi %hi(0x10c6), %o1 call .umul or %o1, %lo(0x10c6), %o1 +delay_continue: #ifndef CONFIG_SMP sethi %hi(C_LABEL(loops_per_jiffy)), %o3 call .umul @@ -1879,7 +1889,7 @@ wr %o4, 0x0, %psr ! the uwinmask state WRITE_PAUSE ! burn them cycles 1: - ld [%g6 + TI_UWINMASK], %o0 ! get consistant state + ld [%g6 + TI_UWINMASK], %o0 ! get consistent state orcc %g0, %o0, %g0 ! did an interrupt come in? be 4f ! yep, we are done rd %wim, %o3 ! get current wim diff -Nru a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c --- a/arch/sparc/kernel/pcic.c Sun Feb 9 21:13:32 2003 +++ b/arch/sparc/kernel/pcic.c Sun Feb 9 21:13:32 2003 @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -34,8 +35,6 @@ #include #include -extern rwlock_t xtime_lock; - #ifndef CONFIG_PCI asmlinkage int sys_pciconfig_read(unsigned long bus, @@ -739,10 +738,10 @@ static void pcic_timer_handler (int irq, void *h, struct pt_regs *regs) { - write_lock(&xtime_lock); /* Dummy, to show that we remember */ + write_seqlock(&xtime_lock); /* Dummy, to show that we remember */ pcic_clear_clock_irq(); do_timer(regs); - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); } #define USECS_PER_JIFFY 10000 /* We have 100HZ "standard" timer for sparc */ @@ -795,18 +794,20 @@ static void pci_do_gettimeofday(struct timeval *tv) { unsigned long flags; + unsigned long seq; unsigned long usec, sec; - read_lock_irqsave(&xtime_lock, flags); - usec = do_gettimeoffset(); - { - unsigned long lost = jiffies - wall_jiffies; - if (lost) - usec += lost * (1000000 / HZ); - } - sec = xtime.tv_sec; - usec += (xtime.tv_nsec / 1000); - read_unlock_irqrestore(&xtime_lock, flags); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); + usec = do_gettimeoffset(); + { + unsigned long lost = jiffies - wall_jiffies; + if (lost) + usec += lost * (1000000 / HZ); + } + sec = xtime.tv_sec; + usec += (xtime.tv_nsec / 1000); + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); while (usec >= 1000000) { usec -= 1000000; diff -Nru a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c --- a/arch/sparc/kernel/signal.c Sun Feb 9 21:13:34 2003 +++ b/arch/sparc/kernel/signal.c Sun Feb 9 21:13:34 2003 @@ -104,11 +104,11 @@ sigset_t saveset; set &= _BLOCKABLE; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; siginitset(¤t->blocked, set); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->pc = regs->npc; regs->npc += 4; @@ -161,11 +161,11 @@ } sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); oldset = current->blocked; current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->pc = regs->npc; regs->npc += 4; @@ -267,10 +267,10 @@ goto segv_and_exit; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); return; segv_and_exit: @@ -314,10 +314,10 @@ goto segv_and_exit; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->pc = pc; regs->npc = npc; @@ -384,10 +384,10 @@ do_sigaltstack(&st, NULL, (unsigned long)sf); sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); return; segv: send_sig(SIGSEGV, current, 1); @@ -967,10 +967,10 @@ set.sig[3] = setv.sigbits[3]; } sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->pc = pc; regs->npc = npc | 1; err |= __get_user(regs->y, &((*gr) [SVR4_Y])); @@ -1007,11 +1007,11 @@ if(ka->sa.sa_flags & SA_ONESHOT) ka->sa.sa_handler = SIG_DFL; if(!(ka->sa.sa_flags & SA_NOMASK)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked, signr); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } } @@ -1066,9 +1066,9 @@ sigset_t *mask = ¤t->blocked; unsigned long signr = 0; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); signr = dequeue_signal(mask, &info); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (!signr) break; diff -Nru a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c --- a/arch/sparc/kernel/sparc_ksyms.c Sun Feb 9 21:13:29 2003 +++ b/arch/sparc/kernel/sparc_ksyms.c Sun Feb 9 21:13:29 2003 @@ -151,6 +151,7 @@ #endif EXPORT_SYMBOL(udelay); +EXPORT_SYMBOL(ndelay); EXPORT_SYMBOL(mostek_lock); EXPORT_SYMBOL(mstk48t02_regs); #if CONFIG_SUN_AUXIO diff -Nru a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c --- a/arch/sparc/kernel/sys_sparc.c Sun Feb 9 21:13:31 2003 +++ b/arch/sparc/kernel/sys_sparc.c Sun Feb 9 21:13:31 2003 @@ -409,7 +409,7 @@ ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); if (!ret && oact) { - /* In the clone() case we could copy half consistant + /* In the clone() case we could copy half consistent * state to the user, however this could sleep and * deadlock us if we held the signal lock on SMP. So for * now I take the easy way out and do no locking. diff -Nru a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c --- a/arch/sparc/kernel/sys_sunos.c Sun Feb 9 21:13:31 2003 +++ b/arch/sparc/kernel/sys_sunos.c Sun Feb 9 21:13:31 2003 @@ -281,11 +281,11 @@ { unsigned long old; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); old = current->blocked.sig[0]; current->blocked.sig[0] |= (blk_mask & _BLOCKABLE); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); return old; } @@ -293,11 +293,11 @@ { unsigned long retval; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); retval = current->blocked.sig[0]; current->blocked.sig[0] = (newmask & _BLOCKABLE); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); return retval; } @@ -1168,7 +1168,7 @@ ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); if (!ret && oact) { - /* In the clone() case we could copy half consistant + /* In the clone() case we could copy half consistent * state to the user, however this could sleep and * deadlock us if we held the signal lock on SMP. So for * now I take the easy way out and do no locking. diff -Nru a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c --- a/arch/sparc/kernel/time.c Sun Feb 9 21:13:32 2003 +++ b/arch/sparc/kernel/time.c Sun Feb 9 21:13:32 2003 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -42,8 +43,6 @@ #include #include -extern rwlock_t xtime_lock; - extern unsigned long wall_jiffies; u64 jiffies_64; @@ -131,7 +130,7 @@ #endif /* Protect counter clear so that do_gettimeoffset works */ - write_lock(&xtime_lock); + write_seqlock(&xtime_lock); #ifdef CONFIG_SUN4 if((idprom->id_machtype == (SM_SUN4 | SM_4_260)) || (idprom->id_machtype == (SM_SUN4 | SM_4_110))) { @@ -155,7 +154,7 @@ else last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ } - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); } /* Kick start a stopped clock (procedure from the Sun NVRAM/hostid FAQ). */ @@ -470,18 +469,20 @@ void do_gettimeofday(struct timeval *tv) { unsigned long flags; + unsigned long seq; unsigned long usec, sec; - read_lock_irqsave(&xtime_lock, flags); - usec = do_gettimeoffset(); - { - unsigned long lost = jiffies - wall_jiffies; - if (lost) - usec += lost * (1000000 / HZ); - } - sec = xtime.tv_sec; - usec += (xtime.tv_nsec / 1000); - read_unlock_irqrestore(&xtime_lock, flags); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); + usec = do_gettimeoffset(); + { + unsigned long lost = jiffies - wall_jiffies; + if (lost) + usec += lost * (1000000 / HZ); + } + sec = xtime.tv_sec; + usec += (xtime.tv_nsec / 1000); + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); while (usec >= 1000000) { usec -= 1000000; @@ -494,9 +495,9 @@ void do_settimeofday(struct timeval *tv) { - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); bus_do_settimeofday(tv); - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } static void sbus_do_settimeofday(struct timeval *tv) diff -Nru a/arch/sparc/math-emu/math.c b/arch/sparc/math-emu/math.c --- a/arch/sparc/math-emu/math.c Sun Feb 9 21:13:31 2003 +++ b/arch/sparc/math-emu/math.c Sun Feb 9 21:13:31 2003 @@ -203,7 +203,7 @@ } /* All routines returning an exception to raise should detect - * such exceptions _before_ rounding to be consistant with + * such exceptions _before_ rounding to be consistent with * the behavior of the hardware in the implemented cases * (and thus with the recommendations in the V9 architecture * manual). diff -Nru a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c --- a/arch/sparc/mm/sun4c.c Sun Feb 9 21:13:34 2003 +++ b/arch/sparc/mm/sun4c.c Sun Feb 9 21:13:34 2003 @@ -1042,7 +1042,7 @@ get_locked_segment(addr); /* We are changing the virtual color of the page(s) - * so we must flush the cache to guarentee consistancy. + * so we must flush the cache to guarentee consistency. */ sun4c_flush_page(pages); #ifndef CONFIG_SUN4 diff -Nru a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig --- a/arch/sparc64/Kconfig Sun Feb 9 21:13:35 2003 +++ b/arch/sparc64/Kconfig Sun Feb 9 21:13:35 2003 @@ -232,7 +232,7 @@ Say Y here if you would like support for ISA Plug and Play devices. Some information is in . - This support is also available as a module called isapnp.o ( = + This support is also available as a module called isapnp ( = code which can be inserted in and removed from the running kernel whenever you want). If you want to compile it as a module, say M here and read . @@ -279,8 +279,8 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - When compiled this way, there will be modules called pcmcia_core.o - and ds.o. If you want to compile it as a module, say M here and + When compiled this way, there will be modules called pcmcia_core + and ds. If you want to compile it as a module, say M here and read . config SBUS @@ -338,7 +338,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module is called rtc.o. If you want to compile it as a module, + The module is called rtc. If you want to compile it as a module, say M here and read . source "drivers/pci/Kconfig" @@ -354,7 +354,7 @@ code which can be inserted in and removed from the running kernel whenever you want), say M here and read . - The module will be called openpromfs.o. If unsure, say M. + The module will be called openpromfs. If unsure, say M. config KCORE_ELF bool @@ -431,7 +431,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called binfmt_elf.o. Saying M or N here is dangerous because + will be called binfmt_elf. Saying M or N here is dangerous because some crucial programs on your system might be in ELF format. config BINFMT_MISC @@ -456,7 +456,7 @@ use this part of the kernel. You may say M here for module support and later load the module when - you have use for it; the module is called binfmt_misc.o. If you + you have use for it; the module is called binfmt_misc. If you don't know what to answer at this point, say Y. config SUNOS_EMUL @@ -477,7 +477,7 @@ This code is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called solaris.o. If you want to compile it as a + The module will be called solaris. If you want to compile it as a module, say M here and read . source "drivers/parport/Kconfig" @@ -498,7 +498,7 @@ driver as a module however ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read and - . The module will be called lp.o. + . The module will be called lp. If you have several parallel ports, you can specify which ports to use with the "lp" kernel command line option. (Try "man bootparam" @@ -518,7 +518,7 @@ This code is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called envctrl.o. If you want to compile it as a + The module will be called envctrl. If you want to compile it as a module, say M here and read . config DISPLAY7SEG @@ -530,7 +530,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called display7seg.o. If you want to compile it + The module will be called display7seg. If you want to compile it as a module, say M here and read . If you do not have a CompactPCI model CP1400 or CP1500, or @@ -546,7 +546,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called cpwatchdog.o. If you want to compile it + The module will be called cpwatchdog. If you want to compile it as a module, say M here and read . If you do not have a CompactPCI model CP1400 or CP1500, or @@ -586,7 +586,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called floppy.o. If you want to compile it as a + The module will be called floppy. If you want to compile it as a module, say M here and read . config BLK_DEV_LOOP @@ -636,7 +636,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called loop.o. + will be called loop. Most users will answer N here. @@ -665,7 +665,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called nbd.o. + will be called nbd. If unsure, say N. @@ -687,7 +687,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M and read . The module will be - called rd.o. + called rd. Most normal users won't need the RAM disk functionality, and can thus say N here. @@ -755,7 +755,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called ide.o. + will be called ide. For further information, please read . @@ -782,7 +782,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called scsi_mod.o. If you want to compile it as + The module will be called scsi_mod. If you want to compile it as a module, say M here and read and . However, do not compile this as a module if your root file system (the one containing the directory /) @@ -803,7 +803,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called sd_mod.o. If you want to compile it as a + The module will be called sd_mod. If you want to compile it as a module, say M here and read and . Do not compile this driver as a module if your root file system (the one containing the directory /) @@ -839,7 +839,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called st.o. If you want to compile it as a + The module will be called st. If you want to compile it as a module, say M here and read and . @@ -864,7 +864,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called osst.o. If you want to compile it as a + The module will be called osst. If you want to compile it as a module, say M here and read and . @@ -879,7 +879,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called sr_mod.o. If you want to compile it as a + The module will be called sr_mod. If you want to compile it as a module, say M here and read and . @@ -932,7 +932,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read and - . The module will be called sg.o. + . The module will be called sg. If unsure, say N. comment "Some SCSI devices (e.g. CD jukebox) support multiple LUNs" @@ -994,7 +994,7 @@ This is the driver for the Sun ESP SCSI host adapter. The ESP chipset is present in most SPARC SBUS-based computers. - This support is also available as a module called esp.o ( = code + This support is also available as a module called esp ( = code which can be inserted in and removed from the running kernel whenever you want). If you want to compile it as a module, say M here and read . @@ -1008,7 +1008,7 @@ PTI,ptisp or QLGC,isp. Note that PCI QLogic SCSI controllers are driven by a different driver. - This support is also available as a module called qlogicpti.o ( = + This support is also available as a module called qlogicpti ( = code which can be inserted in and removed from the running kernel whenever you want). If you want to compile it as a module, say M here and read . @@ -1060,7 +1060,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called aic7xxx_old.o. + will be called aic7xxx_old. config AIC7XXX_OLD_TCQ_ON_BY_DEFAULT bool "Enable Tagged Command Queueing (TCQ) by default" @@ -1404,7 +1404,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called qlogicisp.o. If you want to compile it as + The module will be called qlogicisp. If you want to compile it as a module, say M here and read . config SCSI_QLOGIC_FC @@ -1415,7 +1415,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called qlogicfc.o. If you want to compile it as + The module will be called qlogicfc. If you want to compile it as a module, say M here and read . config SCSI_QLOGIC_FC_FIRMWARE @@ -1502,7 +1502,7 @@ device or user software interacting with such a driver, please read the file . - This driver is also available as a module called videodev.o ( = code + This driver is also available as a module called videodev ( = code which can be inserted in and removed from the running kernel whenever you want). If you want to compile it as a module, say M here and read . @@ -1518,7 +1518,7 @@ If you say Y or M here, you need to say Y or M to "I2C support" and "I2C bit-banging interfaces" in the character device section. - This driver is available as a module called bttv.o ( = code + This driver is available as a module called bttv ( = code which can be inserted in and removed from the running kernel whenever you want). If you want to compile it as a module, say M here and read . @@ -1552,14 +1552,14 @@ depends on DRM help Choose this option if you have a 3dfx Banshee or Voodoo3 (or later), - graphics card. If M is selected, the module will be called tdfx.o. + graphics card. If M is selected, the module will be called tdfx. config DRM_R128 tristate "ATI Rage 128" depends on DRM help Choose this option if you have an ATI Rage 128 graphics card. If M - is selected, the module will be called r128.o. AGP support for + is selected, the module will be called r128. AGP support for this card is strongly suggested (unless you have a PCI version). endmenu @@ -1594,7 +1594,7 @@ and load that module after the PnP configuration is finished. To do this, say M here and read as well as ; the module will be - called soundcore.o. + called soundcore. I'm told that even without a sound card, you can make your computer say more than an occasional beep, by programming the PC speaker. @@ -1623,7 +1623,7 @@ inserted in and removed from the running kernel whenever you want). If you want to compile it as a module, say M here and read . The module will be called - softdog.o. + softdog. endmenu diff -Nru a/arch/sparc64/Makefile b/arch/sparc64/Makefile --- a/arch/sparc64/Makefile Sun Feb 9 21:13:37 2003 +++ b/arch/sparc64/Makefile Sun Feb 9 21:13:37 2003 @@ -61,7 +61,7 @@ CFLAGS := $(CFLAGS) -pg endif -HEAD := arch/sparc64/kernel/head.o arch/sparc64/kernel/init_task.o +head-y := arch/sparc64/kernel/head.o arch/sparc64/kernel/init_task.o core-y += arch/sparc64/kernel/ arch/sparc64/mm/ core-$(CONFIG_SOLARIS_EMUL) += arch/sparc64/solaris/ @@ -73,10 +73,6 @@ tftpboot.img vmlinux.aout: $(Q)$(MAKE) $(build)=arch/sparc64/boot arch/sparc64/boot/$@ - -archclean: - -archmrproper: define archhelp echo '* vmlinux - Standard sparc64 kernel' diff -Nru a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile --- a/arch/sparc64/kernel/Makefile Sun Feb 9 21:13:29 2003 +++ b/arch/sparc64/kernel/Makefile Sun Feb 9 21:13:29 2003 @@ -6,7 +6,6 @@ EXTRA_TARGETS := head.o init_task.o -export-objs := sparc64_ksyms.o ebus.o obj-y := process.o setup.o cpu.o idprom.o \ traps.o devices.o auxio.o \ irq.o ptrace.o time.o sys_sparc.o signal.o \ diff -Nru a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c --- a/arch/sparc64/kernel/power.c Sun Feb 9 21:13:35 2003 +++ b/arch/sparc64/kernel/power.c Sun Feb 9 21:13:35 2003 @@ -70,9 +70,9 @@ again: while (button_pressed == 0) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); flush_signals(current); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); interruptible_sleep_on(&powerd_wait); } diff -Nru a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c --- a/arch/sparc64/kernel/sbus.c Sun Feb 9 21:13:37 2003 +++ b/arch/sparc64/kernel/sbus.c Sun Feb 9 21:13:37 2003 @@ -767,7 +767,7 @@ } imap += reg_base; - /* SYSIO inconsistancy. For external SLOTS, we have to select + /* SYSIO inconsistency. For external SLOTS, we have to select * the right ICLR register based upon the lower SBUS irq level * bits. */ diff -Nru a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c --- a/arch/sparc64/kernel/signal.c Sun Feb 9 21:13:32 2003 +++ b/arch/sparc64/kernel/signal.c Sun Feb 9 21:13:32 2003 @@ -9,6 +9,9 @@ */ #include +#ifdef CONFIG_SPARC32_COMPAT +#include /* for compat_old_sigset_t */ +#endif #include #include #include @@ -67,10 +70,10 @@ goto do_sigsegv; } sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } if (test_thread_flag(TIF_32BIT)) { pc &= 0xffffffff; @@ -247,18 +250,18 @@ #ifdef CONFIG_SPARC32_COMPAT if (test_thread_flag(TIF_32BIT)) { - extern asmlinkage void _sigpause32_common(old_sigset_t32, + extern asmlinkage void _sigpause32_common(compat_old_sigset_t, struct pt_regs *); _sigpause32_common(set, regs); return; } #endif set &= _BLOCKABLE; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; siginitset(¤t->blocked, set); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (test_thread_flag(TIF_32BIT)) { regs->tpc = (regs->tnpc & 0xffffffff); @@ -314,11 +317,11 @@ } sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); oldset = current->blocked; current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (test_thread_flag(TIF_32BIT)) { regs->tpc = (regs->tnpc & 0xffffffff); @@ -425,10 +428,10 @@ set_fs(old_fs); sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); return; segv: send_sig(SIGSEGV, current, 1); @@ -561,11 +564,11 @@ if (ka->sa.sa_flags & SA_ONESHOT) ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NOMASK)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked,signr); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } } @@ -616,9 +619,9 @@ sigset_t *mask = ¤t->blocked; unsigned long signr = 0; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); signr = dequeue_signal(mask, &info); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (!signr) break; diff -Nru a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c --- a/arch/sparc64/kernel/signal32.c Sun Feb 9 21:13:28 2003 +++ b/arch/sparc64/kernel/signal32.c Sun Feb 9 21:13:28 2003 @@ -56,7 +56,7 @@ /* struct sigcontext32 * */ u32 sig_scptr; int sig_address; struct sigcontext32 sig_context; - unsigned extramask[_NSIG_WORDS32 - 1]; + unsigned extramask[_COMPAT_NSIG_WORDS - 1]; }; /* @@ -69,7 +69,7 @@ __siginfo32_t info; /* __siginfo_fpu32_t * */ u32 fpu_save; unsigned int insns [2]; - unsigned extramask[_NSIG_WORDS32 - 1]; + unsigned extramask[_COMPAT_NSIG_WORDS - 1]; unsigned extra_size; /* Should be sizeof(siginfo_extra_v8plus_t) */ /* Only valid if (info.si_regs.psr & (PSR_VERS|PSR_IMPL)) == PSR_V8PLUS */ siginfo_extra_v8plus_t v8plus; @@ -80,7 +80,7 @@ struct sparc_stackf32 ss; siginfo_t32 info; struct pt_regs32 regs; - sigset_t32 mask; + compat_sigset_t mask; /* __siginfo_fpu32_t * */ u32 fpu_save; unsigned int insns [2]; stack_t32 stack; @@ -139,16 +139,16 @@ * atomically swap in the new signal mask, and wait for a signal. * This is really tricky on the Sparc, watch out... */ -asmlinkage void _sigpause32_common(old_sigset_t32 set, struct pt_regs *regs) +asmlinkage void _sigpause32_common(compat_old_sigset_t set, struct pt_regs *regs) { sigset_t saveset; set &= _BLOCKABLE; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; siginitset(¤t->blocked, set); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->tpc = regs->tnpc; regs->tnpc += 4; @@ -179,7 +179,7 @@ asmlinkage void do_rt_sigsuspend32(u32 uset, size_t sigsetsize, struct pt_regs *regs) { sigset_t oldset, set; - sigset_t32 set32; + compat_sigset_t set32; /* XXX: Don't preclude handling different sized sigset_t's. */ if (((compat_size_t)sigsetsize) != sizeof(sigset_t)) { @@ -199,11 +199,11 @@ case 1: set.sig[0] = set32.sig[0] + (((long)set32.sig[1]) << 32); } sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); oldset = current->blocked; current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->tpc = regs->tnpc; regs->tnpc += 4; @@ -256,7 +256,7 @@ unsigned int psr; unsigned pc, npc, fpu_save; sigset_t set; - unsigned seta[_NSIG_WORDS32]; + unsigned seta[_COMPAT_NSIG_WORDS]; int err, i; regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL; @@ -302,7 +302,7 @@ if (fpu_save) err |= restore_fpu_state32(regs, &sf->fpu_state); err |= __get_user(seta[0], &sf->info.si_mask); - err |= copy_from_user(seta+1, &sf->extramask, (_NSIG_WORDS32 - 1) * sizeof(unsigned)); + err |= copy_from_user(seta+1, &sf->extramask, (_COMPAT_NSIG_WORDS - 1) * sizeof(unsigned)); if (err) goto segv; switch (_NSIG_WORDS) { @@ -312,10 +312,10 @@ case 1: set.sig[0] = seta[0] + (((long)seta[1]) << 32); } sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); return; segv: @@ -327,7 +327,7 @@ struct sigcontext32 *scptr; unsigned pc, npc, psr; sigset_t set; - unsigned seta[_NSIG_WORDS32]; + unsigned seta[_COMPAT_NSIG_WORDS]; int err; synchronize_user_stack(); @@ -349,7 +349,7 @@ err |= __get_user(seta[0], &scptr->sigc_mask); /* Note that scptr + 1 points to extramask */ - err |= copy_from_user(seta+1, scptr + 1, (_NSIG_WORDS32 - 1) * sizeof(unsigned)); + err |= copy_from_user(seta+1, scptr + 1, (_COMPAT_NSIG_WORDS - 1) * sizeof(unsigned)); if (err) goto segv; switch (_NSIG_WORDS) { @@ -359,10 +359,10 @@ case 1: set.sig[0] = seta[0] + (((long)seta[1]) << 32); } sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (test_thread_flag(TIF_32BIT)) { pc &= 0xffffffff; @@ -393,7 +393,7 @@ unsigned pc, npc, fpu_save; mm_segment_t old_fs; sigset_t set; - sigset_t32 seta; + compat_sigset_t seta; stack_t st; int err, i; @@ -440,7 +440,7 @@ err |= __get_user(fpu_save, &sf->fpu_save); if (fpu_save) err |= restore_fpu_state32(regs, &sf->fpu_state); - err |= copy_from_user(&seta, &sf->mask, sizeof(sigset_t32)); + err |= copy_from_user(&seta, &sf->mask, sizeof(compat_sigset_t)); err |= __get_user((long)st.ss_sp, &sf->stack.ss_sp); err |= __get_user(st.ss_flags, &sf->stack.ss_flags); err |= __get_user(st.ss_size, &sf->stack.ss_size); @@ -461,10 +461,10 @@ case 1: set.sig[0] = seta.sig[0] + (((long)seta.sig[1]) << 32); } sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); return; segv: do_exit(SIGSEGV); @@ -498,7 +498,7 @@ { struct signal_sframe32 *sframep; struct sigcontext32 *sc; - unsigned seta[_NSIG_WORDS32]; + unsigned seta[_COMPAT_NSIG_WORDS]; int err = 0; void *sig_address; int sig_code; @@ -544,7 +544,7 @@ } err |= __put_user(seta[0], &sc->sigc_mask); err |= __copy_to_user(sframep->extramask, seta + 1, - (_NSIG_WORDS32 - 1) * sizeof(unsigned)); + (_COMPAT_NSIG_WORDS - 1) * sizeof(unsigned)); err |= __put_user(regs->u_regs[UREG_FP], &sc->sigc_sp); err |= __put_user(pc, &sc->sigc_pc); err |= __put_user(npc, &sc->sigc_npc); @@ -673,7 +673,7 @@ int sigframe_size; u32 psr; int i, err; - unsigned seta[_NSIG_WORDS32]; + unsigned seta[_COMPAT_NSIG_WORDS]; /* 1. Make sure everything is clean */ synchronize_user_stack(); @@ -729,7 +729,7 @@ } err |= __put_user(seta[0], &sf->info.si_mask); err |= __copy_to_user(sf->extramask, seta + 1, - (_NSIG_WORDS32 - 1) * sizeof(unsigned)); + (_COMPAT_NSIG_WORDS - 1) * sizeof(unsigned)); err |= copy_in_user((u32 *)sf, (u32 *)(regs->u_regs[UREG_FP]), @@ -1059,10 +1059,10 @@ set_fs(old_fs); sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->tpc = pc; regs->tnpc = npc | 1; if (test_thread_flag(TIF_32BIT)) { @@ -1098,7 +1098,7 @@ int sigframe_size; u32 psr; int i, err; - sigset_t32 seta; + compat_sigset_t seta; /* 1. Make sure everything is clean */ synchronize_user_stack(); @@ -1160,7 +1160,7 @@ case 1: seta.sig[1] = (oldset->sig[0] >> 32); seta.sig[0] = oldset->sig[0]; } - err |= __copy_to_user(&sf->mask, &seta, sizeof(sigset_t32)); + err |= __copy_to_user(&sf->mask, &seta, sizeof(compat_sigset_t)); err |= copy_in_user((u32 *)sf, (u32 *)(regs->u_regs[UREG_FP]), @@ -1241,11 +1241,11 @@ if (ka->sa.sa_flags & SA_ONESHOT) ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NOMASK)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked,signr); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } } @@ -1288,9 +1288,9 @@ sigset_t *mask = ¤t->blocked; unsigned long signr = 0; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); signr = dequeue_signal(mask, &info); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (!signr) break; diff -Nru a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c --- a/arch/sparc64/kernel/sys_sparc32.c Sun Feb 9 21:13:33 2003 +++ b/arch/sparc64/kernel/sys_sparc32.c Sun Feb 9 21:13:33 2003 @@ -1681,7 +1681,7 @@ extern asmlinkage int sys_sigprocmask(int how, old_sigset_t *set, old_sigset_t *oset); -asmlinkage int sys32_sigprocmask(int how, old_sigset_t32 *set, old_sigset_t32 *oset) +asmlinkage int sys32_sigprocmask(int how, compat_old_sigset_t *set, compat_old_sigset_t *oset) { old_sigset_t s; int ret; @@ -1698,15 +1698,15 @@ extern asmlinkage int sys_rt_sigprocmask(int how, sigset_t *set, sigset_t *oset, size_t sigsetsize); -asmlinkage int sys32_rt_sigprocmask(int how, sigset_t32 *set, sigset_t32 *oset, compat_size_t sigsetsize) +asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset_t *oset, compat_size_t sigsetsize) { sigset_t s; - sigset_t32 s32; + compat_sigset_t s32; int ret; mm_segment_t old_fs = get_fs(); if (set) { - if (copy_from_user (&s32, set, sizeof(sigset_t32))) + if (copy_from_user (&s32, set, sizeof(compat_sigset_t))) return -EFAULT; switch (_NSIG_WORDS) { case 4: s.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32); @@ -1726,7 +1726,7 @@ case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1]; case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0]; } - if (copy_to_user (oset, &s32, sizeof(sigset_t32))) + if (copy_to_user (oset, &s32, sizeof(compat_sigset_t))) return -EFAULT; } return 0; @@ -1734,7 +1734,7 @@ extern asmlinkage int sys_sigpending(old_sigset_t *set); -asmlinkage int sys32_sigpending(old_sigset_t32 *set) +asmlinkage int sys32_sigpending(compat_old_sigset_t *set) { old_sigset_t s; int ret; @@ -1749,10 +1749,10 @@ extern asmlinkage int sys_rt_sigpending(sigset_t *set, size_t sigsetsize); -asmlinkage int sys32_rt_sigpending(sigset_t32 *set, compat_size_t sigsetsize) +asmlinkage int sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize) { sigset_t s; - sigset_t32 s32; + compat_sigset_t s32; int ret; mm_segment_t old_fs = get_fs(); @@ -1766,19 +1766,19 @@ case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1]; case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0]; } - if (copy_to_user (set, &s32, sizeof(sigset_t32))) + if (copy_to_user (set, &s32, sizeof(compat_sigset_t))) return -EFAULT; } return ret; } asmlinkage int -sys32_rt_sigtimedwait(sigset_t32 *uthese, siginfo_t32 *uinfo, +sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo, struct compat_timespec *uts, compat_size_t sigsetsize) { int ret, sig; sigset_t these; - sigset_t32 these32; + compat_sigset_t these32; struct timespec ts; siginfo_t info; long timeout = 0; @@ -1787,7 +1787,7 @@ if (sigsetsize != sizeof(sigset_t)) return -EINVAL; - if (copy_from_user (&these32, uthese, sizeof(sigset_t32))) + if (copy_from_user (&these32, uthese, sizeof(compat_sigset_t))) return -EFAULT; switch (_NSIG_WORDS) { @@ -1812,7 +1812,7 @@ return -EINVAL; } - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sig = dequeue_signal(&these, &info); if (!sig) { timeout = MAX_SCHEDULE_TIMEOUT; @@ -1827,19 +1827,19 @@ current->real_blocked = current->blocked; sigandsets(¤t->blocked, ¤t->blocked, &these); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); current->state = TASK_INTERRUPTIBLE; timeout = schedule_timeout(timeout); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sig = dequeue_signal(&these, &info); current->blocked = current->real_blocked; siginitset(¤t->real_blocked, 0); recalc_sigpending(); } } - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (sig) { ret = sig; @@ -2718,7 +2718,7 @@ } if (act) { - old_sigset_t32 mask; + compat_old_sigset_t mask; ret = get_user((long)new_ka.sa.sa_handler, &act->sa_handler); ret |= __get_user((long)new_ka.sa.sa_restorer, &act->sa_restorer); @@ -2748,10 +2748,10 @@ { struct k_sigaction new_ka, old_ka; int ret; - sigset_t32 set32; + compat_sigset_t set32; /* XXX: Don't preclude handling different sized sigset_t's. */ - if (sigsetsize != sizeof(sigset_t32)) + if (sigsetsize != sizeof(compat_sigset_t)) return -EINVAL; /* All tasks which use RT signals (effectively) use @@ -2762,7 +2762,7 @@ if (act) { new_ka.ka_restorer = restorer; ret = get_user((long)new_ka.sa.sa_handler, &act->sa_handler); - ret |= __copy_from_user(&set32, &act->sa_mask, sizeof(sigset_t32)); + ret |= __copy_from_user(&set32, &act->sa_mask, sizeof(compat_sigset_t)); switch (_NSIG_WORDS) { case 4: new_ka.sa.sa_mask.sig[3] = set32.sig[6] | (((long)set32.sig[7]) << 32); case 3: new_ka.sa.sa_mask.sig[2] = set32.sig[4] | (((long)set32.sig[5]) << 32); @@ -2785,7 +2785,7 @@ case 1: set32.sig[1] = (old_ka.sa.sa_mask.sig[0] >> 32); set32.sig[0] = old_ka.sa.sa_mask.sig[0]; } ret = put_user((long)old_ka.sa.sa_handler, &oact->sa_handler); - ret |= __copy_to_user(&oact->sa_mask, &set32, sizeof(sigset_t32)); + ret |= __copy_to_user(&oact->sa_mask, &set32, sizeof(compat_sigset_t)); ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); ret |= __put_user((long)old_ka.sa.sa_restorer, &oact->sa_restorer); if (ret) diff -Nru a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c --- a/arch/sparc64/kernel/sys_sunos32.c Sun Feb 9 21:13:33 2003 +++ b/arch/sparc64/kernel/sys_sunos32.c Sun Feb 9 21:13:33 2003 @@ -238,11 +238,11 @@ { u32 old; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); old = (u32) current->blocked.sig[0]; current->blocked.sig[0] |= (blk_mask & _BLOCKABLE); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); return old; } @@ -250,11 +250,11 @@ { u32 retval; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); retval = (u32) current->blocked.sig[0]; current->blocked.sig[0] = (newmask & _BLOCKABLE); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); return retval; } @@ -1297,7 +1297,7 @@ int ret; if (act) { - old_sigset_t32 mask; + compat_old_sigset_t mask; if (get_user((long)new_ka.sa.sa_handler, &((struct old_sigaction32 *)A(act))->sa_handler) || __get_user(new_ka.sa.sa_flags, &((struct old_sigaction32 *)A(act))->sa_flags)) diff -Nru a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S --- a/arch/sparc64/kernel/systbls.S Sun Feb 9 21:13:31 2003 +++ b/arch/sparc64/kernel/systbls.S Sun Feb 9 21:13:31 2003 @@ -65,9 +65,6 @@ .word sys32_ipc, sys32_sigreturn, sys_clone, sys_nis_syscall, sys32_adjtimex /*220*/ .word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys_getpgid .word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16 - - /* 234 and 235 were for the hugetlb syscalls. They can be reused */ - /*230*/ .word sys32_select, sys_time, sys_nis_syscall, sys_stime, sys_ni_syscall .word sys_ni_syscall, sys_llseek, sys_mlock, sys_munlock, sys_mlockall /*240*/ .word sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler diff -Nru a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c --- a/arch/sparc64/kernel/time.c Sun Feb 9 21:13:32 2003 +++ b/arch/sparc64/kernel/time.c Sun Feb 9 21:13:32 2003 @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -37,8 +38,6 @@ #include #include -extern rwlock_t xtime_lock; - spinlock_t mostek_lock = SPIN_LOCK_UNLOCKED; spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; unsigned long mstk48t02_regs = 0UL; @@ -134,7 +133,7 @@ { unsigned long ticks, pstate; - write_lock(&xtime_lock); + write_seqlock(&xtime_lock); do { #ifndef CONFIG_SMP @@ -196,13 +195,13 @@ timer_check_rtc(); - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); } #ifdef CONFIG_SMP void timer_tick_interrupt(struct pt_regs *regs) { - write_lock(&xtime_lock); + write_seqlock(&xtime_lock); do_timer(regs); @@ -225,7 +224,7 @@ timer_check_rtc(); - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); } #endif @@ -665,7 +664,7 @@ if (this_is_starfire) return; - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); /* * This is revolting. We need to set "xtime" correctly. However, the * value in this location is the value at the most recent update of @@ -686,7 +685,7 @@ time_status |= STA_UNSYNC; time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } /* Ok, my cute asm atomicity trick doesn't work anymore. @@ -696,18 +695,20 @@ void do_gettimeofday(struct timeval *tv) { unsigned long flags; + unsigned long seq; unsigned long usec, sec; - read_lock_irqsave(&xtime_lock, flags); - usec = do_gettimeoffset(); - { - unsigned long lost = jiffies - wall_jiffies; - if (lost) - usec += lost * (1000000 / HZ); - } - sec = xtime.tv_sec; - usec += (xtime.tv_nsec / 1000); - read_unlock_irqrestore(&xtime_lock, flags); + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); + usec = do_gettimeoffset(); + { + unsigned long lost = jiffies - wall_jiffies; + if (lost) + usec += lost * (1000000 / HZ); + } + sec = xtime.tv_sec; + usec += (xtime.tv_nsec / 1000); + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); while (usec >= 1000000) { usec -= 1000000; diff -Nru a/arch/sparc64/kernel/winfixup.S b/arch/sparc64/kernel/winfixup.S --- a/arch/sparc64/kernel/winfixup.S Sun Feb 9 21:13:32 2003 +++ b/arch/sparc64/kernel/winfixup.S Sun Feb 9 21:13:32 2003 @@ -60,7 +60,7 @@ sll %g2, 3, %g2 ! NORMAL-->OTHER wrpr %g0, 0x0, %canrestore ! Standard etrap stuff. - wrpr %g2, 0x0, %wstate ! This must be consistant. + wrpr %g2, 0x0, %wstate ! This must be consistent. wrpr %g0, 0x0, %otherwin ! We know this. mov PRIMARY_CONTEXT, %g1 ! Change contexts... stxa %g0, [%g1] ASI_DMMU ! Back into the nucleus. @@ -181,7 +181,7 @@ sll %g2, 3, %g2 ! NORMAL-->OTHER wrpr %g0, 0x0, %canrestore ! Standard etrap stuff. - wrpr %g2, 0x0, %wstate ! This must be consistant. + wrpr %g2, 0x0, %wstate ! This must be consistent. wrpr %g0, 0x0, %otherwin ! We know this. mov PRIMARY_CONTEXT, %g1 ! Change contexts... stxa %g0, [%g1] ASI_DMMU ! Back into the nucleus. @@ -287,7 +287,7 @@ sll %g2, 3, %g2 ! NORMAL-->OTHER wrpr %g0, 0x0, %canrestore ! Standard etrap stuff. - wrpr %g2, 0x0, %wstate ! This must be consistant. + wrpr %g2, 0x0, %wstate ! This must be consistent. wrpr %g0, 0x0, %otherwin ! We know this. mov PRIMARY_CONTEXT, %g1 ! Change contexts... stxa %g0, [%g1] ASI_DMMU ! Back into the nucleus. diff -Nru a/arch/sparc64/math-emu/math.c b/arch/sparc64/math-emu/math.c --- a/arch/sparc64/math-emu/math.c Sun Feb 9 21:13:33 2003 +++ b/arch/sparc64/math-emu/math.c Sun Feb 9 21:13:33 2003 @@ -88,7 +88,7 @@ #define FSR_CEXC_MASK (0x1fUL << FSR_CEXC_SHIFT) /* All routines returning an exception to raise should detect - * such exceptions _before_ rounding to be consistant with + * such exceptions _before_ rounding to be consistent with * the behavior of the hardware in the implemented cases * (and thus with the recommendations in the V9 architecture * manual). diff -Nru a/arch/sparc64/mm/hugetlbpage.c b/arch/sparc64/mm/hugetlbpage.c --- a/arch/sparc64/mm/hugetlbpage.c Sun Feb 9 21:13:34 2003 +++ b/arch/sparc64/mm/hugetlbpage.c Sun Feb 9 21:13:34 2003 @@ -288,6 +288,7 @@ page = pte_page(pte); if (pages) { page += ((start & ~HPAGE_MASK) >> PAGE_SHIFT); + get_page(page); pages[i] = page; } if (vmas) @@ -584,11 +585,6 @@ page = alloc_pages(GFP_ATOMIC, HUGETLB_PAGE_ORDER); if (page == NULL) break; - map = page; - for (j = 0; j < (HPAGE_SIZE / PAGE_SIZE); j++) { - SetPageReserved(map); - map++; - } spin_lock(&htlbpage_lock); list_add(&page->list, &htlbpage_freelist); htlbpagemem++; @@ -613,7 +609,6 @@ map->flags &= ~(1UL << PG_locked | 1UL << PG_error | 1UL << PG_referenced | 1UL << PG_dirty | 1UL << PG_active | - 1UL << PG_reserved | 1UL << PG_private | 1UL << PG_writeback); set_page_count(page, 0); map++; @@ -624,6 +619,14 @@ return (int) htlbzone_pages; } +static struct page * +hugetlb_nopage(struct vm_area_struct *vma, unsigned long address, int unused) +{ + BUG(); + return NULL; +} + static struct vm_operations_struct hugetlb_vm_ops = { + .nopage = hugetlb_nopage, .close = zap_hugetlb_resources, }; diff -Nru a/arch/sparc64/solaris/signal.c b/arch/sparc64/solaris/signal.c --- a/arch/sparc64/solaris/signal.c Sun Feb 9 21:13:37 2003 +++ b/arch/sparc64/solaris/signal.c Sun Feb 9 21:13:37 2003 @@ -99,16 +99,16 @@ static long solaris_sigset(int sig, u32 arg) { if (arg != 2) /* HOLD */ { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigdelsetmask(¤t->blocked, _S(sig)); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); return sig_handler (sig, arg, 0); } else { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigaddsetmask(¤t->blocked, (_S(sig) & ~_BLOCKABLE)); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); return 0; } } @@ -120,10 +120,10 @@ static inline long solaris_sigrelse(int sig) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigdelsetmask(¤t->blocked, _S(sig)); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); return 0; } @@ -311,10 +311,10 @@ u32 tmp[4]; switch (which) { case 1: /* sigpending */ - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigandsets(&s, ¤t->blocked, ¤t->pending.signal); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); break; case 2: /* sigfillset - I just set signals which have linux equivalents */ sigfillset(&s); diff -Nru a/arch/um/Kconfig b/arch/um/Kconfig --- a/arch/um/Kconfig Sun Feb 9 21:13:32 2003 +++ b/arch/um/Kconfig Sun Feb 9 21:13:32 2003 @@ -30,36 +30,42 @@ bool default y +menu "UML-specific options" + config MODE_TT - bool + bool "Tracing thread support" default y + help + This option controls whether tracing thread support is compiled + into UML. Normally, this should be set to Y. If you intend to + use only skas mode (and the host has the skas patch applied to it), + then it is OK to say N here. + +config STATIC_LINK + bool "Force a static link" + default n + depends on !MODE_TT + help + If CONFIG_MODE_TT is disabled, then this option gives you the ability + to force a static link of UML. Normally, if only skas mode is built + in to UML, it will be linked as a shared binary. This is inconvenient + for use in a chroot jail. So, if you intend to run UML inside a + chroot, and you disable CONFIG_MODE_TT, you probably want to say Y + here. config MODE_SKAS - bool + bool "Separate Kernel Address Space support" default y - -menu "Code maturity level options" - -config EXPERIMENTAL - bool "Prompt for development and/or incomplete code/drivers" - -endmenu - - -menu "General Setup" + help + This option controls whether skas (separate kernel address space) + support is compiled in. If you have applied the skas patch to the + host, then you certainly want to say Y here (and consider saying N + to CONFIG_MODE_TT). Otherwise, it is safe to say Y. Disabling this + option will shrink the UML binary slightly. config NET bool "Networking support" -config SYSVIPC - bool "System V IPC" - -config BSD_PROCESS_ACCT - bool "BSD Process Accounting" - -config SYSCTL - bool "Sysctl support" - config BINFMT_AOUT tristate "Kernel support for a.out binaries" @@ -164,22 +170,18 @@ config HIGHMEM bool "Highmem support" -endmenu - - -menu "Loadable module support" - -config MODULES - bool "Enable loadable module support" - -# MODVERSIONS does not yet work in this architecture -# bool ' Set version information on all module symbols' CONFIG_MODVERSIONS -config KMOD - bool "Kernel module loader" - depends on MODULES +config KERNEL_STACK_ORDER + int "Kernel stack size order" + default 2 + help + This option determines the size of UML kernel stacks. They will + be 1 << order pages. The default is OK unless you're running Valgrind + on UML, in which case, set this to 3. endmenu +source "init/Kconfig" + source "arch/um/Kconfig_char" source "arch/um/Kconfig_block" @@ -194,6 +196,10 @@ source "fs/Kconfig" +source "security/Kconfig" + +source "crypto/Kconfig" + source "lib/Kconfig" menu "SCSI support" @@ -221,6 +227,9 @@ config DEBUG_SLAB bool "Debug memory allocations" +config DEBUG_SPINLOCK + bool "Debug spinlocks usage" + config DEBUGSYM bool "Enable kernel debugging symbols" help @@ -231,6 +240,10 @@ If you're truly short on disk space or don't expect to report any bugs back to the UML developers, say N, otherwise say Y. + +config FRAME_POINTER + bool + default y if DEBUGSYM config PT_PROXY bool "Enable ptrace proxy" diff -Nru a/arch/um/Makefile b/arch/um/Makefile --- a/arch/um/Makefile Sun Feb 9 21:13:33 2003 +++ b/arch/um/Makefile Sun Feb 9 21:13:33 2003 @@ -6,9 +6,6 @@ ARCH_DIR = arch/um OS := $(shell uname -s) -EXTRAVERSION := $(EXTRAVERSION)-1um -include/linux/version.h: arch/$(ARCH)/Makefile - # Recalculate MODLIB to reflect the EXTRAVERSION changes (via KERNELRELEASE) # The way the toplevel Makefile is written EXTRAVERSION is not supposed # to be changed outside the toplevel Makefile, but recalculating MODLIB is @@ -21,17 +18,34 @@ endif CFLAGS-$(CONFIG_DEBUGSYM) += -g -CFLAGS-$(CONFIG_GCOV) += -fprofile-arcs -ftest-coverage -CFLAGS-$(CONFIG_GPROF) += $(PROFILE) -LINK-$(CONFIG_GPROF) += $(PROFILE) -Wl,--wrap,__monstartup core-y += $(ARCH_DIR)/kernel/ \ $(ARCH_DIR)/drivers/ \ $(ARCH_DIR)/sys-$(SUBARCH)/ +# Have to precede the include because the included Makefiles reference them. +SYMLINK_HEADERS = include/asm-um/archparam.h include/asm-um/system.h \ + include/asm-um/sigcontext.h include/asm-um/processor.h \ + include/asm-um/ptrace.h include/asm-um/arch-signal.h + +ARCH_SYMLINKS = include/asm-um/arch $(ARCH_DIR)/include/sysdep $(ARCH_DIR)/os \ + $(SYMLINK_HEADERS) $(ARCH_DIR)/include/uml-config.h + +GEN_HEADERS += $(ARCH_DIR)/include/task.h $(ARCH_DIR)/include/kern_constants.h + +include $(ARCH_DIR)/Makefile-$(SUBARCH) +include $(ARCH_DIR)/Makefile-os-$(OS) + +MAKEFILE-$(CONFIG_MODE_TT) += Makefile-tt +MAKEFILE-$(CONFIG_MODE_SKAS) += Makefile-skas + +ifneq ($(MAKEFILE-y),) + include $(addprefix $(ARCH_DIR)/,$(MAKEFILE-y)) +endif + +EXTRAVERSION := $(EXTRAVERSION)-1um + ARCH_INCLUDE = -I$(ARCH_DIR)/include -MODE_INCLUDE = -I$(ARCH_DIR)/kernel/tt/include \ - -I$(ARCH_DIR)/kernel/skas/include # -Derrno=kernel_errno - This turns all kernel references to errno into # kernel_errno to separate them from the libc errno. This allows -fno-common @@ -46,23 +60,11 @@ SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000) -SYMLINK_HEADERS = include/asm-um/archparam.h include/asm-um/system.h \ - include/asm-um/sigcontext.h include/asm-um/processor.h \ - include/asm-um/ptrace.h include/asm-um/arch-signal.h - -ARCH_SYMLINKS = include/asm-um/arch $(ARCH_DIR)/include/sysdep $(ARCH_DIR)/os \ - $(SYMLINK_HEADERS) $(ARCH_DIR)/include/uml-config.h - ifeq ($(CONFIG_MODE_SKAS), y) -GEN_HEADERS = $(ARCH_DIR)/kernel/skas/include/skas_ptregs.h - $(SYS_HEADERS) : $(ARCH_DIR)/kernel/skas/include/skas_ptregs.h endif -GEN_HEADERS += $(ARCH_DIR)/include/task.h $(ARCH_DIR)/include/kern_constants.h - -include $(ARCH_DIR)/Makefile-$(SUBARCH) -include $(ARCH_DIR)/Makefile-os-$(OS) +include/linux/version.h: arch/$(ARCH)/Makefile $(ARCH_DIR)/vmlinux.lds.S : touch $@ @@ -73,16 +75,46 @@ vmlinux: $(ARCH_DIR)/main.o -$(ARCH_DIR)/uml.lds.s : $(ARCH_DIR)/uml.lds.S scripts FORCE - $(call if_changed_dep,as_s_S) +# These aren't in Makefile-tt because they are needed in the !CONFIG_MODE_TT + +# CONFIG_MODE_SKAS + CONFIG_STATIC_LINK case. -AFLAGS_uml.lds.o = -U$(SUBARCH) -DSTART=$$(($(TOP_ADDR) - $(SIZE))) \ - -DELF_ARCH=$(ELF_ARCH) -DELF_FORMAT=\"$(ELF_FORMAT)\" -P -C -Uum +LINK_TT = -static +LD_SCRIPT_TT := uml.lds.s -linux: $(ARCH_DIR)/uml.lds.s vmlinux - $(CC) -Wl,-T,$(ARCH_DIR)/uml.lds.s -static $(LINK-y) $(LINK_WRAPS) \ - -o linux $(ARCH_DIR)/main.o vmlinux -L/usr/lib -lutil +ifeq ($(CONFIG_STATIC_LINK),y) + LINK-y += $(LINK_TT) + LD_SCRIPT-y := $(LD_SCRIPT_TT) +else +ifeq ($(CONFIG_MODE_TT),y) + LINK-y += $(LINK_TT) + LD_SCRIPT-y := $(LD_SCRIPT_TT) +else +ifeq ($(CONFIG_MODE_SKAS),y) + LINK-y += $(LINK_SKAS) + LD_SCRIPT-y := $(LD_SCRIPT_SKAS) +endif +endif +endif + +CPP_MODE_TT := $(shell [ "$(CONFIG_MODE_TT)" = "y" ] && echo -DMODE_TT) +CONFIG_KERNEL_STACK_ORDER ?= 2 +STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) + +AFLAGS_vmlinux.lds.o = -U$(SUBARCH) \ + -DSTART=$$(($(TOP_ADDR) - $(SIZE))) -DELF_ARCH=$(ELF_ARCH) \ + -DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE_TT) \ + -DKERNEL_STACK_SIZE=$(STACK_SIZE) + +AFLAGS_$(LD_SCRIPT-y:.s=).o = $(AFLAGS_vmlinux.lds.o) -P -C -Uum +LD_SCRIPT-y := $(ARCH_DIR)/$(LD_SCRIPT-y) + +$(LD_SCRIPT-y) : $(LD_SCRIPT-y:.s=.S) scripts FORCE + $(call if_changed_dep,as_s_S) + +linux: vmlinux $(LD_SCRIPT-y) + $(CC) -Wl,-T,$(LD_SCRIPT-y) $(LINK-y) $(LINK_WRAPS) \ + -o linux $(ARCH_DIR)/main.o vmlinux -L/usr/lib -lutil USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) USER_CFLAGS := $(patsubst -Derrno=kernel_errno,,$(USER_CFLAGS)) @@ -92,7 +124,8 @@ # To get a definition of F_SETSIG USER_CFLAGS += -D_GNU_SOURCE -CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/link.ld $(GEN_HEADERS) +CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/uml.lds.s \ + $(ARCH_DIR)/dyn_link.ld.s $(GEN_HEADERS) $(ARCH_DIR)/main.o: $(ARCH_DIR)/main.c $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< @@ -102,8 +135,7 @@ do \ $(MAKE) -C $$d archmrproper; \ done - rm -f $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) include/asm \ - $(ARCH_DIR)/link.ld \ + rm -f $(CLEAN_FILES) $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) include/asm \ $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) archclean: sysclean @@ -132,7 +164,7 @@ cd $(ARCH_DIR) && ln -sf os-$(OS) os $(ARCH_DIR)/include/uml-config.h : - ln -sf $(TOPDIR)/include/linux/autoconf.h $@ + sed 's/ CONFIG/ UML_CONFIG/' $(TOPDIR)/include/linux/autoconf.h > $@ $(ARCH_DIR)/include/task.h : $(ARCH_DIR)/util/mk_task $< > $@ @@ -145,8 +177,5 @@ $(ARCH_DIR)/util: FORCE @$(call descend,$@,) - -$(ARCH_DIR)/kernel/skas/include/skas_ptregs.h : - $(MAKE) -C $(ARCH_DIR)/kernel/skas include/skas_ptregs.h export SUBARCH USER_CFLAGS OS diff -Nru a/arch/um/Makefile-skas b/arch/um/Makefile-skas --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/um/Makefile-skas Sun Feb 9 21:13:37 2003 @@ -0,0 +1,20 @@ +# +# Copyright (C) 2002 Jeff Dike (jdike@karaya.com) +# Licensed under the GPL +# + +PROFILE += -pg + +CFLAGS-$(CONFIG_GCOV) += -fprofile-arcs -ftest-coverage +CFLAGS-$(CONFIG_GPROF) += $(PROFILE) +LINK-$(CONFIG_GPROF) += $(PROFILE) + +MODE_INCLUDE += -I$(TOPDIR)/$(ARCH_DIR)/kernel/skas/include + +LINK_SKAS = -Wl,-rpath,/lib +LD_SCRIPT_SKAS = dyn.lds.s + +GEN_HEADERS += $(ARCH_DIR)/kernel/skas/include/skas_ptregs.h + +$(ARCH_DIR)/kernel/skas/include/skas_ptregs.h : + $(MAKE) -C $(ARCH_DIR)/kernel/skas include/skas_ptregs.h diff -Nru a/arch/um/Makefile-tt b/arch/um/Makefile-tt --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/um/Makefile-tt Sun Feb 9 21:13:38 2003 @@ -0,0 +1,7 @@ +# +# Copyright (C) 2002 Jeff Dike (jdike@karaya.com) +# Licensed under the GPL +# + +MODE_INCLUDE += -I$(TOPDIR)/$(ARCH_DIR)/kernel/tt/include + diff -Nru a/arch/um/defconfig b/arch/um/defconfig --- a/arch/um/defconfig Sun Feb 9 21:13:33 2003 +++ b/arch/um/defconfig Sun Feb 9 21:13:33 2003 @@ -2,11 +2,11 @@ # Automatically generated make config: don't edit # CONFIG_USERMODE=y -# CONFIG_ISA is not set -# CONFIG_SBUS is not set -# CONFIG_PCI is not set +CONFIG_MMU=y +CONFIG_SWAP=y CONFIG_UID16=y CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_CONFIG_LOG_BUF_SHIFT=14 # # Code maturity level options @@ -16,6 +16,8 @@ # # General Setup # +CONFIG_MODE_TT=y +CONFIG_MODE_SKAS=y CONFIG_NET=y CONFIG_SYSVIPC=y CONFIG_BSD_PROCESS_ACCT=y @@ -32,6 +34,8 @@ CONFIG_NEST_LEVEL=0 CONFIG_KERNEL_HALF_GIGS=1 # CONFIG_HIGHMEM is not set +CONFIG_PROC_MM=y +CONFIG_KERNEL_STACK_ORDER=2 # # Loadable module support @@ -56,13 +60,9 @@ CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=256 # CONFIG_WATCHDOG is not set -# CONFIG_WATCHDOG_NOWAYOUT is not set -# CONFIG_SOFT_WATCHDOG is not set -# CONFIG_UML_WATCHDOG is not set CONFIG_UML_SOUND=y CONFIG_SOUND=y CONFIG_HOSTAUDIO=y -# CONFIG_TTY_LOG is not set # # Block Devices @@ -87,13 +87,14 @@ CONFIG_UML_NET_DAEMON=y CONFIG_UML_NET_MCAST=y # CONFIG_UML_NET_PCAP is not set +CONFIG_UML_NET_SLIRP=y CONFIG_DUMMY=y # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set CONFIG_TUN=y +# CONFIG_ETHERTAP is not set CONFIG_PPP=y # CONFIG_PPP_MULTILINK is not set -# CONFIG_PPP_FILTER is not set # CONFIG_PPP_ASYNC is not set # CONFIG_PPP_SYNC_TTY is not set # CONFIG_PPP_DEFLATE is not set @@ -105,6 +106,10 @@ # CONFIG_SLIP_MODE_SLIP6 is not set # +# Networking support +# + +# # Networking options # CONFIG_PACKET=y @@ -113,6 +118,7 @@ # CONFIG_NETFILTER is not set # CONFIG_FILTER is not set CONFIG_UNIX=y +# CONFIG_NET_KEY is not set CONFIG_INET=y # CONFIG_IP_MULTICAST is not set # CONFIG_IP_ADVANCED_ROUTER is not set @@ -122,19 +128,19 @@ # CONFIG_ARPD is not set # CONFIG_INET_ECN is not set # CONFIG_SYN_COOKIES is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_XFRM_USER is not set # CONFIG_IPV6 is not set # -# SCTP Configuration (EXPERIMENTAL) +# SCTP Configuration (EXPERIMENTAL) # CONFIG_IPV6_SCTP__=y # CONFIG_IP_SCTP is not set # CONFIG_ATM is not set # CONFIG_VLAN_8021Q is not set # CONFIG_LLC is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_DEV_APPLETALK is not set # CONFIG_DECNET is not set # CONFIG_BRIDGE is not set # CONFIG_X25 is not set @@ -151,6 +157,35 @@ # CONFIG_NET_SCHED is not set # +# Network testing +# +# CONFIG_NET_PKTGEN is not set + +# +# Ethernet (10 or 100Mbit) +# +# CONFIG_NET_ETHERNET is not set + +# +# Ethernet (1000 Mbit) +# + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices (depends on LLC=y) +# +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# # File systems # CONFIG_QUOTA=y @@ -163,16 +198,14 @@ # CONFIG_REISERFS_CHECK is not set # CONFIG_REISERFS_PROC_INFO is not set # CONFIG_ADFS_FS is not set -# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EXT3_FS is not set # CONFIG_JBD is not set -# CONFIG_JBD_DEBUG is not set CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m -# CONFIG_UMSDOS_FS is not set CONFIG_VFAT_FS=m # CONFIG_EFS_FS is not set CONFIG_JFFS_FS=y @@ -186,13 +219,9 @@ # CONFIG_JOLIET is not set # CONFIG_ZISOFS is not set # CONFIG_JFS_FS is not set -# CONFIG_JFS_DEBUG is not set -# CONFIG_JFS_STATISTICS is not set CONFIG_MINIX_FS=m # CONFIG_VXFS_FS is not set # CONFIG_NTFS_FS is not set -# CONFIG_NTFS_DEBUG is not set -# CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y CONFIG_DEVFS_FS=y @@ -200,17 +229,13 @@ # CONFIG_DEVFS_DEBUG is not set CONFIG_DEVPTS_FS=y # CONFIG_QNX4FS_FS is not set -# CONFIG_QNX4FS_RW is not set # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set # CONFIG_SYSV_FS is not set # CONFIG_UDF_FS is not set -# CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set -# CONFIG_UFS_FS_WRITE is not set # CONFIG_XFS_FS is not set -# CONFIG_XFS_RT is not set -# CONFIG_XFS_QUOTA is not set # # Network File Systems @@ -218,36 +243,18 @@ # CONFIG_CODA_FS is not set # CONFIG_INTERMEZZO_FS is not set # CONFIG_NFS_FS is not set -# CONFIG_NFS_V3 is not set -# CONFIG_NFS_V4 is not set -# CONFIG_ROOT_NFS is not set # CONFIG_NFSD is not set -# CONFIG_NFSD_V3 is not set -# CONFIG_NFSD_V4 is not set -# CONFIG_NFSD_TCP is not set -# CONFIG_SUNRPC is not set -# CONFIG_LOCKD is not set # CONFIG_EXPORTFS is not set # CONFIG_CIFS is not set # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set -# CONFIG_NCPFS_PACKET_SIGNING is not set -# CONFIG_NCPFS_IOCTL_LOCKING is not set -# CONFIG_NCPFS_STRONG is not set -# CONFIG_NCPFS_NFS_NS is not set -# CONFIG_NCPFS_OS2_NS is not set -# CONFIG_NCPFS_SMALLDOS is not set -# CONFIG_NCPFS_NLS is not set -# CONFIG_NCPFS_EXTRAS is not set # CONFIG_AFS_FS is not set -# CONFIG_ZISOFS_FS is not set # # Partition Types # # CONFIG_PARTITION_ADVANCED is not set CONFIG_MSDOS_PARTITION=y -# CONFIG_SMB_NLS is not set CONFIG_NLS=y # @@ -293,6 +300,21 @@ # CONFIG_NLS_UTF8 is not set # +# Security options +# +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Library routines +# +# CONFIG_CRC32 is not set + +# # SCSI support # CONFIG_SCSI=y @@ -322,13 +344,6 @@ # Multi-device support (RAID and LVM) # # CONFIG_MD is not set -# CONFIG_BLK_DEV_MD is not set -# CONFIG_MD_LINEAR is not set -# CONFIG_MD_RAID0 is not set -# CONFIG_MD_RAID1 is not set -# CONFIG_MD_RAID5 is not set -# CONFIG_MD_MULTIPATH is not set -# CONFIG_BLK_DEV_LVM is not set # # Memory Technology Devices (MTD) @@ -337,8 +352,6 @@ # CONFIG_MTD_DEBUG is not set # CONFIG_MTD_PARTITIONS is not set # CONFIG_MTD_CONCAT is not set -# CONFIG_MTD_REDBOOT_PARTS is not set -# CONFIG_MTD_CMDLINE_PARTS is not set # # User Modules And Translation Layers @@ -353,28 +366,18 @@ # # CONFIG_MTD_CFI is not set # CONFIG_MTD_JEDECPROBE is not set -# CONFIG_MTD_GEN_PROBE is not set -# CONFIG_MTD_CFI_INTELEXT is not set -# CONFIG_MTD_CFI_AMDSTD is not set # CONFIG_MTD_RAM is not set # CONFIG_MTD_ROM is not set # CONFIG_MTD_ABSENT is not set # CONFIG_MTD_OBSOLETE_CHIPS is not set -# CONFIG_MTD_AMDSTD is not set -# CONFIG_MTD_SHARP is not set -# CONFIG_MTD_JEDEC is not set # # Mapping drivers for chip access # -# CONFIG_MTD_PHYSMAP is not set -# CONFIG_MTD_PCI is not set -# CONFIG_MTD_PCMCIA is not set # # Self-contained MTD device drivers # -# CONFIG_MTD_PMC551 is not set # CONFIG_MTD_SLRAM is not set # CONFIG_MTD_MTDRAM is not set CONFIG_MTD_BLKMTD=m @@ -385,7 +388,6 @@ # CONFIG_MTD_DOC1000 is not set # CONFIG_MTD_DOC2000 is not set # CONFIG_MTD_DOC2001 is not set -# CONFIG_MTD_DOCPROBE is not set # # NAND Flash Device Drivers @@ -396,7 +398,9 @@ # Kernel hacking # # CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set CONFIG_DEBUGSYM=y +CONFIG_FRAME_POINTER=y CONFIG_PT_PROXY=y # CONFIG_GPROF is not set # CONFIG_GCOV is not set diff -Nru a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile --- a/arch/um/drivers/Makefile Sun Feb 9 21:13:32 2003 +++ b/arch/um/drivers/Makefile Sun Feb 9 21:13:32 2003 @@ -20,8 +20,6 @@ port-objs := port_kern.o port_user.o harddog-objs := harddog_kern.o harddog_user.o -export-objs := mconsole_kern.o - obj-y = obj-$(CONFIG_SSL) += ssl.o obj-$(CONFIG_UML_NET_SLIP) += slip.o diff -Nru a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c --- a/arch/um/drivers/chan_kern.c Sun Feb 9 21:13:37 2003 +++ b/arch/um/drivers/chan_kern.c Sun Feb 9 21:13:37 2003 @@ -75,15 +75,15 @@ } static struct chan_ops not_configged_ops = { - init: not_configged_init, - open: not_configged_open, - close: not_configged_close, - read: not_configged_read, - write: not_configged_write, - console_write: not_configged_console_write, - window_size: not_configged_window_size, - free: not_configged_free, - winch: 0, + .init = not_configged_init, + .open = not_configged_open, + .close = not_configged_close, + .read = not_configged_read, + .write = not_configged_write, + .console_write = not_configged_console_write, + .window_size = not_configged_window_size, + .free = not_configged_free, + .winch = 0, }; static void tty_receive_char(struct tty_struct *tty, char ch) @@ -395,15 +395,15 @@ chan = kmalloc(sizeof(*chan), GFP_KERNEL); if(chan == NULL) return(NULL); - *chan = ((struct chan) { list : LIST_HEAD_INIT(chan->list), - primary : 1, - input : 0, - output : 0, - opened : 0, - fd : -1, - pri : pri, - ops : ops, - data : data }); + *chan = ((struct chan) { .list = LIST_HEAD_INIT(chan->list), + .primary = 1, + .input = 0, + .output = 0, + .opened = 0, + .fd = -1, + .pri = pri, + .ops = ops, + .data = data }); return(chan); } diff -Nru a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c --- a/arch/um/drivers/chan_user.c Sun Feb 9 21:13:28 2003 +++ b/arch/um/drivers/chan_user.c Sun Feb 9 21:13:28 2003 @@ -159,9 +159,9 @@ return(err); } - data = ((struct winch_data) { pty_fd : fd, - pipe_fd : fds[1], - close_me : fds[0] } ); + data = ((struct winch_data) { .pty_fd = fd, + .pipe_fd = fds[1], + .close_me = fds[0] } ); pid = run_helper_thread(winch_thread, &data, 0, &stack, 0); if(pid < 0){ printk("fork of winch_thread failed - errno = %d\n", errno); diff -Nru a/arch/um/drivers/daemon_kern.c b/arch/um/drivers/daemon_kern.c --- a/arch/um/drivers/daemon_kern.c Sun Feb 9 21:13:28 2003 +++ b/arch/um/drivers/daemon_kern.c Sun Feb 9 21:13:28 2003 @@ -28,14 +28,14 @@ pri = dev->priv; dpri = (struct daemon_data *) pri->user; *dpri = ((struct daemon_data) - { sock_type : init->sock_type, - ctl_sock : init->ctl_sock, - ctl_addr : NULL, - data_addr : NULL, - local_addr : NULL, - fd : -1, - control : -1, - dev : dev }); + { .sock_type = init->sock_type, + .ctl_sock = init->ctl_sock, + .ctl_addr = NULL, + .data_addr = NULL, + .local_addr = NULL, + .fd = -1, + .control = -1, + .dev = dev }); printk("daemon backend (uml_switch version %d) - %s:%s", SWITCH_VERSION, dpri->sock_type, dpri->ctl_sock); @@ -59,10 +59,10 @@ } static struct net_kern_info daemon_kern_info = { - init: daemon_init, - protocol: eth_protocol, - read: daemon_read, - write: daemon_write, + .init = daemon_init, + .protocol = eth_protocol, + .read = daemon_read, + .write = daemon_write, }; int daemon_setup(char *str, char **mac_out, void *data) @@ -71,8 +71,8 @@ char *remain; *init = ((struct daemon_init) - { sock_type : "unix", - ctl_sock : "/tmp/uml.ctl" }); + { .sock_type = "unix", + .ctl_sock = "/tmp/uml.ctl" }); remain = split_if_spec(str, mac_out, &init->sock_type, &init->ctl_sock, NULL); @@ -84,13 +84,13 @@ } static struct transport daemon_transport = { - list : LIST_HEAD_INIT(daemon_transport.list), - name : "daemon", - setup : daemon_setup, - user : &daemon_user_info, - kern : &daemon_kern_info, - private_size : sizeof(struct daemon_data), - setup_size : sizeof(struct daemon_init), + .list = LIST_HEAD_INIT(daemon_transport.list), + .name = "daemon", + .setup = daemon_setup, + .user = &daemon_user_info, + .kern = &daemon_kern_info, + .private_size = sizeof(struct daemon_data), + .setup_size = sizeof(struct daemon_init), }; static int register_daemon(void) diff -Nru a/arch/um/drivers/daemon_user.c b/arch/um/drivers/daemon_user.c --- a/arch/um/drivers/daemon_user.c Sun Feb 9 21:13:31 2003 +++ b/arch/um/drivers/daemon_user.c Sun Feb 9 21:13:31 2003 @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -24,8 +25,8 @@ #define SWITCH_MAGIC 0xfeedface struct request_v3 { - unsigned long magic; - int version; + uint32_t magic; + uint32_t version; enum request_type type; struct sockaddr_un sock; }; @@ -172,14 +173,14 @@ } struct net_user_info daemon_user_info = { - init: daemon_user_init, - open: daemon_open, - close: NULL, - remove: daemon_remove, - set_mtu: daemon_set_mtu, - add_address: NULL, - delete_address: NULL, - max_packet: MAX_PACKET - ETH_HEADER_OTHER + .init = daemon_user_init, + .open = daemon_open, + .close = NULL, + .remove = daemon_remove, + .set_mtu = daemon_set_mtu, + .add_address = NULL, + .delete_address = NULL, + .max_packet = MAX_PACKET - ETH_HEADER_OTHER }; /* diff -Nru a/arch/um/drivers/fd.c b/arch/um/drivers/fd.c --- a/arch/um/drivers/fd.c Sun Feb 9 21:13:36 2003 +++ b/arch/um/drivers/fd.c Sun Feb 9 21:13:36 2003 @@ -36,8 +36,8 @@ return(NULL); } if((data = um_kmalloc(sizeof(*data))) == NULL) return(NULL); - *data = ((struct fd_chan) { fd : n, - raw : opts->raw }); + *data = ((struct fd_chan) { .fd = n, + .raw = opts->raw }); return(data); } @@ -72,16 +72,16 @@ } struct chan_ops fd_ops = { - type: "fd", - init: fd_init, - open: fd_open, - close: fd_close, - read: generic_read, - write: generic_write, - console_write: fd_console_write, - window_size: generic_window_size, - free: generic_free, - winch: 1, + .type = "fd", + .init = fd_init, + .open = fd_open, + .close = fd_close, + .read = generic_read, + .write = generic_write, + .console_write = fd_console_write, + .window_size = generic_window_size, + .free = generic_free, + .winch = 1, }; /* diff -Nru a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c --- a/arch/um/drivers/harddog_kern.c Sun Feb 9 21:13:33 2003 +++ b/arch/um/drivers/harddog_kern.c Sun Feb 9 21:13:33 2003 @@ -145,17 +145,17 @@ } static struct file_operations harddog_fops = { - owner: THIS_MODULE, - write: harddog_write, - ioctl: harddog_ioctl, - open: harddog_open, - release: harddog_release, + .owner = THIS_MODULE, + .write = harddog_write, + .ioctl = harddog_ioctl, + .open = harddog_open, + .release = harddog_release, }; static struct miscdevice harddog_miscdev = { - minor: WATCHDOG_MINOR, - name: "watchdog", - fops: &harddog_fops, + .minor = WATCHDOG_MINOR, + .name = "watchdog", + .fops = &harddog_fops, }; static char banner[] __initdata = KERN_INFO "UML Watchdog Timer\n"; diff -Nru a/arch/um/drivers/harddog_user.c b/arch/um/drivers/harddog_user.c --- a/arch/um/drivers/harddog_user.c Sun Feb 9 21:13:30 2003 +++ b/arch/um/drivers/harddog_user.c Sun Feb 9 21:13:30 2003 @@ -11,6 +11,8 @@ #include "helper.h" #include "mconsole.h" #include "os.h" +#include "choose-mode.h" +#include "mode.h" struct dog_data { int stdin; @@ -63,7 +65,8 @@ args = mconsole_args; } else { - sprintf(pid_buf, "%d", tracing_pid); + /* XXX The os_getpid() is not SMP correct */ + sprintf(pid_buf, "%d", CHOOSE_MODE(tracing_pid, os_getpid())); args = pid_args; } diff -Nru a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c --- a/arch/um/drivers/hostaudio_kern.c Sun Feb 9 21:13:36 2003 +++ b/arch/um/drivers/hostaudio_kern.c Sun Feb 9 21:13:36 2003 @@ -195,23 +195,23 @@ /* kernel module operations */ static struct file_operations hostaudio_fops = { - owner: THIS_MODULE, - llseek: no_llseek, - read: hostaudio_read, - write: hostaudio_write, - poll: hostaudio_poll, - ioctl: hostaudio_ioctl, - mmap: NULL, - open: hostaudio_open, - release: hostaudio_release, + .owner = THIS_MODULE, + .llseek = no_llseek, + .read = hostaudio_read, + .write = hostaudio_write, + .poll = hostaudio_poll, + .ioctl = hostaudio_ioctl, + .mmap = NULL, + .open = hostaudio_open, + .release = hostaudio_release, }; static struct file_operations hostmixer_fops = { - owner: THIS_MODULE, - llseek: no_llseek, - ioctl: hostmixer_ioctl_mixdev, - open: hostmixer_open_mixdev, - release: hostmixer_release, + .owner = THIS_MODULE, + .llseek = no_llseek, + .ioctl = hostmixer_ioctl_mixdev, + .open = hostmixer_open_mixdev, + .release = hostmixer_release, }; struct { diff -Nru a/arch/um/drivers/line.c b/arch/um/drivers/line.c --- a/arch/um/drivers/line.c Sun Feb 9 21:13:35 2003 +++ b/arch/um/drivers/line.c Sun Feb 9 21:13:35 2003 @@ -35,7 +35,7 @@ line_interrupt(dev->driver->read_irq, dev, NULL); } -void buffer_data(struct line *line, const char *buf, int len) +static void buffer_data(struct line *line, const char *buf, int len) { int end; @@ -452,11 +452,19 @@ void lines_init(struct line *lines, int nlines) { + struct line *line; int i; for(i = 0; i < nlines; i++){ - INIT_LIST_HEAD(&lines[i].chan_list); - sema_init(&lines[i].sem, 1); + line = &lines[i]; + INIT_LIST_HEAD(&line->chan_list); + sema_init(&line->sem, 1); + if(line->init_str != NULL){ + line->init_str = uml_strdup(line->init_str); + if(line->init_str == NULL) + printk("lines_init - uml_strdup returned " + "NULL\n"); + } } } @@ -511,11 +519,11 @@ printk("register_winch_irq - kmalloc failed\n"); goto out; } - *winch = ((struct winch) { list : LIST_HEAD_INIT(winch->list), - fd : fd, - tty_fd : tty_fd, - pid : pid, - line : line }); + *winch = ((struct winch) { .list = LIST_HEAD_INIT(winch->list), + .fd = fd, + .tty_fd = tty_fd, + .pid = pid, + .line = line }); list_add(&winch->list, &winch_handlers); if(um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt, SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, @@ -533,7 +541,8 @@ list_for_each(ele, &winch_handlers){ winch = list_entry(ele, struct winch, list); close(winch->fd); - if(winch->pid != -1) os_kill_process(winch->pid, 0); + if(winch->pid != -1) + os_kill_process(winch->pid, 1); } } diff -Nru a/arch/um/drivers/mcast_kern.c b/arch/um/drivers/mcast_kern.c --- a/arch/um/drivers/mcast_kern.c Sun Feb 9 21:13:28 2003 +++ b/arch/um/drivers/mcast_kern.c Sun Feb 9 21:13:28 2003 @@ -36,11 +36,11 @@ pri = dev->priv; dpri = (struct mcast_data *) pri->user; *dpri = ((struct mcast_data) - { addr : init->addr, - port : init->port, - ttl : init->ttl, - mcast_addr : NULL, - dev : dev }); + { .addr = init->addr, + .port = init->port, + .ttl = init->ttl, + .mcast_addr = NULL, + .dev = dev }); printk("mcast backend "); printk("multicast adddress: %s:%u, TTL:%u ", dpri->addr, dpri->port, dpri->ttl); @@ -64,10 +64,10 @@ } static struct net_kern_info mcast_kern_info = { - init: mcast_init, - protocol: eth_protocol, - read: mcast_read, - write: mcast_write, + .init = mcast_init, + .protocol = eth_protocol, + .read = mcast_read, + .write = mcast_write, }; int mcast_setup(char *str, char **mac_out, void *data) @@ -78,9 +78,9 @@ int n; *init = ((struct mcast_init) - { addr : "239.192.168.1", - port : 1102, - ttl : 1 }); + { .addr = "239.192.168.1", + .port = 1102, + .ttl = 1 }); remain = split_if_spec(str, mac_out, &init->addr, &port_str, &ttl_str, NULL); @@ -116,13 +116,13 @@ } static struct transport mcast_transport = { - list : LIST_HEAD_INIT(mcast_transport.list), - name : "mcast", - setup : mcast_setup, - user : &mcast_user_info, - kern : &mcast_kern_info, - private_size : sizeof(struct mcast_data), - setup_size : sizeof(struct mcast_init), + .list = LIST_HEAD_INIT(mcast_transport.list), + .name = "mcast", + .setup = mcast_setup, + .user = &mcast_user_info, + .kern = &mcast_kern_info, + .private_size = sizeof(struct mcast_data), + .setup_size = sizeof(struct mcast_init), }; static int register_mcast(void) diff -Nru a/arch/um/drivers/mcast_user.c b/arch/um/drivers/mcast_user.c --- a/arch/um/drivers/mcast_user.c Sun Feb 9 21:13:32 2003 +++ b/arch/um/drivers/mcast_user.c Sun Feb 9 21:13:32 2003 @@ -153,14 +153,14 @@ } struct net_user_info mcast_user_info = { - init: mcast_user_init, - open: mcast_open, - close: mcast_close, - remove: NULL, - set_mtu: mcast_set_mtu, - add_address: NULL, - delete_address: NULL, - max_packet: MAX_PACKET - ETH_HEADER_OTHER + .init = mcast_user_init, + .open = mcast_open, + .close = mcast_close, + .remove = NULL, + .set_mtu = mcast_set_mtu, + .add_address = NULL, + .delete_address = NULL, + .max_packet = MAX_PACKET - ETH_HEADER_OTHER }; /* diff -Nru a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c --- a/arch/um/drivers/mconsole_kern.c Sun Feb 9 21:13:28 2003 +++ b/arch/um/drivers/mconsole_kern.c Sun Feb 9 21:13:28 2003 @@ -36,8 +36,8 @@ static struct notifier_block reboot_notifier = { - notifier_call: do_unlink_socket, - priority: 0, + .notifier_call = do_unlink_socket, + .priority = 0, }; /* Safe without explicit locking for now. Tasklets provide their own @@ -418,9 +418,9 @@ } static struct notifier_block panic_exit_notifier = { - notifier_call : notify_panic, - next : NULL, - priority : 1 + .notifier_call = notify_panic, + .next = NULL, + .priority = 1 }; static int add_notifier(void) diff -Nru a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c --- a/arch/um/drivers/mmapper_kern.c Sun Feb 9 21:13:29 2003 +++ b/arch/um/drivers/mmapper_kern.c Sun Feb 9 21:13:29 2003 @@ -106,13 +106,13 @@ } static struct file_operations mmapper_fops = { - owner: THIS_MODULE, - read: mmapper_read, - write: mmapper_write, - ioctl: mmapper_ioctl, - mmap: mmapper_mmap, - open: mmapper_open, - release: mmapper_release, + .owner = THIS_MODULE, + .read = mmapper_read, + .write = mmapper_write, + .ioctl = mmapper_ioctl, + .mmap = mmapper_mmap, + .open = mmapper_open, + .release = mmapper_release, }; static int __init mmapper_init(void) diff -Nru a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c --- a/arch/um/drivers/net_kern.c Sun Feb 9 21:13:32 2003 +++ b/arch/um/drivers/net_kern.c Sun Feb 9 21:13:32 2003 @@ -368,22 +368,22 @@ */ save = lp->user[0]; *lp = ((struct uml_net_private) - { list : LIST_HEAD_INIT(lp->list), - lock : SPIN_LOCK_UNLOCKED, - dev : dev, - fd : -1, - mac : { 0xfe, 0xfd, 0x0, 0x0, 0x0, 0x0}, - have_mac : device->have_mac, - protocol : transport->kern->protocol, - open : transport->user->open, - close : transport->user->close, - remove : transport->user->remove, - read : transport->kern->read, - write : transport->kern->write, - add_address : transport->user->add_address, - delete_address : transport->user->delete_address, - set_mtu : transport->user->set_mtu, - user : { save } }); + { .list = LIST_HEAD_INIT(lp->list), + .lock = SPIN_LOCK_UNLOCKED, + .dev = dev, + .fd = -1, + .mac = { 0xfe, 0xfd, 0x0, 0x0, 0x0, 0x0}, + .have_mac = device->have_mac, + .protocol = transport->kern->protocol, + .open = transport->user->open, + .close = transport->user->close, + .remove = transport->user->remove, + .read = transport->kern->read, + .write = transport->kern->write, + .add_address = transport->user->add_address, + .delete_address = transport->user->delete_address, + .set_mtu = transport->user->set_mtu, + .user = { save } }); init_timer(&lp->tl); lp->tl.function = uml_net_user_timer_expire; memset(&lp->stats, 0, sizeof(lp->stats)); @@ -542,9 +542,9 @@ printk("eth_init : alloc_bootmem failed\n"); return(1); } - *new = ((struct eth_init) { list : LIST_HEAD_INIT(new->list), - index : n, - init : str }); + *new = ((struct eth_init) { .list = LIST_HEAD_INIT(new->list), + .index = n, + .init = str }); list_add_tail(&new->list, ð_cmd_line); return(1); } @@ -618,9 +618,10 @@ } static struct mc_device net_mc = { - name: "eth", - config: net_config, - remove: net_remove, + .name = "eth", + .config = net_config, + .get_config = NULL, + .remove = net_remove, }; static int uml_inetaddr_event(struct notifier_block *this, unsigned long event, @@ -662,7 +663,7 @@ } struct notifier_block uml_inetaddr_notifier = { - notifier_call: uml_inetaddr_event, + .notifier_call = uml_inetaddr_event, }; static int uml_net_init(void) diff -Nru a/arch/um/drivers/null.c b/arch/um/drivers/null.c --- a/arch/um/drivers/null.c Sun Feb 9 21:13:29 2003 +++ b/arch/um/drivers/null.c Sun Feb 9 21:13:29 2003 @@ -32,16 +32,16 @@ } struct chan_ops null_ops = { - type: "null", - init: null_init, - open: null_open, - close: generic_close, - read: null_read, - write: generic_write, - console_write: generic_console_write, - window_size: generic_window_size, - free: null_free, - winch: 0, + .type = "null", + .init = null_init, + .open = null_open, + .close = generic_close, + .read = null_read, + .write = generic_write, + .console_write = generic_console_write, + .window_size = generic_window_size, + .free = null_free, + .winch = 0, }; /* diff -Nru a/arch/um/drivers/pcap_kern.c b/arch/um/drivers/pcap_kern.c --- a/arch/um/drivers/pcap_kern.c Sun Feb 9 21:13:36 2003 +++ b/arch/um/drivers/pcap_kern.c Sun Feb 9 21:13:36 2003 @@ -27,12 +27,12 @@ pri = dev->priv; ppri = (struct pcap_data *) pri->user; *ppri = ((struct pcap_data) - { host_if : init->host_if, - promisc : init->promisc, - optimize : init->optimize, - filter : init->filter, - compiled : NULL, - pcap : NULL }); + { .host_if = init->host_if, + .promisc = init->promisc, + .optimize = init->optimize, + .filter = init->filter, + .compiled = NULL, + .pcap = NULL }); } static int pcap_read(int fd, struct sk_buff **skb, @@ -51,10 +51,10 @@ } static struct net_kern_info pcap_kern_info = { - init: pcap_init, - protocol: eth_protocol, - read: pcap_read, - write: pcap_write, + .init = pcap_init, + .protocol = eth_protocol, + .read = pcap_read, + .write = pcap_write, }; int pcap_setup(char *str, char **mac_out, void *data) @@ -64,10 +64,10 @@ int i; *init = ((struct pcap_init) - { host_if : "eth0", - promisc : 1, - optimize : 0, - filter : NULL }); + { .host_if = "eth0", + .promisc = 1, + .optimize = 0, + .filter = NULL }); remain = split_if_spec(str, &host_if, &init->filter, &options[0], &options[1], NULL); @@ -98,13 +98,13 @@ } static struct transport pcap_transport = { - list : LIST_HEAD_INIT(pcap_transport.list), - name : "pcap", - setup : pcap_setup, - user : &pcap_user_info, - kern : &pcap_kern_info, - private_size : sizeof(struct pcap_data), - setup_size : sizeof(struct pcap_init), + .list = LIST_HEAD_INIT(pcap_transport.list), + .name = "pcap", + .setup = pcap_setup, + .user = &pcap_user_info, + .kern = &pcap_kern_info, + .private_size = sizeof(struct pcap_data), + .setup_size = sizeof(struct pcap_init), }; static int register_pcap(void) diff -Nru a/arch/um/drivers/pcap_user.c b/arch/um/drivers/pcap_user.c --- a/arch/um/drivers/pcap_user.c Sun Feb 9 21:13:35 2003 +++ b/arch/um/drivers/pcap_user.c Sun Feb 9 21:13:35 2003 @@ -106,8 +106,8 @@ int pcap_user_read(int fd, void *buffer, int len, struct pcap_data *pri) { struct pcap_handler_data hdata = ((struct pcap_handler_data) - { buffer : buffer, - len : len }); + { .buffer = buffer, + .len = len }); int n; n = pcap_dispatch(pri->pcap, 1, handler, (u_char *) &hdata); @@ -121,14 +121,14 @@ } struct net_user_info pcap_user_info = { - init: pcap_user_init, - open: pcap_open, - close: NULL, - remove: pcap_remove, - set_mtu: NULL, - add_address: NULL, - delete_address: NULL, - max_packet: MAX_PACKET - ETH_HEADER_OTHER + .init = pcap_user_init, + .open = pcap_open, + .close = NULL, + .remove = pcap_remove, + .set_mtu = NULL, + .add_address = NULL, + .delete_address = NULL, + .max_packet = MAX_PACKET - ETH_HEADER_OTHER }; /* diff -Nru a/arch/um/drivers/port_kern.c b/arch/um/drivers/port_kern.c --- a/arch/um/drivers/port_kern.c Sun Feb 9 21:13:28 2003 +++ b/arch/um/drivers/port_kern.c Sun Feb 9 21:13:28 2003 @@ -31,7 +31,6 @@ struct port_dev { struct port_list *port; - int fd; int helper_pid; int telnetd_pid; }; @@ -50,12 +49,13 @@ struct connection *conn = data; int fd; - fd = os_rcv_fd(conn->socket[0], &conn->helper_pid); + fd = os_rcv_fd(conn->socket[0], &conn->helper_pid); if(fd < 0){ if(fd == -EAGAIN) return; - printk("os_rcv_fd returned %d\n", -fd); + printk(KERN_ERR "pipe_interrupt : os_rcv_fd returned %d\n", + -fd); os_close_file(conn->fd); } @@ -75,37 +75,42 @@ fd = port_connection(port->fd, socket, &pid); if(fd < 0){ if(fd != -EAGAIN) - printk("port_connection returned %d\n", -fd); + printk(KERN_ERR "port_accept : port_connection " + "returned %d\n", -fd); goto out; } conn = kmalloc(sizeof(*conn), GFP_ATOMIC); if(conn == NULL){ - printk("port_interrupt : failed to allocate connection\n"); + printk(KERN_ERR "port_accept : failed to allocate " + "connection\n"); goto out_close; } *conn = ((struct connection) - { list : LIST_HEAD_INIT(conn->list), - fd : fd, - socket : { socket[0], socket[1] }, - telnetd_pid : pid, - port : port }); + { .list = LIST_HEAD_INIT(conn->list), + .fd = fd, + .socket = { socket[0], socket[1] }, + .telnetd_pid = pid, + .port = port }); if(um_request_irq(TELNETD_IRQ, socket[0], IRQ_READ, pipe_interrupt, SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, "telnetd", conn)){ - printk(KERN_ERR "Failed to get IRQ for telnetd\n"); + printk(KERN_ERR "port_accept : failed to get IRQ for " + "telnetd\n"); goto out_free; } list_add(&conn->list, &port->pending); - return(1); + ret = 1; + goto out; out_free: kfree(conn); out_close: os_close_file(fd); - if(pid != -1) os_kill_process(pid, 0); + if(pid != -1) + os_kill_process(pid, 1); out: return(ret); } @@ -173,14 +178,15 @@ } *port = ((struct port_list) - { list : LIST_HEAD_INIT(port->list), - has_connection : 0, - sem : __SEMAPHORE_INITIALIZER(port->sem, 0), - lock : SPIN_LOCK_UNLOCKED, - port : port_num, - fd : fd, - pending : LIST_HEAD_INIT(port->pending), - connections : LIST_HEAD_INIT(port->connections) }); + { .list = LIST_HEAD_INIT(port->list), + .has_connection = 0, + .sem = __SEMAPHORE_INITIALIZER(port->sem, + 0), + .lock = SPIN_LOCK_UNLOCKED, + .port = port_num, + .fd = fd, + .pending = LIST_HEAD_INIT(port->pending), + .connections = LIST_HEAD_INIT(port->connections) }); list_add(&port->list, &ports); found: @@ -190,9 +196,9 @@ goto out; } - *dev = ((struct port_dev) { port : port, - fd : -1, - helper_pid : -1 }); + *dev = ((struct port_dev) { .port = port, + .helper_pid = -1, + .telnetd_pid = -1 }); goto out; out_free: @@ -204,38 +210,16 @@ return(dev); } -void port_remove_dev(void *d) -{ - struct port_dev *dev = d; - - if(dev->helper_pid != -1) - os_kill_process(dev->helper_pid, 0); - if(dev->telnetd_pid != -1) - os_kill_process(dev->telnetd_pid, 0); - dev->helper_pid = -1; -} - -static void free_port(void) -{ - struct list_head *ele; - struct port_list *port; - - list_for_each(ele, &ports){ - port = list_entry(ele, struct port_list, list); - os_close_file(port->fd); - } -} - -__uml_exitcall(free_port); - int port_wait(void *data) { struct port_dev *dev = data; struct connection *conn; struct port_list *port = dev->port; + int fd; while(1){ - if(down_interruptible(&port->sem)) return(-ERESTARTSYS); + if(down_interruptible(&port->sem)) + return(-ERESTARTSYS); spin_lock(&port->lock); @@ -262,22 +246,47 @@ kfree(conn); } - dev->fd = conn->fd; + fd = conn->fd; dev->helper_pid = conn->helper_pid; dev->telnetd_pid = conn->telnetd_pid; kfree(conn); - return(dev->fd); + return(fd); +} + +void port_remove_dev(void *d) +{ + struct port_dev *dev = d; + + if(dev->helper_pid != -1) + os_kill_process(dev->helper_pid, 0); + if(dev->telnetd_pid != -1) + os_kill_process(dev->telnetd_pid, 1); + dev->helper_pid = -1; + dev->telnetd_pid = -1; } void port_kern_free(void *d) { struct port_dev *dev = d; - if(dev->helper_pid != -1) os_kill_process(dev->helper_pid, 0); - if(dev->telnetd_pid != -1) os_kill_process(dev->telnetd_pid, 0); + port_remove_dev(dev); kfree(dev); } + +static void free_port(void) +{ + struct list_head *ele; + struct port_list *port; + + list_for_each(ele, &ports){ + port = list_entry(ele, struct port_list, list); + free_irq_by_fd(port->fd); + os_close_file(port->fd); + } +} + +__uml_exitcall(free_port); /* * Overrides for Emacs so that we follow Linus's tabbing style. diff -Nru a/arch/um/drivers/port_user.c b/arch/um/drivers/port_user.c --- a/arch/um/drivers/port_user.c Sun Feb 9 21:13:33 2003 +++ b/arch/um/drivers/port_user.c Sun Feb 9 21:13:33 2003 @@ -47,14 +47,28 @@ return(NULL); } - if((kern_data = port_data(port)) == NULL) return(NULL); + if((kern_data = port_data(port)) == NULL) + return(NULL); - if((data = um_kmalloc(sizeof(*data))) == NULL) return(NULL); - *data = ((struct port_chan) { raw : opts->raw, - kernel_data : kern_data }); + if((data = um_kmalloc(sizeof(*data))) == NULL) + goto err; + + *data = ((struct port_chan) { .raw = opts->raw, + .kernel_data = kern_data }); sprintf(data->dev, "%d", port); - + return(data); + err: + port_kern_free(kern_data); + return(NULL); +} + +void port_free(void *d) +{ + struct port_chan *data = d; + + port_kern_free(data->kernel_data); + kfree(data); } int port_open(int input, int output, int primary, void *d, char **dev_out) @@ -86,25 +100,17 @@ return(generic_console_write(fd, buf, n, &data->tt)); } -void port_free(void *d) -{ - struct port_chan *data = d; - - port_kern_free(data->kernel_data); - kfree(data); -} - struct chan_ops port_ops = { - type: "port", - init: port_init, - open: port_open, - close: port_close, - read: generic_read, - write: generic_write, - console_write: port_console_write, - window_size: generic_window_size, - free: port_free, - winch: 1, + .type = "port", + .init = port_init, + .open = port_open, + .close = port_close, + .read = generic_read, + .write = generic_write, + .console_write = port_console_write, + .window_size = generic_window_size, + .free = port_free, + .winch = 1, }; int port_listen_fd(int port) @@ -113,7 +119,8 @@ int fd, err; fd = socket(PF_INET, SOCK_STREAM, 0); - if(fd == -1) return(-errno); + if(fd == -1) + return(-errno); addr.sin_family = AF_INET; addr.sin_port = htons(port); @@ -163,14 +170,16 @@ return(-errno); err = os_pipe(socket, 0, 0); - if(err) goto out_close; + if(err) + goto out_close; data = ((struct port_pre_exec_data) - { sock_fd : new, - pipe_fd : socket[1] }); + { .sock_fd = new, + .pipe_fd = socket[1] }); err = run_helper(port_pre_exec, &data, argv, NULL); - if(err < 0) goto out_shutdown; + if(err < 0) + goto out_shutdown; *pid_out = err; return(new); diff -Nru a/arch/um/drivers/pty.c b/arch/um/drivers/pty.c --- a/arch/um/drivers/pty.c Sun Feb 9 21:13:35 2003 +++ b/arch/um/drivers/pty.c Sun Feb 9 21:13:35 2003 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001 Jeff Dike (jdike@karaya.com) + * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com) * Licensed under the GPL */ @@ -27,9 +27,9 @@ struct pty_chan *data; if((data = um_kmalloc(sizeof(*data))) == NULL) return(NULL); - *data = ((struct pty_chan) { announce : opts->announce, - dev : device, - raw : opts->raw }); + *data = ((struct pty_chan) { .announce = opts->announce, + .dev = device, + .raw = opts->raw }); return(data); } @@ -86,34 +86,15 @@ return(-1); } -struct grantpt_info { - int fd; - int res; - int err; -}; - -static void grantpt_cb(void *arg) -{ - struct grantpt_info *info = arg; - - info->res = grantpt(info->fd); - info->err = errno; -} - int pty_open(int input, int output, int primary, void *d, char **dev_out) { struct pty_chan *data = d; int fd; char dev[sizeof("/dev/ptyxx\0")] = "/dev/ptyxx"; - struct grantpt_info info; fd = getmaster(dev); if(fd < 0) return(-errno); - info.fd = fd; - initial_thread_cb(grantpt_cb, &info); - unlockpt(fd); - if(data->raw) raw(fd, 0); if(data->announce) (*data->announce)(dev, data->dev); @@ -130,29 +111,29 @@ } struct chan_ops pty_ops = { - type: "pty", - init: pty_chan_init, - open: pty_open, - close: generic_close, - read: generic_read, - write: generic_write, - console_write: pty_console_write, - window_size: generic_window_size, - free: generic_free, - winch: 0, + .type = "pty", + .init = pty_chan_init, + .open = pty_open, + .close = generic_close, + .read = generic_read, + .write = generic_write, + .console_write = pty_console_write, + .window_size = generic_window_size, + .free = generic_free, + .winch = 0, }; struct chan_ops pts_ops = { - type: "pts", - init: pty_chan_init, - open: pts_open, - close: generic_close, - read: generic_read, - write: generic_write, - console_write: pty_console_write, - window_size: generic_window_size, - free: generic_free, - winch: 0, + .type = "pts", + .init = pty_chan_init, + .open = pts_open, + .close = generic_close, + .read = generic_read, + .write = generic_write, + .console_write = pty_console_write, + .window_size = generic_window_size, + .free = generic_free, + .winch = 0, }; /* diff -Nru a/arch/um/drivers/slip_kern.c b/arch/um/drivers/slip_kern.c --- a/arch/um/drivers/slip_kern.c Sun Feb 9 21:13:31 2003 +++ b/arch/um/drivers/slip_kern.c Sun Feb 9 21:13:31 2003 @@ -22,15 +22,15 @@ private = dev->priv; spri = (struct slip_data *) private->user; *spri = ((struct slip_data) - { name : { '\0' }, - addr: NULL, - gate_addr : init->gate_addr, - slave : -1, - ibuf : { '\0' }, - obuf : { '\0' }, - pos : 0, - esc : 0, - dev : dev }); + { .name = { '\0' }, + .addr = NULL, + .gate_addr = init->gate_addr, + .slave = -1, + .ibuf = { '\0' }, + .obuf = { '\0' }, + .pos = 0, + .esc = 0, + .dev = dev }); dev->init = NULL; dev->hard_header_len = 0; @@ -61,10 +61,10 @@ } struct net_kern_info slip_kern_info = { - init: slip_init, - protocol: slip_protocol, - read: slip_read, - write: slip_write, + .init = slip_init, + .protocol = slip_protocol, + .read = slip_read, + .write = slip_write, }; static int slip_setup(char *str, char **mac_out, void *data) @@ -72,7 +72,7 @@ struct slip_init *init = data; *init = ((struct slip_init) - { gate_addr : NULL }); + { .gate_addr = NULL }); if(str[0] != '\0') init->gate_addr = str; @@ -80,13 +80,13 @@ } static struct transport slip_transport = { - list : LIST_HEAD_INIT(slip_transport.list), - name : "slip", - setup : slip_setup, - user : &slip_user_info, - kern : &slip_kern_info, - private_size : sizeof(struct slip_data), - setup_size : sizeof(struct slip_init), + .list = LIST_HEAD_INIT(slip_transport.list), + .name = "slip", + .setup = slip_setup, + .user = &slip_user_info, + .kern = &slip_kern_info, + .private_size = sizeof(struct slip_data), + .setup_size = sizeof(struct slip_init), }; static int register_slip(void) diff -Nru a/arch/um/drivers/slip_user.c b/arch/um/drivers/slip_user.c --- a/arch/um/drivers/slip_user.c Sun Feb 9 21:13:35 2003 +++ b/arch/um/drivers/slip_user.c Sun Feb 9 21:13:35 2003 @@ -257,14 +257,14 @@ } struct net_user_info slip_user_info = { - init: slip_user_init, - open: slip_open, - close: slip_close, - remove: NULL, - set_mtu: slip_set_mtu, - add_address: slip_add_addr, - delete_address: slip_del_addr, - max_packet: BUF_SIZE + .init = slip_user_init, + .open = slip_open, + .close = slip_close, + .remove = NULL, + .set_mtu = slip_set_mtu, + .add_address = slip_add_addr, + .delete_address = slip_del_addr, + .max_packet = BUF_SIZE }; /* diff -Nru a/arch/um/drivers/slirp_kern.c b/arch/um/drivers/slirp_kern.c --- a/arch/um/drivers/slirp_kern.c Sun Feb 9 21:13:36 2003 +++ b/arch/um/drivers/slirp_kern.c Sun Feb 9 21:13:36 2003 @@ -22,14 +22,14 @@ private = dev->priv; spri = (struct slirp_data *) private->user; *spri = ((struct slirp_data) - { argw : init->argw, - pid : -1, - slave : -1, - ibuf : { '\0' }, - obuf : { '\0' }, - pos : 0, - esc : 0, - dev : dev }); + { .argw = init->argw, + .pid = -1, + .slave = -1, + .ibuf = { '\0' }, + .obuf = { '\0' }, + .pos = 0, + .esc = 0, + .dev = dev }); dev->init = NULL; dev->hard_header_len = 0; @@ -64,10 +64,10 @@ } struct net_kern_info slirp_kern_info = { - init: slirp_init, - protocol: slirp_protocol, - read: slirp_read, - write: slirp_write, + .init = slirp_init, + .protocol = slirp_protocol, + .read = slirp_read, + .write = slirp_write, }; static int slirp_setup(char *str, char **mac_out, void *data) @@ -103,13 +103,13 @@ } static struct transport slirp_transport = { - list : LIST_HEAD_INIT(slirp_transport.list), - name : "slirp", - setup : slirp_setup, - user : &slirp_user_info, - kern : &slirp_kern_info, - private_size : sizeof(struct slirp_data), - setup_size : sizeof(struct slirp_init), + .list = LIST_HEAD_INIT(slirp_transport.list), + .name = "slirp", + .setup = slirp_setup, + .user = &slirp_user_info, + .kern = &slirp_kern_info, + .private_size = sizeof(struct slirp_data), + .setup_size = sizeof(struct slirp_init), }; static int register_slirp(void) diff -Nru a/arch/um/drivers/slirp_user.c b/arch/um/drivers/slirp_user.c --- a/arch/um/drivers/slirp_user.c Sun Feb 9 21:13:29 2003 +++ b/arch/um/drivers/slirp_user.c Sun Feb 9 21:13:29 2003 @@ -180,14 +180,14 @@ } struct net_user_info slirp_user_info = { - init: slirp_user_init, - open: slirp_open, - close: slirp_close, - remove: NULL, - set_mtu: slirp_set_mtu, - add_address: NULL, - delete_address: NULL, - max_packet: BUF_SIZE + .init = slirp_user_init, + .open = slirp_open, + .close = slirp_close, + .remove = NULL, + .set_mtu = slirp_set_mtu, + .add_address = NULL, + .delete_address = NULL, + .max_packet = BUF_SIZE }; /* diff -Nru a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c --- a/arch/um/drivers/ssl.c Sun Feb 9 21:13:32 2003 +++ b/arch/um/drivers/ssl.c Sun Feb 9 21:13:32 2003 @@ -41,11 +41,11 @@ } static struct chan_opts opts = { - announce: ssl_announce, - xterm_title: "Serial Line #%d", - raw: 1, - tramp_stack : 0, - in_kernel : 1, + .announce = ssl_announce, + .xterm_title = "Serial Line #%d", + .raw = 1, + .tramp_stack = 0, + .in_kernel = 1, }; static int ssl_config(char *str); @@ -53,23 +53,23 @@ static int ssl_remove(char *str); static struct line_driver driver = { - name : "UML serial line", - devfs_name : "tts/%d", - major : TTYAUX_MAJOR, - minor_start : 64, - type : TTY_DRIVER_TYPE_SERIAL, - subtype : 0, - read_irq : SSL_IRQ, - read_irq_name : "ssl", - write_irq : SSL_WRITE_IRQ, - write_irq_name : "ssl-write", - symlink_from : "serial", - symlink_to : "tts", - mc : { - name : "ssl", - config : ssl_config, - get_config : ssl_get_config, - remove : ssl_remove, + .name = "UML serial line", + .devfs_name = "tts/%d", + .major = TTYAUX_MAJOR, + .minor_start = 64, + .type = TTY_DRIVER_TYPE_SERIAL, + .subtype = 0, + .read_irq = SSL_IRQ, + .read_irq_name = "ssl", + .write_irq = SSL_WRITE_IRQ, + .write_irq_name = "ssl-write", + .symlink_from = "serial", + .symlink_to = "tts", + .mc = { + .name = "ssl", + .config = ssl_config, + .get_config = ssl_get_config, + .remove = ssl_remove, }, }; @@ -191,21 +191,21 @@ } static struct tty_driver ssl_driver = { - refcount : &ssl_refcount, - open : ssl_open, - close : ssl_close, - write : ssl_write, - put_char : ssl_put_char, - flush_chars : ssl_flush_chars, - chars_in_buffer : ssl_chars_in_buffer, - flush_buffer : ssl_flush_buffer, - ioctl : ssl_ioctl, - throttle : ssl_throttle, - unthrottle : ssl_unthrottle, - set_termios : ssl_set_termios, - stop : ssl_stop, - start : ssl_start, - hangup : ssl_hangup + .refcount = &ssl_refcount, + .open = ssl_open, + .close = ssl_close, + .write = ssl_write, + .put_char = ssl_put_char, + .flush_chars = ssl_flush_chars, + .chars_in_buffer = ssl_chars_in_buffer, + .flush_buffer = ssl_flush_buffer, + .ioctl = ssl_ioctl, + .throttle = ssl_throttle, + .unthrottle = ssl_unthrottle, + .set_termios = ssl_set_termios, + .stop = ssl_stop, + .start = ssl_start, + .hangup = ssl_hangup }; /* Changed by ssl_init and referenced by ssl_exit, which are both serialized diff -Nru a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c --- a/arch/um/drivers/stdio_console.c Sun Feb 9 21:13:30 2003 +++ b/arch/um/drivers/stdio_console.c Sun Feb 9 21:13:30 2003 @@ -42,28 +42,28 @@ static int console_refcount = 0; static struct chan_ops init_console_ops = { - type: "you shouldn't see this", - init : NULL, - open : NULL, - close : NULL, - read : NULL, - write : NULL, - console_write : generic_write, - window_size : NULL, - free : NULL, - winch: 0, + .type = "you shouldn't see this", + .init = NULL, + .open = NULL, + .close = NULL, + .read = NULL, + .write = NULL, + .console_write = generic_write, + .window_size = NULL, + .free = NULL, + .winch = 0, }; static struct chan init_console_chan = { - list : { }, - primary : 1, - input : 0, - output : 1, - opened : 1, - fd : 1, - pri : INIT_STATIC, - ops : &init_console_ops, - data : NULL + .list = { }, + .primary = 1, + .input = 0, + .output = 1, + .opened = 1, + .fd = 1, + .pri = INIT_STATIC, + .ops = &init_console_ops, + .data = NULL }; void stdio_announce(char *dev_name, int dev) @@ -73,11 +73,11 @@ } static struct chan_opts opts = { - announce: stdio_announce, - xterm_title: "Virtual Console #%d", - raw: 1, - tramp_stack : 0, - in_kernel : 1, + .announce = stdio_announce, + .xterm_title = "Virtual Console #%d", + .raw = 1, + .tramp_stack = 0, + .in_kernel = 1, }; static int con_config(char *str); @@ -85,23 +85,23 @@ static int con_remove(char *str); static struct line_driver driver = { - name : "UML console", - devfs_name : "vc/%d", - major : TTY_MAJOR, - minor_start : 0, - type : TTY_DRIVER_TYPE_CONSOLE, - subtype : SYSTEM_TYPE_CONSOLE, - read_irq : CONSOLE_IRQ, - read_irq_name : "console", - write_irq : CONSOLE_WRITE_IRQ, - write_irq_name : "console-write", - symlink_from : "ttys", - symlink_to : "vc", - mc : { - name : "con", - config : con_config, - get_config : con_get_config, - remove : con_remove, + .name = "UML console", + .devfs_name = "vc/%d", + .major = TTY_MAJOR, + .minor_start = 0, + .type = TTY_DRIVER_TYPE_CONSOLE, + .subtype = SYSTEM_TYPE_CONSOLE, + .read_irq = CONSOLE_IRQ, + .read_irq_name = "console", + .write_irq = CONSOLE_WRITE_IRQ, + .write_irq_name = "console-write", + .symlink_from = "ttys", + .symlink_to = "vc", + .mc = { + .name = "con", + .config = con_config, + .get_config = con_get_config, + .remove = con_remove, }, }; @@ -192,12 +192,12 @@ } static struct tty_driver console_driver = { - refcount : &console_refcount, - open : con_open, - close : con_close, - write : con_write, - chars_in_buffer : chars_in_buffer, - set_termios : set_termios + .refcount = &console_refcount, + .open = con_open, + .close = con_close, + .write = con_write, + .chars_in_buffer = chars_in_buffer, + .set_termios = set_termios }; static kdev_t console_device(struct console *c) diff -Nru a/arch/um/drivers/tty.c b/arch/um/drivers/tty.c --- a/arch/um/drivers/tty.c Sun Feb 9 21:13:31 2003 +++ b/arch/um/drivers/tty.c Sun Feb 9 21:13:31 2003 @@ -32,8 +32,8 @@ if((data = um_kmalloc(sizeof(*data))) == NULL) return(NULL); - *data = ((struct tty_chan) { dev : str, - raw : opts->raw }); + *data = ((struct tty_chan) { .dev = str, + .raw = opts->raw }); return(data); } @@ -62,16 +62,16 @@ } struct chan_ops tty_ops = { - type: "tty", - init: tty_chan_init, - open: tty_open, - close: generic_close, - read: generic_read, - write: generic_write, - console_write: tty_console_write, - window_size: generic_window_size, - free: generic_free, - winch: 0, + .type = "tty", + .init = tty_chan_init, + .open = tty_open, + .close = generic_close, + .read = generic_read, + .write = generic_write, + .console_write = tty_console_write, + .window_size = generic_window_size, + .free = generic_free, + .winch = 0, }; /* diff -Nru a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c --- a/arch/um/drivers/ubd_kern.c Sun Feb 9 21:13:32 2003 +++ b/arch/um/drivers/ubd_kern.c Sun Feb 9 21:13:32 2003 @@ -77,9 +77,11 @@ static struct gendisk *fake_gendisk[MAX_DEV]; #ifdef CONFIG_BLK_DEV_UBD_SYNC -#define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 1, .c = 0 }) +#define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 1, .c = 0, \ + .cl = 1 }) #else -#define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 0, .c = 0 }) +#define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 0, .c = 0, \ + .cl = 1 }) #endif /* Not protected - changed only in ubd_setup_common and then only to @@ -177,6 +179,8 @@ if(proc_ide_root == NULL) make_proc_ide(); dir = proc_mkdir(dev_name, proc_ide); + if(!dir) return; + ent = create_proc_entry("media", S_IFREG|S_IRUGO, dir); if(!ent) return; ent->nlink = 1; @@ -405,7 +409,8 @@ void kill_io_thread(void) { - if(io_pid != -1) kill(io_pid, SIGKILL); + if(io_pid != -1) + os_kill_process(io_pid, 1); } __uml_exitcall(kill_io_thread); @@ -892,9 +897,9 @@ struct ubd *dev = inode->i_bdev->bd_disk->private_data; int err; struct hd_driveid ubd_id = { - .cyls = 0, - .heads = 128, - .sectors = 32, + .cyls = 0, + .heads = 128, + .sectors = 32, }; switch (cmd) { diff -Nru a/arch/um/drivers/xterm.c b/arch/um/drivers/xterm.c --- a/arch/um/drivers/xterm.c Sun Feb 9 21:13:28 2003 +++ b/arch/um/drivers/xterm.c Sun Feb 9 21:13:28 2003 @@ -37,13 +37,13 @@ struct xterm_chan *data; if((data = malloc(sizeof(*data))) == NULL) return(NULL); - *data = ((struct xterm_chan) { pid : -1, - helper_pid : -1, - device : device, - title : opts->xterm_title, - raw : opts->raw, - stack : opts->tramp_stack, - direct_rcv : !opts->in_kernel } ); + *data = ((struct xterm_chan) { .pid = -1, + .helper_pid = -1, + .device = device, + .title = opts->xterm_title, + .raw = opts->raw, + .stack = opts->tramp_stack, + .direct_rcv = !opts->in_kernel } ); return(data); } @@ -137,7 +137,7 @@ } if(new < 0){ printk("xterm_open : os_rcv_fd failed, errno = %d\n", -new); - return(new); + goto out; } tcgetattr(new, &data->tt); @@ -145,6 +145,8 @@ data->pid = pid; *dev_out = NULL; + out: + unlink(file); return(new); } @@ -152,9 +154,11 @@ { struct xterm_chan *data = d; - if(data->pid != -1) kill(data->pid, SIGKILL); + if(data->pid != -1) + os_kill_process(data->pid, 1); data->pid = -1; - if(data->helper_pid != -1) kill(data->helper_pid, SIGKILL); + if(data->helper_pid != -1) + os_kill_process(data->helper_pid, 0); data->helper_pid = -1; close(fd); } @@ -172,16 +176,16 @@ } struct chan_ops xterm_ops = { - type: "xterm", - init: xterm_init, - open: xterm_open, - close: xterm_close, - read: generic_read, - write: generic_write, - console_write: xterm_console_write, - window_size: generic_window_size, - free: xterm_free, - winch: 1, + .type = "xterm", + .init = xterm_init, + .open = xterm_open, + .close = xterm_close, + .read = generic_read, + .write = generic_write, + .console_write = xterm_console_write, + .window_size = generic_window_size, + .free = xterm_free, + .winch = 1, }; /* diff -Nru a/arch/um/drivers/xterm_kern.c b/arch/um/drivers/xterm_kern.c --- a/arch/um/drivers/xterm_kern.c Sun Feb 9 21:13:34 2003 +++ b/arch/um/drivers/xterm_kern.c Sun Feb 9 21:13:34 2003 @@ -39,21 +39,21 @@ data = kmalloc(sizeof(*data), GFP_KERNEL); if(data == NULL){ - printk(KERN_ERR "xterm_fd - failed to allocate semaphore\n"); + printk(KERN_ERR "xterm_fd : failed to allocate xterm_wait\n"); return(-ENOMEM); } *data = ((struct xterm_wait) - { sem : __SEMAPHORE_INITIALIZER(data->sem, 0), - fd : socket, - pid : -1, - new_fd : -1 }); + { .sem = __SEMAPHORE_INITIALIZER(data->sem, 0), + .fd = socket, + .pid = -1, + .new_fd = -1 }); err = um_request_irq(XTERM_IRQ, socket, IRQ_READ, xterm_interrupt, SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, "xterm", data); if(err){ - printk(KERN_ERR "Failed to get IRQ for xterm, err = %d\n", - err); + printk(KERN_ERR "xterm_fd : failed to get IRQ for xterm, " + "err = %d\n", err); return(err); } down(&data->sem); diff -Nru a/arch/um/dyn.lds.S b/arch/um/dyn.lds.S --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/um/dyn.lds.S Sun Feb 9 21:13:38 2003 @@ -0,0 +1,167 @@ +OUTPUT_FORMAT(ELF_FORMAT) +OUTPUT_ARCH(ELF_ARCH) +ENTRY(_start) +jiffies = jiffies_64; + +SEARCH_DIR("/usr/local/i686-pc-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); +/* Do we need any of these for elf? + __DYNAMIC = 0; */ +SECTIONS +{ + . = START + SIZEOF_HEADERS; + .interp : { *(.interp) } + . = ALIGN(4096); + __binary_start = .; + . = ALIGN(4096); /* Init code and data */ + _stext = .; + __init_begin = .; + .text.init : { *(.text.init) } + + . = ALIGN(4096); + + /* Read-only sections, merged into text segment: */ + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } + .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } + .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } + .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } + .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } + .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } + .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } + .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } + .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } + .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .init : { + KEEP (*(.init)) + } =0x90909090 + .plt : { *(.plt) } + .text : { + *(.text .stub .text.* .gnu.linkonce.t.*) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + } =0x90909090 + .fini : { + KEEP (*(.fini)) + } =0x90909090 + + .kstrtab : { *(.kstrtab) } + + #include "asm/common.lds.S" + + .data.init : { *(.data.init) } + + /* Ensure the __preinit_array_start label is properly aligned. We + could instead move the label definition inside the section, but + the linker would then create the section even if it turns out to + be empty, which isn't pretty. */ + . = ALIGN(32 / 8); + .preinit_array : { *(.preinit_array) } + .init_array : { *(.init_array) } + .fini_array : { *(.fini_array) } + .data : { + . = ALIGN(KERNEL_STACK_SIZE); /* init_task */ + *(.data.init_task) + *(.data .data.* .gnu.linkonce.d.*) + SORT(CONSTRUCTORS) + } + .data1 : { *(.data1) } + .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } + .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table) } + .dynamic : { *(.dynamic) } + .ctors : { + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + KEEP (*crtbegin.o(.ctors)) + /* We don't want to include the .ctor section from + from the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } + .dtors : { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + } + .jcr : { KEEP (*(.jcr)) } + .got : { *(.got.plt) *(.got) } + _edata = .; + PROVIDE (edata = .); + __bss_start = .; + .bss : { + *(.dynbss) + *(.bss .bss.* .gnu.linkonce.b.*) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(32 / 8); + . = ALIGN(32 / 8); + } + _end = .; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } +} diff -Nru a/arch/um/include/choose-mode.h b/arch/um/include/choose-mode.h --- a/arch/um/include/choose-mode.h Sun Feb 9 21:13:34 2003 +++ b/arch/um/include/choose-mode.h Sun Feb 9 21:13:34 2003 @@ -8,13 +8,13 @@ #include "uml-config.h" -#if defined(CONFIG_MODE_TT) && defined(CONFIG_MODE_SKAS) +#if defined(UML_CONFIG_MODE_TT) && defined(UML_CONFIG_MODE_SKAS) #define CHOOSE_MODE(tt, skas) (mode_tt ? (tt) : (skas)) -#elif defined(CONFIG_MODE_SKAS) +#elif defined(UML_CONFIG_MODE_SKAS) #define CHOOSE_MODE(tt, skas) (skas) -#elif defined(CONFIG_MODE_TT) +#elif defined(UML_CONFIG_MODE_TT) #define CHOOSE_MODE(tt, skas) (tt) #endif diff -Nru a/arch/um/include/frame.h b/arch/um/include/frame.h --- a/arch/um/include/frame.h Sun Feb 9 21:13:30 2003 +++ b/arch/um/include/frame.h Sun Feb 9 21:13:30 2003 @@ -15,12 +15,12 @@ int sr_index; int sr_relative; int sp_index; + struct arch_frame_data arch; }; struct sc_frame { struct frame_common common; int sc_index; - struct arch_frame_data arch; }; extern struct sc_frame signal_frame_sc; @@ -31,6 +31,8 @@ struct frame_common common; int sip_index; int si_index; + int ucp_index; + int uc_index; }; extern struct si_frame signal_frame_si; diff -Nru a/arch/um/include/irq_user.h b/arch/um/include/irq_user.h --- a/arch/um/include/irq_user.h Sun Feb 9 21:13:33 2003 +++ b/arch/um/include/irq_user.h Sun Feb 9 21:13:33 2003 @@ -8,7 +8,7 @@ enum { IRQ_READ, IRQ_WRITE }; -extern void sigio_handler(int sig, struct uml_pt_regs *regs); +extern void sigio_handler(int sig, union uml_pt_regs *regs); extern int activate_fd(int irq, int fd, int type, void *dev_id); extern void free_irq_by_irq_and_dev(int irq, void *dev_id); extern void free_irq_by_fd(int fd); diff -Nru a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h --- a/arch/um/include/kern_util.h Sun Feb 9 21:13:31 2003 +++ b/arch/um/include/kern_util.h Sun Feb 9 21:13:31 2003 @@ -47,7 +47,7 @@ extern void add_input_request(int op, void (*proc)(int), void *arg); extern int sys_execve(char *file, char **argv, char **env); extern char *current_cmd(void); -extern void timer_handler(int sig, struct uml_pt_regs *regs); +extern void timer_handler(int sig, union uml_pt_regs *regs); extern int set_signals(int enable); extern void force_sigbus(void); extern int pid_to_processor_id(int pid); @@ -64,7 +64,7 @@ extern void syscall_trace(void); extern int hz(void); extern void idle_timer(void); -extern unsigned int do_IRQ(int irq, struct uml_pt_regs *regs); +extern unsigned int do_IRQ(int irq, union uml_pt_regs *regs); extern int external_pid(void *t); extern int pid_to_processor_id(int pid); extern void boot_timer_handler(int sig); @@ -77,10 +77,10 @@ extern int init_parent_proxy(int pid); extern int singlestepping(void *t); extern void check_stack_overflow(void *ptr); -extern void relay_signal(int sig, struct uml_pt_regs *regs); +extern void relay_signal(int sig, union uml_pt_regs *regs); extern void not_implemented(void); extern int user_context(unsigned long sp); -extern void timer_irq(struct uml_pt_regs *regs); +extern void timer_irq(union uml_pt_regs *regs); extern void unprotect_stack(unsigned long stack); extern void do_uml_exitcalls(void); extern int attach_debugger(int idle_pid, int pid, int stop); @@ -101,7 +101,7 @@ extern int clear_user_proc(void *buf, int size); extern int copy_to_user_proc(void *to, void *from, int size); extern int copy_from_user_proc(void *to, void *from, int size); -extern void bus_handler(int sig, struct uml_pt_regs *regs); +extern void bus_handler(int sig, union uml_pt_regs *regs); extern long execute_syscall(void *r); extern int smp_sigio_handler(void); extern void *get_current(void); diff -Nru a/arch/um/include/mconsole.h b/arch/um/include/mconsole.h --- a/arch/um/include/mconsole.h Sun Feb 9 21:13:31 2003 +++ b/arch/um/include/mconsole.h Sun Feb 9 21:13:31 2003 @@ -7,30 +7,35 @@ #ifndef __MCONSOLE_H__ #define __MCONSOLE_H__ +#ifndef __KERNEL__ +#include +#define u32 uint32_t +#endif + #define MCONSOLE_MAGIC (0xcafebabe) #define MCONSOLE_MAX_DATA (512) #define MCONSOLE_VERSION 2 struct mconsole_request { - unsigned long magic; - int version; - int len; + u32 magic; + u32 version; + u32 len; char data[MCONSOLE_MAX_DATA]; }; struct mconsole_reply { - int err; - int more; - int len; + u32 err; + u32 more; + u32 len; char data[MCONSOLE_MAX_DATA]; }; struct mconsole_notify { - unsigned long magic; - int version; + u32 magic; + u32 version; enum { MCONSOLE_SOCKET, MCONSOLE_PANIC, MCONSOLE_HANG, MCONSOLE_USER_NOTIFY } type; - int len; + u32 len; char data[MCONSOLE_MAX_DATA]; }; diff -Nru a/arch/um/include/mode.h b/arch/um/include/mode.h --- a/arch/um/include/mode.h Sun Feb 9 21:13:33 2003 +++ b/arch/um/include/mode.h Sun Feb 9 21:13:33 2003 @@ -8,11 +8,11 @@ #include "uml-config.h" -#ifdef CONFIG_MODE_TT +#ifdef UML_CONFIG_MODE_TT #include "../kernel/tt/include/mode.h" #endif -#ifdef CONFIG_MODE_SKAS +#ifdef UML_CONFIG_MODE_SKAS #include "../kernel/skas/include/mode.h" #endif diff -Nru a/arch/um/include/os.h b/arch/um/include/os.h --- a/arch/um/include/os.h Sun Feb 9 21:13:29 2003 +++ b/arch/um/include/os.h Sun Feb 9 21:13:29 2003 @@ -25,9 +25,11 @@ unsigned int t : 1; /* O_TRUNC */ unsigned int a : 1; /* O_APPEND */ unsigned int e : 1; /* O_EXCL */ + unsigned int cl : 1; /* FD_CLOEXEC */ }; -#define OPENFLAGS() ((struct openflags) { r : 0, w : 0, c : 0, s : 0 }) +#define OPENFLAGS() ((struct openflags) { .r = 0, .w = 0, .s = 0, .c = 0, \ + .t = 0, .a = 0, .e = 0, .cl = 0 }) static inline struct openflags of_read(struct openflags flags) { @@ -83,9 +85,16 @@ return(flags); } +static inline struct openflags of_cloexec(struct openflags flags) +{ + flags.cl = 1; + return(flags); +} + extern int os_seek_file(int fd, __u64 offset); extern int os_open_file(char *file, struct openflags flags, int mode); -extern int os_read_file(int fd, char *buf, int len); +extern int os_read_file(int fd, void *buf, int len); +extern int os_write_file(int fd, void *buf, int count); extern int os_file_size(char *file, long long *size_out); extern int os_pipe(int *fd, int stream, int close_on_exec); extern int os_set_fd_async(int fd, int owner); @@ -98,7 +107,6 @@ extern int os_connect_socket(char *name); extern int os_file_type(char *file); extern int os_file_mode(char *file, struct openflags *mode_out); -extern int os_write_file(int fd, char *buf, int count); extern unsigned long os_process_pc(int pid); extern int os_process_parent(int pid); diff -Nru a/arch/um/include/signal_kern.h b/arch/um/include/signal_kern.h --- a/arch/um/include/signal_kern.h Sun Feb 9 21:13:35 2003 +++ b/arch/um/include/signal_kern.h Sun Feb 9 21:13:35 2003 @@ -1,15 +1,11 @@ /* - * Copyright (C) 2001 Jeff Dike (jdike@karaya.com) + * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com) * Licensed under the GPL */ #ifndef __SIGNAL_KERN_H__ #define __SIGNAL_KERN_H__ -#include "sysdep/ptrace.h" - -extern void signal_deliverer(int sig); -extern int probe_stack(unsigned long sp, int delta); extern int have_signals(void *t); #endif diff -Nru a/arch/um/include/skas_ptrace.h b/arch/um/include/skas_ptrace.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/um/include/skas_ptrace.h Sun Feb 9 21:13:35 2003 @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#ifndef __SKAS_PTRACE_H +#define __SKAS_PTRACE_H + +struct ptrace_faultinfo { + int is_write; + unsigned long addr; +}; + +struct ptrace_ldt { + int func; + void *ptr; + unsigned long bytecount; +}; + +#define PTRACE_FAULTINFO 52 +#define PTRACE_SIGPENDING 53 +#define PTRACE_LDT 54 +#define PTRACE_SWITCH_MM 55 + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -Nru a/arch/um/include/sysdep-i386/frame.h b/arch/um/include/sysdep-i386/frame.h --- a/arch/um/include/sysdep-i386/frame.h Sun Feb 9 21:13:29 2003 +++ b/arch/um/include/sysdep-i386/frame.h Sun Feb 9 21:13:29 2003 @@ -7,7 +7,8 @@ #define __FRAME_I386_H struct arch_frame_data_raw { - unsigned long sc_end; + unsigned long fp_start; + unsigned long sr; }; struct arch_frame_data { diff -Nru a/arch/um/include/sysdep-i386/frame_kern.h b/arch/um/include/sysdep-i386/frame_kern.h --- a/arch/um/include/sysdep-i386/frame_kern.h Sun Feb 9 21:13:29 2003 +++ b/arch/um/include/sysdep-i386/frame_kern.h Sun Feb 9 21:13:29 2003 @@ -16,6 +16,15 @@ return((void *) sp); } +static inline void *sp_to_uc(unsigned long sp) +{ + unsigned long uc; + + uc = sp + signal_frame_si.uc_index - + signal_frame_si.common.sp_index - 4; + return((void *) uc); +} + static inline void *sp_to_rt_sc(unsigned long sp) { unsigned long sc; @@ -42,7 +51,7 @@ mask = sp - signal_frame_si.common.sp_index + signal_frame_si.common.len + - sc_size(&signal_frame_sc.arch) - 4; + sc_size(&signal_frame_si.common.arch) - 4; return((void *) mask); } diff -Nru a/arch/um/include/sysdep-i386/frame_user.h b/arch/um/include/sysdep-i386/frame_user.h --- a/arch/um/include/sysdep-i386/frame_user.h Sun Feb 9 21:13:36 2003 +++ b/arch/um/include/sysdep-i386/frame_user.h Sun Feb 9 21:13:36 2003 @@ -18,26 +18,35 @@ * setup_arch_frame uses that data to figure out what * arch_frame_data.fpstate_size should be. It really has no idea, since it's * not allowed to do sizeof(struct fpstate) but it's safe to consider that it's - * everything from the end of the sgcontext up to the top of the stack. So, + * everything from the end of the sigcontext up to the top of the stack. So, * it masks off the page number to get the offset within the page and subtracts * that from the page size, and that's how big the fpstate struct will be * considered to be. */ static inline void setup_arch_frame_raw(struct arch_frame_data_raw *data, - struct sigcontext *sc) + void *end, unsigned long srp) { - data->sc_end = (unsigned long) sc; - data->sc_end += sizeof(*sc); + unsigned long sr = *((unsigned long *) srp); + + data->fp_start = (unsigned long) end; + if((sr & PAGE_MASK) == ((unsigned long) end & PAGE_MASK)) + data->sr = sr; + else data->sr = 0; } static inline void setup_arch_frame(struct arch_frame_data_raw *in, struct arch_frame_data *out) { - unsigned long fpstate_start = in->sc_end; + unsigned long fpstate_start = in->fp_start; - fpstate_start &= ~PAGE_MASK; - out->fpstate_size = PAGE_SIZE - fpstate_start; + if(in->sr == 0){ + fpstate_start &= ~PAGE_MASK; + out->fpstate_size = PAGE_SIZE - fpstate_start; + } + else { + out->fpstate_size = in->sr - fpstate_start; + } } /* This figures out where on the stack the SA_RESTORER function address diff -Nru a/arch/um/include/sysdep-i386/ptrace.h b/arch/um/include/sysdep-i386/ptrace.h --- a/arch/um/include/sysdep-i386/ptrace.h Sun Feb 9 21:13:29 2003 +++ b/arch/um/include/sysdep-i386/ptrace.h Sun Feb 9 21:13:29 2003 @@ -7,72 +7,101 @@ #define __SYSDEP_I386_PTRACE_H #include "uml-config.h" + +#ifdef UML_CONFIG_MODE_TT #include "ptrace-tt.h" +#endif + +#ifdef UML_CONFIG_MODE_SKAS #include "ptrace-skas.h" +#endif + #include "choose-mode.h" -struct uml_pt_regs { - unsigned long args[6]; - long syscall; - int is_user; - union { -#ifdef CONFIG_MODE_TT - void *tt; +union uml_pt_regs { +#ifdef UML_CONFIG_MODE_TT + struct tt_regs { + long syscall; + void *sc; + } tt; #endif -#ifdef CONFIG_MODE_SKAS - struct { - unsigned long regs[HOST_FRAME_SIZE]; - unsigned long fp[HOST_FP_SIZE]; - unsigned long xfp[HOST_XFP_SIZE]; - unsigned long fault_addr; - unsigned long fault_type; - unsigned long trap_type; - } skas; +#ifdef UML_CONFIG_MODE_SKAS + struct skas_regs { + unsigned long regs[HOST_FRAME_SIZE]; + unsigned long fp[HOST_FP_SIZE]; + unsigned long xfp[HOST_XFP_SIZE]; + unsigned long fault_addr; + unsigned long fault_type; + unsigned long trap_type; + long syscall; + int is_user; + } skas; #endif - } mode; }; -#define EMPTY_UML_PT_REGS { \ - syscall : -1, \ - args : { [0 ... 5] = 0 }, \ - is_user : 0 } +#define EMPTY_UML_PT_REGS { } extern int mode_tt; +#define UPT_SC(r) ((r)->tt.sc) #define UPT_IP(r) \ - CHOOSE_MODE(SC_IP((r)->mode.tt), REGS_IP((r)->mode.skas.regs)) + CHOOSE_MODE(SC_IP(UPT_SC(r)), REGS_IP((r)->skas.regs)) #define UPT_SP(r) \ - CHOOSE_MODE(SC_SP((r)->mode.tt), REGS_SP((r)->mode.skas.regs)) + CHOOSE_MODE(SC_SP(UPT_SC(r)), REGS_SP((r)->skas.regs)) #define UPT_EFLAGS(r) \ - CHOOSE_MODE(SC_EFLAGS((r)->mode.tt), REGS_EFLAGS((r)->mode.skas.regs)) + CHOOSE_MODE(SC_EFLAGS(UPT_SC(r)), REGS_EFLAGS((r)->skas.regs)) #define UPT_EAX(r) \ - CHOOSE_MODE(SC_EAX((r)->mode.tt), REGS_EAX((r)->mode.skas.regs)) + CHOOSE_MODE(SC_EAX(UPT_SC(r)), REGS_EAX((r)->skas.regs)) #define UPT_EBX(r) \ - CHOOSE_MODE(SC_EBX((r)->mode.tt), REGS_EBX((r)->mode.skas.regs)) + CHOOSE_MODE(SC_EBX(UPT_SC(r)), REGS_EBX((r)->skas.regs)) #define UPT_ECX(r) \ - CHOOSE_MODE(SC_ECX((r)->mode.tt), REGS_ECX((r)->mode.skas.regs)) + CHOOSE_MODE(SC_ECX(UPT_SC(r)), REGS_ECX((r)->skas.regs)) #define UPT_EDX(r) \ - CHOOSE_MODE(SC_EDX((r)->mode.tt), REGS_EDX((r)->mode.skas.regs)) + CHOOSE_MODE(SC_EDX(UPT_SC(r)), REGS_EDX((r)->skas.regs)) #define UPT_ESI(r) \ - CHOOSE_MODE(SC_ESI((r)->mode.tt), REGS_ESI((r)->mode.skas.regs)) + CHOOSE_MODE(SC_ESI(UPT_SC(r)), REGS_ESI((r)->skas.regs)) #define UPT_EDI(r) \ - CHOOSE_MODE(SC_EDI((r)->mode.tt), REGS_EDI((r)->mode.skas.regs)) + CHOOSE_MODE(SC_EDI(UPT_SC(r)), REGS_EDI((r)->skas.regs)) #define UPT_EBP(r) \ - CHOOSE_MODE(SC_EBP((r)->mode.tt), REGS_EBP((r)->mode.skas.regs)) -#define UPT_ORIG_EAX(r) ((r)->syscall) + CHOOSE_MODE(SC_EBP(UPT_SC(r)), REGS_EBP((r)->skas.regs)) +#define UPT_ORIG_EAX(r) \ + CHOOSE_MODE((r)->tt.syscall, (r)->skas.syscall) #define UPT_CS(r) \ - CHOOSE_MODE(SC_CS((r)->mode.tt), REGS_CS((r)->mode.skas.regs)) + CHOOSE_MODE(SC_CS(UPT_SC(r)), REGS_CS((r)->skas.regs)) #define UPT_SS(r) \ - CHOOSE_MODE(SC_SS((r)->mode.tt), REGS_SS((r)->mode.skas.regs)) + CHOOSE_MODE(SC_SS(UPT_SC(r)), REGS_SS((r)->skas.regs)) #define UPT_DS(r) \ - CHOOSE_MODE(SC_DS((r)->mode.tt), REGS_DS((r)->mode.skas.regs)) + CHOOSE_MODE(SC_DS(UPT_SC(r)), REGS_DS((r)->skas.regs)) #define UPT_ES(r) \ - CHOOSE_MODE(SC_ES((r)->mode.tt), REGS_ES((r)->mode.skas.regs)) + CHOOSE_MODE(SC_ES(UPT_SC(r)), REGS_ES((r)->skas.regs)) #define UPT_FS(r) \ - CHOOSE_MODE(SC_FS((r)->mode.tt), REGS_FS((r)->mode.skas.regs)) + CHOOSE_MODE(SC_FS(UPT_SC(r)), REGS_FS((r)->skas.regs)) #define UPT_GS(r) \ - CHOOSE_MODE(SC_GS((r)->mode.tt), REGS_GS((r)->mode.skas.regs)) -#define UPT_SC(r) ((r)->mode.tt) + CHOOSE_MODE(SC_GS(UPT_SC(r)), REGS_GS((r)->skas.regs)) + +#define UPT_SYSCALL_ARG1(r) UPT_EBX(r) +#define UPT_SYSCALL_ARG2(r) UPT_ECX(r) +#define UPT_SYSCALL_ARG3(r) UPT_EDX(r) +#define UPT_SYSCALL_ARG4(r) UPT_ESI(r) +#define UPT_SYSCALL_ARG5(r) UPT_EDI(r) +#define UPT_SYSCALL_ARG6(r) UPT_EBP(r) + +extern int user_context(unsigned long sp); + +#define UPT_IS_USER(r) \ + CHOOSE_MODE(user_context(UPT_SP(r)), (r)->skas.is_user) + +struct syscall_args { + unsigned long args[6]; +}; + +#define SYSCALL_ARGS(r) ((struct syscall_args) \ + { .args = { UPT_SYSCALL_ARG1(r), \ + UPT_SYSCALL_ARG2(r), \ + UPT_SYSCALL_ARG3(r), \ + UPT_SYSCALL_ARG4(r), \ + UPT_SYSCALL_ARG5(r), \ + UPT_SYSCALL_ARG6(r) } } ) #define UPT_REG(regs, reg) \ ({ unsigned long val; \ @@ -129,28 +158,26 @@ } while (0) #define UPT_SET_SYSCALL_RETURN(r, res) \ - CHOOSE_MODE(SC_SET_SYSCALL_RETURN((r)->mode.tt, (res)), \ - REGS_SET_SYSCALL_RETURN((r)->mode.skas.regs, (res))) + CHOOSE_MODE(SC_SET_SYSCALL_RETURN(UPT_SC(r), (res)), \ + REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res))) #define UPT_RESTART_SYSCALL(r) \ - CHOOSE_MODE(SC_RESTART_SYSCALL((r)->mode.tt), \ - REGS_RESTART_SYSCALL((r)->mode.skas.regs)) + CHOOSE_MODE(SC_RESTART_SYSCALL(UPT_SC(r)), \ + REGS_RESTART_SYSCALL((r)->skas.regs)) #define UPT_ORIG_SYSCALL(r) UPT_EAX(r) -#define UPT_SYSCALL_NR(r) ((r)->syscall) +#define UPT_SYSCALL_NR(r) UPT_ORIG_EAX(r) #define UPT_SYSCALL_RET(r) UPT_EAX(r) #define UPT_SEGV_IS_FIXABLE(r) \ - CHOOSE_MODE(SC_SEGV_IS_FIXABLE(r->mode.tt), \ - REGS_SEGV_IS_FIXABLE(&r->mode.skas)) + CHOOSE_MODE(SC_SEGV_IS_FIXABLE(UPT_SC(r)), \ + REGS_SEGV_IS_FIXABLE(&r->skas)) #define UPT_FAULT_ADDR(r) \ - CHOOSE_MODE(SC_FAULT_ADDR(r->mode.tt), \ - REGS_FAULT_ADDR(&r->mode.skas)) + CHOOSE_MODE(SC_FAULT_ADDR(UPT_SC(r)), REGS_FAULT_ADDR(&r->skas)) #define UPT_FAULT_WRITE(r) \ - CHOOSE_MODE(SC_FAULT_WRITE(r->mode.tt), \ - REGS_FAULT_WRITE(&r->mode.skas)) + CHOOSE_MODE(SC_FAULT_WRITE(UPT_SC(r)), REGS_FAULT_WRITE(&r->skas)) #endif diff -Nru a/arch/um/include/sysdep-i386/sigcontext.h b/arch/um/include/sysdep-i386/sigcontext.h --- a/arch/um/include/sysdep-i386/sigcontext.h Sun Feb 9 21:13:34 2003 +++ b/arch/um/include/sysdep-i386/sigcontext.h Sun Feb 9 21:13:34 2003 @@ -33,34 +33,6 @@ #define SC_SEGV_IS_FIXABLE(sc) (SEGV_IS_FIXABLE(SC_TRAPNO(sc))) -#ifdef CONFIG_MODE_TT -/* XXX struct sigcontext needs declaring by now */ -static inline void sc_to_regs(struct uml_pt_regs *regs, struct sigcontext *sc, - unsigned long syscall) -{ - regs->syscall = syscall; - regs->args[0] = SC_EBX(sc); - regs->args[1] = SC_ECX(sc); - regs->args[2] = SC_EDX(sc); - regs->args[3] = SC_ESI(sc); - regs->args[4] = SC_EDI(sc); - regs->args[5] = SC_EBP(sc); -} -#endif - -#ifdef CONFIG_MODE_SKAS -static inline void host_to_regs(struct uml_pt_regs *regs) -{ - regs->syscall = UPT_ORIG_EAX(regs); - regs->args[0] = UPT_EBX(regs); - regs->args[1] = UPT_ECX(regs); - regs->args[2] = UPT_EDX(regs); - regs->args[3] = UPT_ESI(regs); - regs->args[4] = UPT_EDI(regs); - regs->args[5] = UPT_EBP(regs); -} -#endif - extern unsigned long *sc_sigmask(void *sc_ptr); extern int sc_get_fpregs(unsigned long buf, void *sc_ptr); diff -Nru a/arch/um/include/sysdep-i386/syscalls.h b/arch/um/include/sysdep-i386/syscalls.h --- a/arch/um/include/sysdep-i386/syscalls.h Sun Feb 9 21:13:29 2003 +++ b/arch/um/include/sysdep-i386/syscalls.h Sun Feb 9 21:13:29 2003 @@ -4,10 +4,12 @@ */ #include "asm/unistd.h" +#include "sysdep/ptrace.h" typedef long syscall_handler_t(struct pt_regs); -#define EXECUTE_SYSCALL(syscall, regs) (*sys_call_table[syscall])(*regs); +#define EXECUTE_SYSCALL(syscall, regs) \ + ((long (*)(struct syscall_args)) (*sys_call_table[syscall]))(SYSCALL_ARGS(®s->regs)) extern syscall_handler_t sys_modify_ldt; extern syscall_handler_t old_mmap_i386; diff -Nru a/arch/um/include/time_user.h b/arch/um/include/time_user.h --- a/arch/um/include/time_user.h Sun Feb 9 21:13:29 2003 +++ b/arch/um/include/time_user.h Sun Feb 9 21:13:29 2003 @@ -11,7 +11,7 @@ extern void set_interval(int timer_type); extern void idle_sleep(int secs); extern void enable_timer(void); -extern void time_lock(void); -extern void time_unlock(void); +extern unsigned long time_lock(void); +extern void time_unlock(unsigned long); #endif diff -Nru a/arch/um/include/umid.h b/arch/um/include/umid.h --- a/arch/um/include/umid.h Sun Feb 9 21:13:30 2003 +++ b/arch/um/include/umid.h Sun Feb 9 21:13:30 2003 @@ -3,7 +3,12 @@ * Licensed under the GPL */ +#ifndef __UMID_H__ +#define __UMID_H__ + extern int umid_file_name(char *name, char *buf, int len); + +#endif /* * Overrides for Emacs so that we follow Linus's tabbing style. diff -Nru a/arch/um/include/uml_uaccess.h b/arch/um/include/uml_uaccess.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/um/include/uml_uaccess.h Sun Feb 9 21:13:37 2003 @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2001 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#ifndef __UML_UACCESS_H__ +#define __UML_UACCESS_H__ + +extern int __do_copy_to_user(void *to, const void *from, int n, + void **fault_addr, void **fault_catcher); +extern unsigned long __do_user_copy(void *to, const void *from, int n, + void **fault_addr, void **fault_catcher, + void (*op)(void *to, const void *from, + int n), int *faulted_out); +void __do_copy(void *to, const void *from, int n); + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -Nru a/arch/um/include/user_util.h b/arch/um/include/user_util.h --- a/arch/um/include/user_util.h Sun Feb 9 21:13:29 2003 +++ b/arch/um/include/user_util.h Sun Feb 9 21:13:29 2003 @@ -24,7 +24,7 @@ extern struct cpu_task cpu_tasks[]; struct signal_info { - void (*handler)(int, struct uml_pt_regs *); + void (*handler)(int, union uml_pt_regs *); int is_irq; }; @@ -61,7 +61,6 @@ int clone_flags, int (*tramp)(void *)); extern int clone_and_wait(int (*fn)(void *), void *arg, void *sp, int flags); extern int linux_main(int argc, char **argv); -extern void remap_data(void *segment_start, void *segment_end, int w); extern void set_cmdline(char *cmd); extern void input_cb(void (*proc)(void *), void *arg, int arg_len); extern int get_pty(void); @@ -87,7 +86,7 @@ extern int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr); extern void write_sigio_workaround(void); extern void arch_check_bugs(void); -extern int arch_handle_signal(int sig, struct uml_pt_regs *regs); +extern int arch_handle_signal(int sig, union uml_pt_regs *regs); extern int arch_fixup(unsigned long address, void *sc_ptr); extern void forward_pending_sigio(int target); extern int can_do_skas(void); diff -Nru a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile --- a/arch/um/kernel/Makefile Sun Feb 9 21:13:34 2003 +++ b/arch/um/kernel/Makefile Sun Feb 9 21:13:34 2003 @@ -3,15 +3,13 @@ # Licensed under the GPL # -EXTRA_TARGETS := unmap_fin.o - obj-y = checksum.o config.o exec_kern.o exitcode.o frame_kern.o frame.o \ helper.o init_task.o irq.o irq_user.o ksyms.o mem.o mem_user.o \ process.o process_kern.o ptrace.o reboot.o resource.o sigio_user.o \ sigio_kern.o signal_kern.o signal_user.o smp.o syscall_kern.o \ syscall_user.o sysrq.o sys_call_table.o tempfile.o time.o \ - time_kern.o tlb.o trap_kern.o trap_user.o um_arch.o \ - umid.o user_util.o + time_kern.o tlb.o trap_kern.o trap_user.o uaccess_user.o um_arch.o \ + umid.o user_syms.o user_util.o obj-$(CONFIG_BLK_DEV_INITRD) += initrd_kern.o initrd_user.o obj-$(CONFIG_GPROF) += gprof_syms.o @@ -23,23 +21,13 @@ user-objs-$(CONFIG_TTY_LOG) += tty_log.o -# user_syms.o not included here because Rules.make has its own ideas about -# building anything in export-objs - USER_OBJS := $(filter %_user.o,$(obj-y)) $(user-objs-y) config.o helper.o \ process.o tempfile.o time.o tty_log.o umid.o user_util.o user_syms.o USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) -UNMAP_CFLAGS := $(patsubst -pg -DPROFILING,,$(USER_CFLAGS)) -UNMAP_CFLAGS := $(patsubst -fprofile-arcs -ftest-coverage,,$(UNMAP_CFLAGS)) - DMODULES-$(CONFIG_MODULES) = -D__CONFIG_MODULES__ DMODVERSIONS-$(CONFIG_MODVERSIONS) = -D__CONFIG_MODVERSIONS__ -export-objs-$(CONFIG_GPROF) += gprof_syms.o -export-objs-$(CONFIG_GCOV) += gmon_syms.o - -export-objs := ksyms.o process_kern.o signal_kern.o $(export-objs-y) CFLAGS_user_syms.o = -D__AUTOCONF_INCLUDED__ $(DMODULES-y) $(DMODVERSIONS-y) \ -I/usr/include -I../include @@ -47,13 +35,7 @@ CFLAGS_frame.o := $(patsubst -fomit-frame-pointer,,$(USER_CFLAGS)) $(USER_OBJS) : %.o: %.c - $(CC) $(CFLAGS_$@) $(USER_CFLAGS) -c -o $@ $< - -$(obj)/unmap.o: $(src)/unmap.c - $(CC) $(UNMAP_CFLAGS) -c -o $@ $< - -$(obj)/unmap_fin.o : $(src)/unmap.o - ld -r -o $@ $< -lc -L/usr/lib + $(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $< # This has to be separate because it needs be compiled with frame pointers # regardless of how the rest of the kernel is built. diff -Nru a/arch/um/kernel/frame.c b/arch/um/kernel/frame.c --- a/arch/um/kernel/frame.c Sun Feb 9 21:13:30 2003 +++ b/arch/um/kernel/frame.c Sun Feb 9 21:13:30 2003 @@ -78,7 +78,8 @@ /* It has outlived its usefulness, so continue it so it can exit */ if(ptrace(PTRACE_CONT, pid, 0, 0) < 0){ - printf("capture_stack : mmap failed - errno = %d\n", errno); + printf("capture_stack : PTRACE_CONT failed - errno = %d\n", + errno); exit(1); } if(waitpid(pid, &status, 0) < 0){ @@ -110,6 +111,7 @@ unsigned long sig; unsigned long sr; unsigned long sp; + struct arch_frame_data_raw arch; }; #define SA_RESTORER (0x04000000) @@ -173,7 +175,6 @@ struct common_raw common; unsigned long sc; int restorer; - struct arch_frame_data_raw arch; }; /* Changed only during early boot */ @@ -185,7 +186,8 @@ raw_sc->common.sr = frame_restorer(); raw_sc->common.sp = frame_sp(); raw_sc->sc = (unsigned long) ≻ - setup_arch_frame_raw(&raw_sc->arch, &sc); + setup_arch_frame_raw(&raw_sc->common.arch, &sc + 1, raw_sc->common.sr); + os_stop_process(os_getpid()); kill(getpid(), SIGKILL); } @@ -205,18 +207,25 @@ struct common_raw common; unsigned long sip; unsigned long si; + unsigned long ucp; + unsigned long uc; }; /* Changed only during early boot */ static struct si_frame_raw *raw_si = NULL; -static void si_handler(int sig, siginfo_t *si) +static void si_handler(int sig, siginfo_t *si, struct ucontext *ucontext) { raw_si->common.sig = (unsigned long) &sig; raw_si->common.sr = frame_restorer(); raw_si->common.sp = frame_sp(); raw_si->sip = (unsigned long) &si; raw_si->si = (unsigned long) si; + raw_si->ucp = (unsigned long) &ucontext; + raw_si->uc = (unsigned long) ucontext; + setup_arch_frame_raw(&raw_si->common.arch, + ucontext->uc_mcontext.fpregs, raw_si->common.sr); + os_stop_process(os_getpid()); kill(getpid(), SIGKILL); } @@ -292,7 +301,7 @@ &signal_frame_sc.common); signal_frame_sc.sc_index = raw_sc.sc - base; - setup_arch_frame(&raw_sc.arch, &signal_frame_sc.arch); + setup_arch_frame(&raw_sc.common.arch, &signal_frame_sc.common.arch); /* Ditto for the sigcontext, sigrestorer layout */ raw_sc.restorer = 1; @@ -300,6 +309,7 @@ (void *) top, sigstack, PAGE_SIZE, &signal_frame_sc_sr.common); signal_frame_sc_sr.sc_index = raw_sc.sc - base; + setup_arch_frame(&raw_sc.common.arch, &signal_frame_sc_sr.common.arch); /* And the siginfo layout */ @@ -308,6 +318,9 @@ &signal_frame_si.common); signal_frame_si.sip_index = raw_si.sip - base; signal_frame_si.si_index = raw_si.si - base; + signal_frame_si.ucp_index = raw_si.ucp - base; + signal_frame_si.uc_index = raw_si.uc - base; + setup_arch_frame(&raw_si.common.arch, &signal_frame_si.common.arch); if((munmap(stack, PAGE_SIZE) < 0) || (munmap(sigstack, PAGE_SIZE) < 0)){ diff -Nru a/arch/um/kernel/frame_kern.c b/arch/um/kernel/frame_kern.c --- a/arch/um/kernel/frame_kern.c Sun Feb 9 21:13:37 2003 +++ b/arch/um/kernel/frame_kern.c Sun Feb 9 21:13:37 2003 @@ -6,6 +6,8 @@ #include "asm/ptrace.h" #include "asm/uaccess.h" #include "asm/signal.h" +#include "asm/uaccess.h" +#include "asm/ucontext.h" #include "frame_kern.h" #include "sigcontext.h" #include "sysdep/ptrace.h" @@ -27,48 +29,62 @@ sizeof(restorer))); } -static int copy_sc_to_user(void *to, struct pt_regs *from) +static int copy_sc_to_user(void *to, void *fp, struct pt_regs *from, + struct arch_frame_data *arch) { - return(CHOOSE_MODE(copy_sc_to_user_tt(to, from->regs.mode.tt, - &signal_frame_sc_sr.arch), - copy_sc_to_user_skas(to, &from->regs, + return(CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs), + arch), + copy_sc_to_user_skas(to, fp, &from->regs, current->thread.cr2, current->thread.err))); } +static int copy_ucontext_to_user(struct ucontext *uc, void *fp, sigset_t *set, + unsigned long sp) +{ + int err = 0; + + err |= put_user(current->sas_ss_sp, &uc->uc_stack.ss_sp); + err |= put_user(sas_ss_flags(sp), &uc->uc_stack.ss_flags); + err |= put_user(current->sas_ss_size, &uc->uc_stack.ss_size); + err |= copy_sc_to_user(&uc->uc_mcontext, fp, ¤t->thread.regs, + &signal_frame_si.common.arch); + err |= copy_to_user(&uc->uc_sigmask, set, sizeof(*set)); + return(err); +} + int setup_signal_stack_si(unsigned long stack_top, int sig, unsigned long handler, void (*restorer)(void), struct pt_regs *regs, siginfo_t *info, sigset_t *mask) { - unsigned long start, sc, sigs; - void *sip; - int sig_size = _NSIG_WORDS * sizeof(unsigned long); + unsigned long start; + void *sip, *ucp, *fp; - start = stack_top - signal_frame_si.common.len - - sc_size(&signal_frame_sc.arch) - sig_size; + start = stack_top - signal_frame_si.common.len; sip = (void *) (start + signal_frame_si.si_index); - sc = start + signal_frame_si.common.len; - sigs = sc + sc_size(&signal_frame_sc.arch); + ucp = (void *) (start + signal_frame_si.uc_index); + fp = (void *) (((unsigned long) ucp) + sizeof(struct ucontext)); if(restorer == NULL) panic("setup_signal_stack_si - no restorer"); - if(copy_sc_to_user((void *) sc, regs) || - copy_to_user((void *) start, signal_frame_si.common.data, + if(copy_to_user((void *) start, signal_frame_si.common.data, signal_frame_si.common.len) || copy_to_user((void *) (start + signal_frame_si.common.sig_index), &sig, sizeof(sig)) || copy_siginfo_to_user(sip, info) || copy_to_user((void *) (start + signal_frame_si.sip_index), &sip, sizeof(sip)) || - copy_to_user((void *) sigs, mask, sig_size) || + copy_ucontext_to_user(ucp, fp, mask, PT_REGS_SP(regs)) || + copy_to_user((void *) (start + signal_frame_si.ucp_index), &ucp, + sizeof(ucp)) || copy_restorer(restorer, start, signal_frame_si.common.sr_index, signal_frame_si.common.sr_relative)) return(1); PT_REGS_IP(regs) = handler; - PT_REGS_SP(regs) = start + signal_frame_sc.common.sp_index; + PT_REGS_SP(regs) = start + signal_frame_si.common.sp_index; return(0); } @@ -96,7 +112,8 @@ if(copy_to_user((void *) start, frame->data, frame->len) || copy_to_user((void *) (start + frame->sig_index), &sig, sizeof(sig)) || - copy_sc_to_user(user_sc, regs) || + copy_sc_to_user(user_sc, NULL, regs, + &signal_frame_sc.common.arch) || copy_to_user(sc_sigmask(user_sc), mask, sizeof(mask->sig[0])) || copy_to_user((void *) sigs, &mask->sig[1], sig_size) || copy_restorer(restorer, start, frame->sr_index, frame->sr_relative)) diff -Nru a/arch/um/kernel/init_task.c b/arch/um/kernel/init_task.c --- a/arch/um/kernel/init_task.c Sun Feb 9 21:13:37 2003 +++ b/arch/um/kernel/init_task.c Sun Feb 9 21:13:37 2003 @@ -3,6 +3,7 @@ * Licensed under the GPL */ +#include "linux/config.h" #include "linux/mm.h" #include "linux/sched.h" #include "linux/init_task.h" @@ -37,17 +38,16 @@ __attribute__((__section__(".data.init_task"))) = { INIT_THREAD_INFO(init_task) }; -struct task_struct *alloc_task_struct(void){ - struct task_struct *task; - - task = (struct task_struct *) __get_free_pages(GFP_KERNEL, 2); - if(task == NULL) return(NULL); - return(task); +struct task_struct *alloc_task_struct(void) +{ + return((struct task_struct *) + __get_free_pages(GFP_KERNEL, CONFIG_KERNEL_STACK_ORDER)); } void unprotect_stack(unsigned long stack) { - protect_memory(stack, 4 * PAGE_SIZE, 1, 1, 0, 1); + protect_memory(stack, (1 << CONFIG_KERNEL_STACK_ORDER) * PAGE_SIZE, + 1, 1, 0, 1); } void free_task_struct(struct task_struct *task) @@ -55,7 +55,7 @@ /* free_pages decrements the page counter and only actually frees * the pages if they are now not accessed by anything. */ - free_pages((unsigned long) task, 2); + free_pages((unsigned long) task, CONFIG_KERNEL_STACK_ORDER); } /* diff -Nru a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c --- a/arch/um/kernel/irq.c Sun Feb 9 21:13:35 2003 +++ b/arch/um/kernel/irq.c Sun Feb 9 21:13:35 2003 @@ -271,7 +271,7 @@ * SMP cross-CPU interrupts have their own specific * handlers). */ -unsigned int do_IRQ(int irq, struct uml_pt_regs *regs) +unsigned int do_IRQ(int irq, union uml_pt_regs *regs) { /* * 0 return value means that this irq is already being diff -Nru a/arch/um/kernel/irq_user.c b/arch/um/kernel/irq_user.c --- a/arch/um/kernel/irq_user.c Sun Feb 9 21:13:31 2003 +++ b/arch/um/kernel/irq_user.c Sun Feb 9 21:13:31 2003 @@ -42,7 +42,7 @@ extern int io_count, intr_count; -void sigio_handler(int sig, struct uml_pt_regs *regs) +void sigio_handler(int sig, union uml_pt_regs *regs) { struct irq_fd *irq_fd, *next; int i, n; @@ -128,15 +128,15 @@ if(type == IRQ_READ) events = POLLIN | POLLPRI; else events = POLLOUT; - *new_fd = ((struct irq_fd) { next : NULL, - id : dev_id, - fd : fd, - type : type, - irq : irq, - pid : pid, - events : events, - current_events: 0, - freed : 0 } ); + *new_fd = ((struct irq_fd) { .next = NULL, + .id = dev_id, + .fd = fd, + .type = type, + .irq = irq, + .pid = pid, + .events = events, + .current_events = 0, + .freed = 0 } ); /* Critical section - locked by a spinlock because this stuff can * be changed from interrupt handlers. The stuff above is done @@ -191,9 +191,9 @@ if(type == IRQ_WRITE) fd = -1; - pollfds[pollfds_num] = ((struct pollfd) { fd : fd, - events : events, - revents : 0 }); + pollfds[pollfds_num] = ((struct pollfd) { .fd = fd, + .events = events, + .revents = 0 }); pollfds_num++; *last_irq_ptr = new_fd; @@ -265,8 +265,8 @@ void free_irq_by_irq_and_dev(int irq, void *dev) { - struct irq_and_dev data = ((struct irq_and_dev) { irq : irq, - dev : dev }); + struct irq_and_dev data = ((struct irq_and_dev) { .irq = irq, + .dev = dev }); free_irq_by_cb(same_irq_and_dev, &data); } diff -Nru a/arch/um/kernel/ksyms.c b/arch/um/kernel/ksyms.c --- a/arch/um/kernel/ksyms.c Sun Feb 9 21:13:28 2003 +++ b/arch/um/kernel/ksyms.c Sun Feb 9 21:13:28 2003 @@ -14,6 +14,7 @@ #include "asm/processor.h" #include "asm/unistd.h" #include "asm/pgalloc.h" +#include "asm/pgtable.h" #include "asm/page.h" #include "asm/tlbflush.h" #include "kern_util.h" @@ -42,7 +43,11 @@ EXPORT_SYMBOL(phys_to_page); EXPORT_SYMBOL(high_physmem); EXPORT_SYMBOL(empty_zero_page); +EXPORT_SYMBOL(um_virt_to_phys); +EXPORT_SYMBOL(mode_tt); +EXPORT_SYMBOL(handle_page_fault); +EXPORT_SYMBOL(os_getpid); EXPORT_SYMBOL(os_open_file); EXPORT_SYMBOL(os_read_file); EXPORT_SYMBOL(os_write_file); @@ -75,7 +80,6 @@ extern void FASTCALL( __read_lock_failed(rwlock_t *rw)); EXPORT_SYMBOL_NOVERS(__read_lock_failed); -EXPORT_SYMBOL(smp_num_cpus); #endif #ifdef CONFIG_HIGHMEM diff -Nru a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c --- a/arch/um/kernel/mem.c Sun Feb 9 21:13:31 2003 +++ b/arch/um/kernel/mem.c Sun Feb 9 21:13:31 2003 @@ -27,6 +27,7 @@ #include "init.h" #include "os.h" #include "mode_kern.h" +#include "uml_uaccess.h" /* Changed during early boot */ pgd_t swapper_pg_dir[1024]; @@ -231,11 +232,11 @@ panic("Failed to allocating mem_region"); } - *region = ((struct mem_region) { driver : driver, - start_pfn : pfn, - start : start, - len : len, - fd : fd } ); + *region = ((struct mem_region) { .driver = driver, + .start_pfn = pfn, + .start = start, + .len = len, + .fd = fd } ); regions[i] = region; out: up(®ions_sem); @@ -414,8 +415,28 @@ struct page *arch_validate(struct page *page, int mask, int order) { - return(CHOOSE_MODE_PROC(arch_validate_tt, arch_validate_skas, page, - mask, order)); + unsigned long addr, zero = 0; + int i; + + again: + if(page == NULL) return(page); + if(PageHighMem(page)) return(page); + + addr = (unsigned long) page_address(page); + for(i = 0; i < (1 << order); i++){ + current->thread.fault_addr = (void *) addr; + if(__do_copy_to_user((void *) addr, &zero, + sizeof(zero), + ¤t->thread.fault_addr, + ¤t->thread.fault_catcher)){ + if(!(mask & __GFP_WAIT)) return(NULL); + else break; + } + addr += PAGE_SIZE; + } + if(i == (1 << order)) return(page); + page = alloc_pages(mask, order); + goto again; } DECLARE_MUTEX(vm_reserved_sem); @@ -423,15 +444,15 @@ /* Static structures, linked in to the list in early boot */ static struct vm_reserved head = { - list : LIST_HEAD_INIT(head.list), - start : 0, - end : 0xffffffff + .list = LIST_HEAD_INIT(head.list), + .start = 0, + .end = 0xffffffff }; static struct vm_reserved tail = { - list : LIST_HEAD_INIT(tail.list), - start : 0, - end : 0xffffffff + .list = LIST_HEAD_INIT(tail.list), + .start = 0, + .end = 0xffffffff }; void set_usable_vm(unsigned long start, unsigned long end) @@ -467,9 +488,9 @@ goto out; } *entry = ((struct vm_reserved) - { list : LIST_HEAD_INIT(entry->list), - start : start, - end : end }); + { .list = LIST_HEAD_INIT(entry->list), + .start = start, + .end = end }); list_add(&entry->list, &prev->list); err = 0; out: @@ -539,9 +560,9 @@ */ struct iomem iomem_regions[NREGIONS] = { [ 0 ... NREGIONS - 1 ] = - { name : NULL, - fd : -1, - size : 0 } }; + { .name = NULL, + .fd = -1, + .size = 0 } }; int num_iomem_regions = 0; @@ -551,9 +572,9 @@ return; size = (size + PAGE_SIZE - 1) & PAGE_MASK; iomem_regions[num_iomem_regions++] = - ((struct iomem) { name : name, - fd : fd, - size : size } ); + ((struct iomem) { .name = name, + .fd = fd, + .size = size } ); } int setup_iomem(void) diff -Nru a/arch/um/kernel/process.c b/arch/um/kernel/process.c --- a/arch/um/kernel/process.c Sun Feb 9 21:13:35 2003 +++ b/arch/um/kernel/process.c Sun Feb 9 21:13:35 2003 @@ -37,17 +37,18 @@ #include "uml-config.h" #include "choose-mode.h" #include "mode.h" -#ifdef CONFIG_MODE_SKAS -#include "skas_ptrace.h" +#ifdef UML_CONFIG_MODE_SKAS #include "skas.h" +#include "skas_ptrace.h" #endif void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)) { - int flags = 0; + int flags = 0, pages; if(sig_stack != NULL){ - set_sigstack(sig_stack, 2 * page_size()); + pages = (1 << UML_CONFIG_KERNEL_STACK_ORDER) - 2; + set_sigstack(sig_stack, pages * page_size()); flags = SA_ONSTACK; } if(usr1_handler) set_handler(SIGUSR1, usr1_handler, flags, -1); @@ -251,32 +252,32 @@ int can_do_skas(void) { -#ifdef CONFIG_MODE_SKAS +#ifdef UML_CONFIG_MODE_SKAS struct ptrace_faultinfo fi; void *stack; int pid, n, ret = 1; - printk("Checking for the skas3 patch in the host..."); + printf("Checking for the skas3 patch in the host..."); pid = start_ptraced_child(&stack); n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi); if(n < 0){ if(errno == EIO) - printk("not found\n"); - else printk("No (unexpected errno - %d)\n", errno); + printf("not found\n"); + else printf("No (unexpected errno - %d)\n", errno); ret = 0; } - else printk("found\n"); + else printf("found\n"); init_registers(pid); stop_ptraced_child(pid, stack, 1); - printk("Checking for /proc/mm..."); + printf("Checking for /proc/mm..."); if(access("/proc/mm", W_OK)){ - printk("not found\n"); + printf("not found\n"); ret = 0; } - else printk("found\n"); + else printf("found\n"); return(ret); #else diff -Nru a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c --- a/arch/um/kernel/process_kern.c Sun Feb 9 21:13:32 2003 +++ b/arch/um/kernel/process_kern.c Sun Feb 9 21:13:32 2003 @@ -169,8 +169,12 @@ void initial_thread_cb(void (*proc)(void *), void *arg) { + int save_kmalloc_ok = kmalloc_ok; + + kmalloc_ok = 0; CHOOSE_MODE_PROC(initial_thread_cb_tt, initial_thread_cb_skas, proc, arg); + kmalloc_ok = save_kmalloc_ok; } unsigned long stack_sp(unsigned long page) @@ -306,7 +310,11 @@ int user_context(unsigned long sp) { - return((sp & (PAGE_MASK << 1)) != current->thread.kernel_stack); + unsigned long stack; + + stack = sp & (PAGE_MASK << CONFIG_KERNEL_STACK_ORDER); + stack += 2 * PAGE_SIZE; + return(stack != current->thread.kernel_stack); } extern void remove_umid_dir(void); diff -Nru a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c --- a/arch/um/kernel/ptrace.c Sun Feb 9 21:13:29 2003 +++ b/arch/um/kernel/ptrace.c Sun Feb 9 21:13:29 2003 @@ -9,7 +9,9 @@ #include "linux/smp_lock.h" #include "linux/security.h" #include "linux/ptrace.h" +#ifdef CONFIG_PROC_MM #include "linux/proc_mm.h" +#endif #include "asm/ptrace.h" #include "asm/uaccess.h" #include "kern_util.h" diff -Nru a/arch/um/kernel/sigio_user.c b/arch/um/kernel/sigio_user.c --- a/arch/um/kernel/sigio_user.c Sun Feb 9 21:13:36 2003 +++ b/arch/um/kernel/sigio_user.c Sun Feb 9 21:13:36 2003 @@ -52,7 +52,7 @@ { struct sigaction old, new; struct termios tt; - struct openpty_arg pty = { master : -1, slave : -1 }; + struct openpty_arg pty = { .master = -1, .slave = -1 }; int master, slave, flags; initial_thread_cb(openpty_cb, &pty); @@ -111,6 +111,7 @@ printk("Checking that host ptys support output SIGIO..."); + memset(buf, 0, sizeof(buf)); while(write(master, buf, sizeof(buf)) > 0) ; if(errno != EAGAIN) panic("check_sigio : write failed, errno = %d\n", errno); @@ -170,15 +171,15 @@ * synchronizes with it. */ struct pollfds current_poll = { - poll : NULL, - size : 0, - used : 0 + .poll = NULL, + .size = 0, + .used = 0 }; struct pollfds next_poll = { - poll : NULL, - size : 0, - used : 0 + .poll = NULL, + .size = 0, + .used = 0 }; static int write_sigio_thread(void *unused) @@ -267,7 +268,8 @@ return; fail: sigio_lock(); - if(write_sigio_pid != -1) kill(write_sigio_pid, SIGKILL); + if(write_sigio_pid != -1) + os_kill_process(write_sigio_pid, 1); write_sigio_pid = -1; close(sigio_private[0]); close(sigio_private[1]); @@ -298,9 +300,9 @@ if(read) events = POLLIN; else events = POLLOUT; - next_poll.poll[n - 1] = ((struct pollfd) { fd : fd, - events : events, - revents : 0 }); + next_poll.poll[n - 1] = ((struct pollfd) { .fd = fd, + .events = events, + .revents = 0 }); update_thread(); out: sigio_unlock(); @@ -348,12 +350,12 @@ printk("setup_initial_poll : failed to allocate poll\n"); return(-1); } - *p = ((struct pollfd) { fd : fd, - events : POLLIN, - revents : 0 }); - current_poll = ((struct pollfds) { poll : p, - used : 1, - size : 1 }); + *p = ((struct pollfd) { .fd = fd, + .events = POLLIN, + .revents = 0 }); + current_poll = ((struct pollfds) { .poll = p, + .used = 1, + .size = 1 }); return(0); } @@ -394,7 +396,7 @@ return; out_kill: - kill(write_sigio_pid, SIGKILL); + os_kill_process(write_sigio_pid, 1); write_sigio_pid = -1; out_close2: close(sigio_private[0]); @@ -420,7 +422,8 @@ static void sigio_cleanup(void) { - if(write_sigio_pid != -1) kill(write_sigio_pid, SIGKILL); + if(write_sigio_pid != -1) + os_kill_process(write_sigio_pid, 1); } __uml_exitcall(sigio_cleanup); diff -Nru a/arch/um/kernel/signal_kern.c b/arch/um/kernel/signal_kern.c --- a/arch/um/kernel/signal_kern.c Sun Feb 9 21:13:32 2003 +++ b/arch/um/kernel/signal_kern.c Sun Feb 9 21:13:32 2003 @@ -18,6 +18,7 @@ #include "asm/uaccess.h" #include "asm/unistd.h" #include "user_util.h" +#include "asm/ucontext.h" #include "kern_util.h" #include "signal_kern.h" #include "signal_user.h" @@ -29,18 +30,6 @@ EXPORT_SYMBOL(block_signals); EXPORT_SYMBOL(unblock_signals); -int probe_stack(unsigned long sp, int delta) -{ - int n; - - if((get_user(n, (int *) sp) != 0) || - (put_user(n, (int *) sp) != 0) || - (get_user(n, (int *) (sp - delta)) != 0) || - (put_user(n, (int *) (sp - delta)) != 0)) - return(-EFAULT); - return(0); -} - static void force_segv(int sig) { if(sig == SIGSEGV){ @@ -106,12 +95,12 @@ ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); sigaddset(¤t->blocked, signr); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } sp = PT_REGS_SP(regs); @@ -197,11 +186,11 @@ sigset_t saveset; mask &= _BLOCKABLE; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; siginitset(¤t->blocked, mask); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); while (1) { current->state = TASK_INTERRUPTIBLE; @@ -223,11 +212,11 @@ return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); while (1) { current->state = TASK_INTERRUPTIBLE; @@ -237,45 +226,48 @@ } } -static int copy_sc_from_user(struct pt_regs *to, void *from) +static int copy_sc_from_user(struct pt_regs *to, void *from, + struct arch_frame_data *arch) { int ret; - ret = CHOOSE_MODE(copy_sc_from_user_tt(to->regs.mode.tt, from, - &signal_frame_sc.arch), + ret = CHOOSE_MODE(copy_sc_from_user_tt(UPT_SC(&to->regs), from, arch), copy_sc_from_user_skas(&to->regs, from)); return(ret); } int sys_sigreturn(struct pt_regs regs) { - void *sc = sp_to_sc(PT_REGS_SP(®s)); - void *mask = sp_to_mask(PT_REGS_SP(®s)); + void *sc = sp_to_sc(PT_REGS_SP(¤t->thread.regs)); + void *mask = sp_to_mask(PT_REGS_SP(¤t->thread.regs)); int sig_size = (_NSIG_WORDS - 1) * sizeof(unsigned long); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); copy_from_user(¤t->blocked.sig[0], sc_sigmask(sc), sizeof(current->blocked.sig[0])); copy_from_user(¤t->blocked.sig[1], mask, sig_size); sigdelsetmask(¤t->blocked, ~_BLOCKABLE); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); - copy_sc_from_user(¤t->thread.regs, sc); + spin_unlock_irq(¤t->sighand->siglock); + copy_sc_from_user(¤t->thread.regs, sc, + &signal_frame_sc.common.arch); return(PT_REGS_SYSCALL_RET(¤t->thread.regs)); } int sys_rt_sigreturn(struct pt_regs regs) { - void *sc = sp_to_rt_sc(PT_REGS_SP(®s)); - void *mask = sp_to_rt_mask(PT_REGS_SP(®s)); + struct ucontext *uc = sp_to_uc(PT_REGS_SP(¤t->thread.regs)); + void *fp; int sig_size = _NSIG_WORDS * sizeof(unsigned long); - spin_lock_irq(¤t->sig->siglock); - copy_from_user(¤t->blocked, mask, sig_size); + spin_lock_irq(¤t->sighand->siglock); + copy_from_user(¤t->blocked, &uc->uc_sigmask, sig_size); sigdelsetmask(¤t->blocked, ~_BLOCKABLE); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); - copy_sc_from_user(¤t->thread.regs, sc); + spin_unlock_irq(¤t->sighand->siglock); + fp = (void *) (((unsigned long) uc) + sizeof(struct ucontext)); + copy_sc_from_user(¤t->thread.regs, &uc->uc_mcontext, + &signal_frame_si.common.arch); return(PT_REGS_SYSCALL_RET(¤t->thread.regs)); } diff -Nru a/arch/um/kernel/skas/include/mode.h b/arch/um/kernel/skas/include/mode.h --- a/arch/um/kernel/skas/include/mode.h Sun Feb 9 21:13:32 2003 +++ b/arch/um/kernel/skas/include/mode.h Sun Feb 9 21:13:32 2003 @@ -12,10 +12,11 @@ extern int have_fpx_regs; extern void user_time_init_skas(void); -extern int copy_sc_from_user_skas(struct uml_pt_regs *regs, void *from_ptr); -extern int copy_sc_to_user_skas(void *to_ptr, struct uml_pt_regs *regs, +extern int copy_sc_from_user_skas(union uml_pt_regs *regs, void *from_ptr); +extern int copy_sc_to_user_skas(void *to_ptr, void *fp, + union uml_pt_regs *regs, unsigned long fault_addr, int fault_type); -extern void sig_handler_common_skas(int sig, struct sigcontext *sc); +extern void sig_handler_common_skas(int sig, void *sc_ptr); extern void halt_skas(void); extern void reboot_skas(void); extern void kill_off_processes_skas(void); diff -Nru a/arch/um/kernel/skas/include/mode_kern.h b/arch/um/kernel/skas/include/mode_kern.h --- a/arch/um/kernel/skas/include/mode_kern.h Sun Feb 9 21:13:32 2003 +++ b/arch/um/kernel/skas/include/mode_kern.h Sun Feb 9 21:13:32 2003 @@ -21,6 +21,8 @@ extern void exit_thread_skas(void); extern void initial_thread_cb_skas(void (*proc)(void *), void *arg); extern void init_idle_skas(void); +extern void flush_tlb_kernel_range_skas(unsigned long start, + unsigned long end); extern void flush_tlb_kernel_vm_skas(void); extern void __flush_tlb_one_skas(unsigned long addr); extern void flush_tlb_range_skas(struct vm_area_struct *vma, @@ -32,11 +34,10 @@ extern unsigned long set_task_sizes_skas(int arg, unsigned long *host_size_out, unsigned long *task_size_out); extern int start_uml_skas(void); -extern struct page *arch_validate_skas(struct page *page, int mask, int order); extern int external_pid_skas(struct task_struct *task); extern int thread_pid_skas(struct task_struct *task); -#define kmem_end_skas (host_task_size) +#define kmem_end_skas (host_task_size - 1024 * 1024) #endif diff -Nru a/arch/um/kernel/skas/include/ptrace-skas.h b/arch/um/kernel/skas/include/ptrace-skas.h --- a/arch/um/kernel/skas/include/ptrace-skas.h Sun Feb 9 21:13:29 2003 +++ b/arch/um/kernel/skas/include/ptrace-skas.h Sun Feb 9 21:13:29 2003 @@ -8,7 +8,7 @@ #include "uml-config.h" -#ifdef CONFIG_MODE_SKAS +#ifdef UML_CONFIG_MODE_SKAS #include "skas_ptregs.h" diff -Nru a/arch/um/kernel/skas/include/skas.h b/arch/um/kernel/skas/include/skas.h --- a/arch/um/kernel/skas/include/skas.h Sun Feb 9 21:13:30 2003 +++ b/arch/um/kernel/skas/include/skas.h Sun Feb 9 21:13:30 2003 @@ -17,21 +17,21 @@ extern int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr); extern int user_thread(unsigned long stack, int flags); -extern void userspace(struct uml_pt_regs *regs); +extern void userspace(union uml_pt_regs *regs); extern void new_thread_proc(void *stack, void (*handler)(int sig)); extern void remove_sigstack(void); extern void new_thread_handler(int sig); -extern void handle_syscall(struct uml_pt_regs *regs); +extern void handle_syscall(union uml_pt_regs *regs); extern void map(int fd, unsigned long virt, unsigned long phys, unsigned long len, int r, int w, int x); extern int unmap(int fd, void *addr, int len); extern int protect(int fd, unsigned long addr, unsigned long len, int r, int w, int x, int must_succeed); -extern void user_signal(int sig, struct uml_pt_regs *regs); +extern void user_signal(int sig, union uml_pt_regs *regs); extern int singlestepping_skas(void); extern int new_mm(int from); -extern void save_registers(struct uml_pt_regs *regs); -extern void restore_registers(struct uml_pt_regs *regs); +extern void save_registers(union uml_pt_regs *regs); +extern void restore_registers(union uml_pt_regs *regs); extern void start_userspace(void); extern void init_registers(int pid); diff -Nru a/arch/um/kernel/skas/include/skas_ptrace.h b/arch/um/kernel/skas/include/skas_ptrace.h --- a/arch/um/kernel/skas/include/skas_ptrace.h Sun Feb 9 21:13:35 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) - * Licensed under the GPL - */ - -#ifndef __SKAS_PTRACE_H -#define __SKAS_PTRACE_H - -struct ptrace_faultinfo { - int is_write; - unsigned long addr; -}; - -struct ptrace_ldt { - int func; - void *ptr; - unsigned long bytecount; -}; - -#define PTRACE_FAULTINFO 52 -#define PTRACE_SIGPENDING 53 -#define PTRACE_LDT 54 -#define PTRACE_SWITCH_MM 55 - -#endif - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ diff -Nru a/arch/um/kernel/skas/include/uaccess.h b/arch/um/kernel/skas/include/uaccess.h --- a/arch/um/kernel/skas/include/uaccess.h Sun Feb 9 21:13:31 2003 +++ b/arch/um/kernel/skas/include/uaccess.h Sun Feb 9 21:13:31 2003 @@ -27,9 +27,6 @@ return(access_ok_skas(type, addr, size) ? 0 : -EFAULT); } -extern void *um_virt_to_phys(struct task_struct *task, unsigned long virt, - pte_t *pte_out); - static inline unsigned long maybe_map(unsigned long virt, int is_write) { pte_t pte; diff -Nru a/arch/um/kernel/skas/mem.c b/arch/um/kernel/skas/mem.c --- a/arch/um/kernel/skas/mem.c Sun Feb 9 21:13:35 2003 +++ b/arch/um/kernel/skas/mem.c Sun Feb 9 21:13:35 2003 @@ -18,11 +18,6 @@ return(((unsigned long) set_task_sizes_skas) & ~0xffffff); } -struct page *arch_validate_skas(struct page *page, int mask, int order) -{ - return(page); -} - /* * Overrides for Emacs so that we follow Linus's tabbing style. * Emacs will notice this stuff at the end of the file and automatically diff -Nru a/arch/um/kernel/skas/mem_user.c b/arch/um/kernel/skas/mem_user.c --- a/arch/um/kernel/skas/mem_user.c Sun Feb 9 21:13:30 2003 +++ b/arch/um/kernel/skas/mem_user.c Sun Feb 9 21:13:30 2003 @@ -33,7 +33,7 @@ .fd = region->fd, .offset = phys_offset(phys) } } } ); - n = os_write_file(fd, (char *) &map, sizeof(map)); + n = os_write_file(fd, &map, sizeof(map)); if(n != sizeof(map)) printk("map : /proc/mm map failed, errno = %d\n", errno); } @@ -48,7 +48,7 @@ { .munmap = { .addr = (unsigned long) addr, .len = len } } } ); - n = os_write_file(fd, (char *) &unmap, sizeof(unmap)); + n = os_write_file(fd, &unmap, sizeof(unmap)); if((n != 0) && (n != sizeof(unmap))) return(-errno); return(0); @@ -70,7 +70,7 @@ .len = len, .prot = prot } } } ); - n = os_write_file(fd, (char *) &protect, sizeof(protect)); + n = os_write_file(fd, &protect, sizeof(protect)); if((n != 0) && (n != sizeof(protect))){ if(must_succeed) panic("protect failed, errno = %d", errno); diff -Nru a/arch/um/kernel/skas/process.c b/arch/um/kernel/skas/process.c --- a/arch/um/kernel/skas/process.c Sun Feb 9 21:13:36 2003 +++ b/arch/um/kernel/skas/process.c Sun Feb 9 21:13:36 2003 @@ -20,10 +20,10 @@ #include "user_util.h" #include "kern_util.h" #include "skas.h" -#include "skas_ptrace.h" #include "sysdep/sigcontext.h" #include "os.h" #include "proc_mm.h" +#include "skas_ptrace.h" unsigned long exec_regs[FRAME_SIZE]; unsigned long exec_fp_regs[HOST_FP_SIZE]; @@ -39,14 +39,15 @@ if(err) panic("handle_segv - PTRACE_FAULTINFO failed, errno = %d\n", errno); + segv(fault.addr, 0, FAULT_WRITE(fault.is_write), 1, NULL); } -static void handle_trap(int pid, struct uml_pt_regs *regs) +static void handle_trap(int pid, union uml_pt_regs *regs) { int err, syscall_nr, status; - syscall_nr = PT_SYSCALL_NR(regs->mode.skas.regs); + syscall_nr = PT_SYSCALL_NR(regs->skas.regs); if(syscall_nr < 1){ relay_signal(SIGTRAP, regs); return; @@ -79,6 +80,7 @@ enable_timer(); ptrace(PTRACE_TRACEME, 0, 0, 0); os_stop_process(os_getpid()); + return(0); } void start_userspace(void) @@ -115,7 +117,7 @@ userspace_pid = pid; } -void userspace(struct uml_pt_regs *regs) +void userspace(union uml_pt_regs *regs) { int err, status, op; @@ -131,7 +133,7 @@ panic("userspace - waitpid failed, errno = %d\n", errno); - regs->is_user = 1; + regs->skas.is_user = 1; save_registers(regs); if(WIFSTOPPED(status)){ @@ -191,28 +193,28 @@ longjmp(*fork_buf, 1); } -static int move_registers(int int_op, int fp_op, struct uml_pt_regs *regs, +static int move_registers(int int_op, int fp_op, union uml_pt_regs *regs, unsigned long *fp_regs) { - if(ptrace(int_op, userspace_pid, 0, regs->mode.skas.regs) < 0) + if(ptrace(int_op, userspace_pid, 0, regs->skas.regs) < 0) return(-errno); if(ptrace(fp_op, userspace_pid, 0, fp_regs) < 0) return(-errno); return(0); } -void save_registers(struct uml_pt_regs *regs) +void save_registers(union uml_pt_regs *regs) { unsigned long *fp_regs; int err, fp_op; if(have_fpx_regs){ fp_op = PTRACE_GETFPXREGS; - fp_regs = regs->mode.skas.xfp; + fp_regs = regs->skas.xfp; } else { fp_op = PTRACE_GETFPREGS; - fp_regs = regs->mode.skas.fp; + fp_regs = regs->skas.fp; } err = move_registers(PTRACE_GETREGS, fp_op, regs, fp_regs); @@ -221,18 +223,18 @@ err); } -void restore_registers(struct uml_pt_regs *regs) +void restore_registers(union uml_pt_regs *regs) { unsigned long *fp_regs; int err, fp_op; if(have_fpx_regs){ fp_op = PTRACE_SETFPXREGS; - fp_regs = regs->mode.skas.xfp; + fp_regs = regs->skas.xfp; } else { fp_op = PTRACE_SETFPREGS; - fp_regs = regs->mode.skas.fp; + fp_regs = regs->skas.fp; } err = move_registers(PTRACE_SETREGS, fp_op, regs, fp_regs); @@ -272,10 +274,14 @@ (*cb_proc)(cb_arg); longjmp(*cb_back, 1); } - else if(n == 3) + else if(n == 3){ + kmalloc_ok = 0; return(0); - else if(n == 4) + } + else if(n == 4){ + kmalloc_ok = 0; return(1); + } longjmp(**switch_buf, 1); } @@ -296,8 +302,11 @@ cb_proc = proc; cb_arg = arg; cb_back = &here; + + block_signals(); if(setjmp(here) == 0) longjmp(initial_jmpbuf, 2); + unblock_signals(); cb_proc = NULL; cb_arg = NULL; @@ -328,7 +337,7 @@ copy = ((struct proc_mm_op) { .op = MM_COPY_SEGMENTS, .u = { .copy_segments = from } } ); - n = os_write_file(fd, (char *) ©, sizeof(copy)); + n = os_write_file(fd, ©, sizeof(copy)); if(n != sizeof(copy)) printk("new_mm : /proc/mm copy_segments failed, " "errno = %d\n", errno); diff -Nru a/arch/um/kernel/skas/process_kern.c b/arch/um/kernel/skas/process_kern.c --- a/arch/um/kernel/skas/process_kern.c Sun Feb 9 21:13:30 2003 +++ b/arch/um/kernel/skas/process_kern.c Sun Feb 9 21:13:30 2003 @@ -68,8 +68,7 @@ n = run_kernel_thread(fn, arg, ¤t->thread.exec_buf); if(n == 1) userspace(¤t->thread.regs.regs); - else if(n == 2) - do_exit(0); + else do_exit(0); } void new_thread_proc(void *stack, void (*handler)(int sig)) @@ -109,21 +108,21 @@ void (*handler)(int); if(current->thread.forking){ - memcpy(&p->thread.regs.regs.mode.skas, - ¤t->thread.regs.regs.mode.skas, - sizeof(p->thread.regs.regs.mode.skas)); - REGS_SET_SYSCALL_RETURN(p->thread.regs.regs.mode.skas.regs, 0); - if(sp != 0) REGS_SP(p->thread.regs.regs.mode.skas.regs) = sp; + memcpy(&p->thread.regs.regs.skas, + ¤t->thread.regs.regs.skas, + sizeof(p->thread.regs.regs.skas)); + REGS_SET_SYSCALL_RETURN(p->thread.regs.regs.skas.regs, 0); + if(sp != 0) REGS_SP(p->thread.regs.regs.skas.regs) = sp; handler = fork_handler; } else { - memcpy(p->thread.regs.regs.mode.skas.regs, exec_regs, - sizeof(p->thread.regs.regs.mode.skas.regs)); - memcpy(p->thread.regs.regs.mode.skas.fp, exec_fp_regs, - sizeof(p->thread.regs.regs.mode.skas.fp)); - memcpy(p->thread.regs.regs.mode.skas.xfp, exec_fpx_regs, - sizeof(p->thread.regs.regs.mode.skas.xfp)); + memcpy(p->thread.regs.regs.skas.regs, exec_regs, + sizeof(p->thread.regs.regs.skas.regs)); + memcpy(p->thread.regs.regs.skas.fp, exec_fp_regs, + sizeof(p->thread.regs.regs.skas.fp)); + memcpy(p->thread.regs.regs.skas.xfp, exec_fpx_regs, + sizeof(p->thread.regs.regs.skas.xfp)); p->thread.request.u.thread = current->thread.request.u.thread; handler = new_thread_handler; } diff -Nru a/arch/um/kernel/skas/sys-i386/sigcontext.c b/arch/um/kernel/skas/sys-i386/sigcontext.c --- a/arch/um/kernel/skas/sys-i386/sigcontext.c Sun Feb 9 21:13:28 2003 +++ b/arch/um/kernel/skas/sys-i386/sigcontext.c Sun Feb 9 21:13:28 2003 @@ -15,7 +15,7 @@ extern int userspace_pid; -int copy_sc_from_user_skas(struct uml_pt_regs *regs, void *from_ptr) +int copy_sc_from_user_skas(union uml_pt_regs *regs, void *from_ptr) { struct sigcontext sc, *from = from_ptr; unsigned long fpregs[FP_FRAME_SIZE]; @@ -26,26 +26,26 @@ if(err) return(err); - regs->mode.skas.regs[GS] = sc.gs; - regs->mode.skas.regs[FS] = sc.fs; - regs->mode.skas.regs[ES] = sc.es; - regs->mode.skas.regs[DS] = sc.ds; - regs->mode.skas.regs[EDI] = sc.edi; - regs->mode.skas.regs[ESI] = sc.esi; - regs->mode.skas.regs[EBP] = sc.ebp; - regs->mode.skas.regs[UESP] = sc.esp; - regs->mode.skas.regs[EBX] = sc.ebx; - regs->mode.skas.regs[EDX] = sc.edx; - regs->mode.skas.regs[ECX] = sc.ecx; - regs->mode.skas.regs[EAX] = sc.eax; - regs->mode.skas.regs[EIP] = sc.eip; - regs->mode.skas.regs[CS] = sc.cs; - regs->mode.skas.regs[EFL] = sc.eflags; - regs->mode.skas.regs[UESP] = sc.esp_at_signal; - regs->mode.skas.regs[SS] = sc.ss; - regs->mode.skas.fault_addr = sc.cr2; - regs->mode.skas.fault_type = FAULT_WRITE(sc.err); - regs->mode.skas.trap_type = sc.trapno; + regs->skas.regs[GS] = sc.gs; + regs->skas.regs[FS] = sc.fs; + regs->skas.regs[ES] = sc.es; + regs->skas.regs[DS] = sc.ds; + regs->skas.regs[EDI] = sc.edi; + regs->skas.regs[ESI] = sc.esi; + regs->skas.regs[EBP] = sc.ebp; + regs->skas.regs[UESP] = sc.esp; + regs->skas.regs[EBX] = sc.ebx; + regs->skas.regs[EDX] = sc.edx; + regs->skas.regs[ECX] = sc.ecx; + regs->skas.regs[EAX] = sc.eax; + regs->skas.regs[EIP] = sc.eip; + regs->skas.regs[CS] = sc.cs; + regs->skas.regs[EFL] = sc.eflags; + regs->skas.regs[UESP] = sc.esp_at_signal; + regs->skas.regs[SS] = sc.ss; + regs->skas.fault_addr = sc.cr2; + regs->skas.fault_type = FAULT_WRITE(sc.err); + regs->skas.trap_type = sc.trapno; err = ptrace(PTRACE_SETFPREGS, userspace_pid, 0, fpregs); if(err < 0){ @@ -57,7 +57,7 @@ return(0); } -int copy_sc_to_user_skas(void *to_ptr, struct uml_pt_regs *regs, +int copy_sc_to_user_skas(void *to_ptr, void *fp, union uml_pt_regs *regs, unsigned long fault_addr, int fault_type) { struct sigcontext sc, *to = to_ptr; @@ -65,26 +65,26 @@ unsigned long fpregs[FP_FRAME_SIZE]; int err; - sc.gs = regs->mode.skas.regs[GS]; - sc.fs = regs->mode.skas.regs[FS]; - sc.es = regs->mode.skas.regs[ES]; - sc.ds = regs->mode.skas.regs[DS]; - sc.edi = regs->mode.skas.regs[EDI]; - sc.esi = regs->mode.skas.regs[ESI]; - sc.ebp = regs->mode.skas.regs[EBP]; - sc.esp = regs->mode.skas.regs[UESP]; - sc.ebx = regs->mode.skas.regs[EBX]; - sc.edx = regs->mode.skas.regs[EDX]; - sc.ecx = regs->mode.skas.regs[ECX]; - sc.eax = regs->mode.skas.regs[EAX]; - sc.eip = regs->mode.skas.regs[EIP]; - sc.cs = regs->mode.skas.regs[CS]; - sc.eflags = regs->mode.skas.regs[EFL]; - sc.esp_at_signal = regs->mode.skas.regs[UESP]; - sc.ss = regs->mode.skas.regs[SS]; + sc.gs = regs->skas.regs[GS]; + sc.fs = regs->skas.regs[FS]; + sc.es = regs->skas.regs[ES]; + sc.ds = regs->skas.regs[DS]; + sc.edi = regs->skas.regs[EDI]; + sc.esi = regs->skas.regs[ESI]; + sc.ebp = regs->skas.regs[EBP]; + sc.esp = regs->skas.regs[UESP]; + sc.ebx = regs->skas.regs[EBX]; + sc.edx = regs->skas.regs[EDX]; + sc.ecx = regs->skas.regs[ECX]; + sc.eax = regs->skas.regs[EAX]; + sc.eip = regs->skas.regs[EIP]; + sc.cs = regs->skas.regs[CS]; + sc.eflags = regs->skas.regs[EFL]; + sc.esp_at_signal = regs->skas.regs[UESP]; + sc.ss = regs->skas.regs[SS]; sc.cr2 = fault_addr; sc.err = TO_SC_ERR(fault_type); - sc.trapno = regs->mode.skas.trap_type; + sc.trapno = regs->skas.trap_type; err = ptrace(PTRACE_GETFPREGS, userspace_pid, 0, fpregs); if(err < 0){ @@ -92,7 +92,8 @@ "errno = %d\n", errno); return(1); } - to_fp = (struct _fpstate *)((unsigned long) to + sizeof(*to)); + to_fp = (struct _fpstate *) + (fp ? (unsigned long) fp : ((unsigned long) to + sizeof(*to))); sc.fpstate = to_fp; if(err) diff -Nru a/arch/um/kernel/skas/syscall_kern.c b/arch/um/kernel/skas/syscall_kern.c --- a/arch/um/kernel/skas/syscall_kern.c Sun Feb 9 21:13:33 2003 +++ b/arch/um/kernel/skas/syscall_kern.c Sun Feb 9 21:13:33 2003 @@ -21,7 +21,7 @@ current->thread.nsyscalls++; nsyscalls++; - syscall = regs->regs.syscall; + syscall = UPT_SYSCALL_NR(®s->regs); if((syscall >= NR_syscalls) || (syscall < 0)) res = -ENOSYS; diff -Nru a/arch/um/kernel/skas/syscall_user.c b/arch/um/kernel/skas/syscall_user.c --- a/arch/um/kernel/skas/syscall_user.c Sun Feb 9 21:13:36 2003 +++ b/arch/um/kernel/skas/syscall_user.c Sun Feb 9 21:13:36 2003 @@ -15,18 +15,17 @@ #define ERESTARTNOINTR 513 #define ERESTARTNOHAND 514 -void handle_syscall(struct uml_pt_regs *regs) +void handle_syscall(union uml_pt_regs *regs) { long result; int index; - host_to_regs(regs); index = record_syscall_start(UPT_SYSCALL_NR(regs)); syscall_trace(); result = execute_syscall(regs); - REGS_SET_SYSCALL_RETURN(regs->mode.skas.regs, result); + REGS_SET_SYSCALL_RETURN(regs->skas.regs, result); if((result == -ERESTARTNOHAND) || (result == -ERESTARTSYS) || (result == -ERESTARTNOINTR)) do_signal(result); diff -Nru a/arch/um/kernel/skas/tlb.c b/arch/um/kernel/skas/tlb.c --- a/arch/um/kernel/skas/tlb.c Sun Feb 9 21:13:32 2003 +++ b/arch/um/kernel/skas/tlb.c Sun Feb 9 21:13:32 2003 @@ -67,7 +67,7 @@ } } -static void flush_kernel_vm_range(unsigned long start, unsigned long end) +void flush_tlb_kernel_range_skas(unsigned long start, unsigned long end) { struct mm_struct *mm; pgd_t *pgd; @@ -99,7 +99,6 @@ protect_memory(addr, PAGE_SIZE, 1, 1, 1, 1); } addr += PAGE_SIZE; - } else { if(pmd_newpage(*pmd)){ @@ -116,27 +115,26 @@ void flush_tlb_kernel_vm_skas(void) { - flush_kernel_vm_range(start_vm, end_vm); + flush_tlb_kernel_range_skas(start_vm, end_vm); } void __flush_tlb_one_skas(unsigned long addr) { - flush_kernel_vm_range(addr, addr + PAGE_SIZE); + flush_tlb_kernel_range_skas(addr, addr + PAGE_SIZE); } void flush_tlb_range_skas(struct vm_area_struct *vma, unsigned long start, unsigned long end) { if(vma->vm_mm == NULL) - flush_kernel_vm_range(start, end); + flush_tlb_kernel_range_skas(start, end); else fix_range(vma->vm_mm, start, end, 0); } void flush_tlb_mm_skas(struct mm_struct *mm) { - if(mm == NULL) - flush_tlb_kernel_vm_skas(); - else fix_range(mm, 0, host_task_size, 0); + flush_tlb_kernel_vm_skas(); + fix_range(mm, 0, host_task_size, 0); } void force_flush_all_skas(void) diff -Nru a/arch/um/kernel/skas/trap_user.c b/arch/um/kernel/skas/trap_user.c --- a/arch/um/kernel/skas/trap_user.c Sun Feb 9 21:13:31 2003 +++ b/arch/um/kernel/skas/trap_user.c Sun Feb 9 21:13:31 2003 @@ -13,41 +13,40 @@ #include "task.h" #include "sigcontext.h" -void sig_handler_common_skas(int sig, struct sigcontext *sc) +void sig_handler_common_skas(int sig, void *sc_ptr) { - struct uml_pt_regs save_regs, *r; + struct sigcontext *sc = sc_ptr; + struct skas_regs *r; struct signal_info *info; int save_errno = errno; - r = (struct uml_pt_regs *) TASK_REGS(get_current()); - save_regs = *r; + r = &TASK_REGS(get_current())->skas; r->is_user = 0; - r->mode.skas.fault_addr = SC_FAULT_ADDR(sc); - r->mode.skas.fault_type = SC_FAULT_TYPE(sc); - r->mode.skas.trap_type = SC_TRAP_TYPE(sc); + r->fault_addr = SC_FAULT_ADDR(sc); + r->fault_type = SC_FAULT_TYPE(sc); + r->trap_type = SC_TRAP_TYPE(sc); change_sig(SIGUSR1, 1); info = &sig_info[sig]; if(!info->is_irq) unblock_signals(); - (*info->handler)(sig, r); + (*info->handler)(sig, (union uml_pt_regs *) r); - *r = save_regs; errno = save_errno; } extern int missed_ticks[]; -void user_signal(int sig, struct uml_pt_regs *regs) +void user_signal(int sig, union uml_pt_regs *regs) { struct signal_info *info; if(sig == SIGVTALRM) missed_ticks[cpu()]++; - regs->is_user = 1; - regs->mode.skas.fault_addr = 0; - regs->mode.skas.fault_type = 0; - regs->mode.skas.trap_type = 0; + regs->skas.is_user = 1; + regs->skas.fault_addr = 0; + regs->skas.fault_type = 0; + regs->skas.trap_type = 0; info = &sig_info[sig]; (*info->handler)(sig, regs); diff -Nru a/arch/um/kernel/smp.c b/arch/um/kernel/smp.c --- a/arch/um/kernel/smp.c Sun Feb 9 21:13:29 2003 +++ b/arch/um/kernel/smp.c Sun Feb 9 21:13:29 2003 @@ -13,6 +13,7 @@ #include "linux/sched.h" #include "linux/threads.h" #include "linux/interrupt.h" +#include "linux/err.h" #include "asm/smp.h" #include "asm/processor.h" #include "asm/spinlock.h" @@ -140,7 +141,7 @@ current->thread.request.u.thread.proc = idle_proc; current->thread.request.u.thread.arg = (void *) cpu; - new_task = do_fork(CLONE_VM | CLONE_IDLETASK, 0, NULL, 0, NULL); + new_task = do_fork(CLONE_VM | CLONE_IDLETASK, 0, NULL, 0, NULL, NULL); if(IS_ERR(new_task)) panic("do_fork failed in idle_thread"); cpu_tasks[cpu] = ((struct cpu_task) @@ -186,7 +187,7 @@ } } -void __devinit smp_prepare_boot_cpu(void) +void smp_prepare_boot_cpu(void) { set_bit(smp_processor_id(), &cpu_online_map); } diff -Nru a/arch/um/kernel/sys_call_table.c b/arch/um/kernel/sys_call_table.c --- a/arch/um/kernel/sys_call_table.c Sun Feb 9 21:13:35 2003 +++ b/arch/um/kernel/sys_call_table.c Sun Feb 9 21:13:35 2003 @@ -481,8 +481,6 @@ [ __NR_io_getevents ] = sys_io_getevents, [ __NR_io_submit ] = sys_io_submit, [ __NR_io_cancel ] = sys_io_cancel, - [ __NR_alloc_hugepages ] = sys_ni_syscall, - [ __NR_free_hugepages ] = sys_ni_syscall, [ __NR_exit_group ] = sys_exit_group, [ __NR_lookup_dcookie ] = sys_lookup_dcookie, [ __NR_epoll_create ] = sys_epoll_create, diff -Nru a/arch/um/kernel/tempfile.c b/arch/um/kernel/tempfile.c --- a/arch/um/kernel/tempfile.c Sun Feb 9 21:13:32 2003 +++ b/arch/um/kernel/tempfile.c Sun Feb 9 21:13:32 2003 @@ -23,20 +23,19 @@ if(tempdir != NULL) return; /* We've already been called */ for(i = 0; dirs[i]; i++){ dir = getenv(dirs[i]); - if(dir != NULL) break; + if((dir != NULL) && (*dir != '\0')) + break; } - if(dir == NULL) dir = "/tmp"; - else if(*dir == '\0') dir = NULL; - if(dir != NULL) { - tempdir = malloc(strlen(dir) + 2); - if(tempdir == NULL){ - fprintf(stderr, "Failed to malloc tempdir, " - "errno = %d\n", errno); - return; - } - strcpy(tempdir, dir); - strcat(tempdir, "/"); + if((dir == NULL) || (*dir == '\0')) + dir = "/tmp"; + tempdir = malloc(strlen(dir) + 2); + if(tempdir == NULL){ + fprintf(stderr, "Failed to malloc tempdir, " + "errno = %d\n", errno); + return; } + strcpy(tempdir, dir); + strcat(tempdir, "/"); } int make_tempfile(const char *template, char **out_tempname, int do_unlink) diff -Nru a/arch/um/kernel/time.c b/arch/um/kernel/time.c --- a/arch/um/kernel/time.c Sun Feb 9 21:13:29 2003 +++ b/arch/um/kernel/time.c Sun Feb 9 21:13:29 2003 @@ -86,20 +86,23 @@ void do_gettimeofday(struct timeval *tv) { - time_lock(); + unsigned long flags; + + flags = time_lock(); gettimeofday(tv, NULL); timeradd(tv, &local_offset, tv); - time_unlock(); + time_unlock(flags); } void do_settimeofday(struct timeval *tv) { struct timeval now; + unsigned long flags; - time_lock(); + flags = time_lock(); gettimeofday(&now, NULL); timersub(tv, &now, &local_offset); - time_unlock(); + time_unlock(flags); } void idle_sleep(int secs) @@ -108,7 +111,7 @@ ts.tv_sec = secs; ts.tv_nsec = 0; - nanosleep(&ts, &ts); + nanosleep(&ts, NULL); } /* diff -Nru a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c --- a/arch/um/kernel/time_kern.c Sun Feb 9 21:13:33 2003 +++ b/arch/um/kernel/time_kern.c Sun Feb 9 21:13:33 2003 @@ -7,6 +7,7 @@ #include "linux/unistd.h" #include "linux/stddef.h" #include "linux/spinlock.h" +#include "linux/time.h" #include "linux/sched.h" #include "linux/interrupt.h" #include "linux/init.h" @@ -21,8 +22,6 @@ u64 jiffies_64; -extern rwlock_t xtime_lock; - int hz(void) { return(HZ); @@ -37,7 +36,7 @@ */ int __attribute__ ((__section__ (".unprotected"))) missed_ticks[NR_CPUS]; -void timer_irq(struct uml_pt_regs *regs) +void timer_irq(union uml_pt_regs *regs) { int cpu = current->thread_info->cpu, ticks = missed_ticks[cpu]; @@ -50,16 +49,18 @@ { struct pt_regs regs; - regs.regs.is_user = 0; + CHOOSE_MODE((void) + (UPT_SC(®s.regs) = (struct sigcontext *) (&sig + 1)), + (void) (regs.regs.skas.is_user = 0)); do_timer(®s); } void um_timer(int irq, void *dev, struct pt_regs *regs) { do_timer(regs); - write_lock(&xtime_lock); + write_seqlock(&xtime_lock); timer(); - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); } long um_time(int * tloc) @@ -118,7 +119,7 @@ for(i=0;imm); } +void flush_tlb_kernel_range(unsigned long start, unsigned long end) +{ + CHOOSE_MODE_PROC(flush_tlb_kernel_range_tt, + flush_tlb_kernel_range_skas, start, end); +} + void flush_tlb_kernel_vm(void) { CHOOSE_MODE(flush_tlb_kernel_vm_tt(), flush_tlb_kernel_vm_skas()); diff -Nru a/arch/um/kernel/trap_kern.c b/arch/um/kernel/trap_kern.c --- a/arch/um/kernel/trap_kern.c Sun Feb 9 21:13:28 2003 +++ b/arch/um/kernel/trap_kern.c Sun Feb 9 21:13:28 2003 @@ -109,7 +109,8 @@ flush_tlb_kernel_vm(); return(0); } - if(current->mm == NULL) panic("Segfault with no mm"); + if(current->mm == NULL) + panic("Segfault with no mm"); err = handle_page_fault(address, ip, is_write, is_user, &si.si_code); catcher = current->thread.fault_catcher; @@ -164,14 +165,15 @@ force_sig_info(SIGSEGV, &si, current); } -void relay_signal(int sig, struct uml_pt_regs *regs) +void relay_signal(int sig, union uml_pt_regs *regs) { if(arch_handle_signal(sig, regs)) return; - if(!regs->is_user) panic("Kernel mode signal %d", sig); + if(!UPT_IS_USER(regs)) + panic("Kernel mode signal %d", sig); force_sig(sig, current); } -void bus_handler(int sig, struct uml_pt_regs *regs) +void bus_handler(int sig, union uml_pt_regs *regs) { if(current->thread.fault_catcher != NULL) do_longjmp(current->thread.fault_catcher, 1); diff -Nru a/arch/um/kernel/trap_user.c b/arch/um/kernel/trap_user.c --- a/arch/um/kernel/trap_user.c Sun Feb 9 21:13:32 2003 +++ b/arch/um/kernel/trap_user.c Sun Feb 9 21:13:32 2003 @@ -48,11 +48,11 @@ int is_user; } segfault_record[1024]; -void segv_handler(int sig, struct uml_pt_regs *regs) +void segv_handler(int sig, union uml_pt_regs *regs) { int index, max; - if(regs->is_user && !UPT_SEGV_IS_FIXABLE(regs)){ + if(UPT_IS_USER(regs) && !UPT_SEGV_IS_FIXABLE(regs)){ bad_segv(UPT_FAULT_ADDR(regs), UPT_IP(regs), UPT_FAULT_WRITE(regs)); return; @@ -65,35 +65,35 @@ segfault_record[index].pid = os_getpid(); segfault_record[index].is_write = UPT_FAULT_WRITE(regs); segfault_record[index].sp = UPT_SP(regs); - segfault_record[index].is_user = regs->is_user; + segfault_record[index].is_user = UPT_IS_USER(regs); segv(UPT_FAULT_ADDR(regs), UPT_IP(regs), UPT_FAULT_WRITE(regs), - regs->is_user, regs); + UPT_IS_USER(regs), regs); } -void usr2_handler(int sig, struct uml_pt_regs *regs) +void usr2_handler(int sig, union uml_pt_regs *regs) { CHOOSE_MODE(syscall_handler_tt(sig, regs), (void) 0); } struct signal_info sig_info[] = { - [ SIGTRAP ] { handler : relay_signal, - is_irq : 0 }, - [ SIGFPE ] { handler : relay_signal, - is_irq : 0 }, - [ SIGILL ] { handler : relay_signal, - is_irq : 0 }, - [ SIGBUS ] { handler : bus_handler, - is_irq : 0 }, - [ SIGSEGV] { handler : segv_handler, - is_irq : 0 }, - [ SIGIO ] { handler : sigio_handler, - is_irq : 1 }, - [ SIGVTALRM ] { handler : timer_handler, - is_irq : 1 }, - [ SIGALRM ] { handler : timer_handler, - is_irq : 1 }, - [ SIGUSR2 ] { handler : usr2_handler, - is_irq : 0 }, + [ SIGTRAP ] { .handler = relay_signal, + .is_irq = 0 }, + [ SIGFPE ] { .handler = relay_signal, + .is_irq = 0 }, + [ SIGILL ] { .handler = relay_signal, + .is_irq = 0 }, + [ SIGBUS ] { .handler = bus_handler, + .is_irq = 0 }, + [ SIGSEGV] { .handler = segv_handler, + .is_irq = 0 }, + [ SIGIO ] { .handler = sigio_handler, + .is_irq = 1 }, + [ SIGVTALRM ] { .handler = timer_handler, + .is_irq = 1 }, + [ SIGALRM ] { .handler = timer_handler, + .is_irq = 1 }, + [ SIGUSR2 ] { .handler = usr2_handler, + .is_irq = 0 }, }; void sig_handler(int sig, struct sigcontext sc) diff -Nru a/arch/um/kernel/tt/Makefile b/arch/um/kernel/tt/Makefile --- a/arch/um/kernel/tt/Makefile Sun Feb 9 21:13:32 2003 +++ b/arch/um/kernel/tt/Makefile Sun Feb 9 21:13:32 2003 @@ -3,18 +3,29 @@ # Licensed under the GPL # -obj-y = exec_kern.o exec_user.o gdb.o gdb_kern.o ksyms.o mem.o process_kern.o \ +EXTRA_TARGETS := unmap_fin.o + +obj-y = exec_kern.o exec_user.o gdb.o ksyms.o mem.o mem_user.o process_kern.o \ syscall_kern.o syscall_user.o time.o tlb.o tracer.o trap_user.o \ uaccess_user.o sys-$(SUBARCH)/ -obj-$(CONFIG_PT_PROXY) += ptproxy/ - -export-objs = ksyms.o +obj-$(CONFIG_PT_PROXY) += gdb_kern.o ptproxy/ USER_OBJS := $(filter %_user.o,$(obj-y)) gdb.o time.o tracer.o USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) +UNMAP_CFLAGS := $(patsubst -pg -DPROFILING,,$(USER_CFLAGS)) +UNMAP_CFLAGS := $(patsubst -fprofile-arcs -ftest-coverage,,$(UNMAP_CFLAGS)) + $(USER_OBJS) : %.o: %.c $(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $< + +$(O_TARGET) : $(obj)/unmap_fin.o + +$(obj)/unmap.o: $(src)/unmap.c + $(CC) $(UNMAP_CFLAGS) -c -o $@ $< + +$(obj)/unmap_fin.o : $(src)/unmap.o + ld -r -o $@ $< -lc -L/usr/lib clean : diff -Nru a/arch/um/kernel/tt/gdb.c b/arch/um/kernel/tt/gdb.c --- a/arch/um/kernel/tt/gdb.c Sun Feb 9 21:13:29 2003 +++ b/arch/um/kernel/tt/gdb.c Sun Feb 9 21:13:29 2003 @@ -44,7 +44,7 @@ return(ptrace(PTRACE_CONT, pid, 0, 0)); } -#ifdef CONFIG_PT_PROXY +#ifdef UML_CONFIG_PT_PROXY int debugger_signal(int status, pid_t pid) { @@ -62,11 +62,11 @@ } static struct chan_opts opts = { - announce : gdb_announce, - xterm_title : "UML kernel debugger", - raw : 0, - tramp_stack : 0, - in_kernel : 0, + .announce = gdb_announce, + .xterm_title = "UML kernel debugger", + .raw = 0, + .tramp_stack = 0, + .in_kernel = 0, }; /* Accessed by the tracing thread, which automatically serializes access */ @@ -74,16 +74,16 @@ static int xterm_fd; extern void *xterm_init(char *, int, struct chan_opts *); -extern int xterm_open(int, int, int, void *); +extern int xterm_open(int, int, int, void *, char **); extern void xterm_close(int, void *); int open_gdb_chan(void) { - char stack[UM_KERN_PAGE_SIZE]; + char stack[UM_KERN_PAGE_SIZE], *dummy; opts.tramp_stack = (unsigned long) stack; xterm_data = xterm_init("", 0, &opts); - xterm_fd = xterm_open(1, 1, 1, xterm_data); + xterm_fd = xterm_open(1, 1, 1, xterm_data, &dummy); return(xterm_fd); } diff -Nru a/arch/um/kernel/tt/gdb_kern.c b/arch/um/kernel/tt/gdb_kern.c --- a/arch/um/kernel/tt/gdb_kern.c Sun Feb 9 21:13:35 2003 +++ b/arch/um/kernel/tt/gdb_kern.c Sun Feb 9 21:13:35 2003 @@ -13,9 +13,9 @@ extern int gdb_remove(char *unused); static struct mc_device gdb_mc = { - name: "gdb", - config: gdb_config, - remove: gdb_remove, + .name = "gdb", + .config = gdb_config, + .remove = gdb_remove, }; int gdb_mc_init(void) diff -Nru a/arch/um/kernel/tt/include/mode.h b/arch/um/kernel/tt/include/mode.h --- a/arch/um/kernel/tt/include/mode.h Sun Feb 9 21:13:33 2003 +++ b/arch/um/kernel/tt/include/mode.h Sun Feb 9 21:13:33 2003 @@ -13,9 +13,10 @@ extern int tracer(int (*init_proc)(void *), void *sp); extern void user_time_init_tt(void); extern int copy_sc_from_user_tt(void *to_ptr, void *from_ptr, void *data); -extern int copy_sc_to_user_tt(void *to_ptr, void *from_ptr, void *data); -extern void sig_handler_common_tt(int sig, struct sigcontext *sc); -extern void syscall_handler_tt(int sig, struct uml_pt_regs *regs); +extern int copy_sc_to_user_tt(void *to_ptr, void *fp, void *from_ptr, + void *data); +extern void sig_handler_common_tt(int sig, void *sc); +extern void syscall_handler_tt(int sig, union uml_pt_regs *regs); extern void reboot_tt(void); extern void halt_tt(void); extern int is_tracer_winch(int pid, int fd, void *data); diff -Nru a/arch/um/kernel/tt/include/mode_kern.h b/arch/um/kernel/tt/include/mode_kern.h --- a/arch/um/kernel/tt/include/mode_kern.h Sun Feb 9 21:13:30 2003 +++ b/arch/um/kernel/tt/include/mode_kern.h Sun Feb 9 21:13:30 2003 @@ -22,6 +22,7 @@ extern void exit_thread_tt(void); extern void initial_thread_cb_tt(void (*proc)(void *), void *arg); extern void init_idle_tt(void); +extern void flush_tlb_kernel_range_tt(unsigned long start, unsigned long end); extern void flush_tlb_kernel_vm_tt(void); extern void __flush_tlb_one_tt(unsigned long addr); extern void flush_tlb_range_tt(struct vm_area_struct *vma, @@ -33,7 +34,6 @@ extern unsigned long set_task_sizes_tt(int arg, unsigned long *host_size_out, unsigned long *task_size_out); extern int start_uml_tt(void); -extern struct page *arch_validate_tt(struct page *page, int mask, int order); extern int external_pid_tt(struct task_struct *task); extern int thread_pid_tt(struct task_struct *task); diff -Nru a/arch/um/kernel/tt/include/ptrace-tt.h b/arch/um/kernel/tt/include/ptrace-tt.h --- a/arch/um/kernel/tt/include/ptrace-tt.h Sun Feb 9 21:13:36 2003 +++ b/arch/um/kernel/tt/include/ptrace-tt.h Sun Feb 9 21:13:36 2003 @@ -8,7 +8,7 @@ #include "uml-config.h" -#ifdef CONFIG_MODE_TT +#ifdef UML_CONFIG_MODE_TT #include "sysdep/sc.h" #endif diff -Nru a/arch/um/kernel/tt/include/tt.h b/arch/um/kernel/tt/include/tt.h --- a/arch/um/kernel/tt/include/tt.h Sun Feb 9 21:13:28 2003 +++ b/arch/um/kernel/tt/include/tt.h Sun Feb 9 21:13:28 2003 @@ -26,10 +26,11 @@ extern int is_tracing(void *task); extern int singlestepping_tt(void *t); extern void clear_singlestep(void *t); -extern void syscall_handler(int sig, struct uml_pt_regs *regs); +extern void syscall_handler(int sig, union uml_pt_regs *regs); extern void exit_kernel(int pid, void *task); extern int do_syscall(void *task, int pid); extern int is_valid_pid(int pid); +extern void remap_data(void *segment_start, void *segment_end, int w); #endif diff -Nru a/arch/um/kernel/tt/include/uaccess.h b/arch/um/kernel/tt/include/uaccess.h --- a/arch/um/kernel/tt/include/uaccess.h Sun Feb 9 21:13:33 2003 +++ b/arch/um/kernel/tt/include/uaccess.h Sun Feb 9 21:13:33 2003 @@ -12,6 +12,7 @@ #include "asm/errno.h" #include "asm/current.h" #include "asm/a.out.h" +#include "uml_uaccess.h" #define ABOVE_KMEM (16 * 1024 * 1024) @@ -50,9 +51,6 @@ ¤t->thread.fault_addr, ¤t->thread.fault_catcher) : n); } - -extern int __do_copy_to_user(void *to, const void *from, int n, - void **fault_addr, void **fault_catcher); static inline int copy_to_user_tt(void *to, const void *from, int n) { diff -Nru a/arch/um/kernel/tt/mem.c b/arch/um/kernel/tt/mem.c --- a/arch/um/kernel/tt/mem.c Sun Feb 9 21:13:31 2003 +++ b/arch/um/kernel/tt/mem.c Sun Feb 9 21:13:31 2003 @@ -39,32 +39,6 @@ return(START); } -struct page *arch_validate_tt(struct page *page, int mask, int order) -{ - unsigned long addr, zero = 0; - int i; - - again: - if(page == NULL) return(page); - if(PageHighMem(page)) return(page); - - addr = (unsigned long) page_address(page); - for(i = 0; i < (1 << order); i++){ - current->thread.fault_addr = (void *) addr; - if(__do_copy_to_user((void *) addr, &zero, - sizeof(zero), - ¤t->thread.fault_addr, - ¤t->thread.fault_catcher)){ - if(!(mask & __GFP_WAIT)) return(NULL); - else break; - } - addr += PAGE_SIZE; - } - if(i == (1 << order)) return(page); - page = alloc_pages(mask, order); - goto again; -} - /* * Overrides for Emacs so that we follow Linus's tabbing style. * Emacs will notice this stuff at the end of the file and automatically diff -Nru a/arch/um/kernel/tt/mem_user.c b/arch/um/kernel/tt/mem_user.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/um/kernel/tt/mem_user.c Sun Feb 9 21:13:37 2003 @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#include +#include +#include +#include +#include +#include +#include "tt.h" +#include "mem_user.h" +#include "user_util.h" + +void remap_data(void *segment_start, void *segment_end, int w) +{ + void *addr; + unsigned long size; + int data, prot; + + if(w) prot = PROT_WRITE; + else prot = 0; + prot |= PROT_READ | PROT_EXEC; + size = (unsigned long) segment_end - + (unsigned long) segment_start; + data = create_mem_file(size); + if((addr = mmap(NULL, size, PROT_WRITE | PROT_READ, + MAP_SHARED, data, 0)) == MAP_FAILED){ + perror("mapping new data segment"); + exit(1); + } + memcpy(addr, segment_start, size); + if(switcheroo(data, prot, addr, segment_start, + size) < 0){ + printf("switcheroo failed\n"); + exit(1); + } +} + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -Nru a/arch/um/kernel/tt/process_kern.c b/arch/um/kernel/tt/process_kern.c --- a/arch/um/kernel/tt/process_kern.c Sun Feb 9 21:13:35 2003 +++ b/arch/um/kernel/tt/process_kern.c Sun Feb 9 21:13:35 2003 @@ -6,6 +6,7 @@ #include "linux/sched.h" #include "linux/signal.h" #include "linux/kernel.h" +#include "linux/interrupt.h" #include "asm/system.h" #include "asm/pgalloc.h" #include "asm/ptrace.h" @@ -111,7 +112,7 @@ close(current->thread.mode.tt.switch_pipe[1]); } -extern void schedule_tail(struct task_struct *prev); +void schedule_tail(task_t *prev); static void new_thread_handler(int sig) { @@ -120,13 +121,13 @@ fn = current->thread.request.u.thread.proc; arg = current->thread.request.u.thread.arg; - current->thread.regs.regs.mode.tt = (void *) (&sig + 1); + UPT_SC(¤t->thread.regs.regs) = (void *) (&sig + 1); suspend_new_thread(current->thread.mode.tt.switch_pipe[0]); block_signals(); init_new_thread_signals(1); #ifdef CONFIG_SMP - schedule_tail(NULL); + schedule_tail(current->thread.prev_sched); #endif enable_timer(); free_page(current->thread.temp_stack); @@ -160,7 +161,7 @@ void finish_fork_handler(int sig) { - current->thread.regs.regs.mode.tt = (void *) (&sig + 1); + UPT_SC(¤t->thread.regs.regs) = (void *) (&sig + 1); suspend_new_thread(current->thread.mode.tt.switch_pipe[0]); #ifdef CONFIG_SMP @@ -168,6 +169,7 @@ #endif enable_timer(); change_sig(SIGVTALRM, 1); + local_irq_enable(); force_flush_all(); if(current->mm != current->parent->mm) protect_memory(uml_reserved, high_physmem - uml_reserved, 1, @@ -187,6 +189,7 @@ { int sig = sigusr1; + local_irq_disable(); init_new_thread_stack(stack, finish_fork_handler); kill(os_getpid(), sig); @@ -232,10 +235,10 @@ } if(current->thread.forking){ - sc_to_sc(p->thread.regs.regs.mode.tt, - current->thread.regs.regs.mode.tt); - SC_SET_SYSCALL_RETURN(p->thread.regs.regs.mode.tt, 0); - if(sp != 0) SC_SP(p->thread.regs.regs.mode.tt) = sp; + sc_to_sc(UPT_SC(&p->thread.regs.regs), + UPT_SC(¤t->thread.regs.regs)); + SC_SET_SYSCALL_RETURN(UPT_SC(&p->thread.regs.regs), 0); + if(sp != 0) SC_SP(UPT_SC(&p->thread.regs.regs)) = sp; } p->thread.mode.tt.extern_pid = new_pid; @@ -367,11 +370,14 @@ static void mprotect_kernel_mem(int w) { unsigned long start, end; + int pages; if(!jail || (current == &init_task)) return; + pages = (1 << CONFIG_KERNEL_STACK_ORDER); + start = (unsigned long) current->thread_info + PAGE_SIZE; - end = (unsigned long) current->thread_info + PAGE_SIZE * 4; + end = (unsigned long) current + PAGE_SIZE * pages; protect_memory(uml_reserved, start - uml_reserved, 1, w, 1, 1); protect_memory(end, high_physmem - end, 1, w, 1, 1); @@ -470,8 +476,10 @@ int start_uml_tt(void) { void *sp; + int pages; - sp = (void *) init_task.thread.kernel_stack + 2 * PAGE_SIZE - + pages = (1 << CONFIG_KERNEL_STACK_ORDER) - 2; + sp = (void *) init_task.thread.kernel_stack + pages * PAGE_SIZE - sizeof(unsigned long); return(tracer(start_kernel_proc, sp)); } diff -Nru a/arch/um/kernel/tt/ptproxy/proxy.c b/arch/um/kernel/tt/ptproxy/proxy.c --- a/arch/um/kernel/tt/ptproxy/proxy.c Sun Feb 9 21:13:33 2003 +++ b/arch/um/kernel/tt/ptproxy/proxy.c Sun Feb 9 21:13:33 2003 @@ -129,14 +129,14 @@ int init_parent_proxy(int pid) { - parent = ((debugger_state) { pid : pid, - wait_options : 0, - wait_status_ptr : NULL, - waiting : 0, - real_wait : 0, - expecting_child : 0, - handle_trace : parent_syscall, - debugee : NULL } ); + parent = ((debugger_state) { .pid = pid, + .wait_options = 0, + .wait_status_ptr = NULL, + .waiting = 0, + .real_wait = 0, + .expecting_child = 0, + .handle_trace = parent_syscall, + .debugee = NULL } ); return(0); } diff -Nru a/arch/um/kernel/tt/sys-i386/sigcontext.c b/arch/um/kernel/tt/sys-i386/sigcontext.c --- a/arch/um/kernel/tt/sys-i386/sigcontext.c Sun Feb 9 21:13:36 2003 +++ b/arch/um/kernel/tt/sys-i386/sigcontext.c Sun Feb 9 21:13:36 2003 @@ -29,14 +29,15 @@ return(err); } -int copy_sc_to_user_tt(void *to_ptr, void *from_ptr, void *data) +int copy_sc_to_user_tt(void *to_ptr, void *fp, void *from_ptr, void *data) { struct arch_frame_data *arch = data; struct sigcontext *to = to_ptr, *from = from_ptr; struct _fpstate *to_fp, *from_fp; int err; - to_fp = (struct _fpstate *)((unsigned long) to + sizeof(*to)); + to_fp = (struct _fpstate *) + (fp ? (unsigned long) fp : ((unsigned long) to + sizeof(*to))); from_fp = from->fpstate; err = copy_to_user_proc(to, from, sizeof(*to)); if(from_fp != NULL){ diff -Nru a/arch/um/kernel/tt/syscall_kern.c b/arch/um/kernel/tt/syscall_kern.c --- a/arch/um/kernel/tt/syscall_kern.c Sun Feb 9 21:13:28 2003 +++ b/arch/um/kernel/tt/syscall_kern.c Sun Feb 9 21:13:28 2003 @@ -20,29 +20,32 @@ static int check_readlink(struct pt_regs *regs) { - return(check_area((void *) regs->regs.args[1], regs->regs.args[2])); + return(check_area((void *) UPT_SYSCALL_ARG1(®s->regs), + UPT_SYSCALL_ARG2(®s->regs))); } static int check_utime(struct pt_regs *regs) { - return(check_area((void *) regs->regs.args[1], + return(check_area((void *) UPT_SYSCALL_ARG1(®s->regs), sizeof(struct utimbuf))); } static int check_oldstat(struct pt_regs *regs) { - return(check_area((void *) regs->regs.args[1], + return(check_area((void *) UPT_SYSCALL_ARG1(®s->regs), sizeof(struct __old_kernel_stat))); } static int check_stat(struct pt_regs *regs) { - return(check_area((void *) regs->regs.args[1], sizeof(struct stat))); + return(check_area((void *) UPT_SYSCALL_ARG1(®s->regs), + sizeof(struct stat))); } static int check_stat64(struct pt_regs *regs) { - return(check_area((void *) regs->regs.args[1], sizeof(struct stat64))); + return(check_area((void *) UPT_SYSCALL_ARG1(®s->regs), + sizeof(struct stat64))); } struct bogus { @@ -90,7 +93,7 @@ static int check_bogosity(struct pt_regs *regs) { - struct bogus *bogon = &this_is_bogus[regs->regs.syscall]; + struct bogus *bogon = &this_is_bogus[UPT_SYSCALL_NR(®s->regs)]; if(!bogon->kernel_ds) return(0); if(bogon->check_params && (*bogon->check_params)(regs)) @@ -109,7 +112,7 @@ current->thread.nsyscalls++; nsyscalls++; - syscall = regs->regs.syscall; + syscall = UPT_SYSCALL_NR(®s->regs); if((syscall >= NR_syscalls) || (syscall < 0)) res = -ENOSYS; diff -Nru a/arch/um/kernel/tt/syscall_user.c b/arch/um/kernel/tt/syscall_user.c --- a/arch/um/kernel/tt/syscall_user.c Sun Feb 9 21:13:33 2003 +++ b/arch/um/kernel/tt/syscall_user.c Sun Feb 9 21:13:33 2003 @@ -22,15 +22,14 @@ #define ERESTARTNOINTR 513 #define ERESTARTNOHAND 514 -void syscall_handler_tt(int sig, struct uml_pt_regs *regs) +void syscall_handler_tt(int sig, union uml_pt_regs *regs) { void *sc; long result; int index, syscall; - syscall = regs->syscall; - sc = regs->mode.tt; - sc_to_regs(regs, sc, syscall); + syscall = UPT_SYSCALL_NR(regs); + sc = UPT_SC(regs); SC_START_SYSCALL(sc); index = record_syscall_start(syscall); @@ -40,7 +39,7 @@ /* regs->sc may have changed while the system call ran (there may * have been an interrupt or segfault), so it needs to be refreshed. */ - regs->mode.tt = sc; + UPT_SC(regs) = sc; SC_SET_SYSCALL_RETURN(sc, result); if((result == -ERESTARTNOHAND) || (result == -ERESTARTSYS) || @@ -54,7 +53,7 @@ int do_syscall(void *task, int pid) { unsigned long proc_regs[FRAME_SIZE]; - struct uml_pt_regs *regs; + union uml_pt_regs *regs; int syscall; if(ptrace_getregs(pid, proc_regs) < 0) diff -Nru a/arch/um/kernel/tt/tlb.c b/arch/um/kernel/tt/tlb.c --- a/arch/um/kernel/tt/tlb.c Sun Feb 9 21:13:28 2003 +++ b/arch/um/kernel/tt/tlb.c Sun Feb 9 21:13:28 2003 @@ -132,7 +132,7 @@ if(updated && update_seq) atomic_inc(&vmchange_seq); } -void flush_tlb_kernel_range(unsigned long start, unsigned long end) +void flush_tlb_kernel_range_tt(unsigned long start, unsigned long end) { flush_kernel_vm_range(start, end, 1); } diff -Nru a/arch/um/kernel/tt/tracer.c b/arch/um/kernel/tt/tracer.c --- a/arch/um/kernel/tt/tracer.c Sun Feb 9 21:13:28 2003 +++ b/arch/um/kernel/tt/tracer.c Sun Feb 9 21:13:28 2003 @@ -120,16 +120,6 @@ return((*proc)(NULL)); } -static void last_ditch_exit(int sig) -{ - kmalloc_ok = 0; - signal(SIGINT, SIG_DFL); - signal(SIGTERM, SIG_DFL); - signal(SIGHUP, SIG_DFL); - uml_cleanup(); - exit(1); -} - static void sleeping_process_signal(int pid, int sig) { switch(sig){ @@ -214,9 +204,6 @@ signal(SIGSEGV, (sighandler_t) tracer_segv); signal(SIGUSR1, signal_usr1); - set_handler(SIGINT, last_ditch_exit, SA_ONESHOT | SA_NODEFER, -1); - set_handler(SIGTERM, last_ditch_exit, SA_ONESHOT | SA_NODEFER, -1); - set_handler(SIGHUP, last_ditch_exit, SA_ONESHOT | SA_NODEFER, -1); if(debug_trace){ printf("Tracing thread pausing to be attached\n"); stop(); diff -Nru a/arch/um/kernel/tt/trap_user.c b/arch/um/kernel/tt/trap_user.c --- a/arch/um/kernel/tt/trap_user.c Sun Feb 9 21:13:32 2003 +++ b/arch/um/kernel/tt/trap_user.c Sun Feb 9 21:13:32 2003 @@ -14,26 +14,27 @@ #include "task.h" #include "tt.h" -void sig_handler_common_tt(int sig, struct sigcontext *sc) +void sig_handler_common_tt(int sig, void *sc_ptr) { - struct uml_pt_regs save_regs, *r; + struct sigcontext *sc = sc_ptr; + struct tt_regs save_regs, *r; struct signal_info *info; int save_errno = errno, is_user; unprotect_kernel_mem(); - r = (struct uml_pt_regs *) TASK_REGS(get_current()); + r = &TASK_REGS(get_current())->tt; save_regs = *r; is_user = user_context(SC_SP(sc)); - r->is_user = is_user; - r->mode.tt = sc; - if(sig != SIGUSR2) r->syscall = -1; + r->sc = sc; + if(sig != SIGUSR2) + r->syscall = -1; change_sig(SIGUSR1, 1); info = &sig_info[sig]; if(!info->is_irq) unblock_signals(); - (*info->handler)(sig, r); + (*info->handler)(sig, (union uml_pt_regs *) r); if(is_user){ interrupt_end(); diff -Nru a/arch/um/kernel/tt/uaccess_user.c b/arch/um/kernel/tt/uaccess_user.c --- a/arch/um/kernel/tt/uaccess_user.c Sun Feb 9 21:13:30 2003 +++ b/arch/um/kernel/tt/uaccess_user.c Sun Feb 9 21:13:30 2003 @@ -7,34 +7,7 @@ #include #include #include "user_util.h" - -static unsigned long __do_user_copy(void *to, const void *from, int n, - void **fault_addr, void **fault_catcher, - void (*op)(void *to, const void *from, - int n), int *faulted_out) -{ - unsigned long *faddrp = (unsigned long *) fault_addr, ret; - - jmp_buf jbuf; - *fault_catcher = &jbuf; - if(setjmp(jbuf) == 0){ - (*op)(to, from, n); - ret = 0; - *faulted_out = 0; - } - else { - ret = *faddrp; - *faulted_out = 1; - } - *fault_addr = NULL; - *fault_catcher = NULL; - return ret; -} - -static void __do_copy(void *to, const void *from, int n) -{ - memcpy(to, from, n); -} +#include "uml_uaccess.h" int __do_copy_from_user(void *to, const void *from, int n, void **fault_addr, void **fault_catcher) @@ -46,19 +19,6 @@ __do_copy, &faulted); if(!faulted) return(0); else return(n - (fault - (unsigned long) from)); -} - - -int __do_copy_to_user(void *to, const void *from, int n, - void **fault_addr, void **fault_catcher) -{ - unsigned long fault; - int faulted; - - fault = __do_user_copy(to, from, n, fault_addr, fault_catcher, - __do_copy, &faulted); - if(!faulted) return(0); - else return(n - (fault - (unsigned long) to)); } static void __do_strncpy(void *dst, const void *src, int count) diff -Nru a/arch/um/kernel/tt/unmap.c b/arch/um/kernel/tt/unmap.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/um/kernel/tt/unmap.c Sun Feb 9 21:13:34 2003 @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#include +#include +#include +#include "user.h" + +int switcheroo(int fd, int prot, void *from, void *to, int size) +{ + if(munmap(to, size) < 0){ + return(-1); + } + if(mmap(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){ + return(-1); + } + if(munmap(from, size) < 0){ + return(-1); + } + return(0); +} + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -Nru a/arch/um/kernel/uaccess_user.c b/arch/um/kernel/uaccess_user.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/um/kernel/uaccess_user.c Sun Feb 9 21:13:38 2003 @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2001 Chris Emerson (cemerson@chiark.greenend.org.uk) + * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#include +#include + +/* These are here rather than tt/uaccess.c because skas mode needs them in + * order to do SIGBUS recovery when a tmpfs mount runs out of room. + */ + +unsigned long __do_user_copy(void *to, const void *from, int n, + void **fault_addr, void **fault_catcher, + void (*op)(void *to, const void *from, + int n), int *faulted_out) +{ + unsigned long *faddrp = (unsigned long *) fault_addr, ret; + + jmp_buf jbuf; + *fault_catcher = &jbuf; + if(setjmp(jbuf) == 0){ + (*op)(to, from, n); + ret = 0; + *faulted_out = 0; + } + else { + ret = *faddrp; + *faulted_out = 1; + } + *fault_addr = NULL; + *fault_catcher = NULL; + return ret; +} + +void __do_copy(void *to, const void *from, int n) +{ + memcpy(to, from, n); +} + + +int __do_copy_to_user(void *to, const void *from, int n, + void **fault_addr, void **fault_catcher) +{ + unsigned long fault; + int faulted; + + fault = __do_user_copy(to, from, n, fault_addr, fault_catcher, + __do_copy, &faulted); + if(!faulted) return(0); + else return(n - (fault - (unsigned long) to)); +} + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff -Nru a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c --- a/arch/um/kernel/um_arch.c Sun Feb 9 21:13:35 2003 +++ b/arch/um/kernel/um_arch.c Sun Feb 9 21:13:35 2003 @@ -85,10 +85,10 @@ } struct seq_operations cpuinfo_op = { - start: c_start, - next: c_next, - stop: c_stop, - show: show_cpuinfo, + .start = c_start, + .next = c_next, + .stop = c_stop, + .show = show_cpuinfo, }; pte_t * __bad_pagetable(void) @@ -110,12 +110,14 @@ unsigned long end_vm; int ncpus = 1; +#ifdef CONFIG_MODE_TT /* Pointer set in linux_main, the array itself is private to each thread, * and changed at address space creation time so this poses no concurrency * problems. */ static char *argv1_begin = NULL; static char *argv1_end = NULL; +#endif /* Set in early boot */ static int have_root __initdata = 0; @@ -123,6 +125,7 @@ void set_cmdline(char *cmd) { +#ifdef CONFIG_MODE_TT char *umid, *ptr; if(CHOOSE_MODE(honeypot, 0)) return; @@ -139,6 +142,7 @@ snprintf(ptr, (argv1_end - ptr) * sizeof(*ptr), " [%s]", cmd); memset(argv1_begin + strlen(argv1_begin), '\0', argv1_end - argv1_begin - strlen(argv1_begin)); +#endif } static char *usage_string = @@ -199,23 +203,28 @@ return(0); } -__uml_setup("mode=tt", mode_tt_setup, -"mode=tt\n" -" When both CONFIG_MODE_TT and CONFIG_MODE_SKAS are enabled, this option\n" -" forces UML to run in tt (tracing thread) mode. It is not the default\n" -" because it's slower and less secure than skas mode.\n\n" -); - #else #ifdef CONFIG_MODE_SKAS #define DEFAULT_TT 0 +static int __init mode_tt_setup(char *line, int *add) +{ + printk("CONFIG_MODE_TT disabled - 'mode=tt' ignored\n"); + return(0); +} + #else #ifdef CONFIG_MODE_TT #define DEFAULT_TT 1 +static int __init mode_tt_setup(char *line, int *add) +{ + printk("CONFIG_MODE_SKAS disabled - 'mode=tt' redundant\n"); + return(0); +} + #else #error Either CONFIG_MODE_TT or CONFIG_MODE_SKAS must be enabled @@ -224,6 +233,13 @@ #endif #endif +__uml_setup("mode=tt", mode_tt_setup, +"mode=tt\n" +" When both CONFIG_MODE_TT and CONFIG_MODE_SKAS are enabled, this option\n" +" forces UML to run in tt (tracing thread) mode. It is not the default\n" +" because it's slower and less secure than skas mode.\n\n" +); + int mode_tt = DEFAULT_TT; static int __init Usage(char *line, int *add) @@ -307,8 +323,10 @@ setup_machinename(system_utsname.machine); +#ifdef CONFIG_MODE_TT argv1_begin = argv[1]; argv1_end = &argv[1][strlen(argv[1])]; +#endif set_usable_vm(uml_physmem, get_kmem_end()); @@ -317,6 +335,11 @@ if(physmem_size > max_physmem){ highmem = physmem_size - max_physmem; physmem_size -= highmem; +#ifndef CONFIG_HIGHMEM + highmem = 0; + printf("CONFIG_HIGHMEM not enabled - physical memory shrunk " + "to %ld bytes\n", physmem_size); +#endif } high_physmem = uml_physmem + physmem_size; @@ -361,9 +384,9 @@ } static struct notifier_block panic_exit_notifier = { - notifier_call : panic_exit, - next : NULL, - priority : 0 + .notifier_call = panic_exit, + .next = NULL, + .priority = 0 }; void __init setup_arch(char **cmdline_p) diff -Nru a/arch/um/kernel/umid.c b/arch/um/kernel/umid.c --- a/arch/um/kernel/umid.c Sun Feb 9 21:13:36 2003 +++ b/arch/um/kernel/umid.c Sun Feb 9 21:13:36 2003 @@ -35,7 +35,7 @@ static int make_umid(void); -static int __init set_umid(char *name, int *add) +static int __init set_umid(char *name, int is_random) { if(umid_inited){ printk("Unique machine name can't be set twice\n"); @@ -48,12 +48,17 @@ strncpy(umid, name, UMID_LEN - 1); umid[UMID_LEN - 1] = '\0'; - umid_is_random = 0; + umid_is_random = is_random; umid_inited = 1; return 0; } -__uml_setup("umid=", set_umid, +static int __init set_umid_arg(char *name, int *add) +{ + return(set_umid(name, 0)); +} + +__uml_setup("umid=", set_umid_arg, "umid=\n" " This is used to assign a unique identity to this UML machine and\n" " is used for naming the pid file and management console socket.\n\n" @@ -186,7 +191,6 @@ } if(!dead) return(1); return(actually_do_remove(dir)); - return(0); } static int __init set_uml_dir(char *name, int *add) @@ -254,7 +258,7 @@ strcat(tmp, "XXXXXX"); fd = mkstemp(tmp); if(fd < 0){ - printk("set_umid - mkstemp failed, errno = %d\n", + printk("make_umid - mkstemp failed, errno = %d\n", errno); return(1); } @@ -265,7 +269,7 @@ * for directories. */ unlink(tmp); - strcpy(umid, &tmp[strlen(uml_dir)]); + set_umid(&tmp[strlen(uml_dir)], 1); } sprintf(tmp, "%s%s", uml_dir, umid); diff -Nru a/arch/um/kernel/unmap.c b/arch/um/kernel/unmap.c --- a/arch/um/kernel/unmap.c Sun Feb 9 21:13:34 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) - * Licensed under the GPL - */ - -#include -#include -#include -#include "user.h" - -int switcheroo(int fd, int prot, void *from, void *to, int size) -{ - if(munmap(to, size) < 0){ - return(-1); - } - if(mmap(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){ - return(-1); - } - if(munmap(from, size) < 0){ - return(-1); - } - return(0); -} - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ diff -Nru a/arch/um/kernel/user_syms.c b/arch/um/kernel/user_syms.c --- a/arch/um/kernel/user_syms.c Sun Feb 9 21:13:36 2003 +++ b/arch/um/kernel/user_syms.c Sun Feb 9 21:13:36 2003 @@ -10,10 +10,7 @@ #include #include "user_util.h" #include "mem_user.h" - -/* XXX All the __CONFIG_* stuff is broken because this file can't include - * config.h - */ +#include "uml-config.h" /* Had to steal this from linux/module.h because that file can't be included * since this includes various user-level headers. @@ -36,7 +33,7 @@ #define EXPORT_SYMBOL(var) error config_must_be_included_before_module #define EXPORT_SYMBOL_NOVERS(var) error config_must_be_included_before_module -#elif !defined(__CONFIG_MODULES__) +#elif !defined(UML_CONFIG_MODULES) #define __EXPORT_SYMBOL(sym,str) #define EXPORT_SYMBOL(var) @@ -51,7 +48,7 @@ __attribute__((section("__ksymtab"))) = \ { (unsigned long)&sym, __kstrtab_##sym } -#if defined(__MODVERSIONS__) || !defined(__CONFIG_MODVERSIONS__) +#if defined(__MODVERSIONS__) || !defined(UML_CONFIG_MODVERSIONS) #define EXPORT_SYMBOL(var) __EXPORT_SYMBOL(var, __MODULE_STRING(var)) #else #define EXPORT_SYMBOL(var) __EXPORT_SYMBOL(var, __MODULE_STRING(__VERSIONED_SYMBOL(var))) diff -Nru a/arch/um/kernel/user_util.c b/arch/um/kernel/user_util.c --- a/arch/um/kernel/user_util.c Sun Feb 9 21:13:29 2003 +++ b/arch/um/kernel/user_util.c Sun Feb 9 21:13:29 2003 @@ -29,6 +29,7 @@ #include "mem_user.h" #include "init.h" #include "helper.h" +#include "uml-config.h" #define COMMAND_LINE_SIZE _POSIX_ARG_MAX @@ -46,31 +47,6 @@ strcat(cmd_line, arg); } -void remap_data(void *segment_start, void *segment_end, int w) -{ - void *addr; - unsigned long size; - int data, prot; - - if(w) prot = PROT_WRITE; - else prot = 0; - prot |= PROT_READ | PROT_EXEC; - size = (unsigned long) segment_end - - (unsigned long) segment_start; - data = create_mem_file(size); - if((addr = mmap(NULL, size, PROT_WRITE | PROT_READ, - MAP_SHARED, data, 0)) < 0){ - perror("mapping new data segment"); - exit(1); - } - memcpy(addr, segment_start, size); - if(switcheroo(data, prot, addr, segment_start, - size) < 0){ - printf("switcheroo failed\n"); - exit(1); - } -} - void stop(void) { while(1) sleep(1000000); @@ -88,12 +64,15 @@ { unsigned long guard = address + page_size(); unsigned long stack = guard + page_size(); - int prot = 0; + int prot = 0, pages; +#ifdef notdef if(mprotect((void *) stack, page_size(), prot) < 0) panic("protecting guard page failed, errno = %d", errno); +#endif + pages = (1 << UML_CONFIG_KERNEL_STACK_ORDER) - 2; prot = PROT_READ | PROT_WRITE | PROT_EXEC; - if(mprotect((void *) stack, 2 * page_size(), prot) < 0) + if(mprotect((void *) stack, pages * page_size(), prot) < 0) panic("protecting stack failed, errno = %d", errno); } diff -Nru a/arch/um/main.c b/arch/um/main.c --- a/arch/um/main.c Sun Feb 9 21:13:35 2003 +++ b/arch/um/main.c Sun Feb 9 21:13:35 2003 @@ -15,10 +15,12 @@ #include "user_util.h" #include "kern_util.h" #include "mem_user.h" +#include "signal_user.h" #include "user.h" #include "init.h" #include "mode.h" #include "choose-mode.h" +#include "uml-config.h" /* Set in set_stklim, which is called from main and __wrap_malloc. * __wrap_malloc only calls it if main hasn't started. @@ -32,11 +34,6 @@ #define STACKSIZE (8 * 1024 * 1024) #define THREAD_NAME_LEN (256) -/* Never changed */ -static char padding[THREAD_NAME_LEN] = { - [ 0 ... THREAD_NAME_LEN - 2] = ' ', '\0' -}; - static void set_stklim(void) { struct rlimit lim; @@ -66,26 +63,43 @@ } } +static void last_ditch_exit(int sig) +{ + CHOOSE_MODE(kmalloc_ok = 0, (void) 0); + signal(SIGINT, SIG_DFL); + signal(SIGTERM, SIG_DFL); + signal(SIGHUP, SIG_DFL); + uml_cleanup(); + exit(1); +} + extern int uml_exitcode; int main(int argc, char **argv, char **envp) { + char **new_argv; sigset_t mask; int ret, i; - char **new_argv; - /* Enable all signals - in some environments, we can enter with - * some signals blocked + /* Enable all signals except SIGIO - in some environments, we can + * enter with some signals blocked */ sigemptyset(&mask); + sigaddset(&mask, SIGIO); if(sigprocmask(SIG_SETMASK, &mask, NULL) < 0){ perror("sigprocmask"); exit(1); } +#ifdef UML_CONFIG_MODE_TT /* Allocate memory for thread command lines */ if(argc < 2 || strlen(argv[1]) < THREAD_NAME_LEN - 1){ + + char padding[THREAD_NAME_LEN] = { + [ 0 ... THREAD_NAME_LEN - 2] = ' ', '\0' + }; + new_argv = malloc((argc + 2) * sizeof(char*)); if(!new_argv) { perror("Allocating extended argv"); @@ -103,6 +117,7 @@ perror("execing with extended args"); exit(1); } +#endif linux_prog = argv[0]; @@ -120,6 +135,10 @@ } new_argv[argc] = NULL; + set_handler(SIGINT, last_ditch_exit, SA_ONESHOT | SA_NODEFER, -1); + set_handler(SIGTERM, last_ditch_exit, SA_ONESHOT | SA_NODEFER, -1); + set_handler(SIGHUP, last_ditch_exit, SA_ONESHOT | SA_NODEFER, -1); + do_uml_initcalls(); ret = linux_main(argc, argv); @@ -141,8 +160,10 @@ void *__wrap_malloc(int size) { - if(CAN_KMALLOC()) return(um_kmalloc(size)); - else return(__real_malloc(size)); + if(CAN_KMALLOC()) + return(um_kmalloc(size)); + else + return(__real_malloc(size)); } void *__wrap_calloc(int n, int size) diff -Nru a/arch/um/os-Linux/drivers/ethertap_kern.c b/arch/um/os-Linux/drivers/ethertap_kern.c --- a/arch/um/os-Linux/drivers/ethertap_kern.c Sun Feb 9 21:13:28 2003 +++ b/arch/um/os-Linux/drivers/ethertap_kern.c Sun Feb 9 21:13:28 2003 @@ -28,11 +28,11 @@ pri = dev->priv; epri = (struct ethertap_data *) pri->user; *epri = ((struct ethertap_data) - { dev_name : init->dev_name, - gate_addr : init->gate_addr, - data_fd : -1, - control_fd : -1, - dev : dev }); + { .dev_name = init->dev_name, + .gate_addr = init->gate_addr, + .data_fd = -1, + .control_fd = -1, + .dev = dev }); printk("ethertap backend - %s", epri->dev_name); if(epri->gate_addr != NULL) @@ -69,10 +69,10 @@ } struct net_kern_info ethertap_kern_info = { - init: etap_init, - protocol: eth_protocol, - read: etap_read, - write: etap_write, + .init = etap_init, + .protocol = eth_protocol, + .read = etap_read, + .write = etap_write, }; int ethertap_setup(char *str, char **mac_out, void *data) @@ -80,8 +80,8 @@ struct ethertap_init *init = data; *init = ((struct ethertap_init) - { dev_name : NULL, - gate_addr : NULL }); + { .dev_name = NULL, + .gate_addr = NULL }); if(tap_setup_common(str, "ethertap", &init->dev_name, mac_out, &init->gate_addr)) return(0); @@ -94,12 +94,12 @@ } static struct transport ethertap_transport = { - list : LIST_HEAD_INIT(ethertap_transport.list), - name : "ethertap", - setup : ethertap_setup, - user : ðertap_user_info, - kern : ðertap_kern_info, - private_size : sizeof(struct ethertap_data), + .list = LIST_HEAD_INIT(ethertap_transport.list), + .name = "ethertap", + .setup = ethertap_setup, + .user = ðertap_user_info, + .kern = ðertap_kern_info, + .private_size = sizeof(struct ethertap_data), }; static int register_ethertap(void) diff -Nru a/arch/um/os-Linux/drivers/ethertap_user.c b/arch/um/os-Linux/drivers/ethertap_user.c --- a/arch/um/os-Linux/drivers/ethertap_user.c Sun Feb 9 21:13:32 2003 +++ b/arch/um/os-Linux/drivers/ethertap_user.c Sun Feb 9 21:13:32 2003 @@ -216,14 +216,14 @@ } struct net_user_info ethertap_user_info = { - init: etap_user_init, - open: etap_open, - close: etap_close, - remove: NULL, - set_mtu: etap_set_mtu, - add_address: etap_add_addr, - delete_address: etap_del_addr, - max_packet: MAX_PACKET - ETH_HEADER_ETHERTAP + .init = etap_user_init, + .open = etap_open, + .close = etap_close, + .remove = NULL, + .set_mtu = etap_set_mtu, + .add_address = etap_add_addr, + .delete_address = etap_del_addr, + .max_packet = MAX_PACKET - ETH_HEADER_ETHERTAP }; /* diff -Nru a/arch/um/os-Linux/drivers/tuntap_kern.c b/arch/um/os-Linux/drivers/tuntap_kern.c --- a/arch/um/os-Linux/drivers/tuntap_kern.c Sun Feb 9 21:13:33 2003 +++ b/arch/um/os-Linux/drivers/tuntap_kern.c Sun Feb 9 21:13:33 2003 @@ -28,11 +28,11 @@ pri = dev->priv; tpri = (struct tuntap_data *) pri->user; *tpri = ((struct tuntap_data) - { dev_name : init->dev_name, - fixed_config : (init->dev_name != NULL), - gate_addr : init->gate_addr, - fd : -1, - dev : dev }); + { .dev_name = init->dev_name, + .fixed_config = (init->dev_name != NULL), + .gate_addr = init->gate_addr, + .fd = -1, + .dev = dev }); printk("TUN/TAP backend - "); if(tpri->gate_addr != NULL) printk("IP = %s", tpri->gate_addr); @@ -55,10 +55,10 @@ } struct net_kern_info tuntap_kern_info = { - init: tuntap_init, - protocol: eth_protocol, - read: tuntap_read, - write: tuntap_write, + .init = tuntap_init, + .protocol = eth_protocol, + .read = tuntap_read, + .write = tuntap_write, }; int tuntap_setup(char *str, char **mac_out, void *data) @@ -66,8 +66,8 @@ struct tuntap_init *init = data; *init = ((struct tuntap_init) - { dev_name : NULL, - gate_addr : NULL }); + { .dev_name = NULL, + .gate_addr = NULL }); if(tap_setup_common(str, "tuntap", &init->dev_name, mac_out, &init->gate_addr)) return(0); @@ -76,13 +76,13 @@ } static struct transport tuntap_transport = { - list : LIST_HEAD_INIT(tuntap_transport.list), - name : "tuntap", - setup : tuntap_setup, - user : &tuntap_user_info, - kern : &tuntap_kern_info, - private_size : sizeof(struct tuntap_data), - setup_size : sizeof(struct tuntap_init), + .list = LIST_HEAD_INIT(tuntap_transport.list), + .name = "tuntap", + .setup = tuntap_setup, + .user = &tuntap_user_info, + .kern = &tuntap_kern_info, + .private_size = sizeof(struct tuntap_data), + .setup_size = sizeof(struct tuntap_init), }; static int register_tuntap(void) diff -Nru a/arch/um/os-Linux/drivers/tuntap_user.c b/arch/um/os-Linux/drivers/tuntap_user.c --- a/arch/um/os-Linux/drivers/tuntap_user.c Sun Feb 9 21:13:37 2003 +++ b/arch/um/os-Linux/drivers/tuntap_user.c Sun Feb 9 21:13:37 2003 @@ -201,14 +201,14 @@ } struct net_user_info tuntap_user_info = { - init: tuntap_user_init, - open: tuntap_open, - close: tuntap_close, - remove: NULL, - set_mtu: tuntap_set_mtu, - add_address: tuntap_add_addr, - delete_address: tuntap_del_addr, - max_packet: MAX_PACKET + .init = tuntap_user_init, + .open = tuntap_open, + .close = tuntap_close, + .remove = NULL, + .set_mtu = tuntap_set_mtu, + .add_address = tuntap_add_addr, + .delete_address = tuntap_del_addr, + .max_packet = MAX_PACKET }; /* diff -Nru a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c --- a/arch/um/os-Linux/file.c Sun Feb 9 21:13:37 2003 +++ b/arch/um/os-Linux/file.c Sun Feb 9 21:13:37 2003 @@ -28,8 +28,8 @@ else if(S_ISLNK(buf.st_mode)) return(OS_TYPE_SYMLINK); else if(S_ISCHR(buf.st_mode)) return(OS_TYPE_CHARDEV); else if(S_ISBLK(buf.st_mode)) return(OS_TYPE_BLOCKDEV); - else if(S_ISFIFO(buf.st_mode))return(OS_TYPE_FIFO); - else if(S_ISSOCK(buf.st_mode))return(OS_TYPE_SOCK); + else if(S_ISFIFO(buf.st_mode)) return(OS_TYPE_FIFO); + else if(S_ISSOCK(buf.st_mode)) return(OS_TYPE_SOCK); else return(OS_TYPE_FILE); } @@ -64,6 +64,15 @@ fd = open64(file, f, mode); if(fd < 0) return(-errno); + + if(flags.cl){ + if(fcntl(fd, F_SETFD, 1)){ + close(fd); + return(-errno); + } + } + + return(fd); return(fd); } @@ -100,7 +109,7 @@ return(0); } -int os_read_file(int fd, char *buf, int len) +int os_read_file(int fd, void *buf, int len) { int n; @@ -118,7 +127,7 @@ return(n); } -int os_write_file(int fd, char *buf, int count) +int os_write_file(int fd, void *buf, int count) { int n; @@ -276,8 +285,8 @@ msg.msg_name = NULL; msg.msg_namelen = 0; - iov = ((struct iovec) { iov_base : helper_pid_out, - iov_len : sizeof(*helper_pid_out) }); + iov = ((struct iovec) { .iov_base = helper_pid_out, + .iov_len = sizeof(*helper_pid_out) }); msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = buf; diff -Nru a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c --- a/arch/um/os-Linux/process.c Sun Feb 9 21:13:29 2003 +++ b/arch/um/os-Linux/process.c Sun Feb 9 21:13:29 2003 @@ -106,7 +106,7 @@ loc = mmap((void *) virt, len, prot, MAP_SHARED | MAP_FIXED, fd, off); - if(loc < 0) + if(loc == MAP_FAILED) return(-errno); return(0); } diff -Nru a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile --- a/arch/um/sys-i386/Makefile Sun Feb 9 21:13:29 2003 +++ b/arch/um/sys-i386/Makefile Sun Feb 9 21:13:29 2003 @@ -3,15 +3,13 @@ obj-$(CONFIG_HIGHMEM) += highmem.o -export-objs = ksyms.o - USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) -SYMLINKS = semaphore.c extable.c highmem.c module.c +SYMLINKS = semaphore.c highmem.c module.c +SYMLINKS := $(foreach f,$(SYMLINKS),$(src)/$f) semaphore.c-dir = kernel -extable.c-dir = mm highmem.c-dir = mm module.c-dir = kernel @@ -23,7 +21,7 @@ $(USER_OBJS) : %.o: %.c $(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $< -$(foreach f,$(SYMLINKS),$(src)/$f): +$(SYMLINKS): $(call make_link,$@) clean: diff -Nru a/arch/um/sys-i386/bugs.c b/arch/um/sys-i386/bugs.c --- a/arch/um/sys-i386/bugs.c Sun Feb 9 21:13:35 2003 +++ b/arch/um/sys-i386/bugs.c Sun Feb 9 21:13:35 2003 @@ -117,7 +117,7 @@ if(check_cpu_feature("xmm", &have_it)) cpu_has_xmm = have_it; } -int arch_handle_signal(int sig, struct uml_pt_regs *regs) +int arch_handle_signal(int sig, union uml_pt_regs *regs) { unsigned long ip; diff -Nru a/arch/um/sys-i386/extable.c b/arch/um/sys-i386/extable.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/um/sys-i386/extable.c Sun Feb 9 21:13:38 2003 @@ -0,0 +1,30 @@ +/* + * linux/arch/i386/mm/extable.c + */ + +#include +#include +#include +#include + +/* Simple binary search */ +const struct exception_table_entry * +search_extable(const struct exception_table_entry *first, + const struct exception_table_entry *last, + unsigned long value) +{ + while (first <= last) { + const struct exception_table_entry *mid; + long diff; + + mid = (last - first) / 2 + first; + diff = mid->insn - value; + if (diff == 0) + return mid; + else if (diff < 0) + first = mid+1; + else + last = mid-1; + } + return NULL; +} diff -Nru a/arch/um/sys-i386/fault.c b/arch/um/sys-i386/fault.c --- a/arch/um/sys-i386/fault.c Sun Feb 9 21:13:32 2003 +++ b/arch/um/sys-i386/fault.c Sun Feb 9 21:13:32 2003 @@ -14,7 +14,7 @@ struct sigcontext *sc = sc_ptr; unsigned long fixup; - fixup = search_exception_table(address); + fixup = search_exception_tables(address); if(fixup != 0){ sc->eip = fixup; return(1); diff -Nru a/arch/um/sys-i386/sigcontext.c b/arch/um/sys-i386/sigcontext.c --- a/arch/um/sys-i386/sigcontext.c Sun Feb 9 21:13:28 2003 +++ b/arch/um/sys-i386/sigcontext.c Sun Feb 9 21:13:28 2003 @@ -21,7 +21,7 @@ void sc_to_sc(void *to_ptr, void *from_ptr) { struct sigcontext *to = to_ptr, *from = from_ptr; - int size = sizeof(*to) + signal_frame_sc.arch.fpstate_size; + int size = sizeof(*to) + signal_frame_sc.common.arch.fpstate_size; memcpy(to, from, size); if(from->fpstate != NULL) to->fpstate = (struct _fpstate *) (to + 1); diff -Nru a/arch/um/sys-i386/util/mk_thread_kern.c b/arch/um/sys-i386/util/mk_thread_kern.c --- a/arch/um/sys-i386/util/mk_thread_kern.c Sun Feb 9 21:13:28 2003 +++ b/arch/um/sys-i386/util/mk_thread_kern.c Sun Feb 9 21:13:28 2003 @@ -1,3 +1,4 @@ +#include "linux/config.h" #include "linux/stddef.h" #include "linux/sched.h" @@ -12,7 +13,9 @@ { print_head(); print_constant_ptr("TASK_DEBUGREGS", THREAD_OFFSET(arch.debugregs)); +#ifdef CONFIG_MODE_TT print_constant("TASK_EXTERN_PID", "int", THREAD_OFFSET(mode.tt.extern_pid)); +#endif print_tail(); return(0); } diff -Nru a/arch/um/uml.lds.S b/arch/um/uml.lds.S --- a/arch/um/uml.lds.S Sun Feb 9 21:13:31 2003 +++ b/arch/um/uml.lds.S Sun Feb 9 21:13:31 2003 @@ -11,15 +11,17 @@ . = ALIGN(4096); __binary_start = .; +#ifdef MODE_TT .thread_private : { __start_thread_private = .; errno = .; . += 4; - arch/um/kernel/unmap_fin.o (.data) + arch/um/kernel/tt/unmap_fin.o (.data) __end_thread_private = .; } . = ALIGN(4096); - .remap : { arch/um/kernel/unmap_fin.o (.text) } + .remap : { arch/um/kernel/tt/unmap_fin.o (.text) } +#endif . = ALIGN(4096); /* Init code and data */ _stext = .; @@ -34,80 +36,12 @@ *(.gnu.linkonce.t*) } - . = ALIGN(16); /* Exception table */ - __start___ex_table = .; - __ex_table : { *(__ex_table) } - __stop___ex_table = .; + #include "asm/common.lds.S" - RODATA - - .fini : { *(.fini) } =0x9090 - _etext = .; - PROVIDE (etext = .); - - . = ALIGN(4096); - PROVIDE (_sdata = .); - - .unprotected : { *(.unprotected) } - . = ALIGN(4096); - PROVIDE (_unprotected_end = .); - - . = ALIGN(4096); - __uml_setup_start = .; - .uml.setup.init : { *(.uml.setup.init) } - __uml_setup_end = .; - - __uml_help_start = .; - .uml.help.init : { *(.uml.help.init) } - __uml_help_end = .; - - __uml_postsetup_start = .; - .uml.postsetup.init : { *(.uml.postsetup.init) } - __uml_postsetup_end = .; - - __setup_start = .; - .init.setup : { *(.init.setup) } - __setup_end = .; - - __start___param = .; - __param : { *(__param) } - __stop___param = .; - - __per_cpu_start = . ; - .data.percpu : { *(.data.percpu) } - __per_cpu_end = . ; - - __initcall_start = .; - .initcall.init : { - *(.initcall1.init) - *(.initcall2.init) - *(.initcall3.init) - *(.initcall4.init) - *(.initcall5.init) - *(.initcall6.init) - *(.initcall7.init) - } - __initcall_end = .; - __uml_initcall_start = .; - .uml.initcall.init : { *(.uml.initcall.init) } - __uml_initcall_end = .; - __init_end = .; - __exitcall_begin = .; - .exitcall : { *(.exitcall.exit) } - __exitcall_end = .; - __uml_exitcall_begin = .; - .uml.exitcall : { *(.uml.exitcall.exit) } - __uml_exitcall_end = .; - - . = ALIGN(4096); - __initramfs_start = .; - .init.ramfs : { *(.init.ramfs) } - __initramfs_end = .; - .data.init : { *(.data.init) } .data : { - . = ALIGN(16384); /* init_task */ + . = ALIGN(KERNEL_STACK_SIZE); /* init_task */ *(.data.init_task) *(.data) *(.gnu.linkonce.d*) diff -Nru a/arch/um/util/mk_task_kern.c b/arch/um/util/mk_task_kern.c --- a/arch/um/util/mk_task_kern.c Sun Feb 9 21:13:29 2003 +++ b/arch/um/util/mk_task_kern.c Sun Feb 9 21:13:29 2003 @@ -9,7 +9,7 @@ int main(int argc, char **argv) { print_head(); - print_ptr("TASK_REGS", "struct uml_pt_regs", + print_ptr("TASK_REGS", "union uml_pt_regs", offsetof(struct task_struct, thread.regs)); print("TASK_PID", "int", offsetof(struct task_struct, pid)); print_tail(); diff -Nru a/arch/um/vmlinux.lds.S b/arch/um/vmlinux.lds.S --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/um/vmlinux.lds.S Sun Feb 9 21:13:37 2003 @@ -0,0 +1,11 @@ +#include + +OUTPUT_FORMAT(ELF_FORMAT) +OUTPUT_ARCH(ELF_ARCH) +ENTRY(_start) +jiffies = jiffies_64; + +SECTIONS +{ +#include "asm/common.lds.S" +} diff -Nru a/arch/v850/Kconfig b/arch/v850/Kconfig --- a/arch/v850/Kconfig Sun Feb 9 21:13:31 2003 +++ b/arch/v850/Kconfig Sun Feb 9 21:13:31 2003 @@ -351,7 +351,7 @@ and load that module after the PnP configuration is finished. To do this, say M here and read as well as ; the module will be - called soundcore.o. + called soundcore. I'm told that even without a sound card, you can make your computer say more than an occasional beep, by programming the PC speaker. diff -Nru a/arch/v850/Makefile b/arch/v850/Makefile --- a/arch/v850/Makefile Sun Feb 9 21:13:37 2003 +++ b/arch/v850/Makefile Sun Feb 9 21:13:37 2003 @@ -31,7 +31,7 @@ OBJCOPY_FLAGS_BLOB := -I binary -O elf32-little -B v850e -HEAD := $(arch_dir)/kernel/head.o $(arch_dir)/kernel/init_task.o +head-y := $(arch_dir)/kernel/head.o $(arch_dir)/kernel/init_task.o core-y += $(arch_dir)/kernel/ libs-y += $(arch_dir)/lib/ diff -Nru a/arch/v850/kernel/Makefile b/arch/v850/kernel/Makefile --- a/arch/v850/kernel/Makefile Sun Feb 9 21:13:37 2003 +++ b/arch/v850/kernel/Makefile Sun Feb 9 21:13:37 2003 @@ -13,8 +13,6 @@ obj-y += intv.o entry.o process.o syscalls.o time.o semaphore.o setup.o \ signal.o irq.o mach.o ptrace.o bug.o -export-objs += v850_ksyms.o rte_mb_a_pci.o - obj-$(CONFIG_MODULES) += module.o v850_ksyms.o # chip-specific code obj-$(CONFIG_V850E_MA1) += ma.o nb85e_utils.o nb85e_timer_d.o diff -Nru a/arch/v850/kernel/mach.h b/arch/v850/kernel/mach.h --- a/arch/v850/kernel/mach.h Sun Feb 9 21:13:37 2003 +++ b/arch/v850/kernel/mach.h Sun Feb 9 21:13:37 2003 @@ -45,7 +45,7 @@ extern void (*mach_tick) (void); /* The following establishes aliases for various mach_ functions to the - name by which the rest of the kernal calls them. These statements + name by which the rest of the kernel calls them. These statements should only have an effect in the file that defines the actual functions. */ #define MACH_ALIAS(to, from) \ asm (".global " macrology_stringify (C_SYMBOL_NAME (to)) ";" \ diff -Nru a/arch/v850/kernel/rte_mb_a_pci.c b/arch/v850/kernel/rte_mb_a_pci.c --- a/arch/v850/kernel/rte_mb_a_pci.c Sun Feb 9 21:13:30 2003 +++ b/arch/v850/kernel/rte_mb_a_pci.c Sun Feb 9 21:13:30 2003 @@ -689,7 +689,7 @@ free_dma_mapping (mapping); } -/* Make physical memory consistant for a single streaming mode DMA +/* Make physical memory consistent for a single streaming mode DMA translation after a transfer. If you perform a pci_map_single() but wish to interrogate the @@ -731,7 +731,7 @@ BUG (); } -/* Make physical memory consistant for a set of streaming mode DMA +/* Make physical memory consistent for a set of streaming mode DMA translations after a transfer. The same as pci_dma_sync_single but for a scatter-gather list, same rules and usage. */ diff -Nru a/arch/v850/kernel/signal.c b/arch/v850/kernel/signal.c --- a/arch/v850/kernel/signal.c Sun Feb 9 21:13:37 2003 +++ b/arch/v850/kernel/signal.c Sun Feb 9 21:13:37 2003 @@ -50,11 +50,11 @@ sigset_t saveset; mask &= _BLOCKABLE; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; siginitset(¤t->blocked, mask); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->gpr[GPR_RVAL] = -EINTR; while (1) { @@ -78,11 +78,11 @@ if (copy_from_user(&newset, unewset, sizeof(newset))) return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs->gpr[GPR_RVAL] = -EINTR; while (1) { @@ -188,10 +188,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext(regs, &frame->sc, &rval)) goto badframe; @@ -216,10 +216,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &rval)) goto badframe; @@ -472,11 +472,11 @@ ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked,sig); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } } diff -Nru a/arch/v850/kernel/time.c b/arch/v850/kernel/time.c --- a/arch/v850/kernel/time.c Sun Feb 9 21:13:33 2003 +++ b/arch/v850/kernel/time.c Sun Feb 9 21:13:33 2003 @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -107,8 +108,6 @@ #endif /* 0 */ } -extern rwlock_t xtime_lock; - /* * This version of gettimeofday has near microsecond resolution. */ @@ -120,21 +119,24 @@ #endif unsigned long flags; unsigned long usec, sec; + unsigned long seq; + + do { + seq = read_seqbegin_irqsave(&xtime_lock, flags); - read_lock_irqsave (&xtime_lock, flags); #if 0 - usec = mach_gettimeoffset ? mach_gettimeoffset () : 0; + usec = mach_gettimeoffset ? mach_gettimeoffset () : 0; #else - usec = 0; + usec = 0; #endif #if 0 /* DAVIDM later if possible */ - lost = lost_ticks; - if (lost) - usec += lost * (1000000/HZ); + lost = lost_ticks; + if (lost) + usec += lost * (1000000/HZ); #endif - sec = xtime.tv_sec; - usec += xtime.tv_nsec / 1000; - read_unlock_irqrestore (&xtime_lock, flags); + sec = xtime.tv_sec; + usec += xtime.tv_nsec / 1000; + } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); while (usec >= 1000000) { usec -= 1000000; @@ -147,7 +149,7 @@ void do_settimeofday (struct timeval *tv) { - write_lock_irq (&xtime_lock); + write_seqlock_irq (&xtime_lock); /* This is revolting. We need to set the xtime.tv_nsec * correctly. However, the value in this location is @@ -172,7 +174,7 @@ time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq (&xtime_lock); + write_sequnlock_irq (&xtime_lock); } static int timer_dev_id; diff -Nru a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig --- a/arch/x86_64/Kconfig Sun Feb 9 21:13:35 2003 +++ b/arch/x86_64/Kconfig Sun Feb 9 21:13:35 2003 @@ -427,7 +427,7 @@ If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called binfmt_elf.o. Saying M or N here is dangerous because + will be called binfmt_elf. Saying M or N here is dangerous because some crucial programs on your system might be in ELF format. config BINFMT_MISC @@ -452,7 +452,7 @@ use this part of the kernel. You may say M here for module support and later load the module when - you have use for it; the module is called binfmt_misc.o. If you + you have use for it; the module is called binfmt_misc. If you don't know what to answer at this point, say Y. config IA32_EMULATION @@ -518,7 +518,7 @@ If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The module - will be called ide.o. + will be called ide. For further information, please read . @@ -545,7 +545,7 @@ This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). - The module will be called scsi_mod.o. If you want to compile it as + The module will be called scsi_mod. If you want to compile it as a module, say M here and read and . However, do not compile this as a module if your root file system (the one containing the directory /) @@ -615,7 +615,7 @@ and load that module after the PnP configuration is finished. To do this, say M here and read as well as ; the module will be - called soundcore.o. + called soundcore. I'm told that even without a sound card, you can make your computer say more than an occasional beep, by programming the PC speaker. diff -Nru a/arch/x86_64/Makefile b/arch/x86_64/Makefile --- a/arch/x86_64/Makefile Sun Feb 9 21:13:35 2003 +++ b/arch/x86_64/Makefile Sun Feb 9 21:13:35 2003 @@ -48,7 +48,7 @@ CFLAGS += -finline-limit=2000 #CFLAGS += -g -HEAD := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o +head-y := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o libs-y += arch/x86_64/lib/ core-y += arch/x86_64/kernel/ arch/x86_64/mm/ diff -Nru a/arch/x86_64/ia32/Makefile b/arch/x86_64/ia32/Makefile --- a/arch/x86_64/ia32/Makefile Sun Feb 9 21:13:30 2003 +++ b/arch/x86_64/ia32/Makefile Sun Feb 9 21:13:30 2003 @@ -2,8 +2,6 @@ # Makefile for the ia32 kernel emulation subsystem. # -export-objs := ia32_ioctl.o sys_ia32.o - obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_ioctl.o \ ia32_signal.o \ ia32_binfmt.o fpu32.o socket32.o ptrace32.o ipc32.o syscall32.o diff -Nru a/arch/x86_64/ia32/ia32_signal.c b/arch/x86_64/ia32/ia32_signal.c --- a/arch/x86_64/ia32/ia32_signal.c Sun Feb 9 21:13:36 2003 +++ b/arch/x86_64/ia32/ia32_signal.c Sun Feb 9 21:13:36 2003 @@ -83,11 +83,11 @@ sigset_t saveset; mask &= _BLOCKABLE; - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; siginitset(¤t->blocked, mask); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); regs.rax = -EINTR; while (1) { @@ -243,10 +243,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (ia32_restore_sigcontext(®s, &frame->sc, &eax)) goto badframe; @@ -270,10 +270,10 @@ goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (ia32_restore_sigcontext(®s, &frame->uc.uc_mcontext, &eax)) goto badframe; diff -Nru a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile --- a/arch/x86_64/kernel/Makefile Sun Feb 9 21:13:34 2003 +++ b/arch/x86_64/kernel/Makefile Sun Feb 9 21:13:34 2003 @@ -4,8 +4,6 @@ EXTRA_TARGETS := head.o head64.o init_task.o EXTRA_AFLAGS := -traditional -export-objs := x8664_ksyms.o pci-gart.o pci-dma.o - obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \ pci-dma.o x8664_ksyms.o i387.o syscall.o vsyscall.o \ diff -Nru a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c --- a/arch/x86_64/kernel/apic.c Sun Feb 9 21:13:29 2003 +++ b/arch/x86_64/kernel/apic.c Sun Feb 9 21:13:29 2003 @@ -895,7 +895,7 @@ * value into /proc/profile. */ -inline void smp_local_timer_interrupt(struct pt_regs *regs) +void smp_local_timer_interrupt(struct pt_regs *regs) { int cpu = smp_processor_id(); diff -Nru a/arch/x86_64/kernel/mtrr/Makefile b/arch/x86_64/kernel/mtrr/Makefile --- a/arch/x86_64/kernel/mtrr/Makefile Sun Feb 9 21:13:32 2003 +++ b/arch/x86_64/kernel/mtrr/Makefile Sun Feb 9 21:13:32 2003 @@ -7,8 +7,6 @@ obj-y += cyrix.o obj-y += centaur.o -export-objs := main.o - $(obj)/main.c: $(obj)/mtrr.h @ln -sf ../../../i386/kernel/cpu/mtrr/main.c $(obj)/main.c $(obj)/if.c: $(obj)/mtrr.h diff -Nru a/arch/x86_64/kernel/signal.c b/arch/x86_64/kernel/signal.c --- a/arch/x86_64/kernel/signal.c Sun Feb 9 21:13:34 2003 +++ b/arch/x86_64/kernel/signal.c Sun Feb 9 21:13:34 2003 @@ -52,11 +52,11 @@ return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); #if DEBUG_SIG printk("rt_sigsuspend savset(%lx) newset(%lx) regs(%p) rip(%lx)\n", saveset, newset, ®s, regs.rip); @@ -155,10 +155,10 @@ } sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext(®s, &frame->uc.uc_mcontext, &eax)) { goto badframe; @@ -401,11 +401,11 @@ ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(¤t->sig->siglock); + spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked,sig); recalc_sigpending(); - spin_unlock_irq(¤t->sig->siglock); + spin_unlock_irq(¤t->sighand->siglock); } } diff -Nru a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c --- a/arch/x86_64/kernel/time.c Sun Feb 9 21:13:34 2003 +++ b/arch/x86_64/kernel/time.c Sun Feb 9 21:13:34 2003 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -27,9 +28,12 @@ u64 jiffies_64; -extern rwlock_t xtime_lock; spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +extern int using_apic_timer; +extern void smp_local_timer_interrupt(struct pt_regs * regs); + + unsigned int cpu_khz; /* TSC clocks / usec, not used here */ unsigned long hpet_period; /* fsecs / HPET clock */ unsigned long hpet_tick; /* HPET clocks / interrupt */ @@ -70,21 +74,22 @@ void do_gettimeofday(struct timeval *tv) { - unsigned long flags, t; + unsigned long flags, t, seq; unsigned int sec, usec; - read_lock_irqsave(&xtime_lock, flags); - spin_lock(&time_offset_lock); - - sec = xtime.tv_sec; - usec = xtime.tv_nsec / 1000; - - t = (jiffies - wall_jiffies) * (1000000L / HZ) + do_gettimeoffset(); - if (t > timeoffset) timeoffset = t; - usec += timeoffset; + spin_lock_irqsave(&time_offset_lock, flags); + do { + seq = read_seqbegin(&xtime_lock); + + sec = xtime.tv_sec; + usec = xtime.tv_nsec / 1000; + + t = (jiffies - wall_jiffies) * (1000000L / HZ) + do_gettimeoffset(); + if (t > timeoffset) timeoffset = t; + usec += timeoffset; - spin_unlock(&time_offset_lock); - read_unlock_irqrestore(&xtime_lock, flags); + } while (read_seqretry(&xtime_lock, seq)); + spin_unlock_irqrestore(&time_offset_lock, flags); tv->tv_sec = sec + usec / 1000000; tv->tv_usec = usec % 1000000; @@ -98,7 +103,7 @@ void do_settimeofday(struct timeval *tv) { - write_lock_irq(&xtime_lock); + write_seqlock_irq(&xtime_lock); vxtime_lock(); tv->tv_usec -= do_gettimeoffset() + @@ -118,7 +123,7 @@ time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; - write_unlock_irq(&xtime_lock); + write_sequnlock_irq(&xtime_lock); } /* @@ -201,7 +206,7 @@ * variables, because both do_timer() and us change them -arca+vojtech */ - write_lock(&xtime_lock); + write_seqlock(&xtime_lock); vxtime_lock(); { @@ -214,6 +219,7 @@ hpet.ticks = min_t(long, max_t(long, (t - hpet.last_tsc) * (1000000L / HZ) / (1000000L / HZ - hpet.offset), cpu_khz * 1000/HZ * 15 / 16), cpu_khz * 1000/HZ * 16 / 15); hpet.last_tsc = t; + timeoffset = 0; } /* @@ -250,7 +256,7 @@ } vxtime_unlock(); - write_unlock(&xtime_lock); + write_sequnlock(&xtime_lock); } unsigned long get_cmos_time(void) diff -Nru a/arch/x86_64/lib/Makefile b/arch/x86_64/lib/Makefile --- a/arch/x86_64/lib/Makefile Sun Feb 9 21:13:29 2003 +++ b/arch/x86_64/lib/Makefile Sun Feb 9 21:13:29 2003 @@ -3,8 +3,6 @@ # L_TARGET := lib.a -export-objs := io.o csum-wrappers.o csum-partial.o - CFLAGS_csum-partial.o := -funroll-loops obj-y := csum-partial.o csum-copy.o csum-wrappers.o delay.o \ diff -Nru a/arch/x86_64/mm/Makefile b/arch/x86_64/mm/Makefile --- a/arch/x86_64/mm/Makefile Sun Feb 9 21:13:34 2003 +++ b/arch/x86_64/mm/Makefile Sun Feb 9 21:13:34 2003 @@ -2,7 +2,5 @@ # Makefile for the linux i386-specific parts of the memory manager. # -export-objs := pageattr.o - obj-y := init.o fault.o ioremap.o extable.o pageattr.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o diff -Nru a/arch/x86_64/mm/hugetlbpage.c b/arch/x86_64/mm/hugetlbpage.c --- a/arch/x86_64/mm/hugetlbpage.c Sun Feb 9 21:13:32 2003 +++ b/arch/x86_64/mm/hugetlbpage.c Sun Feb 9 21:13:32 2003 @@ -25,7 +25,6 @@ int htlbpage_max; static long htlbzone_pages; -struct vm_operations_struct hugetlb_vm_ops; static LIST_HEAD(htlbpage_freelist); static spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED; @@ -134,6 +133,7 @@ page = pte_page(pte); if (pages) { page += ((start & ~HPAGE_MASK) >> PAGE_SHIFT); + get_page(page); pages[i] = page; } if (vmas) @@ -204,6 +204,7 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma) { struct mm_struct *mm = current->mm; + struct inode = mapping->host; unsigned long addr; int ret = 0; @@ -227,6 +228,8 @@ + (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT)); page = find_get_page(mapping, idx); if (!page) { + loff_t i_size; + page = alloc_hugetlb_page(); if (!page) { ret = -ENOMEM; @@ -238,6 +241,9 @@ free_huge_page(page); goto out; } + i_size = (loff_t)(idx + 1) * HPAGE_SIZE; + if (i_size > inode->i_size) + inode->i_size = i_size; } set_huge_pte(mm, vma, page, pte, vma->vm_flags & VM_WRITE); } @@ -263,11 +269,6 @@ page = alloc_pages(__GFP_HIGHMEM, HUGETLB_PAGE_ORDER); if (page == NULL) break; - map = page; - for (j = 0; j < (HPAGE_SIZE / PAGE_SIZE); j++) { - SetPageReserved(map); - map++; - } spin_lock(&htlbpage_lock); list_add(&page->list, &htlbpage_freelist); htlbpagemem++; @@ -286,8 +287,9 @@ spin_unlock(&htlbpage_lock); map = page; for (j = 0; j < (HPAGE_SIZE / PAGE_SIZE); j++) { - map->flags &= ~(1 << PG_locked | 1 << PG_error | 1 << PG_referenced | - 1 << PG_dirty | 1 << PG_active | 1 << PG_reserved | + map->flags &= ~(1 << PG_locked | 1 << PG_error | + 1 << PG_referenced | + 1 << PG_dirty | 1 << PG_active | 1 << PG_private | 1<< PG_writeback); set_page_count(map, 0); map++; @@ -346,7 +348,8 @@ HPAGE_SIZE/1024); } -static struct page * hugetlb_nopage(struct vm_area_struct * area, unsigned long address, int unused) +static struct page * +hugetlb_nopage(struct vm_area_struct *vma, unsigned long address, int unused) { BUG(); return NULL; diff -Nru a/crypto/Makefile b/crypto/Makefile --- a/crypto/Makefile Sun Feb 9 21:13:36 2003 +++ b/crypto/Makefile Sun Feb 9 21:13:36 2003 @@ -2,8 +2,6 @@ # Cryptographic API # -export-objs := api.o hmac.o - autoload-crypto-$(CONFIG_KMOD) = autoload.o proc-crypto-$(CONFIG_PROC_FS) = proc.o diff -Nru a/crypto/cipher.c b/crypto/cipher.c --- a/crypto/cipher.c Sun Feb 9 21:13:32 2003 +++ b/crypto/cipher.c Sun Feb 9 21:13:32 2003 @@ -4,6 +4,7 @@ * Cipher operations. * * Copyright (c) 2002 James Morris + * Generic scatterwalk code by Adam J. Richter . * * 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 @@ -16,12 +17,22 @@ #include #include #include +#include #include #include #include "internal.h" typedef void (cryptfn_t)(void *, u8 *, const u8 *); -typedef void (procfn_t)(struct crypto_tfm *, u8 *, cryptfn_t, int enc); +typedef void (procfn_t)(struct crypto_tfm *, u8 *, u8*, cryptfn_t, int enc); + +struct scatter_walk { + struct scatterlist *sg; + struct page *page; + void *data; + unsigned int len_this_page; + unsigned int len_this_segment; + unsigned int offset; +}; static inline void xor_64(u8 *a, const u8 *b) { @@ -37,165 +48,191 @@ ((u32 *)a)[3] ^= ((u32 *)b)[3]; } -static inline unsigned int sglen(struct scatterlist *sg, unsigned int nsg) + +/* Define sg_next is an inline routine now in case we want to change + scatterlist to a linked list later. */ +static inline struct scatterlist *sg_next(struct scatterlist *sg) { - unsigned int i, n; - - for (i = 0, n = 0; i < nsg; i++) - n += sg[i].length; - - return n; + return sg + 1; } -/* - * Do not call this unless the total length of all of the fragments - * has been verified as multiple of the block size. - */ -static unsigned int copy_chunks(struct crypto_tfm *tfm, u8 *buf, - struct scatterlist *sg, unsigned int sgidx, - unsigned int rlen, unsigned int *last, int in) -{ - unsigned int i, copied, coff, j, aligned; - unsigned int bsize = crypto_tfm_alg_blocksize(tfm); - - for (i = sgidx, j = copied = 0, aligned = 0 ; copied < bsize; i++) { - unsigned int len = sg[i].length; - unsigned int clen; - char *p; - - if (copied) { - coff = 0; - clen = min(len, bsize - copied); - - if (len == bsize - copied) - aligned = 1; /* last + right aligned */ - - } else { - coff = len - rlen; - clen = rlen; - } +void *which_buf(struct scatter_walk *walk, unsigned int nbytes, void *scratch) +{ + if (nbytes <= walk->len_this_page && + (((unsigned long)walk->data) & (PAGE_CACHE_SIZE - 1)) + nbytes <= + PAGE_CACHE_SIZE) + return walk->data; + else + return scratch; +} - p = crypto_kmap(sg[i].page) + sg[i].offset + coff; - - if (in) - memcpy(&buf[copied], p, clen); +static void memcpy_dir(void *buf, void *sgdata, size_t nbytes, int out) +{ + if (out) + memcpy(sgdata, buf, nbytes); + else + memcpy(buf, sgdata, nbytes); +} + +static void scatterwalk_start(struct scatter_walk *walk, struct scatterlist *sg) +{ + unsigned int rest_of_page; + + walk->sg = sg; + + walk->page = sg->page; + walk->len_this_segment = sg->length; + + rest_of_page = PAGE_CACHE_SIZE - (sg->offset & (PAGE_CACHE_SIZE - 1)); + walk->len_this_page = min(sg->length, rest_of_page); + walk->offset = sg->offset; +} + +static void scatterwalk_map(struct scatter_walk *walk, int out) +{ + walk->data = crypto_kmap(walk->page, out) + walk->offset; +} + +static void scatter_page_done(struct scatter_walk *walk, int out, + unsigned int more) +{ + /* walk->data may be pointing the first byte of the next page; + however, we know we transfered at least one byte. So, + walk->data - 1 will be a virutual address in the mapped page. */ + + if (out) + flush_dcache_page(walk->page); + + if (more) { + walk->len_this_segment -= walk->len_this_page; + + if (walk->len_this_segment) { + walk->page++; + walk->len_this_page = min(walk->len_this_segment, + (unsigned)PAGE_CACHE_SIZE); + walk->offset = 0; + } else - memcpy(p, &buf[copied], clen); - - crypto_kunmap(p); - *last = aligned ? 0 : clen; - copied += clen; + scatterwalk_start(walk, sg_next(walk->sg)); } - - return i - sgidx - 2 + aligned; } -static inline unsigned int gather_chunks(struct crypto_tfm *tfm, u8 *buf, - struct scatterlist *sg, - unsigned int sgidx, unsigned int rlen, - unsigned int *last) +static void scatter_done(struct scatter_walk *walk, int out, int more) { - return copy_chunks(tfm, buf, sg, sgidx, rlen, last, 1); + crypto_kunmap(walk->data, out); + if (walk->len_this_page == 0 || !more) + scatter_page_done(walk, out, more); } -static inline unsigned int scatter_chunks(struct crypto_tfm *tfm, u8 *buf, - struct scatterlist *sg, - unsigned int sgidx, unsigned int rlen, - unsigned int *last) +/* + * Do not call this unless the total length of all of the fragments + * has been verified as multiple of the block size. + */ +static int copy_chunks(void *buf, struct scatter_walk *walk, + size_t nbytes, int out) { - return copy_chunks(tfm, buf, sg, sgidx, rlen, last, 0); + if (buf != walk->data) { + while (nbytes > walk->len_this_page) { + memcpy_dir(buf, walk->data, walk->len_this_page, out); + buf += walk->len_this_page; + nbytes -= walk->len_this_page; + + crypto_kunmap(walk->data, out); + scatter_page_done(walk, out, 1); + scatterwalk_map(walk, out); + } + + memcpy_dir(buf, walk->data, nbytes, out); + } + + walk->offset += nbytes; + walk->len_this_page -= nbytes; + walk->len_this_segment -= nbytes; + return 0; } /* - * Generic encrypt/decrypt wrapper for ciphers. - * - * If we find a a remnant at the end of a frag, we have to encrypt or - * decrypt across possibly multiple page boundaries via a temporary - * block, then continue processing with a chunk offset until the end - * of a frag is block aligned. - * - * The code is further complicated by having to remap a page after - * processing a block then yielding. The data will be offset from the - * start of page at the scatterlist offset, the chunking offset (coff) - * and the block offset (boff). + * Generic encrypt/decrypt wrapper for ciphers, handles operations across + * multiple page boundaries by using temporary blocks. In user context, + * the kernel is given a chance to schedule us once per block. */ -static int crypt(struct crypto_tfm *tfm, struct scatterlist *sg, - unsigned int nsg, cryptfn_t crfn, procfn_t prfn, int enc) -{ - unsigned int i, coff; - unsigned int bsize = crypto_tfm_alg_blocksize(tfm); - u8 tmp[bsize]; +static int crypt(struct crypto_tfm *tfm, + struct scatterlist *dst, + struct scatterlist *src, + unsigned int nbytes, cryptfn_t crfn, procfn_t prfn, int enc) +{ + struct scatter_walk walk_in, walk_out; + const unsigned int bsize = crypto_tfm_alg_blocksize(tfm); + u8 tmp_src[nbytes > src->length ? bsize : 0]; + u8 tmp_dst[nbytes > dst->length ? bsize : 0]; - if (sglen(sg, nsg) % bsize) { + if (!nbytes) + return 0; + + if (nbytes % bsize) { tfm->crt_flags |= CRYPTO_TFM_RES_BAD_BLOCK_LEN; return -EINVAL; } - for (i = 0, coff = 0; i < nsg; i++) { - unsigned int n = 0, boff = 0; - unsigned int len = sg[i].length - coff; - char *p = crypto_kmap(sg[i].page) + sg[i].offset + coff; - - while (len) { - if (len < bsize) { - crypto_kunmap(p); - n = gather_chunks(tfm, tmp, sg, i, len, &coff); - prfn(tfm, tmp, crfn, enc); - scatter_chunks(tfm, tmp, sg, i, len, &coff); - crypto_yield(tfm); - goto unmapped; - } else { - prfn(tfm, p, crfn, enc); - crypto_kunmap(p); - crypto_yield(tfm); - - /* remap and point to recalculated offset */ - boff += bsize; - p = crypto_kmap(sg[i].page) - + sg[i].offset + coff + boff; - - len -= bsize; - - /* End of frag with no remnant? */ - if (coff && len == 0) - coff = 0; - } - } - crypto_kunmap(p); -unmapped: - i += n; + scatterwalk_start(&walk_in, src); + scatterwalk_start(&walk_out, dst); + + for(;;) { + u8 *src_p, *dst_p; + + scatterwalk_map(&walk_in, 0); + scatterwalk_map(&walk_out, 1); + src_p = which_buf(&walk_in, bsize, tmp_src); + dst_p = which_buf(&walk_out, bsize, tmp_dst); + + nbytes -= bsize; + copy_chunks(src_p, &walk_in, bsize, 0); + + prfn(tfm, dst_p, src_p, crfn, enc); + + scatter_done(&walk_in, 0, nbytes); + + copy_chunks(dst_p, &walk_out, bsize, 1); + scatter_done(&walk_out, 1, nbytes); + + if (!nbytes) + return 0; + + crypto_yield(tfm); } - return 0; } static void cbc_process(struct crypto_tfm *tfm, - u8 *block, cryptfn_t fn, int enc) + u8 *dst, u8 *src, cryptfn_t fn, int enc) { /* Null encryption */ if (!tfm->crt_cipher.cit_iv) return; if (enc) { - tfm->crt_u.cipher.cit_xor_block(tfm->crt_cipher.cit_iv, block); - fn(tfm->crt_ctx, block, tfm->crt_cipher.cit_iv); - memcpy(tfm->crt_cipher.cit_iv, block, + tfm->crt_u.cipher.cit_xor_block(tfm->crt_cipher.cit_iv, src); + fn(tfm->crt_ctx, dst, tfm->crt_cipher.cit_iv); + memcpy(tfm->crt_cipher.cit_iv, dst, crypto_tfm_alg_blocksize(tfm)); } else { - u8 buf[crypto_tfm_alg_blocksize(tfm)]; + const int need_stack = (src == dst); + u8 stack[need_stack ? crypto_tfm_alg_blocksize(tfm) : 0]; + u8 *buf = need_stack ? stack : dst; - fn(tfm->crt_ctx, buf, block); + fn(tfm->crt_ctx, buf, src); tfm->crt_u.cipher.cit_xor_block(buf, tfm->crt_cipher.cit_iv); - memcpy(tfm->crt_cipher.cit_iv, block, + memcpy(tfm->crt_cipher.cit_iv, src, crypto_tfm_alg_blocksize(tfm)); - memcpy(block, buf, crypto_tfm_alg_blocksize(tfm)); + if (buf != dst) + memcpy(dst, buf, crypto_tfm_alg_blocksize(tfm)); } } -static void ecb_process(struct crypto_tfm *tfm, u8 *block, +static void ecb_process(struct crypto_tfm *tfm, u8 *dst, u8 *src, cryptfn_t fn, int enc) { - fn(tfm->crt_ctx, block, block); + fn(tfm->crt_ctx, dst, src); } static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) @@ -211,35 +248,44 @@ } static int ecb_encrypt(struct crypto_tfm *tfm, - struct scatterlist *sg, unsigned int nsg) + struct scatterlist *dst, + struct scatterlist *src, unsigned int nbytes) { - return crypt(tfm, sg, nsg, + return crypt(tfm, dst, src, nbytes, tfm->__crt_alg->cra_cipher.cia_encrypt, ecb_process, 1); } static int ecb_decrypt(struct crypto_tfm *tfm, - struct scatterlist *sg, unsigned int nsg) + struct scatterlist *dst, + struct scatterlist *src, + unsigned int nbytes) { - return crypt(tfm, sg, nsg, + return crypt(tfm, dst, src, nbytes, tfm->__crt_alg->cra_cipher.cia_decrypt, ecb_process, 1); } static int cbc_encrypt(struct crypto_tfm *tfm, - struct scatterlist *sg, unsigned int nsg) + struct scatterlist *dst, + struct scatterlist *src, + unsigned int nbytes) { - return crypt(tfm, sg, nsg, + return crypt(tfm, dst, src, nbytes, tfm->__crt_alg->cra_cipher.cia_encrypt, cbc_process, 1); } static int cbc_decrypt(struct crypto_tfm *tfm, - struct scatterlist *sg, unsigned int nsg) + struct scatterlist *dst, + struct scatterlist *src, + unsigned int nbytes) { - return crypt(tfm, sg, nsg, + return crypt(tfm, dst, src, nbytes, tfm->__crt_alg->cra_cipher.cia_decrypt, cbc_process, 0); } static int nocrypt(struct crypto_tfm *tfm, - struct scatterlist *sg, unsigned int nsg) + struct scatterlist *dst, + struct scatterlist *src, + unsigned int nbytes) { return -ENOSYS; } diff -Nru a/crypto/digest.c b/crypto/digest.c --- a/crypto/digest.c Sun Feb 9 21:13:28 2003 +++ b/crypto/digest.c Sun Feb 9 21:13:28 2003 @@ -28,10 +28,10 @@ unsigned int i; for (i = 0; i < nsg; i++) { - char *p = crypto_kmap(sg[i].page) + sg[i].offset; + char *p = crypto_kmap(sg[i].page, 0) + sg[i].offset; tfm->__crt_alg->cra_digest.dia_update(tfm->crt_ctx, p, sg[i].length); - crypto_kunmap(p); + crypto_kunmap(p, 0); crypto_yield(tfm); } } @@ -49,10 +49,10 @@ tfm->crt_digest.dit_init(tfm); for (i = 0; i < nsg; i++) { - char *p = crypto_kmap(sg[i].page) + sg[i].offset; + char *p = crypto_kmap(sg[i].page, 0) + sg[i].offset; tfm->__crt_alg->cra_digest.dia_update(tfm->crt_ctx, p, sg[i].length); - crypto_kunmap(p); + crypto_kunmap(p, 0); crypto_yield(tfm); } crypto_digest_final(tfm, out); diff -Nru a/crypto/internal.h b/crypto/internal.h --- a/crypto/internal.h Sun Feb 9 21:13:28 2003 +++ b/crypto/internal.h Sun Feb 9 21:13:28 2003 @@ -16,17 +16,29 @@ #include #include #include +#include -static inline void *crypto_kmap(struct page *page) +static enum km_type km_types[] = { + KM_USER0, + KM_USER1, + KM_SOFTIRQ0, + KM_SOFTIRQ1, +}; + +static inline enum km_type crypto_kmap_type(int out) +{ + return km_types[(in_softirq() ? 2 : 0) + out]; +} + + +static inline void *crypto_kmap(struct page *page, int out) { - return kmap_atomic(page, in_softirq() ? - KM_CRYPTO_SOFTIRQ : KM_CRYPTO_USER); + return kmap_atomic(page, crypto_kmap_type(out)); } -static inline void crypto_kunmap(void *vaddr) +static inline void crypto_kunmap(void *vaddr, int out) { - kunmap_atomic(vaddr, in_softirq() ? - KM_CRYPTO_SOFTIRQ : KM_CRYPTO_USER); + kunmap_atomic(vaddr, crypto_kmap_type(out)); } static inline void crypto_yield(struct crypto_tfm *tfm) diff -Nru a/crypto/tcrypt.c b/crypto/tcrypt.c --- a/crypto/tcrypt.c Sun Feb 9 21:13:35 2003 +++ b/crypto/tcrypt.c Sun Feb 9 21:13:35 2003 @@ -703,7 +703,7 @@ sg[0].page = virt_to_page(p); sg[0].offset = ((long) p & ~PAGE_MASK); sg[0].length = len; - ret = crypto_cipher_encrypt(tfm, sg, 1); + ret = crypto_cipher_encrypt(tfm, sg, sg, len); if (ret) { printk("encrypt() failed flags=%x\n", tfm->crt_flags); goto out; @@ -746,7 +746,7 @@ sg[1].offset = ((long) p & ~PAGE_MASK); sg[1].length = 8; - ret = crypto_cipher_encrypt(tfm, sg, 2); + ret = crypto_cipher_encrypt(tfm, sg, sg, 16); if (ret) { printk("encrypt() failed flags=%x\n", tfm->crt_flags); goto out; @@ -814,7 +814,7 @@ sg[2].offset = ((long) p & ~PAGE_MASK); sg[2].length = 8; - ret = crypto_cipher_encrypt(tfm, sg, 3); + ret = crypto_cipher_encrypt(tfm, sg, sg, 32); if (ret) { printk("decrypt() failed flags=%x\n", tfm->crt_flags); @@ -890,7 +890,7 @@ sg[3].offset = ((long) p & ~PAGE_MASK); sg[3].length = 18; - ret = crypto_cipher_encrypt(tfm, sg, 4); + ret = crypto_cipher_encrypt(tfm, sg, sg, 24); if (ret) { printk("encrypt() failed flags=%x\n", tfm->crt_flags); @@ -979,7 +979,7 @@ sg[4].offset = ((long) p & ~PAGE_MASK); sg[4].length = 8; - ret = crypto_cipher_encrypt(tfm, sg, 5); + ret = crypto_cipher_encrypt(tfm, sg, sg, 16); if (ret) { printk("encrypt() failed flags=%x\n", tfm->crt_flags); @@ -1078,7 +1078,7 @@ sg[7].offset = ((long) p & ~PAGE_MASK); sg[7].length = 1; - ret = crypto_cipher_encrypt(tfm, sg, 8); + ret = crypto_cipher_encrypt(tfm, sg, sg, 8); if (ret) { printk("encrypt() failed flags=%x\n", tfm->crt_flags); goto out; @@ -1120,7 +1120,7 @@ sg[0].offset = ((long) p & ~PAGE_MASK); sg[0].length = len; - ret = crypto_cipher_decrypt(tfm, sg, 1); + ret = crypto_cipher_decrypt(tfm, sg, sg, sg[0].length); if (ret) { printk("des_decrypt() failed flags=%x\n", tfm->crt_flags); @@ -1163,7 +1163,7 @@ sg[1].offset = ((long) p & ~PAGE_MASK); sg[1].length = 8; - ret = crypto_cipher_decrypt(tfm, sg, 2); + ret = crypto_cipher_decrypt(tfm, sg, sg, 16); if (ret) { printk("decrypt() failed flags=%x\n", tfm->crt_flags); goto out; @@ -1220,7 +1220,7 @@ sg[2].offset = ((long) p & ~PAGE_MASK); sg[2].length = 1; - ret = crypto_cipher_decrypt(tfm, sg, 3); + ret = crypto_cipher_decrypt(tfm, sg, sg, 16); if (ret) { printk("decrypt() failed flags=%x\n", tfm->crt_flags); @@ -1290,7 +1290,7 @@ crypto_cipher_set_iv(tfm, des_tv[i].iv, crypto_tfm_alg_ivsize(tfm)); - ret = crypto_cipher_encrypt(tfm, sg, 1); + ret = crypto_cipher_encrypt(tfm, sg, sg, len); if (ret) { printk("des_cbc_encrypt() failed flags=%x\n", tfm->crt_flags); @@ -1349,7 +1349,7 @@ crypto_cipher_set_iv(tfm, des_tv[i].iv, crypto_tfm_alg_ivsize(tfm)); - ret = crypto_cipher_encrypt(tfm, sg, 2); + ret = crypto_cipher_encrypt(tfm, sg, sg, 24); if (ret) { printk("des_cbc_decrypt() failed flags=%x\n", tfm->crt_flags); goto out; @@ -1398,7 +1398,7 @@ crypto_cipher_set_iv(tfm, des_tv[i].iv, crypto_tfm_alg_blocksize(tfm)); - ret = crypto_cipher_decrypt(tfm, sg, 1); + ret = crypto_cipher_decrypt(tfm, sg, sg, len); if (ret) { printk("des_cbc_decrypt() failed flags=%x\n", tfm->crt_flags); @@ -1450,7 +1450,7 @@ crypto_cipher_set_iv(tfm, des_tv[i].iv, crypto_tfm_alg_ivsize(tfm)); - ret = crypto_cipher_decrypt(tfm, sg, 2); + ret = crypto_cipher_decrypt(tfm, sg, sg, 8); if (ret) { printk("des_cbc_decrypt() failed flags=%x\n", tfm->crt_flags); goto out; @@ -1518,7 +1518,7 @@ sg[0].page = virt_to_page(p); sg[0].offset = ((long) p & ~PAGE_MASK); sg[0].length = len; - ret = crypto_cipher_encrypt(tfm, sg, 1); + ret = crypto_cipher_encrypt(tfm, sg, sg, len); if (ret) { printk("encrypt() failed flags=%x\n", tfm->crt_flags); goto out; @@ -1561,7 +1561,7 @@ sg[0].page = virt_to_page(p); sg[0].offset = ((long) p & ~PAGE_MASK); sg[0].length = len; - ret = crypto_cipher_decrypt(tfm, sg, 1); + ret = crypto_cipher_decrypt(tfm, sg, sg, len); if (ret) { printk("decrypt() failed flags=%x\n", tfm->crt_flags); goto out; @@ -1624,7 +1624,7 @@ sg[0].page = virt_to_page(p); sg[0].offset = ((long) p & ~PAGE_MASK); sg[0].length = bf_tv[i].plen; - ret = crypto_cipher_encrypt(tfm, sg, 1); + ret = crypto_cipher_encrypt(tfm, sg, sg, sg[0].length); if (ret) { printk("encrypt() failed flags=%x\n", tfm->crt_flags); goto out; @@ -1666,7 +1666,7 @@ sg[0].page = virt_to_page(p); sg[0].offset = ((long) p & ~PAGE_MASK); sg[0].length = bf_tv[i].plen; - ret = crypto_cipher_decrypt(tfm, sg, 1); + ret = crypto_cipher_decrypt(tfm, sg, sg, sg[0].length); if (ret) { printk("decrypt() failed flags=%x\n", tfm->crt_flags); goto out; @@ -1719,7 +1719,7 @@ crypto_cipher_set_iv(tfm, bf_tv[i].iv, crypto_tfm_alg_ivsize(tfm)); - ret = crypto_cipher_encrypt(tfm, sg, 1); + ret = crypto_cipher_encrypt(tfm, sg, sg, sg[0].length); if (ret) { printk("blowfish_cbc_encrypt() failed flags=%x\n", tfm->crt_flags); @@ -1764,7 +1764,7 @@ crypto_cipher_set_iv(tfm, bf_tv[i].iv, crypto_tfm_alg_ivsize(tfm)); - ret = crypto_cipher_decrypt(tfm, sg, 1); + ret = crypto_cipher_decrypt(tfm, sg, sg, sg[0].length); if (ret) { printk("blowfish_cbc_decrypt() failed flags=%x\n", tfm->crt_flags); @@ -1829,7 +1829,7 @@ sg[0].page = virt_to_page(p); sg[0].offset = ((long) p & ~PAGE_MASK); sg[0].length = tf_tv[i].plen; - ret = crypto_cipher_encrypt(tfm, sg, 1); + ret = crypto_cipher_encrypt(tfm, sg, sg, sg[0].length); if (ret) { printk("encrypt() failed flags=%x\n", tfm->crt_flags); goto out; @@ -1871,7 +1871,7 @@ sg[0].page = virt_to_page(p); sg[0].offset = ((long) p & ~PAGE_MASK); sg[0].length = tf_tv[i].plen; - ret = crypto_cipher_decrypt(tfm, sg, 1); + ret = crypto_cipher_decrypt(tfm, sg, sg, sg[0].length); if (ret) { printk("decrypt() failed flags=%x\n", tfm->crt_flags); goto out; @@ -1924,7 +1924,7 @@ crypto_cipher_set_iv(tfm, tf_tv[i].iv, crypto_tfm_alg_ivsize(tfm)); - ret = crypto_cipher_encrypt(tfm, sg, 1); + ret = crypto_cipher_encrypt(tfm, sg, sg, sg[0].length); if (ret) { printk("blowfish_cbc_encrypt() failed flags=%x\n", tfm->crt_flags); @@ -1970,7 +1970,7 @@ crypto_cipher_set_iv(tfm, tf_tv[i].iv, crypto_tfm_alg_ivsize(tfm)); - ret = crypto_cipher_decrypt(tfm, sg, 1); + ret = crypto_cipher_decrypt(tfm, sg, sg, sg[0].length); if (ret) { printk("blowfish_cbc_decrypt() failed flags=%x\n", tfm->crt_flags); @@ -2030,7 +2030,7 @@ sg[0].page = virt_to_page(p); sg[0].offset = ((long) p & ~PAGE_MASK); sg[0].length = sizeof(serp_tv[i].plaintext); - ret = crypto_cipher_encrypt(tfm, sg, 1); + ret = crypto_cipher_encrypt(tfm, sg, sg, sg[0].length); if (ret) { printk("encrypt() failed flags=%x\n", tfm->crt_flags); goto out; @@ -2070,7 +2070,7 @@ sg[0].page = virt_to_page(p); sg[0].offset = ((long) p & ~PAGE_MASK); sg[0].length = sizeof(serp_tv[i].plaintext); - ret = crypto_cipher_decrypt(tfm, sg, 1); + ret = crypto_cipher_decrypt(tfm, sg, sg, sg[0].length); if (ret) { printk("decrypt() failed flags=%x\n", tfm->crt_flags); goto out; @@ -2133,7 +2133,7 @@ sg[0].page = virt_to_page(p); sg[0].offset = ((long) p & ~PAGE_MASK); sg[0].length = aes_tv[i].plen; - ret = crypto_cipher_encrypt(tfm, sg, 1); + ret = crypto_cipher_encrypt(tfm, sg, sg, sg[0].length); if (ret) { printk("encrypt() failed flags=%x\n", tfm->crt_flags); goto out; @@ -2175,7 +2175,7 @@ sg[0].page = virt_to_page(p); sg[0].offset = ((long) p & ~PAGE_MASK); sg[0].length = aes_tv[i].plen; - ret = crypto_cipher_decrypt(tfm, sg, 1); + ret = crypto_cipher_decrypt(tfm, sg, sg, sg[0].length); if (ret) { printk("decrypt() failed flags=%x\n", tfm->crt_flags); goto out; diff -Nru a/drivers/acorn/char/pcf8583.c b/drivers/acorn/char/pcf8583.c --- a/drivers/acorn/char/pcf8583.c Sun Feb 9 21:13:36 2003 +++ b/drivers/acorn/char/pcf8583.c Sun Feb 9 21:13:36 2003 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "pcf8583.h" diff -Nru a/drivers/acorn/scsi/Makefile b/drivers/acorn/scsi/Makefile --- a/drivers/acorn/scsi/Makefile Sun Feb 9 21:13:28 2003 +++ b/drivers/acorn/scsi/Makefile Sun Feb 9 21:13:28 2003 @@ -2,7 +2,6 @@ # Makefile for drivers/acorn/scsi # -export-objs := fas216.o queue.o msgqueue.o acornscsi_mod-objs := acornscsi.o acornscsi-io.o obj-$(CONFIG_SCSI_ACORNSCSI_3) += acornscsi_mod.o queue.o msgqueue.o diff -Nru a/drivers/acorn/scsi/acornscsi.c b/drivers/acorn/scsi/acornscsi.c --- a/drivers/acorn/scsi/acornscsi.c Sun Feb 9 21:13:32 2003 +++ b/drivers/acorn/scsi/acornscsi.c Sun Feb 9 21:13:32 2003 @@ -3110,7 +3110,8 @@ .remove = __devexit_p(acornscsi_remove), .id_table = acornscsi_cids, .drv = { - .name = "acornscsi", + .devclass = &shost_devclass, + .name = "acornscsi", }, }; diff -Nru a/drivers/acorn/scsi/arxescsi.c b/drivers/acorn/scsi/arxescsi.c --- a/drivers/acorn/scsi/arxescsi.c Sun Feb 9 21:13:32 2003 +++ b/drivers/acorn/scsi/arxescsi.c Sun Feb 9 21:13:32 2003 @@ -40,33 +40,18 @@ #include "fas216.h" struct arxescsi_info { - FAS216_Info info; - - /* other info... */ - unsigned int cstatus; /* card status register */ - unsigned int dmaarea; /* Pseudo DMA area */ + FAS216_Info info; + struct expansion_card *ec; }; -#define CSTATUS_IRQ (1 << 0) -#define CSTATUS_DRQ (1 << 0) +#define DMADATA_OFFSET (0x200) -#ifndef CAN_QUEUE -#define CAN_QUEUE 1 -#endif - -#ifndef CMD_PER_LUN -#define CMD_PER_LUN 1 -#endif +#define DMASTAT_OFFSET (0x600) +#define DMASTAT_DRQ (1 << 0) -/* Hmm - this should go somewhere else */ -#define BUS_ADDR(x) ((((unsigned long)(x)) << 2) + IO_BASE) +#define CSTATUS_IRQ (1 << 0) -/* - * Version - */ -#define VER_MAJOR 0 -#define VER_MINOR 1 -#define VER_PATCH 1 +#define VERSION "1.10 (23/01/2003 2.5.57)" /* * Function: int arxescsi_dma_setup(host, SCpnt, direction, min_type) @@ -87,44 +72,7 @@ return fasdma_pseudo; } - - -/* Faster transfer routines, written by SH to speed up the loops */ - -static inline unsigned char getb(unsigned int address, unsigned int reg) -{ - unsigned char value; - - __asm__ __volatile__( - "ldrb %0, [%1, %2, lsl #5]" - : "=r" (value) - : "r" (address), "r" (reg) ); - return value; -} - -static inline unsigned int getw(unsigned int address, unsigned int reg) -{ - unsigned int value; - - __asm__ __volatile__( - "ldr %0, [%1, %2, lsl #5]\n\t" - "mov %0, %0, lsl #16\n\t" - "mov %0, %0, lsr #16" - : "=r" (value) - : "r" (address), "r" (reg) ); - return value; -} - -static inline void putw(unsigned int address, unsigned int reg, unsigned long value) -{ - __asm__ __volatile__( - "mov %0, %0, lsl #16\n\t" - "str %0, [%1, %2, lsl #5]" - : - : "r" (value), "r" (address), "r" (reg) ); -} - -void arxescsi_pseudo_dma_write(unsigned char *addr, unsigned int io) +static void arxescsi_pseudo_dma_write(unsigned char *addr, unsigned char *base) { __asm__ __volatile__( " stmdb sp!, {r0-r12}\n" @@ -149,7 +97,7 @@ " bne .loop_1\n" " ldmia sp!, {r0-r12}\n" : - : "r" (addr), "r" (io) ); + : "r" (addr), "r" (base)); } /* @@ -160,40 +108,41 @@ * direction - DMA on to/off of card * transfer - minimum number of bytes we expect to transfer */ -void arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, - fasdmadir_t direction, int transfer) +static void +arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, + fasdmadir_t direction, int transfer) { struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata; - unsigned int length, io, error=0; + unsigned int length, error = 0; + unsigned char *base = info->info.scsi.io_base; unsigned char *addr; length = SCp->this_residual; addr = SCp->ptr; - io = __ioaddr(host->io_port); if (direction == DMA_OUT) { unsigned int word; while (length > 256) { - if (getb(io, 4) & STAT_INT) { - error=1; + if (readb(base + 0x80) & STAT_INT) { + error = 1; break; } - arxescsi_pseudo_dma_write(addr, io); + arxescsi_pseudo_dma_write(addr, base); addr += 256; length -= 256; } if (!error) while (length > 0) { - if (getb(io, 4) & STAT_INT) + if (readb(base + 0x80) & STAT_INT) break; - if (!(getb(io, 48) & CSTATUS_IRQ)) + if (!(readb(base + DMASTAT_OFFSET) & DMASTAT_DRQ)) continue; word = *addr | *(addr + 1) << 8; - putw(io, 16, word); + writew(word, base + DMADATA_OFFSET); if (length > 1) { addr += 2; length -= 2; @@ -206,15 +155,15 @@ else { if (transfer && (transfer & 255)) { while (length >= 256) { - if (getb(io, 4) & STAT_INT) { - error=1; + if (readb(base + 0x80) & STAT_INT) { + error = 1; break; } - if (!(getb(io, 48) & CSTATUS_IRQ)) + if (!(readb(base + DMASTAT_OFFSET) & DMASTAT_DRQ)) continue; - insw(info->dmaarea, addr, 256 >> 1); + readsw(base + DMADATA_OFFSET, addr, 256 >> 1); addr += 256; length -= 256; } @@ -224,13 +173,13 @@ while (length > 0) { unsigned long word; - if (getb(io, 4) & STAT_INT) + if (readb(base + 0x80) & STAT_INT) break; - if (!(getb(io, 48) & CSTATUS_IRQ)) + if (!(readb(base + DMASTAT_OFFSET) & DMASTAT_DRQ)) continue; - word = getw(io, 16); + word = readw(base + DMADATA_OFFSET); *addr++ = word; if (--length > 0) { *addr++ = word >> 8; @@ -259,15 +208,14 @@ * Params : host - driver host structure to return info for. * Returns : pointer to a static buffer containing null terminated string. */ -const char *arxescsi_info(struct Scsi_Host *host) +static const char *arxescsi_info(struct Scsi_Host *host) { struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata; - static char string[100], *p; + static char string[150]; - p = string; - p += sprintf(p, "%s ", host->hostt->name); - p += fas216_info(&info->info, p); - p += sprintf(p, "v%d.%d.%d", VER_MAJOR, VER_MINOR, VER_PATCH); + sprintf(string, "%s (%s) in slot %d v%s", + host->hostt->name, info->info.scsi.type, info->ec->slot_no, + VERSION); return string; } @@ -286,8 +234,9 @@ * inout - 0 for reading, 1 for writing. * Returns : length of data written to buffer. */ -int arxescsi_proc_info(char *buffer, char **start, off_t offset, - int length, int host_no, int inout) +static int +arxescsi_proc_info(char *buffer, char **start, off_t offset, int length, + int host_no, int inout) { int pos, begin; struct Scsi_Host *host; @@ -303,9 +252,7 @@ return -EINVAL; begin = 0; - pos = sprintf(buffer, - "ARXE 16-bit SCSI driver version %d.%d.%d\n", - VER_MAJOR, VER_MINOR, VER_PATCH); + pos = sprintf(buffer, "ARXE 16-bit SCSI driver v%s\n", VERSION); pos += fas216_print_host(&info->info, buffer + pos); pos += fas216_print_stats(&info->info, buffer + pos); @@ -343,7 +290,7 @@ .can_queue = 0, .this_id = 7, .sg_tablesize = SG_ALL, - .cmd_per_lun = CMD_PER_LUN, + .cmd_per_lun = 1, .use_clustering = DISABLE_CLUSTERING, .proc_name = "arxescsi", }; @@ -352,21 +299,41 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id) { struct Scsi_Host *host; - struct arxescsi_info *info; - int ret = -ENOMEM; + struct arxescsi_info *info; + unsigned long resbase, reslen; + unsigned char *base; + int ret; - host = scsi_register(&arxescsi_template, sizeof(struct arxescsi_info)); - if (!host) + resbase = ecard_resource_start(ec, ECARD_RES_MEMC); + reslen = ecard_resource_len(ec, ECARD_RES_MEMC); + + if (!request_mem_region(resbase, reslen, "arxescsi")) { + ret = -EBUSY; goto out; + } - host->io_port = ecard_address(ec, ECARD_MEMC, 0) + 0x0800; + base = ioremap(resbase, reslen); + if (!base) { + ret = -ENOMEM; + goto out_region; + } + + host = scsi_register(&arxescsi_template, sizeof(struct arxescsi_info)); + if (!host) { + ret = -ENOMEM; + goto out_unmap; + } + + host->base = (unsigned long)base; host->irq = NO_IRQ; host->dma_channel = NO_DMA; info = (struct arxescsi_info *)host->hostdata; - info->info.scsi.io_port = host->io_port; + info->ec = ec; + + info->info.scsi.io_base = base + 0x2000; info->info.scsi.irq = host->irq; - info->info.scsi.io_shift = 3; + info->info.scsi.io_shift = 5; info->info.ifcfg.clockrate = 24; /* MHz */ info->info.ifcfg.select_timeout = 255; info->info.ifcfg.asyncperiod = 200; /* ns */ @@ -374,39 +341,29 @@ info->info.ifcfg.cntl3 = CNTL3_FASTSCSI | CNTL3_FASTCLK; info->info.ifcfg.disconnect_ok = 0; info->info.ifcfg.wide_max_size = 0; + info->info.ifcfg.capabilities = FASCAP_PSEUDODMA; info->info.dma.setup = arxescsi_dma_setup; info->info.dma.pseudo = arxescsi_dma_pseudo; info->info.dma.stop = arxescsi_dma_stop; - info->dmaarea = host->io_port + 128; - info->cstatus = host->io_port + 384; - ec->irqaddr = (unsigned char *)BUS_ADDR(host->io_port); + ec->irqaddr = base; ec->irqmask = CSTATUS_IRQ; - if (!request_region(host->io_port, 120, "arxescsi-fas")) { - ret = -EBUSY; - goto out_free; - } - - if (!request_region(host->io_port + 128, 384, "arxescsi-dma")) { - ret = -EBUSY; - goto out_release; - } - - printk("scsi%d: Has no interrupts - using polling mode\n", - host->host_no); + ret = fas216_init(host); + if (ret) + goto out_unregister; - fas216_init(host); - - ret = scsi_add_host(host, &ec->dev); + ret = fas216_add(host, &ec->dev); if (ret == 0) goto out; - release_region(host->io_port + 128, 384); - out_release: - release_region(host->io_port, 120); - out_free: + fas216_release(host); + out_unregister: scsi_unregister(host); + out_unmap: + iounmap(base); + out_region: + release_mem_region(resbase, reslen); out: return ret; } @@ -414,13 +371,19 @@ static void __devexit arxescsi_remove(struct expansion_card *ec) { struct Scsi_Host *host = ecard_get_drvdata(ec); + unsigned long resbase, reslen; ecard_set_drvdata(ec, NULL); - scsi_remove_host(host); - fas216_release(host); + fas216_remove(host); + + iounmap((void *)host->base); + + resbase = ecard_resource_start(ec, ECARD_RES_MEMC); + reslen = ecard_resource_len(ec, ECARD_RES_MEMC); - release_region(host->io_port + 128, 384); - release_region(host->io_port, 120); + release_mem_region(resbase, reslen); + + fas216_release(host); scsi_unregister(host); } @@ -434,7 +397,8 @@ .remove = __devexit_p(arxescsi_remove), .id_table = arxescsi_cids, .drv = { - .name = "arxescsi", + .devclass = &shost_devclass, + .name = "arxescsi", }, }; diff -Nru a/drivers/acorn/scsi/cumana_1.c b/drivers/acorn/scsi/cumana_1.c --- a/drivers/acorn/scsi/cumana_1.c Sun Feb 9 21:13:29 2003 +++ b/drivers/acorn/scsi/cumana_1.c Sun Feb 9 21:13:29 2003 @@ -334,7 +334,8 @@ .remove = __devexit_p(cumanascsi1_remove), .id_table = cumanascsi1_cids, .drv = { - .name = "cumanascsi1", + .devclass = &shost_devclass, + .name = "cumanascsi1", }, }; diff -Nru a/drivers/acorn/scsi/cumana_2.c b/drivers/acorn/scsi/cumana_2.c --- a/drivers/acorn/scsi/cumana_2.c Sun Feb 9 21:13:34 2003 +++ b/drivers/acorn/scsi/cumana_2.c Sun Feb 9 21:13:34 2003 @@ -41,12 +41,12 @@ #include -#define CUMANASCSI2_STATUS (0) +#define CUMANASCSI2_STATUS (0x0000) #define STATUS_INT (1 << 0) #define STATUS_DRQ (1 << 1) #define STATUS_LATCHED (1 << 3) -#define CUMANASCSI2_ALATCH (5) +#define CUMANASCSI2_ALATCH (0x0014) #define ALATCH_ENA_INT (3) #define ALATCH_DIS_INT (2) #define ALATCH_ENA_TERM (5) @@ -58,11 +58,10 @@ #define ALATCH_DMA_OUT (15) #define ALATCH_DMA_IN (14) -#define CUMANASCSI2_PSEUDODMA (0x80) +#define CUMANASCSI2_PSEUDODMA (0x0200) -#define CUMANASCSI2_FAS216_OFFSET (0xc0) -#define CUMANASCSI2_FAS216_SHIFT 0 -#define CUMANASCSI2_FAS216_SIZE (16) +#define CUMANASCSI2_FAS216_OFFSET (0x0300) +#define CUMANASCSI2_FAS216_SHIFT 2 /* * Version @@ -77,13 +76,14 @@ #define NR_SG 256 struct cumanascsi2_info { - FAS216_Info info; + FAS216_Info info; + struct expansion_card *ec; - unsigned int status; /* card status register */ - unsigned int alatch; /* Control register */ - unsigned int terms; /* Terminator state */ - unsigned int dmaarea; /* Pseudo DMA area */ - struct scatterlist sg[NR_SG]; /* Scatter DMA list */ + void *status; /* card status register */ + void *alatch; /* Control register */ + unsigned int terms; /* Terminator state */ + void *dmaarea; /* Pseudo DMA area */ + struct scatterlist sg[NR_SG]; /* Scatter DMA list */ }; #define CSTATUS_IRQ (1 << 0) @@ -97,8 +97,7 @@ static void cumanascsi_2_irqenable(struct expansion_card *ec, int irqnr) { - unsigned int port = (unsigned int)ec->irq_data; - outb(ALATCH_ENA_INT, port); + writeb(ALATCH_ENA_INT, ec->irq_data); } /* Prototype: void cumanascsi_2_irqdisable(ec, irqnr) @@ -109,8 +108,7 @@ static void cumanascsi_2_irqdisable(struct expansion_card *ec, int irqnr) { - unsigned int port = (unsigned int)ec->irq_data; - outb(ALATCH_DIS_INT, port); + writeb(ALATCH_DIS_INT, ec->irq_data); } static const expansioncard_ops_t cumanascsi_2_ops = { @@ -130,10 +128,10 @@ if (on_off) { info->terms = 1; - outb (ALATCH_ENA_TERM, info->alatch); + writeb(ALATCH_ENA_TERM, info->alatch); } else { info->terms = 0; - outb (ALATCH_DIS_TERM, info->alatch); + writeb(ALATCH_DIS_TERM, info->alatch); } } @@ -146,9 +144,9 @@ static void cumanascsi_2_intr(int irq, void *dev_id, struct pt_regs *regs) { - struct Scsi_Host *host = (struct Scsi_Host *)dev_id; + struct cumanascsi2_info *info = dev_id; - fas216_intr(host); + fas216_intr(&info->info); } /* Prototype: fasdmatype_t cumanascsi_2_dma_setup(host, SCpnt, direction, min_type) @@ -167,7 +165,7 @@ struct device *dev = scsi_get_device(host); int dmach = host->dma_channel; - outb(ALATCH_DIS_DMA, info->alatch); + writeb(ALATCH_DIS_DMA, info->alatch); if (dmach != NO_DMA && (min_type == fasdma_real_all || SCp->this_residual >= 512)) { @@ -188,11 +186,11 @@ disable_dma(dmach); set_dma_sg(dmach, info->sg, bufs + 1); - outb(alatch_dir, info->alatch); + writeb(alatch_dir, info->alatch); set_dma_mode(dmach, dma_dir); enable_dma(dmach); - outb(ALATCH_ENA_DMA, info->alatch); - outb(ALATCH_DIS_BIT32, info->alatch); + writeb(ALATCH_ENA_DMA, info->alatch); + writeb(ALATCH_DIS_BIT32, info->alatch); return fasdma_real_all; } @@ -226,7 +224,7 @@ #if 0 while (length > 1) { unsigned long word; - unsigned int status = inb(info->status); + unsigned int status = readb(info->status); if (status & STATUS_INT) goto end; @@ -235,7 +233,7 @@ continue; word = *addr | *(addr + 1) << 8; - outw (info->dmaarea); + writew(word, info->dmaarea); addr += 2; length -= 2; } @@ -245,15 +243,15 @@ else { if (transfer && (transfer & 255)) { while (length >= 256) { - unsigned int status = inb(info->status); + unsigned int status = readb(info->status); if (status & STATUS_INT) - goto end; + return; if (!(status & STATUS_DRQ)) continue; - insw(info->dmaarea, addr, 256 >> 1); + readsw(info->dmaarea, addr, 256 >> 1); addr += 256; length -= 256; } @@ -261,15 +259,15 @@ while (length > 0) { unsigned long word; - unsigned int status = inb(info->status); + unsigned int status = readb(info->status); if (status & STATUS_INT) - goto end; + return; if (!(status & STATUS_DRQ)) continue; - word = inw (info->dmaarea); + word = readw(info->dmaarea); *addr++ = word; if (--length > 0) { *addr++ = word >> 8; @@ -277,8 +275,6 @@ } } } - -end: } /* Prototype: int cumanascsi_2_dma_stop(host, SCpnt) @@ -291,7 +287,7 @@ { struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata; if (host->dma_channel != NO_DMA) { - outb(ALATCH_DIS_DMA, info->alatch); + writeb(ALATCH_DIS_DMA, info->alatch); disable_dma(host->dma_channel); } } @@ -304,13 +300,11 @@ const char *cumanascsi_2_info(struct Scsi_Host *host) { struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata; - static char string[100], *p; + static char string[150]; - p = string; - p += sprintf(p, "%s ", host->hostt->name); - p += fas216_info(&info->info, p); - p += sprintf(p, "v%s terminators o%s", - VERSION, info->terms ? "n" : "ff"); + sprintf(string, "%s (%s) in slot %d v%s terminators o%s", + host->hostt->name, info->info.scsi.type, info->ec->slot_no, + VERSION, info->terms ? "n" : "ff"); return string; } @@ -377,10 +371,7 @@ info = (struct cumanascsi2_info *)host->hostdata; begin = 0; - pos = sprintf(buffer, - "Cumana SCSI II driver version v%s\n", - VERSION); - + pos = sprintf(buffer, "Cumana SCSI II driver v%s\n", VERSION); pos += fas216_print_host(&info->info, buffer + pos); pos += sprintf(buffer + pos, "Term : o%s\n", info->terms ? "n" : "ff"); @@ -440,38 +431,52 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id) { struct Scsi_Host *host; - struct cumanascsi2_info *info; - int ret = -ENOMEM; + struct cumanascsi2_info *info; + unsigned long resbase, reslen; + unsigned char *base; + int ret; - host = scsi_register(&cumanascsi2_template, sizeof (struct cumanascsi2_info)); - if (!host) + resbase = ecard_resource_start(ec, ECARD_RES_MEMC); + reslen = ecard_resource_len(ec, ECARD_RES_MEMC); + + if (!request_mem_region(resbase, reslen, "cumanascsi2")) { + ret = -EBUSY; goto out; + } - host->io_port = ecard_address(ec, ECARD_MEMC, 0); - host->irq = ec->irq; - host->dma_channel = ec->dma; + base = ioremap(resbase, reslen); + if (!base) { + ret = -ENOMEM; + goto out_region; + } - if (!request_region(host->io_port + CUMANASCSI2_FAS216_OFFSET, - CUMANASCSI2_FAS216_SIZE, "cumanascsi2-fas")) { - ret = -EBUSY; - goto out_free; + host = scsi_register(&cumanascsi2_template, + sizeof(struct cumanascsi2_info)); + if (!host) { + ret = -ENOMEM; + goto out_unmap; } + host->base = (unsigned long)base; + host->irq = ec->irq; + host->dma_channel = ec->dma; + ecard_set_drvdata(ec, host); info = (struct cumanascsi2_info *)host->hostdata; - info->dmaarea = host->io_port + CUMANASCSI2_PSEUDODMA; - info->status = host->io_port + CUMANASCSI2_STATUS; - info->alatch = host->io_port + CUMANASCSI2_ALATCH; + info->ec = ec; + info->dmaarea = base + CUMANASCSI2_PSEUDODMA; + info->status = base + CUMANASCSI2_STATUS; + info->alatch = base + CUMANASCSI2_ALATCH; - ec->irqaddr = (unsigned char *)ioaddr(info->status); + ec->irqaddr = info->status; ec->irqmask = STATUS_INT; - ec->irq_data = (void *)info->alatch; - ec->ops = (expansioncard_ops_t *)&cumanascsi_2_ops; + ec->irq_data = base + CUMANASCSI2_ALATCH; + ec->ops = &cumanascsi_2_ops; cumanascsi_2_terminator_ctl(host, term[ec->slot_no]); - info->info.scsi.io_port = host->io_port + CUMANASCSI2_FAS216_OFFSET; + info->info.scsi.io_base = base + CUMANASCSI2_FAS216_OFFSET; info->info.scsi.io_shift = CUMANASCSI2_FAS216_SHIFT; info->info.scsi.irq = host->irq; info->info.ifcfg.clockrate = 40; /* MHz */ @@ -481,16 +486,21 @@ info->info.ifcfg.cntl3 = CNTL3_BS8 | CNTL3_FASTSCSI | CNTL3_FASTCLK; info->info.ifcfg.disconnect_ok = 1; info->info.ifcfg.wide_max_size = 0; + info->info.ifcfg.capabilities = FASCAP_PSEUDODMA; info->info.dma.setup = cumanascsi_2_dma_setup; info->info.dma.pseudo = cumanascsi_2_dma_pseudo; info->info.dma.stop = cumanascsi_2_dma_stop; + ret = fas216_init(host); + if (ret) + goto out_free; + ret = request_irq(host->irq, cumanascsi_2_intr, - SA_INTERRUPT, "cumanascsi2", host); + SA_INTERRUPT, "cumanascsi2", info); if (ret) { printk("scsi%d: IRQ%d not free: %d\n", host->host_no, host->irq, ret); - goto out_region; + goto out_release; } if (host->dma_channel != NO_DMA) { @@ -500,26 +510,30 @@ host->dma_channel = NO_DMA; } else { set_dma_speed(host->dma_channel, 180); + info->info.ifcfg.capabilities |= FASCAP_DMA; } } - fas216_init(host); - - ret = scsi_add_host(host, &ec->dev); + ret = fas216_add(host, &ec->dev); if (ret == 0) goto out; - fas216_release(host); - if (host->dma_channel != NO_DMA) free_dma(host->dma_channel); free_irq(host->irq, host); - out_region: - release_region(host->io_port + CUMANASCSI2_FAS216_OFFSET, - CUMANASCSI2_FAS216_SIZE); + + out_release: + fas216_release(host); + out_free: scsi_unregister(host); + out_unmap: + iounmap(base); + + out_region: + release_mem_region(resbase, reslen); + out: return ret; } @@ -527,17 +541,24 @@ static void __devexit cumanascsi2_remove(struct expansion_card *ec) { struct Scsi_Host *host = ecard_get_drvdata(ec); + struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata; + unsigned long resbase, reslen; ecard_set_drvdata(ec, NULL); - scsi_remove_host(host); - fas216_release(host); + fas216_remove(host); if (host->dma_channel != NO_DMA) free_dma(host->dma_channel); - free_irq(host->irq, host); - release_region(host->io_port + CUMANASCSI2_FAS216_OFFSET, - CUMANASCSI2_FAS216_SIZE); + free_irq(host->irq, info); + iounmap((void *)host->base); + + resbase = ecard_resource_start(ec, ECARD_RES_MEMC); + reslen = ecard_resource_len(ec, ECARD_RES_MEMC); + + release_mem_region(resbase, reslen); + + fas216_release(host); scsi_unregister(host); } @@ -551,7 +572,8 @@ .remove = __devexit_p(cumanascsi2_remove), .id_table = cumanascsi2_cids, .drv = { - .name = "cumanascsi2", + .devclass = &shost_devclass, + .name = "cumanascsi2", }, }; diff -Nru a/drivers/acorn/scsi/eesox.c b/drivers/acorn/scsi/eesox.c --- a/drivers/acorn/scsi/eesox.c Sun Feb 9 21:13:37 2003 +++ b/drivers/acorn/scsi/eesox.c Sun Feb 9 21:13:37 2003 @@ -1,7 +1,7 @@ /* * linux/drivers/acorn/scsi/eesox.c * - * Copyright (C) 1997-2002 Russell King + * Copyright (C) 1997-2003 Russell King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -47,25 +47,21 @@ #include -#define EESOX_FAS216_OFFSET 0xc00 -#define EESOX_FAS216_SHIFT 3 -#define EESOX_FAS216_SIZE (16 << EESOX_FAS216_SHIFT) +#define EESOX_FAS216_OFFSET 0x3000 +#define EESOX_FAS216_SHIFT 5 -#define EESOX_STATUS 0xa00 +#define EESOX_DMASTAT 0x2800 #define EESOX_STAT_INTR 0x01 #define EESOX_STAT_DMA 0x02 -#define EESOX_CONTROL 0xa00 +#define EESOX_CONTROL 0x2800 #define EESOX_INTR_ENABLE 0x04 #define EESOX_TERM_ENABLE 0x02 #define EESOX_RESET 0x01 -#define EESOX_DMA_OFFSET 0xe00 +#define EESOX_DMADATA 0x3800 -/* - * Version - */ -#define VERSION "1.00 (13/11/2002 2.5.47)" +#define VERSION "1.10 (17/01/2003 2.5.59)" /* * Use term=0,1,0,0,0 to turn terminators on/off @@ -75,12 +71,12 @@ #define NR_SG 256 struct eesoxscsi_info { - FAS216_Info info; + FAS216_Info info; + struct expansion_card *ec; - unsigned int ctl_port; - unsigned int control; - unsigned int dmaarea; /* Pseudo DMA area */ - struct scatterlist sg[NR_SG]; /* Scatter DMA list */ + void *ctl_port; + unsigned int control; + struct scatterlist sg[NR_SG]; /* Scatter DMA list */ }; /* Prototype: void eesoxscsi_irqenable(ec, irqnr) @@ -95,7 +91,7 @@ info->control |= EESOX_INTR_ENABLE; - outb(info->control, info->ctl_port); + writeb(info->control, info->ctl_port); } /* Prototype: void eesoxscsi_irqdisable(ec, irqnr) @@ -110,7 +106,7 @@ info->control &= ~EESOX_INTR_ENABLE; - outb(info->control, info->ctl_port); + writeb(info->control, info->ctl_port); } static const expansioncard_ops_t eesoxscsi_ops = { @@ -135,7 +131,7 @@ else info->control &= ~EESOX_TERM_ENABLE; - outb(info->control, info->ctl_port); + writeb(info->control, info->ctl_port); spin_unlock_irqrestore(host->host_lock, flags); } @@ -148,9 +144,9 @@ static void eesoxscsi_intr(int irq, void *dev_id, struct pt_regs *regs) { - struct Scsi_Host *host = (struct Scsi_Host *)dev_id; + struct eesoxscsi_info *info = dev_id; - fas216_intr(host); + fas216_intr(&info->info); } /* Prototype: fasdmatype_t eesoxscsi_dma_setup(host, SCpnt, direction, min_type) @@ -198,93 +194,164 @@ return fasdma_pseudo; } +static void eesoxscsi_buffer_in(void *buf, int length, void *base) +{ + const void *reg_fas = base + EESOX_FAS216_OFFSET; + const void *reg_dmastat = base + EESOX_DMASTAT; + const void *reg_dmadata = base + EESOX_DMADATA; + const register unsigned long mask = 0xffff; + + do { + unsigned int status; + + /* + * Interrupt request? + */ + status = readb(reg_fas + (REG_STAT << EESOX_FAS216_SHIFT)); + if (status & STAT_INT) + break; + + /* + * DMA request active? + */ + status = readb(reg_dmastat); + if (!(status & EESOX_STAT_DMA)) + continue; + + /* + * Get number of bytes in FIFO + */ + status = readb(reg_fas + (REG_CFIS << EESOX_FAS216_SHIFT)) & CFIS_CF; + if (status > 16) + status = 16; + if (status > length) + status = length; + + /* + * Align buffer. + */ + if (((u32)buf) & 2 && status >= 2) { + *((u16 *)buf)++ = readl(reg_dmadata); + status -= 2; + length -= 2; + } + + if (status >= 8) { + unsigned long l1, l2; + + l1 = readl(reg_dmadata) & mask; + l1 |= readl(reg_dmadata) << 16; + l2 = readl(reg_dmadata) & mask; + l2 |= readl(reg_dmadata) << 16; + *((u32 *)buf)++ = l1; + *((u32 *)buf)++ = l2; + length -= 8; + continue; + } + + if (status >= 4) { + unsigned long l1; + + l1 = readl(reg_dmadata) & mask; + l1 |= readl(reg_dmadata) << 16; + + *((u32 *)buf)++ = l1; + length -= 4; + continue; + } + + if (status >= 2) { + *((u16 *)buf)++ = readl(reg_dmadata); + length -= 2; + } + } while (length); +} + +static void eesoxscsi_buffer_out(void *buf, int length, void *base) +{ + const void *reg_fas = base + EESOX_FAS216_OFFSET; + const void *reg_dmastat = base + EESOX_DMASTAT; + const void *reg_dmadata = base + EESOX_DMADATA; + + do { + unsigned int status; + + /* + * Interrupt request? + */ + status = readb(reg_fas + (REG_STAT << EESOX_FAS216_SHIFT)); + if (status & STAT_INT) + break; + + /* + * DMA request active? + */ + status = readb(reg_dmastat); + if (!(status & EESOX_STAT_DMA)) + continue; + + /* + * Get number of bytes in FIFO + */ + status = readb(reg_fas + (REG_CFIS << EESOX_FAS216_SHIFT)) & CFIS_CF; + if (status > 16) + status = 16; + status = 16 - status; + if (status > length) + status = length; + status &= ~1; + + /* + * Align buffer. + */ + if (((u32)buf) & 2 && status >= 2) { + writel(*((u16 *)buf)++ << 16, reg_dmadata); + status -= 2; + length -= 2; + } + + if (status >= 8) { + unsigned long l1, l2; + + l1 = *((u32 *)buf)++; + l2 = *((u32 *)buf)++; + + writel(l1 << 16, reg_dmadata); + writel(l1, reg_dmadata); + writel(l2 << 16, reg_dmadata); + writel(l2, reg_dmadata); + length -= 8; + continue; + } + + if (status >= 4) { + unsigned long l1; + + l1 = *((u32 *)buf)++; + + writel(l1 << 16, reg_dmadata); + writel(l1, reg_dmadata); + length -= 4; + continue; + } + + if (status >= 2) { + writel(*((u16 *)buf)++ << 16, reg_dmadata); + length -= 2; + } + } while (length); +} + static void eesoxscsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, fasdmadir_t dir, int transfer_size) { - struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; - unsigned int status; - unsigned int length = SCp->this_residual; - union { - unsigned char *c; - unsigned short *s; - unsigned long *l; - } buffer; - - buffer.c = SCp->ptr; - - status = inb(host->io_port + EESOX_STATUS); + void *base = (void *)host->base; if (dir == DMA_IN) { - while (length > 8) { - if (status & EESOX_STAT_DMA) { - unsigned long l1, l2; - - l1 = inw(info->dmaarea); - l1 |= inw(info->dmaarea) << 16; - l2 = inw(info->dmaarea); - l2 |= inw(info->dmaarea) << 16; - *buffer.l++ = l1; - *buffer.l++ = l2; - length -= 8; - } else if (status & EESOX_STAT_INTR) - goto end; - status = inb(host->io_port + EESOX_STATUS); - } - - while (length > 1) { - if (status & EESOX_STAT_DMA) { - *buffer.s++ = inw(info->dmaarea); - length -= 2; - } else if (status & EESOX_STAT_INTR) - goto end; - status = inb(host->io_port + EESOX_STATUS); - } - - while (length > 0) { - if (status & EESOX_STAT_DMA) { - *buffer.c++ = inw(info->dmaarea); - length -= 1; - } else if (status & EESOX_STAT_INTR) - goto end; - status = inb(host->io_port + EESOX_STATUS); - } + eesoxscsi_buffer_in(SCp->ptr, SCp->this_residual, base); } else { - while (length > 8) { - if (status & EESOX_STAT_DMA) { - unsigned long l1, l2; - - l1 = *buffer.l++; - l2 = *buffer.l++; - - outw(l1, info->dmaarea); - outw(l1 >> 16, info->dmaarea); - outw(l2, info->dmaarea); - outw(l2 >> 16, info->dmaarea); - length -= 8; - } else if (status & EESOX_STAT_INTR) - goto end; - status = inb(host->io_port + EESOX_STATUS); - } - - while (length > 1) { - if (status & EESOX_STAT_DMA) { - outw(*buffer.s++, info->dmaarea); - length -= 2; - } else if (status & EESOX_STAT_INTR) - goto end; - status = inb(host->io_port + EESOX_STATUS); - } - - while (length > 0) { - if (status & EESOX_STAT_DMA) { - outw(*buffer.c++, info->dmaarea); - length -= 1; - } else if (status & EESOX_STAT_INTR) - goto end; - status = inb(host->io_port + EESOX_STATUS); - } + eesoxscsi_buffer_out(SCp->ptr, SCp->this_residual, base); } -end: } /* Prototype: int eesoxscsi_dma_stop(host, SCpnt) @@ -307,14 +374,11 @@ const char *eesoxscsi_info(struct Scsi_Host *host) { struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; - static char string[100], *p; + static char string[150]; - p = string; - p += sprintf(p, "%s ", host->hostt->name); - p += fas216_info(&info->info, p); - p += sprintf(p, "v%s terminators o%s", - VERSION, - info->control & EESOX_TERM_ENABLE ? "n" : "ff"); + sprintf(string, "%s (%s) in slot %d v%s terminators o%s", + host->hostt->name, info->info.scsi.type, info->ec->slot_no, + VERSION, info->control & EESOX_TERM_ENABLE ? "n" : "ff"); return string; } @@ -381,9 +445,7 @@ info = (struct eesoxscsi_info *)host->hostdata; begin = 0; - pos = sprintf(buffer, - "EESOX SCSI driver version v%s\n", - VERSION); + pos = sprintf(buffer, "EESOX SCSI driver v%s\n", VERSION); pos += fas216_print_host(&info->info, buffer + pos); pos += sprintf(buffer + pos, "Term : o%s\n", info->control & EESOX_TERM_ENABLE ? "n" : "ff"); @@ -417,6 +479,39 @@ return pos; } +static ssize_t eesoxscsi_show_term(struct device *dev, char *buf) +{ + struct expansion_card *ec = ECARD_DEV(dev); + struct Scsi_Host *host = ecard_get_drvdata(ec); + struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; + + return sprintf(buf, "%d\n", info->control & EESOX_TERM_ENABLE ? 1 : 0); +} + +static ssize_t eesoxscsi_store_term(struct device *dev, const char *buf, size_t len) +{ + struct expansion_card *ec = ECARD_DEV(dev); + struct Scsi_Host *host = ecard_get_drvdata(ec); + struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; + unsigned long flags; + + if (len > 1) { + spin_lock_irqsave(host->host_lock, flags); + if (buf[0] != '0') { + info->control |= EESOX_TERM_ENABLE; + } else { + info->control &= ~EESOX_TERM_ENABLE; + } + writeb(info->control, info->ctl_port); + spin_unlock_irqrestore(host->host_lock, flags); + } + + return len; +} + +static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR, + eesoxscsi_show_term, eesoxscsi_store_term); + static Scsi_Host_Template eesox_template = { .module = THIS_MODULE, .proc_info = eesoxscsi_proc_info, @@ -440,57 +535,75 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id) { struct Scsi_Host *host; - struct eesoxscsi_info *info; - int ret = -ENOMEM; + struct eesoxscsi_info *info; + unsigned long resbase, reslen; + unsigned char *base; + int ret; - host = scsi_register(&eesox_template, - sizeof(struct eesoxscsi_info)); - if (!host) + resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST); + reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST); + + if (!request_mem_region(resbase, reslen, "eesoxscsi")) { + ret = -EBUSY; goto out; + } - host->io_port = ecard_address(ec, ECARD_IOC, ECARD_FAST); - host->irq = ec->irq; - host->dma_channel = ec->dma; + base = ioremap(resbase, reslen); + if (!base) { + ret = -ENOMEM; + goto out_region; + } - if (!request_region(host->io_port + EESOX_FAS216_OFFSET, - EESOX_FAS216_SIZE, "eesox2-fas")) { - ret = -EBUSY; - goto out_free; + host = scsi_register(&eesox_template, + sizeof(struct eesoxscsi_info)); + if (!host) { + ret = -ENOMEM; + goto out_unmap; } + host->base = (unsigned long)base; + host->irq = ec->irq; + host->dma_channel = ec->dma; + ecard_set_drvdata(ec, host); info = (struct eesoxscsi_info *)host->hostdata; - info->ctl_port = host->io_port + EESOX_CONTROL; - info->control = term[ec->slot_no] ? EESOX_TERM_ENABLE : 0; - outb(info->control, info->ctl_port); - - ec->irqaddr = (unsigned char *)ioaddr(host->io_port + EESOX_STATUS); - ec->irqmask = EESOX_STAT_INTR; - ec->irq_data = info; - ec->ops = (expansioncard_ops_t *)&eesoxscsi_ops; + info->ec = ec; + info->ctl_port = base + EESOX_CONTROL; + info->control = term[ec->slot_no] ? EESOX_TERM_ENABLE : 0; + writeb(info->control, info->ctl_port); + + ec->irqaddr = base + EESOX_DMASTAT; + ec->irqmask = EESOX_STAT_INTR; + ec->irq_data = info; + ec->ops = &eesoxscsi_ops; - info->info.scsi.io_port = host->io_port + EESOX_FAS216_OFFSET; + info->info.scsi.io_base = base + EESOX_FAS216_OFFSET; info->info.scsi.io_shift = EESOX_FAS216_SHIFT; info->info.scsi.irq = host->irq; info->info.ifcfg.clockrate = 40; /* MHz */ info->info.ifcfg.select_timeout = 255; info->info.ifcfg.asyncperiod = 200; /* ns */ info->info.ifcfg.sync_max_depth = 7; - info->info.ifcfg.cntl3 = CNTL3_BS8 | CNTL3_FASTSCSI | CNTL3_FASTCLK; + info->info.ifcfg.cntl3 = CNTL3_FASTSCSI | CNTL3_FASTCLK; info->info.ifcfg.disconnect_ok = 1; info->info.ifcfg.wide_max_size = 0; + info->info.ifcfg.capabilities = FASCAP_PSEUDODMA; info->info.dma.setup = eesoxscsi_dma_setup; info->info.dma.pseudo = eesoxscsi_dma_pseudo; info->info.dma.stop = eesoxscsi_dma_stop; - info->dmaarea = host->io_port + EESOX_DMA_OFFSET; - ret = request_irq(host->irq, eesoxscsi_intr, - SA_INTERRUPT, "eesox", host); + device_create_file(&ec->dev, &dev_attr_bus_term); + + ret = fas216_init(host); + if (ret) + goto out_free; + + ret = request_irq(host->irq, eesoxscsi_intr, 0, "eesoxscsi", info); if (ret) { printk("scsi%d: IRQ%d not free: %d\n", host->host_no, host->irq, ret); - goto out_region; + goto out_remove; } if (host->dma_channel != NO_DMA) { @@ -500,24 +613,32 @@ host->dma_channel = NO_DMA; } else { set_dma_speed(host->dma_channel, 180); + info->info.ifcfg.capabilities |= FASCAP_DMA; + info->info.ifcfg.cntl3 |= CNTL3_BS8; } } - fas216_init(host); - ret = scsi_add_host(host, &ec->dev); + ret = fas216_add(host, &ec->dev); if (ret == 0) goto out; - fas216_release(host); - if (host->dma_channel != NO_DMA) free_dma(host->dma_channel); free_irq(host->irq, host); - out_region: - release_region(host->io_port + EESOX_FAS216_OFFSET, - EESOX_FAS216_SIZE); + + out_remove: + fas216_remove(host); + out_free: + device_remove_file(&ec->dev, &dev_attr_bus_term); scsi_unregister(host); + + out_unmap: + iounmap(base); + + out_region: + release_mem_region(resbase, reslen); + out: return ret; } @@ -525,15 +646,26 @@ static void __devexit eesoxscsi_remove(struct expansion_card *ec) { struct Scsi_Host *host = ecard_get_drvdata(ec); + struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; + unsigned long resbase, reslen; ecard_set_drvdata(ec, NULL); - scsi_remove_host(host); - fas216_release(host); + fas216_remove(host); if (host->dma_channel != NO_DMA) free_dma(host->dma_channel); - free_irq(host->irq, host); - release_region(host->io_port + EESOX_FAS216_OFFSET, EESOX_FAS216_SIZE); + free_irq(host->irq, info); + + device_remove_file(&ec->dev, &dev_attr_bus_term); + + iounmap((void *)host->base); + + resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST); + reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST); + + release_mem_region(resbase, reslen); + + fas216_release(host); scsi_unregister(host); } @@ -547,7 +679,8 @@ .remove = __devexit_p(eesoxscsi_remove), .id_table = eesoxscsi_cids, .drv = { - .name = "eesoxscsi", + .devclass = &shost_devclass, + .name = "eesoxscsi", }, }; diff -Nru a/drivers/acorn/scsi/fas216.c b/drivers/acorn/scsi/fas216.c --- a/drivers/acorn/scsi/fas216.c Sun Feb 9 21:13:31 2003 +++ b/drivers/acorn/scsi/fas216.c Sun Feb 9 21:13:31 2003 @@ -1,7 +1,7 @@ /* * linux/drivers/acorn/scsi/fas216.c * - * Copyright (C) 1997-2000 Russell King + * Copyright (C) 1997-2003 Russell King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -10,7 +10,7 @@ * Based on information in qlogicfas.c by Tom Zerucha, Michael Griffith, and * other sources, including: * the AMD Am53CF94 data sheet - * the AMD Am53C94 data sheet + * the AMD Am53C94 data sheet * * This is a generic driver. To use it, have a look at cumana_2.c. You * should define your own structure that overlays FAS216_Info, eg: @@ -33,9 +33,6 @@ * 02-04-2000 RMK Converted to use the new error handling, and * automatically request sense data upon check * condition status from targets. - * - * Todo: - * - allow individual devices to enable sync xfers. */ #include #include @@ -45,6 +42,7 @@ #include #include #include +#include #include #include @@ -52,17 +50,11 @@ #include #include -#define FAS216_C - #include "../../scsi/scsi.h" #include "../../scsi/hosts.h" #include "fas216.h" #include "scsi.h" -#define VER_MAJOR 0 -#define VER_MINOR 0 -#define VER_PATCH 5 - /* NOTE: SCSI2 Synchronous transfers *require* DMA according to * the data sheet. This restriction is crazy, especially when * you only want to send 16 bytes! What were the guys who @@ -104,22 +96,43 @@ static int level_mask = LOG_ERROR; +static inline unsigned char fas216_readb(FAS216_Info *info, unsigned int reg) +{ + unsigned int off = reg << info->scsi.io_shift; + if (info->scsi.io_base) + return readb(info->scsi.io_base + off); + else + return inb(info->scsi.io_port + off); +} + +static inline void fas216_writeb(FAS216_Info *info, unsigned int reg, unsigned int val) +{ + unsigned int off = reg << info->scsi.io_shift; + if (info->scsi.io_base) + writeb(val, info->scsi.io_base + off); + else + outb(val, info->scsi.io_port + off); +} + static void fas216_dumpstate(FAS216_Info *info) { unsigned char is, stat, inst; - is = inb(REG_IS(info)); - stat = inb(REG_STAT(info)); - inst = inb(REG_INST(info)); + is = fas216_readb(info, REG_IS); + stat = fas216_readb(info, REG_STAT); + inst = fas216_readb(info, REG_INST); printk("FAS216: CTCL=%02X CTCM=%02X CMD=%02X STAT=%02X" " INST=%02X IS=%02X CFIS=%02X", - inb(REG_CTCL(info)), inb(REG_CTCM(info)), - inb(REG_CMD(info)), stat, inst, is, - inb(REG_CFIS(info))); + fas216_readb(info, REG_CTCL), + fas216_readb(info, REG_CTCM), + fas216_readb(info, REG_CMD), stat, inst, is, + fas216_readb(info, REG_CFIS)); printk(" CNTL1=%02X CNTL2=%02X CNTL3=%02X CTCH=%02X\n", - inb(REG_CNTL1(info)), inb(REG_CNTL2(info)), - inb(REG_CNTL3(info)), inb(REG_CTCH(info))); + fas216_readb(info, REG_CNTL1), + fas216_readb(info, REG_CNTL2), + fas216_readb(info, REG_CNTL3), + fas216_readb(info, REG_CTCH)); } static void print_SCp(Scsi_Pointer *SCp, const char *prefix, const char *suffix) @@ -236,19 +249,63 @@ return 'H'; } +static void +fas216_do_log(FAS216_Info *info, char target, char *fmt, va_list ap) +{ + static char buf[1024]; + + vsnprintf(buf, sizeof(buf), fmt, ap); + printk("scsi%d.%c: %s", info->host->host_no, target, buf); +} + +static void +fas216_log_command(FAS216_Info *info, int level, Scsi_Cmnd *SCpnt, char *fmt, ...) +{ + va_list args; + + if (level != 0 && !(level & level_mask)) + return; + + va_start(args, fmt); + fas216_do_log(info, '0' + SCpnt->target, fmt, args); + va_end(args); + + printk(" CDB: "); + print_command(SCpnt->cmnd); +} + +static void +fas216_log_target(FAS216_Info *info, int level, int target, char *fmt, ...) +{ + va_list args; + + if (level != 0 && !(level & level_mask)) + return; + + if (target < 0) + target = 'H'; + else + target += '0'; + + va_start(args, fmt); + fas216_do_log(info, target, fmt, args); + va_end(args); + + printk("\n"); +} + static void fas216_log(FAS216_Info *info, int level, char *fmt, ...) { va_list args; - static char buf[1024]; if (level != 0 && !(level & level_mask)) return; va_start(args, fmt); - vsnprintf(buf, sizeof(buf), fmt, args); + fas216_do_log(info, fas216_target(info), fmt, args); va_end(args); - printk("scsi%d.%c: %s\n", info->host->host_no, fas216_target(info), buf); + printk("\n"); } #define PH_SIZE 32 @@ -276,7 +333,7 @@ cmd_ptr = (cmd_ptr + 1) & 7; - outb(command, REG_CMD(info)); + fas216_writeb(info, REG_CMD, command); } static void print_debug_list(void) @@ -308,11 +365,11 @@ static void fas216_done(FAS216_Info *info, unsigned int result); -/** - * fast216_clockrate - calculate clock conversion factor +/** + * fas216_clockrate - calculate clock conversion factor * @clock: clock speed in MHz - * - * Calculate correct value to be written into clock conversion factor + * + * Calculate correct value to be written into clock conversion factor * register. Returns CLKF_ value. */ static int fas216_clockrate(int clock) @@ -327,11 +384,11 @@ return clock; } -/** +/** * fas216_get_last_msg - retrive last message from the list * @info: interface to search * @pos: current fifo position - * + * * Retrieve a last message from the list, using position in fifo. */ static inline unsigned short @@ -359,12 +416,12 @@ return packed_msg; } -/** +/** * fas216_syncperiod - calculate STP register value * @info: state structure for interface connected to device * @ns: period in ns (between subsequent bytes) - * - * Calculate value to be loaded into the STP register for a given period + * + * Calculate value to be loaded into the STP register for a given period * in ns. Returns a value suitable for REG_STP. */ static int fas216_syncperiod(FAS216_Info *info, int ns) @@ -381,11 +438,11 @@ return value & 31; } -/** +/** * fas216_set_sync - setup FAS216 chip for specified transfer period. - * @info: state structure for interface connected to device + * @info: state structure for interface connected to device * @target: target - * + * * Correctly setup FAS216 chip for specified transfer period. * Notes : we need to switch the chip out of FASTSCSI mode if we have * a transfer period >= 200ns - otherwise the chip will violate @@ -393,12 +450,16 @@ */ static void fas216_set_sync(FAS216_Info *info, int target) { - outb(info->device[target].sof, REG_SOF(info)); - outb(info->device[target].stp, REG_STP(info)); + unsigned int cntl3; + + fas216_writeb(info, REG_SOF, info->device[target].sof); + fas216_writeb(info, REG_STP, info->device[target].stp); + + cntl3 = info->scsi.cfg[2]; if (info->device[target].period >= (200 / 4)) - outb(info->scsi.cfg[2] & ~CNTL3_FASTSCSI, REG_CNTL3(info)); - else - outb(info->scsi.cfg[2], REG_CNTL3(info)); + cntl3 = cntl3 & ~CNTL3_FASTSCSI; + + fas216_writeb(info, REG_CNTL3, cntl3); } /* Synchronous transfer support @@ -428,8 +489,8 @@ /** * fas216_handlesync - Handle a synchronous transfer message * @info: state structure for interface - * @ms: message from target - * + * @msg: message from target + * * Handle a synchronous transfer message from the target */ static void fas216_handlesync(FAS216_Info *info, char *msg) @@ -538,11 +599,11 @@ } } -/** - * fas216_handlewide - Handle a wide transfer message +/** + * fas216_handlewide - Handle a wide transfer message * @info: state structure for interface * @msg: message from target - * + * * Handle a wide transfer message from the target */ static void fas216_handlewide(FAS216_Info *info, char *msg) @@ -637,11 +698,11 @@ } } -/** +/** * fas216_updateptrs - update data pointers after transfer suspended/paused * @info: interface's local pointer to update * @bytes_transferred: number of bytes transferred - * + * * Update data pointers after transfer suspended/paused */ static void fas216_updateptrs(FAS216_Info *info, int bytes_transferred) @@ -662,7 +723,7 @@ * next buffer. */ bytes_transferred -= SCp->this_residual; - if (!next_SCp(&info->scsi.SCp) && bytes_transferred) { + if (!next_SCp(SCp) && bytes_transferred) { printk(KERN_WARNING "scsi%d.%c: out of buffers\n", info->host->host_no, '0' + info->SCpnt->target); return; @@ -680,33 +741,67 @@ * fas216_pio - transfer data off of/on to card using programmed IO * @info: interface to transfer data to/from * @direction: direction to transfer data (DMA_OUT/DMA_IN) - * + * * Transfer data off of/on to card using programmed IO. * Notes: this is incredibly slow. */ static void fas216_pio(FAS216_Info *info, fasdmadir_t direction) { + Scsi_Pointer *SCp = &info->scsi.SCp; + fas216_checkmagic(info); if (direction == DMA_OUT) - outb(get_next_SCp_byte(&info->scsi.SCp), REG_FF(info)); + fas216_writeb(info, REG_FF, get_next_SCp_byte(SCp)); else - put_next_SCp_byte(&info->scsi.SCp, inb(REG_FF(info))); + put_next_SCp_byte(SCp, fas216_readb(info, REG_FF)); + + if (SCp->this_residual == 0) + next_SCp(SCp); +} + +static void fas216_set_stc(FAS216_Info *info, unsigned int length) +{ + fas216_writeb(info, REG_STCL, length); + fas216_writeb(info, REG_STCM, length >> 8); + fas216_writeb(info, REG_STCH, length >> 16); +} + +static unsigned int fas216_get_ctc(FAS216_Info *info) +{ + return fas216_readb(info, REG_CTCL) + + (fas216_readb(info, REG_CTCM) << 8) + + (fas216_readb(info, REG_CTCH) << 16); } +/** + * fas216_cleanuptransfer - clean up after a transfer has completed. + * @info: interface to clean up + * + * Update the data pointers according to the number of bytes transferred + * on the SCSI bus. + */ static void fas216_cleanuptransfer(FAS216_Info *info) { unsigned long total, residual, fifo; + fasdmatype_t dmatype = info->dma.transfer_type; + + info->dma.transfer_type = fasdma_none; - if (info->dma.transfer_type == fasdma_real_all) + /* + * PIO transfers do not need to be cleaned up. + */ + if (dmatype == fasdma_pio || dmatype == fasdma_none) + return; + + if (dmatype == fasdma_real_all) total = info->SCpnt->request_bufflen; else total = info->scsi.SCp.this_residual; - residual = inb(REG_CTCL(info)) + (inb(REG_CTCM(info)) << 8) + - (inb(REG_CTCH(info)) << 16); + residual = fas216_get_ctc(info); - fifo = inb(REG_CFIS(info)) & CFIS_CF; + fifo = fas216_readb(info, REG_CFIS) & CFIS_CF; fas216_log(info, LOG_BUFFER, "cleaning up from previous " "transfer: length 0x%06x, residual 0x%x, fifo %d", @@ -718,54 +813,22 @@ * host to the FIFO. This means we must include the * bytes left in the FIFO from the transfer counter. */ - if (info->scsi.phase == PHASE_DATAOUT) { + if (info->scsi.phase == PHASE_DATAOUT) residual += fifo; - fifo = 0; - } - - if (info->dma.transfer_type != fasdma_none && - info->dma.transfer_type != fasdma_pio) { - fas216_updateptrs(info, total - residual); - } - - /* - * If we were performing Data-In, then the FIFO counter - * contains the number of bytes not transferred via DMA - * from the on-board FIFO. Read them manually. - */ - if (info->scsi.phase == PHASE_DATAIN) { - while (fifo && info->scsi.SCp.ptr) { - *info->scsi.SCp.ptr = inb(REG_FF(info)); - fas216_updateptrs(info, 1); - fifo--; - } - } - info->dma.transfer_type = fasdma_none; + fas216_updateptrs(info, total - residual); } -/** - * fas216_starttransfer - Start a DMA/PIO transfer off of/on to card +/** + * fas216_transfer - Perform a DMA/PIO transfer off of/on to card * @info: interface from which device disconnected from - * @direction: transfer direction (DMA_OUT/DMA_IN) - * + * * Start a DMA/PIO transfer off of/on to card */ -static void fas216_starttransfer(FAS216_Info *info, fasdmadir_t direction) +static void fas216_transfer(FAS216_Info *info) { + fasdmadir_t direction; fasdmatype_t dmatype; - int phase = (direction == DMA_OUT) ? PHASE_DATAOUT : PHASE_DATAIN; - - fas216_checkmagic(info); - - if (phase != info->scsi.phase) { - info->scsi.phase = phase; - - if (direction == DMA_OUT) - fas216_cmd(info, CMD_FLUSHFIFO); - } else { - fas216_cleanuptransfer(info); - } fas216_log(info, LOG_BUFFER, "starttransfer: buffer %p length 0x%06x reqlen 0x%06x", @@ -781,36 +844,41 @@ } /* - * Default to PIO mode or DMA mode if we have - * a synchronous transfer agreement. + * If we have a synchronous transfer agreement in effect, we must + * use DMA mode. If we are using asynchronous transfers, we may + * use DMA mode or PIO mode. */ - if (info->device[info->SCpnt->target].sof && info->dma.setup) + if (info->device[info->SCpnt->target].sof) dmatype = fasdma_real_all; else dmatype = fasdma_pio; + if (info->scsi.phase == PHASE_DATAOUT) + direction = DMA_OUT; + else + direction = DMA_IN; + if (info->dma.setup) dmatype = info->dma.setup(info->host, &info->scsi.SCp, direction, dmatype); info->dma.transfer_type = dmatype; + if (dmatype == fasdma_real_all) + fas216_set_stc(info, info->SCpnt->request_bufflen); + else + fas216_set_stc(info, info->scsi.SCp.this_residual); + switch (dmatype) { case fasdma_pio: fas216_log(info, LOG_BUFFER, "PIO transfer"); - outb(0, REG_SOF(info)); - outb(info->scsi.async_stp, REG_STP(info)); - outb(info->scsi.SCp.this_residual, REG_STCL(info)); - outb(info->scsi.SCp.this_residual >> 8, REG_STCM(info)); - outb(info->scsi.SCp.this_residual >> 16, REG_STCH(info)); + fas216_writeb(info, REG_SOF, 0); + fas216_writeb(info, REG_STP, info->scsi.async_stp); fas216_cmd(info, CMD_TRANSFERINFO); fas216_pio(info, direction); break; case fasdma_pseudo: fas216_log(info, LOG_BUFFER, "pseudo transfer"); - outb(info->scsi.SCp.this_residual, REG_STCL(info)); - outb(info->scsi.SCp.this_residual >> 8, REG_STCM(info)); - outb(info->scsi.SCp.this_residual >> 16, REG_STCH(info)); fas216_cmd(info, CMD_TRANSFERINFO | CMD_WITHDMA); info->dma.pseudo(info->host, &info->scsi.SCp, direction, info->SCpnt->transfersize); @@ -818,17 +886,11 @@ case fasdma_real_block: fas216_log(info, LOG_BUFFER, "block dma transfer"); - outb(info->scsi.SCp.this_residual, REG_STCL(info)); - outb(info->scsi.SCp.this_residual >> 8, REG_STCM(info)); - outb(info->scsi.SCp.this_residual >> 16, REG_STCH(info)); fas216_cmd(info, CMD_TRANSFERINFO | CMD_WITHDMA); break; case fasdma_real_all: fas216_log(info, LOG_BUFFER, "total dma transfer"); - outb(info->SCpnt->request_bufflen, REG_STCL(info)); - outb(info->SCpnt->request_bufflen >> 8, REG_STCM(info)); - outb(info->SCpnt->request_bufflen >> 16, REG_STCH(info)); fas216_cmd(info, CMD_TRANSFERINFO | CMD_WITHDMA); break; @@ -839,44 +901,61 @@ } } -/** +/** * fas216_stoptransfer - Stop a DMA transfer onto / off of the card * @info: interface from which device disconnected from - * - * Stop a DMA transfer onto / off of the card + * + * Called when we switch away from DATA IN or DATA OUT phases. */ static void fas216_stoptransfer(FAS216_Info *info) { fas216_checkmagic(info); - if ((info->dma.transfer_type == fasdma_real_all || - info->dma.transfer_type == fasdma_real_block) && - info->dma.stop) + if (info->dma.transfer_type == fasdma_real_all || + info->dma.transfer_type == fasdma_real_block) info->dma.stop(info->host, &info->scsi.SCp); fas216_cleanuptransfer(info); - if (info->scsi.phase == PHASE_DATAOUT) + if (info->scsi.phase == PHASE_DATAIN) { + unsigned int fifo; + + /* + * If we were performing Data-In, then the FIFO counter + * contains the number of bytes not transferred via DMA + * from the on-board FIFO. Read them manually. + */ + fifo = fas216_readb(info, REG_CFIS) & CFIS_CF; + while (fifo && info->scsi.SCp.ptr) { + *info->scsi.SCp.ptr = fas216_readb(info, REG_FF); + fas216_updateptrs(info, 1); + fifo--; + } + } else { + /* + * After a Data-Out phase, there may be unsent + * bytes left in the FIFO. Flush them out. + */ fas216_cmd(info, CMD_FLUSHFIFO); + } } static void fas216_aborttransfer(FAS216_Info *info) { fas216_checkmagic(info); - if ((info->dma.transfer_type == fasdma_real_all || - info->dma.transfer_type == fasdma_real_block) && - info->dma.stop) + if (info->dma.transfer_type == fasdma_real_all || + info->dma.transfer_type == fasdma_real_block) info->dma.stop(info->host, &info->scsi.SCp); info->dma.transfer_type = fasdma_none; fas216_cmd(info, CMD_FLUSHFIFO); } -/** +/** * fas216_disconnected_intr - handle device disconnection * @info: interface from which device disconnected from - * + * * Handle device disconnection */ static void fas216_disconnect_intr(FAS216_Info *info) @@ -924,10 +1003,10 @@ } } -/** +/** * fas216_reselected_intr - start reconnection of a device * @info: interface which was reselected - * + * * Start reconnection of a device */ static void @@ -952,19 +1031,14 @@ fas216_log(info, LOG_CONNECT, "reconnect phase=%02X", info->scsi.phase); - if ((inb(REG_CFIS(info)) & CFIS_CF) != 2) { + if ((fas216_readb(info, REG_CFIS) & CFIS_CF) != 2) { printk(KERN_ERR "scsi%d.H: incorrect number of bytes after reselect\n", info->host->host_no); - fas216_cmd(info, CMD_SETATN); - msgqueue_flush(&info->scsi.msgs); - msgqueue_addmsg(&info->scsi.msgs, 1, INITIATOR_ERROR); - info->scsi.phase = PHASE_MSGOUT_EXPECT; - fas216_cmd(info, CMD_MSGACCEPTED); - return; + goto initiator_error; } - target = inb(REG_FF(info)); - identify_msg = inb(REG_FF(info)); + target = fas216_readb(info, REG_FF); + identify_msg = fas216_readb(info, REG_FF); ok = 1; if (!(target & (1 << info->host->this_id))) { @@ -983,26 +1057,11 @@ * Something went wrong - send an initiator error to * the target. */ - fas216_cmd(info, CMD_SETATN); - msgqueue_flush(&info->scsi.msgs); - msgqueue_addmsg(&info->scsi.msgs, 1, INITIATOR_ERROR); - info->scsi.phase = PHASE_MSGOUT_EXPECT; - fas216_cmd(info, CMD_MSGACCEPTED); - return; + goto initiator_error; } target &= ~(1 << info->host->this_id); - switch (target) { - case 1: target = 0; break; - case 2: target = 1; break; - case 4: target = 2; break; - case 8: target = 3; break; - case 16: target = 4; break; - case 32: target = 5; break; - case 64: target = 6; break; - case 128: target = 7; break; - default: target = info->host->this_id; break; - } + target = ffs(target) - 1; identify_msg &= 7; info->scsi.reconnected.target = target; @@ -1023,7 +1082,7 @@ msgqueue_flush(&info->scsi.msgs); if (ok) { info->scsi.phase = PHASE_RECONNECTED; - outb(target, REG_SDID(info)); + fas216_writeb(info, REG_SDID, target); } else { /* * Our command structure not found - abort the @@ -1037,9 +1096,17 @@ } fas216_cmd(info, CMD_MSGACCEPTED); + return; + + initiator_error: + fas216_cmd(info, CMD_SETATN); + msgqueue_flush(&info->scsi.msgs); + msgqueue_addmsg(&info->scsi.msgs, 1, INITIATOR_ERROR); + info->scsi.phase = PHASE_MSGOUT_EXPECT; + fas216_cmd(info, CMD_MSGACCEPTED); } -/** +/** * fas216_finish_reconnect - finish reconnection sequence for device * @info: interface which caused function done interrupt * @@ -1232,7 +1299,7 @@ fas216_cmd(info, cmd); for (tout = 1000; tout; tout -= 1) { - stat = inb(REG_STAT(info)); + stat = fas216_readb(info, REG_STAT); if (stat & (STAT_INT|STAT_PARITYERROR)) break; udelay(1); @@ -1251,7 +1318,7 @@ if ((stat & STAT_BUSMASK) != STAT_MESGIN) goto unexpected_phase_change; - inb(REG_INST(info)); + fas216_readb(info, REG_INST); stat = fas216_wait_cmd(info, CMD_TRANSFERINFO); @@ -1264,9 +1331,9 @@ if ((stat & STAT_BUSMASK) != STAT_MESGIN) goto unexpected_phase_change; - inb(REG_INST(info)); + fas216_readb(info, REG_INST); - return inb(REG_FF(info)); + return fas216_readb(info, REG_FF); timedout: fas216_log(info, LOG_ERROR, "timed out waiting for message byte"); @@ -1284,7 +1351,7 @@ /** * fas216_message - handle a function done interrupt from FAS216 chip * @info: interface which caused function done interrupt - * + * * Handle a function done interrupt from FAS216 chip */ static void fas216_message(FAS216_Info *info) @@ -1295,7 +1362,7 @@ fas216_checkmagic(info); - message[0] = inb(REG_FF(info)); + message[0] = fas216_readb(info, REG_FF); if (message[0] == EXTENDED_MESSAGE) { msgbyte = fas216_get_msg_byte(info); @@ -1317,8 +1384,6 @@ if (msgbyte == -3) goto parity_error; - info->scsi.msglen = msglen; - #ifdef DEBUG_MESSAGES { int i; @@ -1354,7 +1419,7 @@ /** * fas216_send_command - send command after all message bytes have been sent * @info: interface which caused bus service - * + * * Send a command to a target after all message bytes have been sent */ static void fas216_send_command(FAS216_Info *info) @@ -1368,17 +1433,17 @@ /* load command */ for (i = info->scsi.SCp.sent_command; i < info->SCpnt->cmd_len; i++) - outb(info->SCpnt->cmnd[i], REG_FF(info)); + fas216_writeb(info, REG_FF, info->SCpnt->cmnd[i]); fas216_cmd(info, CMD_TRANSFERINFO); info->scsi.phase = PHASE_COMMAND; } -/** +/** * fas216_send_messageout - handle bus service to send a message * @info: interface which caused bus service - * + * * Handle bus service to send a message. * Note: We do not allow the device to change the data direction! */ @@ -1398,25 +1463,25 @@ int i; for (i = start; i < msg->length; i++) - outb(msg->msg[i], REG_FF(info)); + fas216_writeb(info, REG_FF, msg->msg[i]); - msg->fifo = tot_msglen - (inb(REG_CFIS(info)) & CFIS_CF); + msg->fifo = tot_msglen - (fas216_readb(info, REG_CFIS) & CFIS_CF); start = 0; } } else - outb(NOP, REG_FF(info)); + fas216_writeb(info, REG_FF, NOP); fas216_cmd(info, CMD_TRANSFERINFO); info->scsi.phase = PHASE_MSGOUT; } -/** +/** * fas216_busservice_intr - handle bus service interrupt from FAS216 chip * @info: interface which caused bus service interrupt * @stat: Status register contents * @ssr: SCSI Status register contents - * + * * Handle a bus service interrupt from FAS216 chip */ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigned int ssr) @@ -1429,7 +1494,7 @@ switch (info->scsi.phase) { case PHASE_SELECTION: - if ((ssr & IS_BITS) != 1) + if ((ssr & IS_BITS) != IS_MSGBYTESENT) goto bad_is; break; @@ -1464,15 +1529,17 @@ case STATE(STAT_DATAIN, PHASE_RECONNECTED): fas216_finish_reconnect(info); case STATE(STAT_DATAIN, PHASE_SELSTEPS):/* Sel w/ steps -> Data In */ - case STATE(STAT_DATAIN, PHASE_DATAIN): /* Data In -> Data In */ case STATE(STAT_DATAIN, PHASE_MSGOUT): /* Message Out -> Data In */ case STATE(STAT_DATAIN, PHASE_COMMAND): /* Command -> Data In */ case STATE(STAT_DATAIN, PHASE_MSGIN): /* Message In -> Data In */ - fas216_starttransfer(info, DMA_IN); + info->scsi.phase = PHASE_DATAIN; + fas216_transfer(info); return; + case STATE(STAT_DATAIN, PHASE_DATAIN): /* Data In -> Data In */ case STATE(STAT_DATAOUT, PHASE_DATAOUT):/* Data Out -> Data Out */ - fas216_starttransfer(info, DMA_OUT); + fas216_cleanuptransfer(info); + fas216_transfer(info); return; /* Reselmsgin -> Data Out */ @@ -1482,7 +1549,9 @@ case STATE(STAT_DATAOUT, PHASE_MSGOUT): /* Message Out -> Data Out */ case STATE(STAT_DATAOUT, PHASE_COMMAND):/* Command -> Data Out */ case STATE(STAT_DATAOUT, PHASE_MSGIN): /* Message In -> Data Out */ - fas216_starttransfer(info, DMA_OUT); + fas216_cmd(info, CMD_FLUSHFIFO); + info->scsi.phase = PHASE_DATAOUT; + fas216_transfer(info); return; /* Reselmsgin -> Status */ @@ -1507,7 +1576,7 @@ case STATE(STAT_MESGIN, PHASE_COMMAND): /* Command -> Message In */ case STATE(STAT_MESGIN, PHASE_SELSTEPS):/* Sel w/ steps -> Message In */ case STATE(STAT_MESGIN, PHASE_MSGOUT): /* Message Out -> Message In */ - info->scsi.msgin_fifo = inb(REG_CFIS(info)) & CFIS_CF; + info->scsi.msgin_fifo = fas216_readb(info, REG_CFIS) & CFIS_CF; fas216_cmd(info, CMD_FLUSHFIFO); fas216_cmd(info, CMD_TRANSFERINFO); info->scsi.phase = PHASE_MSGIN; @@ -1516,7 +1585,7 @@ /* Reselmsgin -> Message In */ case STATE(STAT_MESGIN, PHASE_RECONNECTED): case STATE(STAT_MESGIN, PHASE_MSGIN): - info->scsi.msgin_fifo = inb(REG_CFIS(info)) & CFIS_CF; + info->scsi.msgin_fifo = fas216_readb(info, REG_CFIS) & CFIS_CF; fas216_cmd(info, CMD_TRANSFERINFO); return; @@ -1555,7 +1624,7 @@ */ info->device[info->SCpnt->target].parity_check = 0; info->device[info->SCpnt->target].parity_enabled = 1; - outb(info->scsi.cfg[0], REG_CNTL1(info)); + fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0]); } if (msgqueue_msglength(&info->scsi.msgs) > 1) @@ -1584,9 +1653,7 @@ "target trying to receive more command bytes\n", info->host->host_no, fas216_target(info)); fas216_cmd(info, CMD_SETATN); - outb(15, REG_STCL(info)); - outb(0, REG_STCM(info)); - outb(0, REG_STCH(info)); + fas216_set_stc(info, 15); fas216_cmd(info, CMD_PADBYTES | CMD_WITHDMA); msgqueue_flush(&info->scsi.msgs); msgqueue_addmsg(&info->scsi.msgs, 1, INITIATOR_ERROR); @@ -1615,6 +1682,7 @@ bad_is: fas216_log(info, 0, "bus service at step %d?", ssr & IS_BITS); + fas216_dumpstate(info); print_debug_list(); fas216_done(info, DID_ERROR); @@ -1625,12 +1693,12 @@ * @info: interface which caused function done interrupt * @stat: Status register contents * @ssr: SCSI Status register contents - * + * * Handle a function done interrupt from FAS216 chip */ static void fas216_funcdone_intr(FAS216_Info *info, unsigned int stat, unsigned int ssr) { - unsigned int fifo_len = inb(REG_CFIS(info)) & CFIS_CF; + unsigned int fifo_len = fas216_readb(info, REG_CFIS) & CFIS_CF; unsigned int status, message; fas216_checkmagic(info); @@ -1644,8 +1712,8 @@ if (fifo_len != 2) { fas216_log(info, 0, "odd number of bytes in FIFO: %d", fifo_len); } - status = inb(REG_FF(info)); - message = inb(REG_FF(info)); + status = fas216_readb(info, REG_FF); + message = fas216_readb(info, REG_FF); info->scsi.SCp.Message = message; info->scsi.SCp.Status = status; info->scsi.phase = PHASE_DONE; @@ -1679,26 +1747,21 @@ info->scsi.reconnected.lun = 0; info->scsi.reconnected.tag = 0; - if (info->ifcfg.wide_max_size == 0) - wide_state = neg_invalid; - else + wide_state = neg_invalid; + sync_state = neg_invalid; + #ifdef SCSI2_WIDE + if (info->ifcfg.wide_max_size != 0) wide_state = neg_wait; -#else - wide_state = neg_invalid; #endif - - if (info->host->dma_channel == NO_DMA || !info->dma.setup) - sync_state = neg_invalid; - else #ifdef SCSI2_SYNC + if (info->ifcfg.capabilities & (FASCAP_DMA|FASCAP_PSEUDODMA)) sync_state = neg_wait; -#else - sync_state = neg_invalid; #endif info->scsi.phase = PHASE_IDLE; info->SCpnt = NULL; /* bug! */ + memset(&info->scsi.SCp, 0, sizeof(info->scsi.SCp)); for (i = 0; i < 8; i++) { info->device[i].disconnect_ok = info->ifcfg.disconnect_ok; @@ -1714,22 +1777,21 @@ wake_up(&info->eh_wait); } -/** +/** * fas216_intr - handle interrupts to progress a command - * @instance: interface to service - * + * @info: interface to service + * * Handle interrupts from the interface to progress a command */ -void fas216_intr(struct Scsi_Host *instance) +void fas216_intr(FAS216_Info *info) { - FAS216_Info *info = (FAS216_Info *)instance->hostdata; unsigned char isr, ssr, stat; fas216_checkmagic(info); - stat = inb(REG_STAT(info)); - ssr = inb(REG_IS(info)); - isr = inb(REG_INST(info)); + stat = fas216_readb(info, REG_STAT); + ssr = fas216_readb(info, REG_IS); + isr = fas216_readb(info, REG_INST); add_debug_list(stat, ssr, isr, info->scsi.phase); @@ -1762,17 +1824,15 @@ int tot_msglen; /* following what the ESP driver says */ - outb(0, REG_STCL(info)); - outb(0, REG_STCM(info)); - outb(0, REG_STCH(info)); + fas216_set_stc(info, 0); fas216_cmd(info, CMD_NOP | CMD_WITHDMA); /* flush FIFO */ fas216_cmd(info, CMD_FLUSHFIFO); /* load bus-id and timeout */ - outb(BUSID(SCpnt->target), REG_SDID(info)); - outb(info->ifcfg.select_timeout, REG_STIM(info)); + fas216_writeb(info, REG_SDID, BUSID(SCpnt->target)); + fas216_writeb(info, REG_STIM, info->ifcfg.select_timeout); /* synchronous transfers */ fas216_set_sync(info, SCpnt->target); @@ -1808,13 +1868,13 @@ /* load message bytes */ while ((msg = msgqueue_getmsg(&info->scsi.msgs, msgnr++)) != NULL) { for (i = 0; i < msg->length; i++) - outb(msg->msg[i], REG_FF(info)); - msg->fifo = tot_msglen - (inb(REG_CFIS(info)) & CFIS_CF); + fas216_writeb(info, REG_FF, msg->msg[i]); + msg->fifo = tot_msglen - (fas216_readb(info, REG_CFIS) & CFIS_CF); } /* load command */ for (i = 0; i < SCpnt->cmd_len; i++) - outb(SCpnt->cmnd[i], REG_FF(info)); + fas216_writeb(info, REG_FF, SCpnt->cmnd[i]); if (tot_msglen == 1) fas216_cmd(info, CMD_SELECTATN); @@ -1828,7 +1888,7 @@ */ struct message *msg = msgqueue_getmsg(&info->scsi.msgs, 0); - outb(msg->msg[0], REG_FF(info)); + fas216_writeb(info, REG_FF, msg->msg[0]); msg->fifo = 1; fas216_cmd(info, CMD_SELECTATNSTOP); @@ -1855,11 +1915,6 @@ { int disconnect_ok; - if (parity_test(info, SCpnt->target)) - outb(info->scsi.cfg[0] | CNTL1_PTE, REG_CNTL1(info)); - else - outb(info->scsi.cfg[0], REG_CNTL1(info)); - /* * claim host busy */ @@ -1868,6 +1923,11 @@ info->SCpnt = SCpnt; info->dma.transfer_type = fasdma_none; + if (parity_test(info, SCpnt->target)) + fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0] | CNTL1_PTE); + else + fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0]); + /* * Don't allow request sense commands to disconnect. */ @@ -1966,24 +2026,22 @@ msgqueue_addmsg(&info->scsi.msgs, 1, BUS_DEVICE_RESET); /* following what the ESP driver says */ - outb(0, REG_STCL(info)); - outb(0, REG_STCM(info)); - outb(0, REG_STCH(info)); + fas216_set_stc(info, 0); fas216_cmd(info, CMD_NOP | CMD_WITHDMA); /* flush FIFO */ fas216_cmd(info, CMD_FLUSHFIFO); /* load bus-id and timeout */ - outb(BUSID(SCpnt->target), REG_SDID(info)); - outb(info->ifcfg.select_timeout, REG_STIM(info)); + fas216_writeb(info, REG_SDID, BUSID(SCpnt->target)); + fas216_writeb(info, REG_STIM, info->ifcfg.select_timeout); /* synchronous transfers */ fas216_set_sync(info, SCpnt->target); msg = msgqueue_getmsg(&info->scsi.msgs, 0); - outb(BUS_DEVICE_RESET, REG_FF(info)); + fas216_writeb(info, REG_FF, BUS_DEVICE_RESET); msg->fifo = 1; fas216_cmd(info, CMD_SELECTATNSTOP); @@ -1992,8 +2050,8 @@ /** * fas216_kick - kick a command to the interface * @info: our host interface to kick - * - * kick a command to the interface, interface should be idle. + * + * Kick a command to the interface, interface should be idle. * Notes: Interrupts are always disabled! */ static void fas216_kick(FAS216_Info *info) @@ -2050,11 +2108,8 @@ info->SCpnt = NULL; } -#if defined(DEBUG_CONNECT) || defined(DEBUG_MESSAGES) - printk("scsi%d.%c: starting ", - info->host->host_no, '0' + SCpnt->target); - print_command(SCpnt->cmnd); -#endif + fas216_log_command(info, LOG_CONNECT | LOG_MESSAGES, SCpnt, + "starting"); switch (where_from) { case TYPE_QUEUE: @@ -2094,13 +2149,13 @@ * @info: interface that completed * @SCpnt: command that completed * @result: driver byte of result - * + * * Finish processing automatic request sense command */ static void fas216_rq_sns_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) { - fas216_log(info, LOG_CONNECT, + fas216_log_target(info, LOG_CONNECT, SCpnt->target, "request sense complete, result=0x%04x%02x%02x", result, SCpnt->SCp.Message, SCpnt->SCp.Status); @@ -2127,7 +2182,7 @@ * @info: interface that completed * @SCpnt: command that completed * @result: driver byte of result - * + * * Finish processing of standard command */ static void @@ -2138,17 +2193,14 @@ SCpnt->result = result << 16 | info->scsi.SCp.Message << 8 | info->scsi.SCp.Status; -#ifdef DEBUG_CONNECT - printk("scsi%d.%c: command complete, result=%08X, command=", - info->host->host_no, '0' + SCpnt->target, SCpnt->result); - print_command(SCpnt->cmnd); -#endif + fas216_log_command(info, LOG_CONNECT, SCpnt, + "command complete, result=0x%08x", SCpnt->result); /* - * If the driver detected an error, or the command - * was request sense, then we're all done. + * If the driver detected an error, we're all done. */ - if (result != DID_OK || SCpnt->cmnd[0] == REQUEST_SENSE) + if (host_byte(SCpnt->result) != DID_OK || + msg_byte(SCpnt->result) != COMMAND_COMPLETE) goto done; /* @@ -2163,7 +2215,7 @@ * If the command did not complete with GOOD status, * we are all done here. */ - if (info->scsi.SCp.Status != GOOD) + if (status_byte(SCpnt->result) != GOOD) goto done; /* @@ -2177,17 +2229,19 @@ switch (SCpnt->cmnd[0]) { case INQUIRY: case START_STOP: -// case READ_CAPACITY: case MODE_SENSE: break; default: printk(KERN_ERR "scsi%d.%c: incomplete data transfer " - "detected: res=%08X ptr=%p len=%X command=", + "detected: res=%08X ptr=%p len=%X CDB: ", info->host->host_no, '0' + SCpnt->target, SCpnt->result, info->scsi.SCp.ptr, info->scsi.SCp.this_residual); print_command(SCpnt->cmnd); + SCpnt->result &= ~(255 << 16); + SCpnt->result |= DID_BAD_TARGET << 16; + goto request_sense; } } @@ -2202,6 +2256,11 @@ request_sense: + if (SCpnt->cmnd[0] == REQUEST_SENSE) + goto done; + + fas216_log_target(info, LOG_CONNECT, SCpnt->target, + "requesting sense"); memset(SCpnt->cmnd, 0, sizeof (SCpnt->cmnd)); SCpnt->cmnd[0] = REQUEST_SENSE; SCpnt->cmnd[1] = SCpnt->lun << 5; @@ -2213,6 +2272,7 @@ SCpnt->SCp.this_residual = sizeof(SCpnt->sense_buffer); SCpnt->SCp.Message = 0; SCpnt->SCp.Status = 0; + SCpnt->request_bufflen = sizeof(SCpnt->sense_buffer); SCpnt->sc_data_direction = SCSI_DATA_READ; SCpnt->use_sg = 0; SCpnt->tag = 0; @@ -2233,7 +2293,7 @@ * fas216_done - complete processing for current command * @info: interface that completed * @result: driver byte of result - * + * * Complete processing for current command */ static void fas216_done(FAS216_Info *info, unsigned int result) @@ -2263,7 +2323,7 @@ */ if (info->scsi.SCp.ptr && info->scsi.SCp.this_residual == 0) { printk("scsi%d.%c: zero bytes left to transfer, but " - "buffer pointer still valid: ptr=%p len=%08x command=", + "buffer pointer still valid: ptr=%p len=%08x CDB: ", info->host->host_no, '0' + SCpnt->target, info->scsi.SCp.ptr, info->scsi.SCp.this_residual); info->scsi.SCp.ptr = NULL; @@ -2298,9 +2358,9 @@ * fas216_queue_command - queue a command for adapter to process. * @SCpnt: Command to queue * @done: done function to call once command is complete - * + * * Queue a command for adapter to process. - * Returns: 0 in success, else error. + * Returns: 0 on success, else error. * Notes: io_request_lock is held, interrupts are disabled. */ int fas216_queue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) @@ -2310,11 +2370,8 @@ fas216_checkmagic(info); -#ifdef DEBUG_CONNECT - printk("scsi%d.H: received command for id %d (%p) ", - SCpnt->host->host_no, SCpnt->target, SCpnt); - print_command(SCpnt->cmnd); -#endif + fas216_log_command(info, LOG_CONNECT, SCpnt, + "received command (%p)", SCpnt); SCpnt->scsi_done = done; SCpnt->host_scribble = (void *)fas216_std_done; @@ -2341,10 +2398,8 @@ fas216_kick(info); spin_unlock(&info->host_lock); -#ifdef DEBUG_CONNECT - printk("scsi%d.H: queue %s\n", info->host->host_no, + fas216_log_target(info, LOG_CONNECT, -1, "queue %s", result ? "failure" : "success"); -#endif return result; } @@ -2352,7 +2407,7 @@ /** * fas216_internal_done - trigger restart of a waiting thread in fas216_command * @SCpnt: Command to wake - * + * * Trigger restart of a waiting thread in fas216_command */ static void fas216_internal_done(Scsi_Cmnd *SCpnt) @@ -2366,9 +2421,9 @@ /** * fas216_command - queue a command for adapter to process. - * @SCpnt: Command to queue - * - * Qqueue a command for adapter to process. + * @SCpnt: Command to queue + * + * Queue a command for adapter to process. * Returns: scsi result code. * Notes: io_request_lock is held, interrupts are disabled. */ @@ -2405,9 +2460,9 @@ * and go to sleep if we know that the device is going * to be some time (eg, disconnected). */ - if (inb(REG_STAT(info)) & STAT_INT) { + if (fas216_readb(info, REG_STAT) & STAT_INT) { spin_lock_irq(info->host->host_lock); - fas216_intr(info->host); + fas216_intr(info); spin_unlock_irq(info->host->host_lock); } } @@ -2446,7 +2501,7 @@ /** * fas216_do_abort - decide how to abort a command * @SCpnt: command to abort - * + * * Decide how to abort a command. * Returns: abort status */ @@ -2512,7 +2567,7 @@ /** * fas216_eh_abort - abort this command * @SCpnt: command to abort - * + * * Abort this command. * Returns: FAILED if unable to abort * Notes: io_request_lock is taken, and irqs are disabled @@ -2567,12 +2622,12 @@ /** * fas216_eh_device_reset - Reset the device associated with this command - * @SCpnt: command specifing device to reset - * + * @SCpnt: command specifing device to reset + * * Reset the device associated with this command. * Returns: FAILED if unable to reset. * Notes: We won't be re-entered, so we'll only have one device - * reset on the go at one time. + * reset on the go at one time. */ int fas216_eh_device_reset(Scsi_Cmnd *SCpnt) { @@ -2650,7 +2705,7 @@ /** * fas216_eh_bus_reset - Reset the bus associated with the command * @SCpnt: command specifing bus to reset - * + * * Reset the bus associated with the command. * Returns: FAILED if unable to reset. * Notes: Further commands are blocked. @@ -2672,13 +2727,13 @@ * Stop all activity on this interface. */ fas216_aborttransfer(info); - outb(info->scsi.cfg[2], REG_CNTL3(info)); + fas216_writeb(info, REG_CNTL3, info->scsi.cfg[2]); /* * Clear any pending interrupts. */ - while (inb(REG_STAT(info)) & STAT_INT) - inb(REG_INST(info)); + while (fas216_readb(info, REG_STAT) & STAT_INT) + fas216_readb(info, REG_INST); info->rst_bus_status = 0; @@ -2728,26 +2783,26 @@ /** * fas216_init_chip - Initialise FAS216 state after reset - * @info: state structure for interface - * + * @info: state structure for interface + * * Initialise FAS216 state after reset */ static void fas216_init_chip(FAS216_Info *info) { - outb(fas216_clockrate(info->ifcfg.clockrate), REG_CLKF(info)); - outb(info->scsi.cfg[0], REG_CNTL1(info)); - outb(info->scsi.cfg[1], REG_CNTL2(info)); - outb(info->scsi.cfg[2], REG_CNTL3(info)); - outb(info->ifcfg.select_timeout, REG_STIM(info)); - outb(0, REG_SOF(info)); - outb(info->scsi.async_stp, REG_STP(info)); - outb(info->scsi.cfg[0], REG_CNTL1(info)); + fas216_writeb(info, REG_CLKF, fas216_clockrate(info->ifcfg.clockrate)); + fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0]); + fas216_writeb(info, REG_CNTL2, info->scsi.cfg[1]); + fas216_writeb(info, REG_CNTL3, info->scsi.cfg[2]); + fas216_writeb(info, REG_STIM, info->ifcfg.select_timeout); + fas216_writeb(info, REG_SOF, 0); + fas216_writeb(info, REG_STP, info->scsi.async_stp); + fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0]); } /** * fas216_eh_host_reset - Reset the host associated with this command * @SCpnt: command specifing host to reset - * + * * Reset the host associated with this command. * Returns: FAILED if unable to reset. * Notes: io_request_lock is taken, and irqs are disabled @@ -2811,56 +2866,56 @@ /* * Reset the chip. */ - outb(CMD_RESETCHIP, REG_CMD(info)); + fas216_writeb(info, REG_CMD, CMD_RESETCHIP); udelay(50); - outb(CMD_NOP, REG_CMD(info)); + fas216_writeb(info, REG_CMD, CMD_NOP); /* * Check to see if control reg 2 is present. */ - outb(0, REG_CNTL3(info)); - outb(CNTL2_S2FE, REG_CNTL2(info)); + fas216_writeb(info, REG_CNTL3, 0); + fas216_writeb(info, REG_CNTL2, CNTL2_S2FE); /* * If we are unable to read back control reg 2 * correctly, it is not present, and we have a * NCR53C90. */ - if ((inb(REG_CNTL2(info)) & (~0xe0)) != CNTL2_S2FE) + if ((fas216_readb(info, REG_CNTL2) & (~0xe0)) != CNTL2_S2FE) return TYPE_NCR53C90; /* * Now, check control register 3 */ - outb(0, REG_CNTL2(info)); - outb(0, REG_CNTL3(info)); - outb(5, REG_CNTL3(info)); + fas216_writeb(info, REG_CNTL2, 0); + fas216_writeb(info, REG_CNTL3, 0); + fas216_writeb(info, REG_CNTL3, 5); /* * If we are unable to read the register back * correctly, we have a NCR53C90A */ - if (inb(REG_CNTL3(info)) != 5) + if (fas216_readb(info, REG_CNTL3) != 5) return TYPE_NCR53C90A; /* * Now read the ID from the chip. */ - outb(0, REG_CNTL3(info)); + fas216_writeb(info, REG_CNTL3, 0); - outb(CNTL3_ADIDCHK, REG_CNTL3(info)); - outb(0, REG_CNTL3(info)); + fas216_writeb(info, REG_CNTL3, CNTL3_ADIDCHK); + fas216_writeb(info, REG_CNTL3, 0); - outb(CMD_RESETCHIP, REG_CMD(info)); - udelay(5); - outb(CMD_WITHDMA | CMD_NOP, REG_CMD(info)); + fas216_writeb(info, REG_CMD, CMD_RESETCHIP); + udelay(50); + fas216_writeb(info, REG_CMD, CMD_WITHDMA | CMD_NOP); - outb(CNTL2_ENF, REG_CNTL2(info)); - outb(CMD_RESETCHIP, REG_CMD(info)); - udelay(5); - outb(CMD_NOP, REG_CMD(info)); + fas216_writeb(info, REG_CNTL2, CNTL2_ENF); + fas216_writeb(info, REG_CMD, CMD_RESETCHIP); + udelay(50); + fas216_writeb(info, REG_CMD, CMD_NOP); - rev = inb(REG1_ID(info)); + rev = fas216_readb(info, REG_ID); family = rev >> 3; rev &= 7; @@ -2886,10 +2941,10 @@ return TYPE_NCR53C9x; } -/** +/** * fas216_reset_state - Initialise driver internal state * @info: state to initialise - * + * * Initialise driver internal state */ static void fas216_reset_state(FAS216_Info *info) @@ -2927,23 +2982,23 @@ } /** - * fas216_init - initialise FAS/NCR/AMD SCSI ic. - * @instance: a driver-specific filled-out structure - * - * Initialise FAS/NCR/AMD SCSI ic. + * fas216_init - initialise FAS/NCR/AMD SCSI structures. + * @host: a driver-specific filled-out structure + * + * Initialise FAS/NCR/AMD SCSI structures. * Returns: 0 on success */ -int fas216_init(struct Scsi_Host *instance) +int fas216_init(struct Scsi_Host *host) { - FAS216_Info *info = (FAS216_Info *)instance->hostdata; - int type; + FAS216_Info *info = (FAS216_Info *)host->hostdata; info->magic_start = MAGIC; info->magic_end = MAGIC; - info->host = instance; - info->scsi.cfg[0] = instance->this_id | CNTL1_PERE; + info->host = host; + info->scsi.cfg[0] = host->this_id | CNTL1_PERE; info->scsi.cfg[1] = CNTL2_ENF | CNTL2_S2FE; - info->scsi.cfg[2] = info->ifcfg.cntl3 | CNTL3_ADIDCHK | CNTL3_G2CB; + info->scsi.cfg[2] = info->ifcfg.cntl3 | + CNTL3_ADIDCHK | CNTL3_G2CB | CNTL3_LBTM; info->scsi.async_stp = fas216_syncperiod(info, info->ifcfg.asyncperiod); info->rst_dev_status = -1; @@ -2960,13 +3015,29 @@ msgqueue_initialise(&info->scsi.msgs); if (!queue_initialise(&info->queues.issue)) - return 1; + return -ENOMEM; if (!queue_initialise(&info->queues.disconnected)) { queue_free(&info->queues.issue); - return 1; + return -ENOMEM; } + return 0; +} + +/** + * fas216_add - initialise FAS/NCR/AMD SCSI ic. + * @host: a driver-specific filled-out structure + * @dev: parent device + * + * Initialise FAS/NCR/AMD SCSI ic. + * Returns: 0 on success + */ +int fas216_add(struct Scsi_Host *host, struct device *dev) +{ + FAS216_Info *info = (FAS216_Info *)host->hostdata; + int type, ret; + fas216_reset_state(info); type = fas216_detect_type(info); info->scsi.type = chip_types[type]; @@ -2983,8 +3054,8 @@ * the resulting reset interrupt, so mask it * out. */ - outb(info->scsi.cfg[0] | CNTL1_DISR, REG_CNTL1(info)); - outb(CMD_RESETSCSI, REG_CMD(info)); + fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0] | CNTL1_DISR); + fas216_writeb(info, REG_CMD, CMD_RESETSCSI); /* * scsi standard says wait 250ms @@ -2993,60 +3064,40 @@ scsi_sleep(100*HZ/100); spin_lock_irq(info->host->host_lock); - outb(info->scsi.cfg[0], REG_CNTL1(info)); - inb(REG_INST(info)); + fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0]); + fas216_readb(info, REG_INST); fas216_checkmagic(info); - return 0; + ret = scsi_add_host(host, dev); + if (ret) + fas216_writeb(info, REG_CMD, CMD_RESETCHIP); + + return ret; } -/** - * fas216_release - release all resources for FAS/NCR/AMD SCSI ic. - * @instance: a driver-specific filled-out structure - * - * release all resources and put everything to bed for FAS/NCR/AMD SCSI ic, - * Returns: 0 on success. - */ -int fas216_release(struct Scsi_Host *instance) +void fas216_remove(struct Scsi_Host *host) { - FAS216_Info *info = (FAS216_Info *)instance->hostdata; + FAS216_Info *info = (FAS216_Info *)host->hostdata; fas216_checkmagic(info); + scsi_remove_host(host); - outb(CMD_RESETCHIP, REG_CMD(info)); - queue_free(&info->queues.disconnected); - queue_free(&info->queues.issue); - - return 0; + fas216_writeb(info, REG_CMD, CMD_RESETCHIP); } /** - * fas216_info - generate a string containing information about host. - * @info: FAS216 host information - * @buffer: string buffer to build string - * - * Generate a string containing information about this host. - * Returns: size of built string + * fas216_release - release all resources for FAS/NCR/AMD SCSI ic. + * @host: a driver-specific filled-out structure + * + * release all resources and put everything to bed for FAS/NCR/AMD SCSI ic. */ -int fas216_info(FAS216_Info *info, char *buffer) +void fas216_release(struct Scsi_Host *host) { - char *p = buffer; - - p += sprintf(p, "(%s) at port 0x%08lX ", - info->scsi.type, info->host->io_port); + FAS216_Info *info = (FAS216_Info *)host->hostdata; - if (info->host->irq != NO_IRQ) - p += sprintf(p, "irq %d ", info->host->irq); - else - p += sprintf(p, "no irq "); - - if (info->host->dma_channel != NO_DMA) - p += sprintf(p, "dma %d ", info->host->dma_channel); - else - p += sprintf(p, "no dma "); - - return p - buffer; + queue_free(&info->queues.disconnected); + queue_free(&info->queues.issue); } int fas216_print_host(FAS216_Info *info, char *buffer) @@ -3054,7 +3105,7 @@ return sprintf(buffer, "\n" "Chip : %s\n" - " Address: 0x%08lX\n" + " Address: 0x%08lx\n" " IRQ : %d\n" " DMA : %d\n", info->scsi.type, info->host->io_port, @@ -3116,11 +3167,12 @@ return p - buffer; } -EXPORT_SYMBOL(fas216_info); EXPORT_SYMBOL(fas216_init); +EXPORT_SYMBOL(fas216_add); EXPORT_SYMBOL(fas216_queue_command); EXPORT_SYMBOL(fas216_command); EXPORT_SYMBOL(fas216_intr); +EXPORT_SYMBOL(fas216_remove); EXPORT_SYMBOL(fas216_release); EXPORT_SYMBOL(fas216_eh_abort); EXPORT_SYMBOL(fas216_eh_device_reset); diff -Nru a/drivers/acorn/scsi/fas216.h b/drivers/acorn/scsi/fas216.h --- a/drivers/acorn/scsi/fas216.h Sun Feb 9 21:13:37 2003 +++ b/drivers/acorn/scsi/fas216.h Sun Feb 9 21:13:37 2003 @@ -22,18 +22,18 @@ /* FAS register definitions */ /* transfer count low */ -#define REG_CTCL(x) ((x)->scsi.io_port) -#define REG_STCL(x) ((x)->scsi.io_port) +#define REG_CTCL (0) +#define REG_STCL (0) /* transfer count medium */ -#define REG_CTCM(x) ((x)->scsi.io_port + (1 << (x)->scsi.io_shift)) -#define REG_STCM(x) ((x)->scsi.io_port + (1 << (x)->scsi.io_shift)) +#define REG_CTCM (1) +#define REG_STCM (1) /* fifo data */ -#define REG_FF(x) ((x)->scsi.io_port + (2 << (x)->scsi.io_shift)) +#define REG_FF (2) /* command */ -#define REG_CMD(x) ((x)->scsi.io_port + (3 << (x)->scsi.io_shift)) +#define REG_CMD (3) #define CMD_NOP 0x00 #define CMD_FLUSHFIFO 0x01 #define CMD_RESETCHIP 0x02 @@ -57,7 +57,7 @@ #define CMD_WITHDMA 0x80 /* status register (read) */ -#define REG_STAT(x) ((x)->scsi.io_port + (4 << (x)->scsi.io_shift)) +#define REG_STAT (4) #define STAT_IO (1 << 0) /* IO phase */ #define STAT_CD (1 << 1) /* CD phase */ #define STAT_MSG (1 << 2) /* MSG phase */ @@ -76,11 +76,11 @@ #define STAT_MESGIN (STAT_MSG|STAT_CD|STAT_IO) /* Message In */ /* bus ID for select / reselect */ -#define REG_SDID(x) ((x)->scsi.io_port + (4 << (x)->scsi.io_shift)) +#define REG_SDID (4) #define BUSID(target) ((target) & 7) /* Interrupt status register (read) */ -#define REG_INST(x) ((x)->scsi.io_port + (5 << (x)->scsi.io_shift)) +#define REG_INST (5) #define INST_SELWOATN (1 << 0) /* Select w/o ATN */ #define INST_SELATN (1 << 1) /* Select w/ATN */ #define INST_RESELECTED (1 << 2) /* Reselected */ @@ -91,10 +91,10 @@ #define INST_BUSRESET (1 << 7) /* SCSI Bus reset */ /* Timeout register (write) */ -#define REG_STIM(x) ((x)->scsi.io_port + (5 << (x)->scsi.io_shift)) +#define REG_STIM (5) /* Sequence step register (read) */ -#define REG_IS(x) ((x)->scsi.io_port + (6 << (x)->scsi.io_shift)) +#define REG_IS (6) #define IS_BITS 0x07 #define IS_SELARB 0x00 /* Select & Arb ok */ #define IS_MSGBYTESENT 0x01 /* One byte message sent*/ @@ -104,18 +104,18 @@ #define IS_SOF 0x08 /* Sync off flag */ /* Transfer period step (write) */ -#define REG_STP(x) ((x)->scsi.io_port + (6 << (x)->scsi.io_shift)) +#define REG_STP (6) /* Synchronous Offset (write) */ -#define REG_SOF(x) ((x)->scsi.io_port + (7 << (x)->scsi.io_shift)) +#define REG_SOF (7) /* Fifo state register (read) */ -#define REG_CFIS(x) ((x)->scsi.io_port + (7 << (x)->scsi.io_shift)) +#define REG_CFIS (7) #define CFIS_CF 0x1f /* Num bytes in FIFO */ #define CFIS_IS 0xe0 /* Step */ /* config register 1 */ -#define REG_CNTL1(x) ((x)->scsi.io_port + (8 << (x)->scsi.io_shift)) +#define REG_CNTL1 (8) #define CNTL1_CID (7 << 0) /* Chip ID */ #define CNTL1_STE (1 << 3) /* Self test enable */ #define CNTL1_PERE (1 << 4) /* Parity enable reporting en. */ @@ -124,7 +124,7 @@ #define CNTL1_ETM (1 << 7) /* Extended Timing Mode */ /* Clock conversion factor (read) */ -#define REG_CLKF(x) ((x)->scsi.io_port + (9 << (x)->scsi.io_shift)) +#define REG_CLKF (9) #define CLKF_F37MHZ 0x00 /* 35.01 - 40 MHz */ #define CLKF_F10MHZ 0x02 /* 10 MHz */ #define CLKF_F12MHZ 0x03 /* 10.01 - 15 MHz */ @@ -134,13 +134,13 @@ #define CLKF_F32MHZ 0x07 /* 30.01 - 35 MHz */ /* Chip test register (write) */ -#define REG0_FTM(x) ((x)->scsi.io_port + (10 << (x)->scsi.io_shift)) +#define REG_FTM (10) #define TEST_FTM 0x01 /* Force target mode */ #define TEST_FIM 0x02 /* Force initiator mode */ #define TEST_FHI 0x04 /* Force high impedance mode */ /* Configuration register 2 (read/write) */ -#define REG_CNTL2(x) ((x)->scsi.io_port + (11 << (x)->scsi.io_shift)) +#define REG_CNTL2 (11) #define CNTL2_PGDP (1 << 0) /* Pass Th/Generate Data Parity */ #define CNTL2_PGRP (1 << 1) /* Pass Th/Generate Reg Parity */ #define CNTL2_ACDPE (1 << 2) /* Abort on Cmd/Data Parity Err */ @@ -151,7 +151,7 @@ #define CNTL2_DAE (1 << 7) /* Data Alignment Enable */ /* Configuration register 3 (read/write) */ -#define REG_CNTL3(x) ((x)->scsi.io_port + (12 << (x)->scsi.io_shift)) +#define REG_CNTL3 (12) #define CNTL3_BS8 (1 << 0) /* Burst size 8 */ #define CNTL3_MDM (1 << 1) /* Modify DMA mode */ #define CNTL3_LBTM (1 << 2) /* Last Byte Transfer mode */ @@ -162,14 +162,14 @@ #define CNTL3_ADIDCHK (1 << 7) /* Additional ID check */ /* High transfer count (read/write) */ -#define REG_CTCH(x) ((x)->scsi.io_port + (14 << (x)->scsi.io_shift)) -#define REG_STCH(x) ((x)->scsi.io_port + (14 << (x)->scsi.io_shift)) +#define REG_CTCH (14) +#define REG_STCH (14) -/* ID reigster (read only) */ -#define REG1_ID(x) ((x)->scsi.io_port + (14 << (x)->scsi.io_shift)) +/* ID register (read only) */ +#define REG_ID (14) /* Data alignment */ -#define REG0_DAL(x) ((x)->scsi.io_port + (15 << (x)->scsi.io_shift)) +#define REG_DAL (15) typedef enum { PHASE_IDLE, /* we're not planning on doing anything */ @@ -212,6 +212,9 @@ #define MAGIC 0x441296bdUL #define NR_MSGS 8 +#define FASCAP_DMA (1 << 0) +#define FASCAP_PSEUDODMA (1 << 1) + typedef struct { unsigned long magic_start; spinlock_t host_lock; @@ -233,12 +236,13 @@ /* driver information */ struct { + phase_t phase; /* current phase */ + void *io_base; /* iomem base of FAS216 */ unsigned int io_port; /* base address of FAS216 */ unsigned int io_shift; /* shift to adjust reg offsets by */ - unsigned int irq; /* interrupt */ unsigned char cfg[4]; /* configuration registers */ const char *type; /* chip type */ - phase_t phase; /* current phase */ + unsigned int irq; /* interrupt */ struct { unsigned char target; /* reconnected target */ @@ -253,7 +257,6 @@ unsigned int async_stp; /* Async transfer STP value */ unsigned char msgin_fifo; /* bytes in fifo at time of message in */ unsigned char message[256]; /* last message received from device */ - unsigned int msglen; /* length of last message received */ unsigned char disconnectable:1; /* this command can be disconnected */ unsigned char aborting:1; /* aborting command */ @@ -281,6 +284,7 @@ unsigned char wide_max_size; /* Maximum wide transfer size */ unsigned char cntl3; /* Control Reg 3 */ unsigned int asyncperiod; /* Async transfer period (ns) */ + unsigned int capabilities; /* driver capabilities */ unsigned int disconnect_ok:1; /* Disconnects allowed? */ } ifcfg; @@ -319,26 +323,18 @@ } FAS216_Info; /* Function: int fas216_init (struct Scsi_Host *instance) - * Purpose : initialise FAS/NCR/AMD SCSI ic. + * Purpose : initialise FAS/NCR/AMD SCSI structures. * Params : instance - a driver-specific filled-out structure * Returns : 0 on success */ extern int fas216_init (struct Scsi_Host *instance); -/* Function: int fas216_abort (Scsi_Cmnd *SCpnt) - * Purpose : abort a command if something horrible happens. - * Params : SCpnt - Command that is believed to be causing a problem. - * Returns : one of SCSI_ABORT_ macros. - */ -extern int fas216_abort (Scsi_Cmnd *); - -/* Function: int fas216_reset (Scsi_Cmnd *SCpnt, unsigned int reset_flags) - * Purpose : resets the adapter if something horrible happens. - * Params : SCpnt - Command that is believed to be causing a problem. - * reset_flags - flags indicating reset type that is believed to be required. - * Returns : one of SCSI_RESET_ macros, or'd with the SCSI_RESET_*_RESET macros. +/* Function: int fas216_add (struct Scsi_Host *instance, struct device *dev) + * Purpose : initialise FAS/NCR/AMD SCSI ic. + * Params : instance - a driver-specific filled-out structure + * Returns : 0 on success */ -extern int fas216_reset (Scsi_Cmnd *, unsigned int); +extern int fas216_add (struct Scsi_Host *instance, struct device *dev); /* Function: int fas216_queue_command (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) * Purpose : queue a command for adapter to process. @@ -355,20 +351,21 @@ */ extern int fas216_command (Scsi_Cmnd *); -/* Function: void fas216_intr (struct Scsi_Host *instance) +/* Function: void fas216_intr (FAS216_Info *info) * Purpose : handle interrupts from the interface to progress a command - * Params : instance - interface to service + * Params : info - interface to service */ -extern void fas216_intr (struct Scsi_Host *instance); +extern void fas216_intr (FAS216_Info *info); + +extern void fas216_remove (struct Scsi_Host *instance); -/* Function: int fas216_release (struct Scsi_Host *instance) +/* Function: void fas216_release (struct Scsi_Host *instance) * Purpose : release all resources and put everything to bed for FAS/NCR/AMD SCSI ic. * Params : instance - a driver-specific filled-out structure * Returns : 0 on success */ -extern int fas216_release (struct Scsi_Host *instance); +extern void fas216_release (struct Scsi_Host *instance); -extern int fas216_info(FAS216_Info *info, char *buffer); extern int fas216_print_host(FAS216_Info *info, char *buffer); extern int fas216_print_stats(FAS216_Info *info, char *buffer); extern int fas216_print_device(FAS216_Info *info, Scsi_Device *scd, char *buffer); diff -Nru a/drivers/acorn/scsi/oak.c b/drivers/acorn/scsi/oak.c --- a/drivers/acorn/scsi/oak.c Sun Feb 9 21:13:28 2003 +++ b/drivers/acorn/scsi/oak.c Sun Feb 9 21:13:28 2003 @@ -192,7 +192,8 @@ .remove = __devexit_p(oakscsi_remove), .id_table = oakscsi_cids, .drv = { - .name = "oakscsi", + .devclass = &shost_devclass, + .name = "oakscsi", }, }; diff -Nru a/drivers/acorn/scsi/powertec.c b/drivers/acorn/scsi/powertec.c --- a/drivers/acorn/scsi/powertec.c Sun Feb 9 21:13:33 2003 +++ b/drivers/acorn/scsi/powertec.c Sun Feb 9 21:13:33 2003 @@ -1,7 +1,7 @@ /* * linux/drivers/acorn/scsi/powertec.c * - * Copyright (C) 1997-2002 Russell King + * Copyright (C) 1997-2003 Russell King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -32,24 +32,23 @@ #include -#define POWERTEC_FAS216_OFFSET 0xc00 -#define POWERTEC_FAS216_SHIFT 4 -#define POWERTEC_FAS216_SIZE (16 << POWERTEC_FAS216_SHIFT) +#define POWERTEC_FAS216_OFFSET 0x3000 +#define POWERTEC_FAS216_SHIFT 6 -#define POWERTEC_INTR_STATUS 0x800 +#define POWERTEC_INTR_STATUS 0x2000 #define POWERTEC_INTR_BIT 0x80 -#define POWERTEC_RESET_CONTROL 0x406 +#define POWERTEC_RESET_CONTROL 0x1018 #define POWERTEC_RESET_BIT 1 -#define POWERTEC_TERM_CONTROL 0x806 +#define POWERTEC_TERM_CONTROL 0x2018 #define POWERTEC_TERM_ENABLE 1 -#define POWERTEC_INTR_CONTROL 0x407 +#define POWERTEC_INTR_CONTROL 0x101c #define POWERTEC_INTR_ENABLE 1 #define POWERTEC_INTR_DISABLE 0 -#define VERSION "1.00 (13/11/2002 2.5.47)" +#define VERSION "1.10 (19/01/2003 2.5.59)" /* * Use term=0,1,0,0,0 to turn terminators on/off. @@ -60,10 +59,11 @@ #define NR_SG 256 struct powertec_info { - FAS216_Info info; - unsigned int term_port; - unsigned int term_ctl; - struct scatterlist sg[NR_SG]; + FAS216_Info info; + struct expansion_card *ec; + void *term_port; + unsigned int term_ctl; + struct scatterlist sg[NR_SG]; }; /* Prototype: void powertecscsi_irqenable(ec, irqnr) @@ -74,8 +74,7 @@ static void powertecscsi_irqenable(struct expansion_card *ec, int irqnr) { - unsigned int port = (unsigned int)ec->irq_data; - outb(POWERTEC_INTR_ENABLE, port); + writeb(POWERTEC_INTR_ENABLE, ec->irq_data); } /* Prototype: void powertecscsi_irqdisable(ec, irqnr) @@ -86,8 +85,7 @@ static void powertecscsi_irqdisable(struct expansion_card *ec, int irqnr) { - unsigned int port = (unsigned int)ec->irq_data; - outb(POWERTEC_INTR_DISABLE, port); + writeb(POWERTEC_INTR_DISABLE, ec->irq_data); } static const expansioncard_ops_t powertecscsi_ops = { @@ -106,7 +104,7 @@ struct powertec_info *info = (struct powertec_info *)host->hostdata; info->term_ctl = on_off ? POWERTEC_TERM_ENABLE : 0; - outb(info->term_ctl, info->term_port); + writeb(info->term_ctl, info->term_port); } /* Prototype: void powertecscsi_intr(irq, *dev_id, *regs) @@ -118,9 +116,9 @@ static void powertecscsi_intr(int irq, void *dev_id, struct pt_regs *regs) { - struct Scsi_Host *host = (struct Scsi_Host *)dev_id; + struct powertec_info *info = dev_id; - fas216_intr(host); + fas216_intr(&info->info); } /* Prototype: fasdmatype_t powertecscsi_dma_setup(host, SCpnt, direction, min_type) @@ -139,8 +137,8 @@ struct device *dev = scsi_get_device(host); int dmach = host->dma_channel; - if (dmach != NO_DMA && - (min_type == fasdma_real_all || SCp->this_residual >= 512)) { + if (info->info.ifcfg.capabilities & FASCAP_DMA && + min_type == fasdma_real_all) { int bufs, map_dir, dma_dir; bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG); @@ -188,13 +186,11 @@ const char *powertecscsi_info(struct Scsi_Host *host) { struct powertec_info *info = (struct powertec_info *)host->hostdata; - static char string[100], *p; + static char string[150]; - p = string; - p += sprintf(p, "%s ", host->hostt->name); - p += fas216_info(&info->info, p); - p += sprintf(p, "v%s terminators o%s", - VERSION, info->term_ctl ? "n" : "ff"); + sprintf(string, "%s (%s) in slot %d v%s terminators o%s", + host->hostt->name, info->info.scsi.type, info->ec->slot_no, + VERSION, info->term_ctl ? "n" : "ff"); return string; } @@ -262,7 +258,6 @@ begin = 0; pos = sprintf(buffer, "PowerTec SCSI driver v%s\n", VERSION); - pos += fas216_print_host(&info->info, buffer + pos); pos += sprintf(buffer + pos, "Term : o%s\n", info->term_ctl ? "n" : "ff"); @@ -290,6 +285,30 @@ return pos; } +static ssize_t powertecscsi_show_term(struct device *dev, char *buf) +{ + struct expansion_card *ec = ECARD_DEV(dev); + struct Scsi_Host *host = ecard_get_drvdata(ec); + struct powertec_info *info = (struct powertec_info *)host->hostdata; + + return sprintf(buf, "%d\n", info->term_ctl ? 1 : 0); +} + +static ssize_t +powertecscsi_store_term(struct device *dev, const char *buf, size_t len) +{ + struct expansion_card *ec = ECARD_DEV(dev); + struct Scsi_Host *host = ecard_get_drvdata(ec); + + if (len > 1) + powertecscsi_terminator_ctl(host, buf[0] != '0'); + + return len; +} + +static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR, + powertecscsi_show_term, powertecscsi_store_term); + static Scsi_Host_Template powertecscsi_template = { .module = THIS_MODULE, .proc_info = powertecscsi_proc_info, @@ -302,10 +321,10 @@ .eh_device_reset_handler = fas216_eh_device_reset, .eh_abort_handler = fas216_eh_abort, - .can_queue = 1, + .can_queue = 8, .this_id = 7, .sg_tablesize = SG_ALL, - .cmd_per_lun = 1, + .cmd_per_lun = 2, .use_clustering = ENABLE_CLUSTERING, .proc_name = "powertec", }; @@ -314,37 +333,50 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) { struct Scsi_Host *host; - struct powertec_info *info; - int ret = -ENOMEM; + struct powertec_info *info; + unsigned long resbase, reslen; + unsigned char *base; + int ret; + + resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST); + reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST); + + if (!request_mem_region(resbase, reslen, "powertecscsi")) { + ret = -EBUSY; + goto out; + } + + base = ioremap(resbase, reslen); + if (!base) { + ret = -ENOMEM; + goto out_region; + } host = scsi_register(&powertecscsi_template, sizeof (struct powertec_info)); - if (!host) - goto out; + if (!host) { + ret = -ENOMEM; + goto out_unmap; + } - host->io_port = ecard_address(ec, ECARD_IOC, ECARD_FAST); + host->base = (unsigned long)base; host->irq = ec->irq; host->dma_channel = ec->dma; - if (!request_region(host->io_port + POWERTEC_FAS216_OFFSET, - POWERTEC_FAS216_SIZE, "powertec2-fas")) { - ret = -EBUSY; - goto out_free; - } - - ec->irqaddr = (unsigned char *) - ioaddr(host->io_port + POWERTEC_INTR_STATUS); + ec->irqaddr = base + POWERTEC_INTR_STATUS; ec->irqmask = POWERTEC_INTR_BIT; - ec->irq_data = (void *)(host->io_port + POWERTEC_INTR_CONTROL); - ec->ops = (expansioncard_ops_t *)&powertecscsi_ops; + ec->irq_data = base + POWERTEC_INTR_CONTROL; + ec->ops = &powertecscsi_ops; ecard_set_drvdata(ec, host); info = (struct powertec_info *)host->hostdata; - info->term_port = host->io_port + POWERTEC_TERM_CONTROL; + info->term_port = base + POWERTEC_TERM_CONTROL; powertecscsi_terminator_ctl(host, term[ec->slot_no]); - info->info.scsi.io_port = host->io_port + POWERTEC_FAS216_OFFSET; + device_create_file(&ec->dev, &dev_attr_bus_term); + + info->info.scsi.io_base = base + POWERTEC_FAS216_OFFSET; info->info.scsi.io_shift = POWERTEC_FAS216_SHIFT; info->info.scsi.irq = host->irq; info->info.ifcfg.clockrate = 40; /* MHz */ @@ -354,16 +386,21 @@ info->info.ifcfg.cntl3 = CNTL3_BS8 | CNTL3_FASTSCSI | CNTL3_FASTCLK; info->info.ifcfg.disconnect_ok = 1; info->info.ifcfg.wide_max_size = 0; + info->info.ifcfg.capabilities = 0; info->info.dma.setup = powertecscsi_dma_setup; info->info.dma.pseudo = NULL; info->info.dma.stop = powertecscsi_dma_stop; + ret = fas216_init(host); + if (ret) + goto out_free; + ret = request_irq(host->irq, powertecscsi_intr, - SA_INTERRUPT, "powertec", host); + SA_INTERRUPT, "powertec", info); if (ret) { printk("scsi%d: IRQ%d not free: %d\n", host->host_no, host->irq, ret); - goto out_region; + goto out_release; } if (host->dma_channel != NO_DMA) { @@ -373,26 +410,31 @@ host->dma_channel = NO_DMA; } else { set_dma_speed(host->dma_channel, 180); + info->info.ifcfg.capabilities |= FASCAP_DMA; } } - fas216_init(host); - - ret = scsi_add_host(host, &ec->dev); + ret = fas216_add(host, &ec->dev); if (ret == 0) goto out; - fas216_release(host); - if (host->dma_channel != NO_DMA) free_dma(host->dma_channel); free_irq(host->irq, host); - out_region: - release_region(host->io_port + POWERTEC_FAS216_OFFSET, - POWERTEC_FAS216_SIZE); + + out_release: + fas216_release(host); + out_free: + device_remove_file(&ec->dev, &dev_attr_bus_term); scsi_unregister(host); + out_unmap: + iounmap(base); + + out_region: + release_mem_region(resbase, reslen); + out: return ret; } @@ -400,16 +442,26 @@ static void __devexit powertecscsi_remove(struct expansion_card *ec) { struct Scsi_Host *host = ecard_get_drvdata(ec); + struct powertecscsi_info *info = (struct powertecscsi_info *)host->hostdata; + unsigned long resbase, reslen; ecard_set_drvdata(ec, NULL); - scsi_remove_host(host); - fas216_release(host); + fas216_remove(host); + + device_remove_file(&ec->dev, &dev_attr_bus_term); if (host->dma_channel != NO_DMA) free_dma(host->dma_channel); - free_irq(host->irq, host); - release_region(host->io_port + POWERTEC_FAS216_OFFSET, - POWERTEC_FAS216_SIZE); + free_irq(host->irq, info); + + iounmap((void *)host->base); + + resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST); + reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST); + + release_mem_region(resbase, reslen); + + fas216_release(host); scsi_unregister(host); } @@ -423,7 +475,8 @@ .remove = __devexit_p(powertecscsi_remove), .id_table = powertecscsi_cids, .drv = { - .name = "powertecscsi", + .devclass = &shost_devclass, + .name = "powertecscsi", }, }; diff -Nru a/drivers/acorn/scsi/scsi.h b/drivers/acorn/scsi/scsi.h --- a/drivers/acorn/scsi/scsi.h Sun Feb 9 21:13:29 2003 +++ b/drivers/acorn/scsi/scsi.h Sun Feb 9 21:13:29 2003 @@ -55,8 +55,6 @@ SCp->ptr += 1; SCp->this_residual -= 1; - if (SCp->this_residual == 0) - next_SCp(SCp); return c; } @@ -66,8 +64,6 @@ *SCp->ptr = c; SCp->ptr += 1; SCp->this_residual -= 1; - if (SCp->this_residual == 0) - next_SCp(SCp); } static inline void init_SCp(Scsi_Cmnd *SCpnt) @@ -112,7 +108,7 @@ * we aren't interested in the buffer pointer. */ if (SCpnt->SCp.this_residual == 0 && SCpnt->SCp.ptr) { -#ifdef BELT_AND_BRACES +#if 0 //def BELT_AND_BRACES printk(KERN_WARNING "scsi%d.%c: zero length buffer passed for " "command ", SCpnt->host->host_no, '0' + SCpnt->target); print_command(SCpnt->cmnd); diff -Nru a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig --- a/drivers/acpi/Kconfig Sun Feb 9 21:13:37 2003 +++ b/drivers/acpi/Kconfig Sun Feb 9 21:13:37 2003 @@ -116,14 +116,6 @@ ACPI C2 and C3 processor states to save power, on systems that support it. -config ACPI_PROCESSOR_PERF - bool "Processor Performance States" - depends on X86 && ACPI && !ACPI_HT_ONLY && ACPI_PROCESSOR && CPU_FREQ - help - This driver adds support for CPU frequency scaling, if this is supported - by the hardware and the BIOS. If you are compiling for a mobile system, - say Y. - config ACPI_THERMAL tristate "Thermal Zone" depends on ACPI_PROCESSOR diff -Nru a/drivers/acpi/Makefile b/drivers/acpi/Makefile --- a/drivers/acpi/Makefile Sun Feb 9 21:13:36 2003 +++ b/drivers/acpi/Makefile Sun Feb 9 21:13:36 2003 @@ -4,15 +4,13 @@ export ACPI_CFLAGS -ACPI_CFLAGS := -D_LINUX -Idrivers/acpi/include +ACPI_CFLAGS := -D_LINUX -Os -Iinclude/acpi ifdef CONFIG_ACPI_DEBUG ACPI_CFLAGS += -DACPI_DEBUG_OUTPUT endif EXTRA_CFLAGS += $(ACPI_CFLAGS) - -export-objs := acpi_ksyms.o processor.o obj-y := acpi_ksyms.o diff -Nru a/drivers/acpi/ac.c b/drivers/acpi/ac.c --- a/drivers/acpi/ac.c Sun Feb 9 21:13:31 2003 +++ b/drivers/acpi/ac.c Sun Feb 9 21:13:31 2003 @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include "acpi_bus.h" diff -Nru a/drivers/acpi/acpi_bus.h b/drivers/acpi/acpi_bus.h --- a/drivers/acpi/acpi_bus.h Sun Feb 9 21:13:31 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,312 +0,0 @@ -/* - * acpi_bus.h - ACPI Bus Driver ($Revision: 22 $) - * - * Copyright (C) 2001, 2002 Andy Grover - * Copyright (C) 2001, 2002 Paul Diefenbaugh - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - */ - -#ifndef __ACPI_BUS_H__ -#define __ACPI_BUS_H__ - -#include -#include - -#include "include/acpi.h" - -#define PREFIX "ACPI: " - -extern int acpi_disabled; - -/* TBD: Make dynamic */ -#define ACPI_MAX_HANDLES 10 -struct acpi_handle_list { - u32 count; - acpi_handle handles[ACPI_MAX_HANDLES]; -}; - - -/* acpi_utils.h */ -acpi_status -acpi_extract_package ( - union acpi_object *package, - struct acpi_buffer *format, - struct acpi_buffer *buffer); -acpi_status -acpi_evaluate_integer ( - acpi_handle handle, - acpi_string pathname, - struct acpi_object_list *arguments, - unsigned long *data); -acpi_status -acpi_evaluate_reference ( - acpi_handle handle, - acpi_string pathname, - struct acpi_object_list *arguments, - struct acpi_handle_list *list); - - -#ifdef CONFIG_ACPI_BUS - -#include - -#define ACPI_BUS_FILE_ROOT "acpi" -extern struct proc_dir_entry *acpi_root_dir; -extern FADT_DESCRIPTOR acpi_fadt; - -enum acpi_bus_removal_type { - ACPI_BUS_REMOVAL_NORMAL = 0, - ACPI_BUS_REMOVAL_EJECT, - ACPI_BUS_REMOVAL_SUPRISE, - ACPI_BUS_REMOVAL_TYPE_COUNT -}; - -enum acpi_bus_device_type { - ACPI_BUS_TYPE_DEVICE = 0, - ACPI_BUS_TYPE_POWER, - ACPI_BUS_TYPE_PROCESSOR, - ACPI_BUS_TYPE_THERMAL, - ACPI_BUS_TYPE_SYSTEM, - ACPI_BUS_TYPE_POWER_BUTTON, - ACPI_BUS_TYPE_SLEEP_BUTTON, - ACPI_BUS_DEVICE_TYPE_COUNT -}; - -struct acpi_driver; -struct acpi_device; - - -/* - * ACPI Driver - * ----------- - */ - -typedef int (*acpi_op_add) (struct acpi_device *device); -typedef int (*acpi_op_remove) (struct acpi_device *device, int type); -typedef int (*acpi_op_lock) (struct acpi_device *device, int type); -typedef int (*acpi_op_start) (struct acpi_device *device); -typedef int (*acpi_op_stop) (struct acpi_device *device, int type); -typedef int (*acpi_op_suspend) (struct acpi_device *device, int state); -typedef int (*acpi_op_resume) (struct acpi_device *device, int state); -typedef int (*acpi_op_scan) (struct acpi_device *device); -typedef int (*acpi_op_bind) (struct acpi_device *device); - -struct acpi_device_ops { - acpi_op_add add; - acpi_op_remove remove; - acpi_op_lock lock; - acpi_op_start start; - acpi_op_stop stop; - acpi_op_suspend suspend; - acpi_op_resume resume; - acpi_op_scan scan; - acpi_op_bind bind; -}; - -struct acpi_driver { - struct list_head node; - char name[80]; - char class[80]; - atomic_t references; - char *ids; /* Supported Hardware IDs */ - struct acpi_device_ops ops; -}; - -/* - * ACPI Device - * ----------- - */ - -/* Status (_STA) */ - -struct acpi_device_status { - u32 present:1; - u32 enabled:1; - u32 show_in_ui:1; - u32 functional:1; - u32 battery_present:1; - u32 reserved:27; -}; - - -/* Flags */ - -struct acpi_device_flags { - u32 dynamic_status:1; - u32 hardware_id:1; - u32 compatible_ids:1; - u32 bus_address:1; - u32 unique_id:1; - u32 removable:1; - u32 ejectable:1; - u32 lockable:1; - u32 suprise_removal_ok:1; - u32 power_manageable:1; - u32 performance_manageable:1; - u32 reserved:21; -}; - - -/* File System */ - -struct acpi_device_dir { - struct proc_dir_entry *entry; -}; - -#define acpi_device_dir(d) ((d)->dir.entry) - - -/* Plug and Play */ - -typedef char acpi_bus_id[5]; -typedef unsigned long acpi_bus_address; -typedef char acpi_hardware_id[9]; -typedef char acpi_unique_id[9]; -typedef char acpi_device_name[40]; -typedef char acpi_device_class[20]; - -struct acpi_device_pnp { - acpi_bus_id bus_id; /* Object name */ - acpi_bus_address bus_address; /* _ADR */ - acpi_hardware_id hardware_id; /* _HID */ - acpi_unique_id unique_id; /* _UID */ - acpi_device_name device_name; /* Driver-determined */ - acpi_device_class device_class; /* " */ -}; - -#define acpi_device_bid(d) ((d)->pnp.bus_id) -#define acpi_device_adr(d) ((d)->pnp.bus_address) -#define acpi_device_hid(d) ((d)->pnp.hardware_id) -#define acpi_device_uid(d) ((d)->pnp.unique_id) -#define acpi_device_name(d) ((d)->pnp.device_name) -#define acpi_device_class(d) ((d)->pnp.device_class) - - -/* Power Management */ - -struct acpi_device_power_flags { - u32 explicit_get:1; /* _PSC present? */ - u32 power_resources:1; /* Power resources */ - u32 inrush_current:1; /* Serialize Dx->D0 */ - u32 wake_capable:1; /* Wakeup supported? */ - u32 wake_enabled:1; /* Enabled for wakeup */ - u32 power_removed:1; /* Optimize Dx->D0 */ - u32 reserved:26; -}; - -struct acpi_device_power_state { - struct { - u8 valid:1; - u8 explicit_set:1; /* _PSx present? */ - u8 reserved:6; - } flags; - int power; /* % Power (compared to D0) */ - int latency; /* Dx->D0 time (microseconds) */ - struct acpi_handle_list resources; /* Power resources referenced */ -}; - -struct acpi_device_power { - int state; /* Current state */ - struct acpi_device_power_flags flags; - struct acpi_device_power_state states[4]; /* Power states (D0-D3) */ -}; - - -/* Performance Management */ - -struct acpi_device_perf_flags { - u8 reserved:8; -}; - -struct acpi_device_perf_state { - struct { - u8 valid:1; - u8 reserved:7; - } flags; - u8 power; /* % Power (compared to P0) */ - u8 performance; /* % Performance ( " ) */ - int latency; /* Px->P0 time (microseconds) */ -}; - -struct acpi_device_perf { - int state; - struct acpi_device_perf_flags flags; - int state_count; - struct acpi_device_perf_state *states; -}; - - -/* Device */ - -struct acpi_device { - acpi_handle handle; - struct acpi_device *parent; - struct list_head children; - struct list_head node; - struct list_head g_list; - struct acpi_device_status status; - struct acpi_device_flags flags; - struct acpi_device_pnp pnp; - struct acpi_device_power power; - struct acpi_device_perf performance; - struct acpi_device_dir dir; - struct acpi_device_ops ops; - struct acpi_driver *driver; - void *driver_data; - struct kobject kobj; -}; - -#define acpi_driver_data(d) ((d)->driver_data) - - -/* - * Events - * ------ - */ - -struct acpi_bus_event { - struct list_head node; - acpi_device_class device_class; - acpi_bus_id bus_id; - u32 type; - u32 data; -}; - -extern struct subsystem acpi_subsys; - -/* - * External Functions - */ - -int acpi_bus_get_device(acpi_handle, struct acpi_device **device); -int acpi_bus_get_status (struct acpi_device *device); -int acpi_bus_get_power (acpi_handle handle, int *state); -int acpi_bus_set_power (acpi_handle handle, int state); -int acpi_bus_generate_event (struct acpi_device *device, u8 type, int data); -int acpi_bus_receive_event (struct acpi_bus_event *event); -int acpi_bus_register_driver (struct acpi_driver *driver); -int acpi_bus_unregister_driver (struct acpi_driver *driver); - -int acpi_create_dir(struct acpi_device *); -void acpi_remove_dir(struct acpi_device *); - -#endif /*CONFIG_ACPI_BUS*/ - -#endif /*__ACPI_BUS_H__*/ diff -Nru a/drivers/acpi/acpi_drivers.h b/drivers/acpi/acpi_drivers.h --- a/drivers/acpi/acpi_drivers.h Sun Feb 9 21:13:34 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,163 +0,0 @@ -/* - * acpi_drivers.h ($Revision: 31 $) - * - * Copyright (C) 2001, 2002 Andy Grover - * Copyright (C) 2001, 2002 Paul Diefenbaugh - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - */ - -#ifndef __ACPI_DRIVERS_H__ -#define __ACPI_DRIVERS_H__ - -#include -#include "acpi_bus.h" - - -#define ACPI_MAX_STRING 80 - -#define ACPI_BUS_COMPONENT 0x00010000 -#define ACPI_SYSTEM_COMPONENT 0x02000000 - -/* _HID definitions */ - -#define ACPI_POWER_HID "ACPI_PWR" -#define ACPI_PROCESSOR_HID "ACPI_CPU" -#define ACPI_SYSTEM_HID "ACPI_SYS" -#define ACPI_THERMAL_HID "ACPI_THM" -#define ACPI_BUTTON_HID_POWERF "ACPI_FPB" -#define ACPI_BUTTON_HID_SLEEPF "ACPI_FSB" - - -/* -------------------------------------------------------------------------- - PCI - -------------------------------------------------------------------------- */ - -#ifdef CONFIG_ACPI_PCI - -#define ACPI_PCI_COMPONENT 0x00400000 - -/* ACPI PCI Root Bridge (pci_root.c) */ - -void acpi_pci_get_translations (struct acpi_pci_id* id, u64* mem_tra, u64* io_tra); - -/* ACPI PCI Interrupt Link (pci_link.c) */ - -int acpi_pci_link_check (void); -int acpi_pci_link_get_irq (acpi_handle handle, int index); - -/* ACPI PCI Interrupt Routing (pci_irq.c) */ - -int acpi_pci_irq_add_prt (acpi_handle handle, int segment, int bus); - -/* ACPI PCI Device Binding (pci_bind.c) */ - -struct pci_bus; - -int acpi_pci_bind (struct acpi_device *device); -int acpi_pci_bind_root (struct acpi_device *device, struct acpi_pci_id *id, struct pci_bus *bus); - -#endif /*CONFIG_ACPI_PCI*/ - - -/* -------------------------------------------------------------------------- - Power Resource - -------------------------------------------------------------------------- */ - -#ifdef CONFIG_ACPI_POWER - -int acpi_power_get_inferred_state (struct acpi_device *device); -int acpi_power_transition (struct acpi_device *device, int state); -#endif - - -/* -------------------------------------------------------------------------- - Embedded Controller - -------------------------------------------------------------------------- */ -#ifdef CONFIG_ACPI_EC -int acpi_ec_ecdt_probe (void); -#endif - -/* -------------------------------------------------------------------------- - Processor - -------------------------------------------------------------------------- */ - -#define ACPI_PROCESSOR_LIMIT_NONE 0x00 -#define ACPI_PROCESSOR_LIMIT_INCREMENT 0x01 -#define ACPI_PROCESSOR_LIMIT_DECREMENT 0x02 - -int acpi_processor_set_thermal_limit(acpi_handle handle, int type); - - -/* -------------------------------------------------------------------------- - Debug Support - -------------------------------------------------------------------------- */ - -#define ACPI_DEBUG_RESTORE 0 -#define ACPI_DEBUG_LOW 1 -#define ACPI_DEBUG_MEDIUM 2 -#define ACPI_DEBUG_HIGH 3 -#define ACPI_DEBUG_DRIVERS 4 - -extern u32 acpi_dbg_level; -extern u32 acpi_dbg_layer; - -static inline void -acpi_set_debug ( - u32 flag) -{ - static u32 layer_save; - static u32 level_save; - - switch (flag) { - case ACPI_DEBUG_RESTORE: - acpi_dbg_layer = layer_save; - acpi_dbg_level = level_save; - break; - case ACPI_DEBUG_LOW: - case ACPI_DEBUG_MEDIUM: - case ACPI_DEBUG_HIGH: - case ACPI_DEBUG_DRIVERS: - layer_save = acpi_dbg_layer; - level_save = acpi_dbg_level; - break; - } - - switch (flag) { - case ACPI_DEBUG_LOW: - acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS; - acpi_dbg_level = ACPI_DEBUG_DEFAULT; - break; - case ACPI_DEBUG_MEDIUM: - acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS; - acpi_dbg_level = ACPI_LV_FUNCTIONS | ACPI_LV_ALL_EXCEPTIONS; - break; - case ACPI_DEBUG_HIGH: - acpi_dbg_layer = 0xFFFFFFFF; - acpi_dbg_level = 0xFFFFFFFF; - break; - case ACPI_DEBUG_DRIVERS: - acpi_dbg_layer = ACPI_ALL_DRIVERS; - acpi_dbg_level = 0xFFFFFFFF; - break; - } -} - - -#endif /*__ACPI_DRIVERS_H__*/ diff -Nru a/drivers/acpi/acpi_ksyms.c b/drivers/acpi/acpi_ksyms.c --- a/drivers/acpi/acpi_ksyms.c Sun Feb 9 21:13:30 2003 +++ b/drivers/acpi/acpi_ksyms.c Sun Feb 9 21:13:30 2003 @@ -25,7 +25,7 @@ #include #include -#include "include/acpi.h" +#include #include "acpi_bus.h" diff -Nru a/drivers/acpi/battery.c b/drivers/acpi/battery.c --- a/drivers/acpi/battery.c Sun Feb 9 21:13:34 2003 +++ b/drivers/acpi/battery.c Sun Feb 9 21:13:34 2003 @@ -27,7 +27,6 @@ #include #include #include -#include #include #include "acpi_bus.h" #include "acpi_drivers.h" diff -Nru a/drivers/acpi/button.c b/drivers/acpi/button.c --- a/drivers/acpi/button.c Sun Feb 9 21:13:28 2003 +++ b/drivers/acpi/button.c Sun Feb 9 21:13:28 2003 @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include "acpi_bus.h" diff -Nru a/drivers/acpi/dispatcher/dsinit.c b/drivers/acpi/dispatcher/dsinit.c --- a/drivers/acpi/dispatcher/dsinit.c Sun Feb 9 21:13:36 2003 +++ b/drivers/acpi/dispatcher/dsinit.c Sun Feb 9 21:13:36 2003 @@ -24,11 +24,8 @@ #include "acpi.h" -#include "acparser.h" -#include "amlcode.h" #include "acdispat.h" #include "acnamesp.h" -#include "acinterp.h" #define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME ("dsinit") diff -Nru a/drivers/acpi/ec.c b/drivers/acpi/ec.c --- a/drivers/acpi/ec.c Sun Feb 9 21:13:32 2003 +++ b/drivers/acpi/ec.c Sun Feb 9 21:13:32 2003 @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include "acpi_bus.h" diff -Nru a/drivers/acpi/fan.c b/drivers/acpi/fan.c --- a/drivers/acpi/fan.c Sun Feb 9 21:13:28 2003 +++ b/drivers/acpi/fan.c Sun Feb 9 21:13:28 2003 @@ -27,7 +27,6 @@ #include #include #include -#include #include #include "acpi_bus.h" #include "acpi_drivers.h" diff -Nru a/drivers/acpi/hardware/hwtimer.c b/drivers/acpi/hardware/hwtimer.c --- a/drivers/acpi/hardware/hwtimer.c Sun Feb 9 21:13:29 2003 +++ b/drivers/acpi/hardware/hwtimer.c Sun Feb 9 21:13:29 2003 @@ -117,7 +117,10 @@ * Note that this function accomodates only a single timer * rollover. Thus for 24-bit timers, this function should only * be used for calculating durations less than ~4.6 seconds - * (~20 hours for 32-bit timers). + * (~20 minutes for 32-bit timers) -- calculations below + * + * 2**24 Ticks / 3,600,000 Ticks/Sec = 4.66 sec + * 2**32 Ticks / 3,600,000 Ticks/Sec = 1193 sec or 19.88 minutes * ******************************************************************************/ diff -Nru a/drivers/acpi/include/acconfig.h b/drivers/acpi/include/acconfig.h --- a/drivers/acpi/include/acconfig.h Sun Feb 9 21:13:34 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,188 +0,0 @@ -/****************************************************************************** - * - * Name: acconfig.h - Global configuration constants - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _ACCONFIG_H -#define _ACCONFIG_H - - -/****************************************************************************** - * - * Compile-time options - * - *****************************************************************************/ - -/* - * ACPI_DEBUG_OUTPUT - This switch enables all the debug facilities of the - * ACPI subsystem. This includes the DEBUG_PRINT output - * statements. When disabled, all DEBUG_PRINT - * statements are compiled out. - * - * ACPI_APPLICATION - Use this switch if the subsystem is going to be run - * at the application level. - * - */ - - -/****************************************************************************** - * - * Subsystem Constants - * - *****************************************************************************/ - - -/* Version string */ - -#define ACPI_CA_VERSION 0x20030109 - -/* Version of ACPI supported */ - -#define ACPI_CA_SUPPORT_LEVEL 2 - -/* Maximum objects in the various object caches */ - -#define ACPI_MAX_STATE_CACHE_DEPTH 64 /* State objects for stacks */ -#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ -#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 64 /* Parse tree objects */ -#define ACPI_MAX_OBJECT_CACHE_DEPTH 64 /* Interpreter operand objects */ -#define ACPI_MAX_WALK_CACHE_DEPTH 4 /* Objects for parse tree walks */ - -/* String size constants */ - -#define ACPI_MAX_STRING_LENGTH 512 -#define ACPI_PATHNAME_MAX 256 /* A full namespace pathname */ - -/* Maximum count for a semaphore object */ - -#define ACPI_MAX_SEMAPHORE_COUNT 256 - -/* Max reference count (for debug only) */ - -#define ACPI_MAX_REFERENCE_COUNT 0x400 - -/* Size of cached memory mapping for system memory operation region */ - -#define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096 - - -/****************************************************************************** - * - * Configuration of subsystem behavior - * - *****************************************************************************/ - - -/* - * Should the subystem abort the loading of an ACPI table if the - * table checksum is incorrect? - */ -#define ACPI_CHECKSUM_ABORT FALSE - - -/****************************************************************************** - * - * ACPI Specification constants (Do not change unless the specification changes) - * - *****************************************************************************/ - -/* Number of distinct GPE register blocks and register width */ - -#define ACPI_MAX_GPE_BLOCKS 2 -#define ACPI_GPE_REGISTER_WIDTH 8 - -/* - * Method info (in WALK_STATE), containing local variables and argumetns - */ -#define ACPI_METHOD_NUM_LOCALS 8 -#define ACPI_METHOD_MAX_LOCAL 7 - -#define ACPI_METHOD_NUM_ARGS 7 -#define ACPI_METHOD_MAX_ARG 6 - -/* Maximum length of resulting string when converting from a buffer */ - -#define ACPI_MAX_STRING_CONVERSION 200 - -/* - * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG - */ -#define ACPI_OBJ_NUM_OPERANDS 8 -#define ACPI_OBJ_MAX_OPERAND 7 - -/* Names within the namespace are 4 bytes long */ - -#define ACPI_NAME_SIZE 4 -#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ -#define ACPI_PATH_SEPARATOR '.' - -/* Constants used in searching for the RSDP in low memory */ - -#define ACPI_LO_RSDP_WINDOW_BASE 0 /* Physical Address */ -#define ACPI_HI_RSDP_WINDOW_BASE 0xE0000 /* Physical Address */ -#define ACPI_LO_RSDP_WINDOW_SIZE 0x400 -#define ACPI_HI_RSDP_WINDOW_SIZE 0x20000 -#define ACPI_RSDP_SCAN_STEP 16 - -/* Operation regions */ - -#define ACPI_NUM_PREDEFINED_REGIONS 8 -#define ACPI_USER_REGION_BEGIN 0x80 - -/* Maximum space_ids for Operation Regions */ - -#define ACPI_MAX_ADDRESS_SPACE 255 - -/* Array sizes. Used for range checking also */ - -#define ACPI_NUM_ACCESS_TYPES 6 -#define ACPI_NUM_UPDATE_RULES 3 -#define ACPI_NUM_LOCK_RULES 2 -#define ACPI_NUM_MATCH_OPS 6 -#define ACPI_NUM_OPCODES 256 -#define ACPI_NUM_FIELD_NAMES 2 - -/* RSDP checksums */ - -#define ACPI_RSDP_CHECKSUM_LENGTH 20 -#define ACPI_RSDP_XCHECKSUM_LENGTH 36 - -/* SMBus bidirectional buffer size */ - -#define ACPI_SMBUS_BUFFER_SIZE 34 - - -/****************************************************************************** - * - * ACPI AML Debugger - * - *****************************************************************************/ - - -#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */ - -#define ACPI_DEBUGGER_COMMAND_PROMPT '-' -#define ACPI_DEBUGGER_EXECUTE_PROMPT '%' - - -#endif /* _ACCONFIG_H */ - diff -Nru a/drivers/acpi/include/acdebug.h b/drivers/acpi/include/acdebug.h --- a/drivers/acpi/include/acdebug.h Sun Feb 9 21:13:29 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,430 +0,0 @@ -/****************************************************************************** - * - * Name: acdebug.h - ACPI/AML debugger - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACDEBUG_H__ -#define __ACDEBUG_H__ - - -#define ACPI_DEBUG_BUFFER_SIZE 4196 - -struct command_info -{ - char *name; /* Command Name */ - u8 min_args; /* Minimum arguments required */ -}; - - -struct argument_info -{ - char *name; /* Argument Name */ -}; - - -#define PARAM_LIST(pl) pl - -#define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose) - -#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\ - acpi_os_printf PARAM_LIST(fp);} - -#define EX_NO_SINGLE_STEP 1 -#define EX_SINGLE_STEP 2 - - -/* Prototypes */ - - -/* - * dbapi - external debugger interfaces - */ - -acpi_status -acpi_db_initialize ( - void); - -void -acpi_db_terminate ( - void); - -acpi_status -acpi_db_single_step ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - u32 op_type); - - -/* - * dbcmds - debug commands and output routines - */ - -void -acpi_db_display_table_info ( - char *table_arg); - -void -acpi_db_unload_acpi_table ( - char *table_arg, - char *instance_arg); - -void -acpi_db_set_method_breakpoint ( - char *location, - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); - -void -acpi_db_set_method_call_breakpoint ( - union acpi_parse_object *op); - -void -acpi_db_disassemble_aml ( - char *statements, - union acpi_parse_object *op); - -void -acpi_db_dump_namespace ( - char *start_arg, - char *depth_arg); - -void -acpi_db_dump_namespace_by_owner ( - char *owner_arg, - char *depth_arg); - -void -acpi_db_send_notify ( - char *name, - u32 value); - -void -acpi_db_set_method_data ( - char *type_arg, - char *index_arg, - char *value_arg); - -acpi_status -acpi_db_display_objects ( - char *obj_type_arg, - char *display_count_arg); - -acpi_status -acpi_db_find_name_in_namespace ( - char *name_arg); - -void -acpi_db_set_scope ( - char *name); - -void -acpi_db_find_references ( - char *object_arg); - -void -acpi_db_display_locks (void); - - -void -acpi_db_display_resources ( - char *object_arg); - -void -acpi_db_check_integrity ( - void); - -acpi_status -acpi_db_integrity_walk ( - acpi_handle obj_handle, - u32 nesting_level, - void *context, - void **return_value); - -acpi_status -acpi_db_walk_and_match_name ( - acpi_handle obj_handle, - u32 nesting_level, - void *context, - void **return_value); - -acpi_status -acpi_db_walk_for_references ( - acpi_handle obj_handle, - u32 nesting_level, - void *context, - void **return_value); - -acpi_status -acpi_db_walk_for_specific_objects ( - acpi_handle obj_handle, - u32 nesting_level, - void *context, - void **return_value); - - -/* - * dbdisply - debug display commands - */ - -void -acpi_db_display_method_info ( - union acpi_parse_object *op); - -void -acpi_db_decode_and_display_object ( - char *target, - char *output_type); - -void -acpi_db_decode_node ( - struct acpi_namespace_node *node); - -void -acpi_db_display_result_object ( - union acpi_operand_object *obj_desc, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_db_display_all_methods ( - char *display_count_arg); - -void -acpi_db_display_internal_object ( - union acpi_operand_object *obj_desc, - struct acpi_walk_state *walk_state); - -void -acpi_db_display_arguments ( - void); - -void -acpi_db_display_locals ( - void); - -void -acpi_db_display_results ( - void); - -void -acpi_db_display_calling_tree ( - void); - -void -acpi_db_display_argument_object ( - union acpi_operand_object *obj_desc, - struct acpi_walk_state *walk_state); - -void -acpi_db_dump_parser_descriptor ( - union acpi_parse_object *op); - -void * -acpi_db_get_pointer ( - void *target); - -void -acpi_db_decode_internal_object ( - union acpi_operand_object *obj_desc); - - -/* - * dbexec - debugger control method execution - */ - -void -acpi_db_execute ( - char *name, - char **args, - u32 flags); - -void -acpi_db_create_execution_threads ( - char *num_threads_arg, - char *num_loops_arg, - char *method_name_arg); - -acpi_status -acpi_db_execute_method ( - struct acpi_db_method_info *info, - struct acpi_buffer *return_obj); - -void -acpi_db_execute_setup ( - struct acpi_db_method_info *info); - -u32 -acpi_db_get_outstanding_allocations ( - void); - -void ACPI_SYSTEM_XFACE -acpi_db_method_thread ( - void *context); - - -/* - * dbfileio - Debugger file I/O commands - */ - -acpi_object_type -acpi_db_match_argument ( - char *user_argument, - struct argument_info *arguments); - -acpi_status -ae_local_load_table ( - struct acpi_table_header *table_ptr); - -void -acpi_db_close_debug_file ( - void); - -void -acpi_db_open_debug_file ( - char *name); - -acpi_status -acpi_db_load_acpi_table ( - char *filename); - -acpi_status -acpi_db_get_acpi_table ( - char *filename); - -/* - * dbhistry - debugger HISTORY command - */ - -void -acpi_db_add_to_history ( - char *command_line); - -void -acpi_db_display_history (void); - -char * -acpi_db_get_from_history ( - char *command_num_arg); - - -/* - * dbinput - user front-end to the AML debugger - */ - -acpi_status -acpi_db_command_dispatch ( - char *input_buffer, - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); - -void ACPI_SYSTEM_XFACE -acpi_db_execute_thread ( - void *context); - -acpi_status -acpi_db_user_commands ( - char prompt, - union acpi_parse_object *op); - -void -acpi_db_display_help ( - char *help_type); - -char * -acpi_db_get_next_token ( - char *string, - char **next); - -u32 -acpi_db_get_line ( - char *input_buffer); - -u32 -acpi_db_match_command ( - char *user_command); - -void -acpi_db_single_thread ( - void); - - -/* - * dbstats - Generation and display of ACPI table statistics - */ - -void -acpi_db_generate_statistics ( - union acpi_parse_object *root, - u8 is_method); - - -acpi_status -acpi_db_display_statistics ( - char *type_arg); - -acpi_status -acpi_db_classify_one_object ( - acpi_handle obj_handle, - u32 nesting_level, - void *context, - void **return_value); - -void -acpi_db_count_namespace_objects ( - void); - -void -acpi_db_enumerate_object ( - union acpi_operand_object *obj_desc); - - -/* - * dbutils - AML debugger utilities - */ - -void -acpi_db_set_output_destination ( - u32 where); - -void -acpi_db_dump_buffer ( - u32 address); - -void -acpi_db_dump_object ( - union acpi_object *obj_desc, - u32 level); - -void -acpi_db_prep_namestring ( - char *name); - - -acpi_status -acpi_db_second_pass_parse ( - union acpi_parse_object *root); - -struct acpi_namespace_node * -acpi_db_local_ns_lookup ( - char *name); - - -#endif /* __ACDEBUG_H__ */ diff -Nru a/drivers/acpi/include/acdispat.h b/drivers/acpi/include/acdispat.h --- a/drivers/acpi/include/acdispat.h Sun Feb 9 21:13:34 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,494 +0,0 @@ -/****************************************************************************** - * - * Name: acdispat.h - dispatcher (parser to interpreter interface) - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _ACDISPAT_H_ -#define _ACDISPAT_H_ - - -#define NAMEOF_LOCAL_NTE "__L0" -#define NAMEOF_ARG_NTE "__A0" - - -/* Common interfaces */ - -acpi_status -acpi_ds_obj_stack_push ( - void *object, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_obj_stack_pop ( - u32 pop_count, - struct acpi_walk_state *walk_state); - -void * -acpi_ds_obj_stack_get_value ( - u32 index, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_obj_stack_pop_object ( - union acpi_operand_object **object, - struct acpi_walk_state *walk_state); - - -/* dsopcode - support for late evaluation */ - -acpi_status -acpi_ds_execute_arguments ( - struct acpi_namespace_node *node, - struct acpi_namespace_node *scope_node, - u32 aml_length, - u8 *aml_start); - -acpi_status -acpi_ds_get_buffer_field_arguments ( - union acpi_operand_object *obj_desc); - -acpi_status -acpi_ds_get_region_arguments ( - union acpi_operand_object *rgn_desc); - -acpi_status -acpi_ds_get_buffer_arguments ( - union acpi_operand_object *obj_desc); - -acpi_status -acpi_ds_get_package_arguments ( - union acpi_operand_object *obj_desc); - -acpi_status -acpi_ds_init_buffer_field ( - u16 aml_opcode, - union acpi_operand_object *obj_desc, - union acpi_operand_object *buffer_desc, - union acpi_operand_object *offset_desc, - union acpi_operand_object *length_desc, - union acpi_operand_object *result_desc); - -acpi_status -acpi_ds_eval_buffer_field_operands ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); - -acpi_status -acpi_ds_eval_region_operands ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); - -acpi_status -acpi_ds_eval_data_object_operands ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - union acpi_operand_object *obj_desc); - -acpi_status -acpi_ds_initialize_region ( - acpi_handle obj_handle); - - -/* dsctrl - Parser/Interpreter interface, control stack routines */ - - -acpi_status -acpi_ds_exec_begin_control_op ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); - -acpi_status -acpi_ds_exec_end_control_op ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); - - -/* dsexec - Parser/Interpreter interface, method execution callbacks */ - - -acpi_status -acpi_ds_get_predicate_value ( - struct acpi_walk_state *walk_state, - union acpi_operand_object *result_obj); - -acpi_status -acpi_ds_exec_begin_op ( - struct acpi_walk_state *walk_state, - union acpi_parse_object **out_op); - -acpi_status -acpi_ds_exec_end_op ( - struct acpi_walk_state *state); - - -/* dsfield - Parser/Interpreter interface for AML fields */ - -acpi_status -acpi_ds_get_field_names ( - struct acpi_create_field_info *info, - struct acpi_walk_state *walk_state, - union acpi_parse_object *arg); - -acpi_status -acpi_ds_create_field ( - union acpi_parse_object *op, - struct acpi_namespace_node *region_node, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_create_bank_field ( - union acpi_parse_object *op, - struct acpi_namespace_node *region_node, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_create_index_field ( - union acpi_parse_object *op, - struct acpi_namespace_node *region_node, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_create_buffer_field ( - union acpi_parse_object *op, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_init_field_objects ( - union acpi_parse_object *op, - struct acpi_walk_state *walk_state); - - -/* dsload - Parser/Interpreter interface, namespace load callbacks */ - -acpi_status -acpi_ds_load1_begin_op ( - struct acpi_walk_state *walk_state, - union acpi_parse_object **out_op); - -acpi_status -acpi_ds_load1_end_op ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_load2_begin_op ( - struct acpi_walk_state *walk_state, - union acpi_parse_object **out_op); - -acpi_status -acpi_ds_load2_end_op ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_init_callbacks ( - struct acpi_walk_state *walk_state, - u32 pass_number); - - -/* dsmthdat - method data (locals/args) */ - - -acpi_status -acpi_ds_store_object_to_local ( - u16 opcode, - u32 index, - union acpi_operand_object *src_desc, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_method_data_get_entry ( - u16 opcode, - u32 index, - struct acpi_walk_state *walk_state, - union acpi_operand_object ***node); - -void -acpi_ds_method_data_delete_all ( - struct acpi_walk_state *walk_state); - -u8 -acpi_ds_is_method_value ( - union acpi_operand_object *obj_desc); - -acpi_object_type -acpi_ds_method_data_get_type ( - u16 opcode, - u32 index, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_method_data_get_value ( - u16 opcode, - u32 index, - struct acpi_walk_state *walk_state, - union acpi_operand_object **dest_desc); - -void -acpi_ds_method_data_delete_value ( - u16 opcode, - u32 index, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_method_data_init_args ( - union acpi_operand_object **params, - u32 max_param_count, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_method_data_get_node ( - u16 opcode, - u32 index, - struct acpi_walk_state *walk_state, - struct acpi_namespace_node **node); - -void -acpi_ds_method_data_init ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_method_data_set_value ( - u16 opcode, - u32 index, - union acpi_operand_object *object, - struct acpi_walk_state *walk_state); - - -/* dsmethod - Parser/Interpreter interface - control method parsing */ - -acpi_status -acpi_ds_parse_method ( - acpi_handle obj_handle); - -acpi_status -acpi_ds_call_control_method ( - struct acpi_thread_state *thread, - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); - -acpi_status -acpi_ds_restart_control_method ( - struct acpi_walk_state *walk_state, - union acpi_operand_object *return_desc); - -acpi_status -acpi_ds_terminate_control_method ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_begin_method_execution ( - struct acpi_namespace_node *method_node, - union acpi_operand_object *obj_desc, - struct acpi_namespace_node *calling_method_node); - - -/* dsobj - Parser/Interpreter interface - object initialization and conversion */ - -acpi_status -acpi_ds_init_one_object ( - acpi_handle obj_handle, - u32 level, - void *context, - void **return_value); - -acpi_status -acpi_ds_initialize_objects ( - struct acpi_table_desc *table_desc, - struct acpi_namespace_node *start_node); - -acpi_status -acpi_ds_build_internal_buffer_obj ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - u32 buffer_length, - union acpi_operand_object **obj_desc_ptr); - -acpi_status -acpi_ds_build_internal_package_obj ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - u32 package_length, - union acpi_operand_object **obj_desc); - -acpi_status -acpi_ds_build_internal_object ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - union acpi_operand_object **obj_desc_ptr); - -acpi_status -acpi_ds_init_object_from_op ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - u16 opcode, - union acpi_operand_object **obj_desc); - -acpi_status -acpi_ds_create_node ( - struct acpi_walk_state *walk_state, - struct acpi_namespace_node *node, - union acpi_parse_object *op); - - -/* dsutils - Parser/Interpreter interface utility routines */ - -u8 -acpi_ds_is_result_used ( - union acpi_parse_object *op, - struct acpi_walk_state *walk_state); - -void -acpi_ds_delete_result_if_not_used ( - union acpi_parse_object *op, - union acpi_operand_object *result_obj, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_create_operand ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *arg, - u32 args_remaining); - -acpi_status -acpi_ds_create_operands ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *first_arg); - -acpi_status -acpi_ds_resolve_operands ( - struct acpi_walk_state *walk_state); - -void -acpi_ds_clear_operands ( - struct acpi_walk_state *walk_state); - - -/* - * dswscope - Scope Stack manipulation - */ - -acpi_status -acpi_ds_scope_stack_push ( - struct acpi_namespace_node *node, - acpi_object_type type, - struct acpi_walk_state *walk_state); - - -acpi_status -acpi_ds_scope_stack_pop ( - struct acpi_walk_state *walk_state); - -void -acpi_ds_scope_stack_clear ( - struct acpi_walk_state *walk_state); - - -/* dswstate - parser WALK_STATE management routines */ - -struct acpi_walk_state * -acpi_ds_create_walk_state ( - acpi_owner_id owner_id, - union acpi_parse_object *origin, - union acpi_operand_object *mth_desc, - struct acpi_thread_state *thread); - -acpi_status -acpi_ds_init_aml_walk ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - struct acpi_namespace_node *method_node, - u8 *aml_start, - u32 aml_length, - union acpi_operand_object **params, - union acpi_operand_object **return_obj_desc, - u32 pass_number); - -acpi_status -acpi_ds_obj_stack_delete_all ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_obj_stack_pop_and_delete ( - u32 pop_count, - struct acpi_walk_state *walk_state); - -void -acpi_ds_delete_walk_state ( - struct acpi_walk_state *walk_state); - -struct acpi_walk_state * -acpi_ds_pop_walk_state ( - struct acpi_thread_state *thread); - -void -acpi_ds_push_walk_state ( - struct acpi_walk_state *walk_state, - struct acpi_thread_state *thread); - -acpi_status -acpi_ds_result_stack_pop ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_result_stack_push ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_result_stack_clear ( - struct acpi_walk_state *walk_state); - -struct acpi_walk_state * -acpi_ds_get_current_walk_state ( - struct acpi_thread_state *thread); - -void -acpi_ds_delete_walk_state_cache ( - void); - -acpi_status -acpi_ds_result_insert ( - void *object, - u32 index, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_result_remove ( - union acpi_operand_object **object, - u32 index, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_result_pop ( - union acpi_operand_object **object, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_result_push ( - union acpi_operand_object *object, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_result_pop_from_bottom ( - union acpi_operand_object **object, - struct acpi_walk_state *walk_state); - -#endif /* _ACDISPAT_H_ */ diff -Nru a/drivers/acpi/include/acevents.h b/drivers/acpi/include/acevents.h --- a/drivers/acpi/include/acevents.h Sun Feb 9 21:13:33 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,221 +0,0 @@ -/****************************************************************************** - * - * Name: acevents.h - Event subcomponent prototypes and defines - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACEVENTS_H__ -#define __ACEVENTS_H__ - - -acpi_status -acpi_ev_initialize ( - void); - -acpi_status -acpi_ev_handler_initialize ( - void); - - -/* - * Evfixed - Fixed event handling - */ - -acpi_status -acpi_ev_fixed_event_initialize ( - void); - -u32 -acpi_ev_fixed_event_detect ( - void); - -u32 -acpi_ev_fixed_event_dispatch ( - u32 event); - - -/* - * Evmisc - */ - -u8 -acpi_ev_is_notify_object ( - struct acpi_namespace_node *node); - -acpi_status -acpi_ev_acquire_global_lock( - u16 timeout); - -acpi_status -acpi_ev_release_global_lock( - void); - -acpi_status -acpi_ev_init_global_lock_handler ( - void); - -u32 -acpi_ev_get_gpe_register_index ( - u32 gpe_number); - -u32 -acpi_ev_get_gpe_number_index ( - u32 gpe_number); - -acpi_status -acpi_ev_queue_notify_request ( - struct acpi_namespace_node *node, - u32 notify_value); - -void ACPI_SYSTEM_XFACE -acpi_ev_notify_dispatch ( - void *context); - - -/* - * Evgpe - GPE handling and dispatch - */ - -acpi_status -acpi_ev_gpe_initialize ( - void); - -acpi_status -acpi_ev_init_gpe_control_methods ( - void); - -u32 -acpi_ev_gpe_dispatch ( - u32 gpe_number); - -u32 -acpi_ev_gpe_detect ( - void); - -/* - * Evregion - Address Space handling - */ - -acpi_status -acpi_ev_init_address_spaces ( - void); - -acpi_status -acpi_ev_address_space_dispatch ( - union acpi_operand_object *region_obj, - u32 function, - acpi_physical_address address, - u32 bit_width, - void *value); - -acpi_status -acpi_ev_addr_handler_helper ( - acpi_handle obj_handle, - u32 level, - void *context, - void **return_value); - -acpi_status -acpi_ev_attach_region ( - union acpi_operand_object *handler_obj, - union acpi_operand_object *region_obj, - u8 acpi_ns_is_locked); - -void -acpi_ev_detach_region ( - union acpi_operand_object *region_obj, - u8 acpi_ns_is_locked); - - -/* - * Evregini - Region initialization and setup - */ - -acpi_status -acpi_ev_system_memory_region_setup ( - acpi_handle handle, - u32 function, - void *handler_context, - void **region_context); - -acpi_status -acpi_ev_io_space_region_setup ( - acpi_handle handle, - u32 function, - void *handler_context, - void **region_context); - -acpi_status -acpi_ev_pci_config_region_setup ( - acpi_handle handle, - u32 function, - void *handler_context, - void **region_context); - -acpi_status -acpi_ev_cmos_region_setup ( - acpi_handle handle, - u32 function, - void *handler_context, - void **region_context); - -acpi_status -acpi_ev_pci_bar_region_setup ( - acpi_handle handle, - u32 function, - void *handler_context, - void **region_context); - -acpi_status -acpi_ev_default_region_setup ( - acpi_handle handle, - u32 function, - void *handler_context, - void **region_context); - -acpi_status -acpi_ev_initialize_region ( - union acpi_operand_object *region_obj, - u8 acpi_ns_locked); - - -/* - * Evsci - SCI (System Control Interrupt) handling/dispatch - */ - -u32 -acpi_ev_install_sci_handler ( - void); - -acpi_status -acpi_ev_remove_sci_handler ( - void); - -u32 -acpi_ev_initialize_sCI ( - u32 program_sCI); - -void -acpi_ev_terminate ( - void); - - -#endif /* __ACEVENTS_H__ */ diff -Nru a/drivers/acpi/include/acexcep.h b/drivers/acpi/include/acexcep.h --- a/drivers/acpi/include/acexcep.h Sun Feb 9 21:13:28 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,283 +0,0 @@ -/****************************************************************************** - * - * Name: acexcep.h - Exception codes returned by the ACPI subsystem - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACEXCEP_H__ -#define __ACEXCEP_H__ - - -/* - * Exceptions returned by external ACPI interfaces - */ - -#define AE_CODE_ENVIRONMENTAL 0x0000 -#define AE_CODE_PROGRAMMER 0x1000 -#define AE_CODE_ACPI_TABLES 0x2000 -#define AE_CODE_AML 0x3000 -#define AE_CODE_CONTROL 0x4000 -#define AE_CODE_MASK 0xF000 - - -#define ACPI_SUCCESS(a) (!(a)) -#define ACPI_FAILURE(a) (a) - - -#define AE_OK (acpi_status) 0x0000 - -/* - * Environmental exceptions - */ -#define AE_ERROR (acpi_status) (0x0001 | AE_CODE_ENVIRONMENTAL) -#define AE_NO_ACPI_TABLES (acpi_status) (0x0002 | AE_CODE_ENVIRONMENTAL) -#define AE_NO_NAMESPACE (acpi_status) (0x0003 | AE_CODE_ENVIRONMENTAL) -#define AE_NO_MEMORY (acpi_status) (0x0004 | AE_CODE_ENVIRONMENTAL) -#define AE_NOT_FOUND (acpi_status) (0x0005 | AE_CODE_ENVIRONMENTAL) -#define AE_NOT_EXIST (acpi_status) (0x0006 | AE_CODE_ENVIRONMENTAL) -#define AE_ALREADY_EXISTS (acpi_status) (0x0007 | AE_CODE_ENVIRONMENTAL) -#define AE_TYPE (acpi_status) (0x0008 | AE_CODE_ENVIRONMENTAL) -#define AE_NULL_OBJECT (acpi_status) (0x0009 | AE_CODE_ENVIRONMENTAL) -#define AE_NULL_ENTRY (acpi_status) (0x000A | AE_CODE_ENVIRONMENTAL) -#define AE_BUFFER_OVERFLOW (acpi_status) (0x000B | AE_CODE_ENVIRONMENTAL) -#define AE_STACK_OVERFLOW (acpi_status) (0x000C | AE_CODE_ENVIRONMENTAL) -#define AE_STACK_UNDERFLOW (acpi_status) (0x000D | AE_CODE_ENVIRONMENTAL) -#define AE_NOT_IMPLEMENTED (acpi_status) (0x000E | AE_CODE_ENVIRONMENTAL) -#define AE_VERSION_MISMATCH (acpi_status) (0x000F | AE_CODE_ENVIRONMENTAL) -#define AE_SUPPORT (acpi_status) (0x0010 | AE_CODE_ENVIRONMENTAL) -#define AE_SHARE (acpi_status) (0x0011 | AE_CODE_ENVIRONMENTAL) -#define AE_LIMIT (acpi_status) (0x0012 | AE_CODE_ENVIRONMENTAL) -#define AE_TIME (acpi_status) (0x0013 | AE_CODE_ENVIRONMENTAL) -#define AE_UNKNOWN_STATUS (acpi_status) (0x0014 | AE_CODE_ENVIRONMENTAL) -#define AE_ACQUIRE_DEADLOCK (acpi_status) (0x0015 | AE_CODE_ENVIRONMENTAL) -#define AE_RELEASE_DEADLOCK (acpi_status) (0x0016 | AE_CODE_ENVIRONMENTAL) -#define AE_NOT_ACQUIRED (acpi_status) (0x0017 | AE_CODE_ENVIRONMENTAL) -#define AE_ALREADY_ACQUIRED (acpi_status) (0x0018 | AE_CODE_ENVIRONMENTAL) -#define AE_NO_HARDWARE_RESPONSE (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL) -#define AE_NO_GLOBAL_LOCK (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL) -#define AE_LOGICAL_ADDRESS (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL) -#define AE_ABORT_METHOD (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL) - -#define AE_CODE_ENV_MAX 0x001C - -/* - * Programmer exceptions - */ -#define AE_BAD_PARAMETER (acpi_status) (0x0001 | AE_CODE_PROGRAMMER) -#define AE_BAD_CHARACTER (acpi_status) (0x0002 | AE_CODE_PROGRAMMER) -#define AE_BAD_PATHNAME (acpi_status) (0x0003 | AE_CODE_PROGRAMMER) -#define AE_BAD_DATA (acpi_status) (0x0004 | AE_CODE_PROGRAMMER) -#define AE_BAD_ADDRESS (acpi_status) (0x0005 | AE_CODE_PROGRAMMER) -#define AE_ALIGNMENT (acpi_status) (0x0006 | AE_CODE_PROGRAMMER) -#define AE_BAD_HEX_CONSTANT (acpi_status) (0x0007 | AE_CODE_PROGRAMMER) -#define AE_BAD_OCTAL_CONSTANT (acpi_status) (0x0008 | AE_CODE_PROGRAMMER) -#define AE_BAD_DECIMAL_CONSTANT (acpi_status) (0x0009 | AE_CODE_PROGRAMMER) - -#define AE_CODE_PGM_MAX 0x0009 - - -/* - * Acpi table exceptions - */ -#define AE_BAD_SIGNATURE (acpi_status) (0x0001 | AE_CODE_ACPI_TABLES) -#define AE_BAD_HEADER (acpi_status) (0x0002 | AE_CODE_ACPI_TABLES) -#define AE_BAD_CHECKSUM (acpi_status) (0x0003 | AE_CODE_ACPI_TABLES) -#define AE_BAD_VALUE (acpi_status) (0x0004 | AE_CODE_ACPI_TABLES) -#define AE_TABLE_NOT_SUPPORTED (acpi_status) (0x0005 | AE_CODE_ACPI_TABLES) -#define AE_INVALID_TABLE_LENGTH (acpi_status) (0x0006 | AE_CODE_ACPI_TABLES) - -#define AE_CODE_TBL_MAX 0x0006 - - -/* - * AML exceptions. These are caused by problems with - * the actual AML byte stream - */ -#define AE_AML_ERROR (acpi_status) (0x0001 | AE_CODE_AML) -#define AE_AML_PARSE (acpi_status) (0x0002 | AE_CODE_AML) -#define AE_AML_BAD_OPCODE (acpi_status) (0x0003 | AE_CODE_AML) -#define AE_AML_NO_OPERAND (acpi_status) (0x0004 | AE_CODE_AML) -#define AE_AML_OPERAND_TYPE (acpi_status) (0x0005 | AE_CODE_AML) -#define AE_AML_OPERAND_VALUE (acpi_status) (0x0006 | AE_CODE_AML) -#define AE_AML_UNINITIALIZED_LOCAL (acpi_status) (0x0007 | AE_CODE_AML) -#define AE_AML_UNINITIALIZED_ARG (acpi_status) (0x0008 | AE_CODE_AML) -#define AE_AML_UNINITIALIZED_ELEMENT (acpi_status) (0x0009 | AE_CODE_AML) -#define AE_AML_NUMERIC_OVERFLOW (acpi_status) (0x000A | AE_CODE_AML) -#define AE_AML_REGION_LIMIT (acpi_status) (0x000B | AE_CODE_AML) -#define AE_AML_BUFFER_LIMIT (acpi_status) (0x000C | AE_CODE_AML) -#define AE_AML_PACKAGE_LIMIT (acpi_status) (0x000D | AE_CODE_AML) -#define AE_AML_DIVIDE_BY_ZERO (acpi_status) (0x000E | AE_CODE_AML) -#define AE_AML_BAD_NAME (acpi_status) (0x000F | AE_CODE_AML) -#define AE_AML_NAME_NOT_FOUND (acpi_status) (0x0010 | AE_CODE_AML) -#define AE_AML_INTERNAL (acpi_status) (0x0011 | AE_CODE_AML) -#define AE_AML_INVALID_SPACE_ID (acpi_status) (0x0012 | AE_CODE_AML) -#define AE_AML_STRING_LIMIT (acpi_status) (0x0013 | AE_CODE_AML) -#define AE_AML_NO_RETURN_VALUE (acpi_status) (0x0014 | AE_CODE_AML) -#define AE_AML_METHOD_LIMIT (acpi_status) (0x0015 | AE_CODE_AML) -#define AE_AML_NOT_OWNER (acpi_status) (0x0016 | AE_CODE_AML) -#define AE_AML_MUTEX_ORDER (acpi_status) (0x0017 | AE_CODE_AML) -#define AE_AML_MUTEX_NOT_ACQUIRED (acpi_status) (0x0018 | AE_CODE_AML) -#define AE_AML_INVALID_RESOURCE_TYPE (acpi_status) (0x0019 | AE_CODE_AML) -#define AE_AML_INVALID_INDEX (acpi_status) (0x001A | AE_CODE_AML) -#define AE_AML_REGISTER_LIMIT (acpi_status) (0x001B | AE_CODE_AML) -#define AE_AML_NO_WHILE (acpi_status) (0x001C | AE_CODE_AML) -#define AE_AML_ALIGNMENT (acpi_status) (0x001D | AE_CODE_AML) -#define AE_AML_NO_RESOURCE_END_TAG (acpi_status) (0x001E | AE_CODE_AML) -#define AE_AML_BAD_RESOURCE_VALUE (acpi_status) (0x001F | AE_CODE_AML) -#define AE_AML_CIRCULAR_REFERENCE (acpi_status) (0x0020 | AE_CODE_AML) - -#define AE_CODE_AML_MAX 0x0020 - -/* - * Internal exceptions used for control - */ -#define AE_CTRL_RETURN_VALUE (acpi_status) (0x0001 | AE_CODE_CONTROL) -#define AE_CTRL_PENDING (acpi_status) (0x0002 | AE_CODE_CONTROL) -#define AE_CTRL_TERMINATE (acpi_status) (0x0003 | AE_CODE_CONTROL) -#define AE_CTRL_TRUE (acpi_status) (0x0004 | AE_CODE_CONTROL) -#define AE_CTRL_FALSE (acpi_status) (0x0005 | AE_CODE_CONTROL) -#define AE_CTRL_DEPTH (acpi_status) (0x0006 | AE_CODE_CONTROL) -#define AE_CTRL_END (acpi_status) (0x0007 | AE_CODE_CONTROL) -#define AE_CTRL_TRANSFER (acpi_status) (0x0008 | AE_CODE_CONTROL) -#define AE_CTRL_BREAK (acpi_status) (0x0009 | AE_CODE_CONTROL) -#define AE_CTRL_CONTINUE (acpi_status) (0x000A | AE_CODE_CONTROL) -#define AE_CTRL_SKIP (acpi_status) (0x000B | AE_CODE_CONTROL) - -#define AE_CODE_CTRL_MAX 0x000B - - -#ifdef DEFINE_ACPI_GLOBALS - -/* - * String versions of the exception codes above - * These strings must match the corresponding defines exactly - */ -char const *acpi_gbl_exception_names_env[] = -{ - "AE_OK", - "AE_ERROR", - "AE_NO_ACPI_TABLES", - "AE_NO_NAMESPACE", - "AE_NO_MEMORY", - "AE_NOT_FOUND", - "AE_NOT_EXIST", - "AE_ALREADY_EXISTS", - "AE_TYPE", - "AE_NULL_OBJECT", - "AE_NULL_ENTRY", - "AE_BUFFER_OVERFLOW", - "AE_STACK_OVERFLOW", - "AE_STACK_UNDERFLOW", - "AE_NOT_IMPLEMENTED", - "AE_VERSION_MISMATCH", - "AE_SUPPORT", - "AE_SHARE", - "AE_LIMIT", - "AE_TIME", - "AE_UNKNOWN_STATUS", - "AE_ACQUIRE_DEADLOCK", - "AE_RELEASE_DEADLOCK", - "AE_NOT_ACQUIRED", - "AE_ALREADY_ACQUIRED", - "AE_NO_HARDWARE_RESPONSE", - "AE_NO_GLOBAL_LOCK", - "AE_LOGICAL_ADDRESS", - "AE_ABORT_METHOD" -}; - -char const *acpi_gbl_exception_names_pgm[] = -{ - "AE_BAD_PARAMETER", - "AE_BAD_CHARACTER", - "AE_BAD_PATHNAME", - "AE_BAD_DATA", - "AE_BAD_ADDRESS", - "AE_ALIGNMENT", - "AE_BAD_HEX_CONSTANT", - "AE_BAD_OCTAL_CONSTANT", - "AE_BAD_DECIMAL_CONSTANT" -}; - -char const *acpi_gbl_exception_names_tbl[] = -{ - "AE_BAD_SIGNATURE", - "AE_BAD_HEADER", - "AE_BAD_CHECKSUM", - "AE_BAD_VALUE", - "AE_TABLE_NOT_SUPPORTED", - "AE_INVALID_TABLE_LENGTH" -}; - -char const *acpi_gbl_exception_names_aml[] = -{ - "AE_AML_ERROR", - "AE_AML_PARSE", - "AE_AML_BAD_OPCODE", - "AE_AML_NO_OPERAND", - "AE_AML_OPERAND_TYPE", - "AE_AML_OPERAND_VALUE", - "AE_AML_UNINITIALIZED_LOCAL", - "AE_AML_UNINITIALIZED_ARG", - "AE_AML_UNINITIALIZED_ELEMENT", - "AE_AML_NUMERIC_OVERFLOW", - "AE_AML_REGION_LIMIT", - "AE_AML_BUFFER_LIMIT", - "AE_AML_PACKAGE_LIMIT", - "AE_AML_DIVIDE_BY_ZERO", - "AE_AML_BAD_NAME", - "AE_AML_NAME_NOT_FOUND", - "AE_AML_INTERNAL", - "AE_AML_INVALID_SPACE_ID", - "AE_AML_STRING_LIMIT", - "AE_AML_NO_RETURN_VALUE", - "AE_AML_METHOD_LIMIT", - "AE_AML_NOT_OWNER", - "AE_AML_MUTEX_ORDER", - "AE_AML_MUTEX_NOT_ACQUIRED", - "AE_AML_INVALID_RESOURCE_TYPE", - "AE_AML_INVALID_INDEX", - "AE_AML_REGISTER_LIMIT", - "AE_AML_NO_WHILE", - "AE_AML_ALIGNMENT", - "AE_AML_NO_RESOURCE_END_TAG", - "AE_AML_BAD_RESOURCE_VALUE", - "AE_AML_CIRCULAR_REFERENCE" -}; - -char const *acpi_gbl_exception_names_ctrl[] = -{ - "AE_CTRL_RETURN_VALUE", - "AE_CTRL_PENDING", - "AE_CTRL_TERMINATE", - "AE_CTRL_TRUE", - "AE_CTRL_FALSE", - "AE_CTRL_DEPTH", - "AE_CTRL_END", - "AE_CTRL_TRANSFER", - "AE_CTRL_BREAK", - "AE_CTRL_CONTINUE", - "AE_CTRL_SKIP" -}; - -#endif /* ACPI GLOBALS */ - - -#endif /* __ACEXCEP_H__ */ diff -Nru a/drivers/acpi/include/acglobal.h b/drivers/acpi/include/acglobal.h --- a/drivers/acpi/include/acglobal.h Sun Feb 9 21:13:28 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,298 +0,0 @@ -/****************************************************************************** - * - * Name: acglobal.h - Declarations for global variables - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACGLOBAL_H__ -#define __ACGLOBAL_H__ - - -/* - * Ensure that the globals are actually defined only once. - * - * The use of these defines allows a single list of globals (here) in order - * to simplify maintenance of the code. - */ -#ifdef DEFINE_ACPI_GLOBALS -#define ACPI_EXTERN -#else -#define ACPI_EXTERN extern -#endif - - -/***************************************************************************** - * - * Debug support - * - ****************************************************************************/ - -/* Runtime configuration of debug print levels */ - -extern u32 acpi_dbg_level; -extern u32 acpi_dbg_layer; - -/* Procedure nesting level for debug output */ - -extern u32 acpi_gbl_nesting_level; - - -/***************************************************************************** - * - * ACPI Table globals - * - ****************************************************************************/ - -/* - * Table pointers. - * Although these pointers are somewhat redundant with the global acpi_table, - * they are convenient because they are typed pointers. - * - * These tables are single-table only; meaning that there can be at most one - * of each in the system. Each global points to the actual table. - * - */ -ACPI_EXTERN u32 acpi_gbl_table_flags; -ACPI_EXTERN u32 acpi_gbl_rsdt_table_count; -ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP; -ACPI_EXTERN XSDT_DESCRIPTOR *acpi_gbl_XSDT; -ACPI_EXTERN FADT_DESCRIPTOR *acpi_gbl_FADT; -ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT; -ACPI_EXTERN FACS_DESCRIPTOR *acpi_gbl_FACS; -ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS; - -/* - * Handle both ACPI 1.0 and ACPI 2.0 Integer widths - * If we are running a method that exists in a 32-bit ACPI table. - * Use only 32 bits of the Integer for conversion. - */ -ACPI_EXTERN u8 acpi_gbl_integer_bit_width; -ACPI_EXTERN u8 acpi_gbl_integer_byte_width; - -/* - * Since there may be multiple SSDTs and PSDTS, a single pointer is not - * sufficient; Therefore, there isn't one! - */ - - -/* - * ACPI Table info arrays - */ -extern struct acpi_table_desc acpi_gbl_acpi_tables[NUM_ACPI_TABLES]; -extern struct acpi_table_support acpi_gbl_acpi_table_data[NUM_ACPI_TABLES]; - -/* - * Predefined mutex objects. This array contains the - * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. - * (The table maps local handles to the real OS handles) - */ -ACPI_EXTERN struct acpi_mutex_info acpi_gbl_acpi_mutex_info [NUM_MTX]; - - -/***************************************************************************** - * - * Miscellaneous globals - * - ****************************************************************************/ - - -ACPI_EXTERN struct acpi_memory_list acpi_gbl_memory_lists[ACPI_NUM_MEM_LISTS]; -ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_drv_notify; -ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_sys_notify; -ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler; -ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk; -ACPI_EXTERN acpi_handle acpi_gbl_global_lock_semaphore; - -ACPI_EXTERN u32 acpi_gbl_global_lock_thread_count; -ACPI_EXTERN u32 acpi_gbl_original_mode; -ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; -ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; -ACPI_EXTERN u32 acpi_gbl_ps_find_count; -ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; -ACPI_EXTERN u16 acpi_gbl_next_table_owner_id; -ACPI_EXTERN u16 acpi_gbl_next_method_owner_id; -ACPI_EXTERN u16 acpi_gbl_global_lock_handle; -ACPI_EXTERN u8 acpi_gbl_debugger_configuration; -ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; -ACPI_EXTERN u8 acpi_gbl_step_to_next_call; -ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present; -ACPI_EXTERN u8 acpi_gbl_global_lock_present; -ACPI_EXTERN u8 acpi_gbl_events_initialized; - -extern u8 acpi_gbl_shutdown; -extern u32 acpi_gbl_startup_flags; -extern const u8 acpi_gbl_decode_to8bit[8]; -extern const char *acpi_gbl_db_sleep_states[ACPI_S_STATE_COUNT]; -extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; -extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; - - -/***************************************************************************** - * - * Namespace globals - * - ****************************************************************************/ - -#define NUM_NS_TYPES ACPI_TYPE_INVALID+1 - -#if defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) -#define NUM_PREDEFINED_NAMES 10 -#else -#define NUM_PREDEFINED_NAMES 9 -#endif - -ACPI_EXTERN struct acpi_namespace_node acpi_gbl_root_node_struct; -ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_root_node; - -extern const u8 acpi_gbl_ns_properties[NUM_NS_TYPES]; -extern const struct acpi_predefined_names acpi_gbl_pre_defined_names [NUM_PREDEFINED_NAMES]; - -#ifdef ACPI_DEBUG_OUTPUT -ACPI_EXTERN u32 acpi_gbl_current_node_count; -ACPI_EXTERN u32 acpi_gbl_current_node_size; -ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count; -ACPI_EXTERN acpi_size acpi_gbl_entry_stack_pointer; -ACPI_EXTERN acpi_size acpi_gbl_lowest_stack_pointer; -ACPI_EXTERN u32 acpi_gbl_deepest_nesting; -#endif - -/***************************************************************************** - * - * Interpreter globals - * - ****************************************************************************/ - - -ACPI_EXTERN struct acpi_thread_state *acpi_gbl_current_walk_list; - -/* Control method single step flag */ - -ACPI_EXTERN u8 acpi_gbl_cm_single_step; - - -/***************************************************************************** - * - * Parser globals - * - ****************************************************************************/ - -ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root; - -/***************************************************************************** - * - * Hardware globals - * - ****************************************************************************/ - -extern struct acpi_bit_register_info acpi_gbl_bit_register_info[ACPI_NUM_BITREG]; -ACPI_EXTERN u8 acpi_gbl_sleep_type_a; -ACPI_EXTERN u8 acpi_gbl_sleep_type_b; - - -/***************************************************************************** - * - * Event and GPE globals - * - ****************************************************************************/ - -extern struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS]; -ACPI_EXTERN struct acpi_fixed_event_handler acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS]; - -ACPI_EXTERN acpi_handle acpi_gbl_gpe_obj_handle; -ACPI_EXTERN u32 acpi_gbl_gpe_register_count; -ACPI_EXTERN u32 acpi_gbl_gpe_number_max; -ACPI_EXTERN struct acpi_gpe_register_info *acpi_gbl_gpe_register_info; -ACPI_EXTERN struct acpi_gpe_number_info *acpi_gbl_gpe_number_info; -ACPI_EXTERN struct acpi_gpe_block_info acpi_gbl_gpe_block_info[ACPI_MAX_GPE_BLOCKS]; - -/* - * GPE translation table - * Indexed by the GPE number, returns a valid index into the global GPE tables. - * - * This table is needed because the GPE numbers supported by block 1 do not - * have to be contiguous with the GPE numbers supported by block 0. - */ -ACPI_EXTERN struct acpi_gpe_index_info *acpi_gbl_gpe_number_to_index; - - -/***************************************************************************** - * - * Debugger globals - * - ****************************************************************************/ - - -ACPI_EXTERN u8 acpi_gbl_db_output_flags; - -#ifdef ACPI_DISASSEMBLER - -ACPI_EXTERN u8 acpi_gbl_db_opt_disasm; -ACPI_EXTERN u8 acpi_gbl_db_opt_verbose; -#endif - - -#ifdef ACPI_DEBUGGER - -extern u8 acpi_gbl_method_executing; -extern u8 acpi_gbl_abort_method; -extern u8 acpi_gbl_db_terminate_threads; - -ACPI_EXTERN int optind; -ACPI_EXTERN char *optarg; - -ACPI_EXTERN u8 acpi_gbl_db_opt_tables; -ACPI_EXTERN u8 acpi_gbl_db_opt_stats; -ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods; - - -ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS]; -ACPI_EXTERN char acpi_gbl_db_line_buf[80]; -ACPI_EXTERN char acpi_gbl_db_parsed_buf[80]; -ACPI_EXTERN char acpi_gbl_db_scope_buf[40]; -ACPI_EXTERN char acpi_gbl_db_debug_filename[40]; -ACPI_EXTERN u8 acpi_gbl_db_output_to_file; -ACPI_EXTERN char *acpi_gbl_db_buffer; -ACPI_EXTERN char *acpi_gbl_db_filename; -ACPI_EXTERN u32 acpi_gbl_db_debug_level; -ACPI_EXTERN u32 acpi_gbl_db_console_debug_level; -ACPI_EXTERN struct acpi_table_header *acpi_gbl_db_table_ptr; -ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node; - -/* - * Statistic globals - */ -ACPI_EXTERN u16 acpi_gbl_obj_type_count[ACPI_TYPE_NS_NODE_MAX+1]; -ACPI_EXTERN u16 acpi_gbl_node_type_count[ACPI_TYPE_NS_NODE_MAX+1]; -ACPI_EXTERN u16 acpi_gbl_obj_type_count_misc; -ACPI_EXTERN u16 acpi_gbl_node_type_count_misc; -ACPI_EXTERN u32 acpi_gbl_num_nodes; -ACPI_EXTERN u32 acpi_gbl_num_objects; - - -ACPI_EXTERN u32 acpi_gbl_size_of_parse_tree; -ACPI_EXTERN u32 acpi_gbl_size_of_method_trees; -ACPI_EXTERN u32 acpi_gbl_size_of_node_entries; -ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects; - -#endif /* ACPI_DEBUGGER */ - - -#endif /* __ACGLOBAL_H__ */ diff -Nru a/drivers/acpi/include/achware.h b/drivers/acpi/include/achware.h --- a/drivers/acpi/include/achware.h Sun Feb 9 21:13:33 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,154 +0,0 @@ -/****************************************************************************** - * - * Name: achware.h -- hardware specific interfaces - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACHWARE_H__ -#define __ACHWARE_H__ - - -/* PM Timer ticks per second (HZ) */ -#define PM_TIMER_FREQUENCY 3579545 - - -/* Prototypes */ - - -acpi_status -acpi_hw_initialize ( - void); - -acpi_status -acpi_hw_shutdown ( - void); - -acpi_status -acpi_hw_initialize_system_info ( - void); - -acpi_status -acpi_hw_set_mode ( - u32 mode); - -u32 -acpi_hw_get_mode ( - void); - -u32 -acpi_hw_get_mode_capabilities ( - void); - -/* Register I/O Prototypes */ - -struct acpi_bit_register_info * -acpi_hw_get_bit_register_info ( - u32 register_id); - -acpi_status -acpi_hw_register_read ( - u8 use_lock, - u32 register_id, - u32 *return_value); - -acpi_status -acpi_hw_register_write ( - u8 use_lock, - u32 register_id, - u32 value); - -acpi_status -acpi_hw_low_level_read ( - u32 width, - u32 *value, - struct acpi_generic_address *reg, - u32 offset); - -acpi_status -acpi_hw_low_level_write ( - u32 width, - u32 value, - struct acpi_generic_address *reg, - u32 offset); - -acpi_status -acpi_hw_clear_acpi_status ( - void); - - -/* GPE support */ - -u8 -acpi_hw_get_gpe_bit_mask ( - u32 gpe_number); - -acpi_status -acpi_hw_enable_gpe ( - u32 gpe_number); - -void -acpi_hw_enable_gpe_for_wakeup ( - u32 gpe_number); - -acpi_status -acpi_hw_disable_gpe ( - u32 gpe_number); - -void -acpi_hw_disable_gpe_for_wakeup ( - u32 gpe_number); - -acpi_status -acpi_hw_clear_gpe ( - u32 gpe_number); - -acpi_status -acpi_hw_get_gpe_status ( - u32 gpe_number, - acpi_event_status *event_status); - -acpi_status -acpi_hw_disable_non_wakeup_gpes ( - void); - -acpi_status -acpi_hw_enable_non_wakeup_gpes ( - void); - - -/* ACPI Timer prototypes */ - -acpi_status -acpi_get_timer_resolution ( - u32 *resolution); - -acpi_status -acpi_get_timer ( - u32 *ticks); - -acpi_status -acpi_get_timer_duration ( - u32 start_ticks, - u32 end_ticks, - u32 *time_elapsed); - - -#endif /* __ACHWARE_H__ */ diff -Nru a/drivers/acpi/include/acinterp.h b/drivers/acpi/include/acinterp.h --- a/drivers/acpi/include/acinterp.h Sun Feb 9 21:13:35 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,717 +0,0 @@ -/****************************************************************************** - * - * Name: acinterp.h - Interpreter subcomponent prototypes and defines - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACINTERP_H__ -#define __ACINTERP_H__ - - -#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1])) - - -acpi_status -acpi_ex_resolve_operands ( - u16 opcode, - union acpi_operand_object **stack_ptr, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_check_object_type ( - acpi_object_type type_needed, - acpi_object_type this_type, - void *object); - -/* - * exxface - External interpreter interfaces - */ - -acpi_status -acpi_ex_load_table ( - acpi_table_type table_id); - -acpi_status -acpi_ex_execute_method ( - struct acpi_namespace_node *method_node, - union acpi_operand_object **params, - union acpi_operand_object **return_obj_desc); - - -/* - * exconvrt - object conversion - */ - -acpi_status -acpi_ex_convert_to_integer ( - union acpi_operand_object *obj_desc, - union acpi_operand_object **result_desc, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_convert_to_buffer ( - union acpi_operand_object *obj_desc, - union acpi_operand_object **result_desc, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_convert_to_string ( - union acpi_operand_object *obj_desc, - union acpi_operand_object **result_desc, - u32 base, - u32 max_length, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_convert_to_target_type ( - acpi_object_type destination_type, - union acpi_operand_object *source_desc, - union acpi_operand_object **result_desc, - struct acpi_walk_state *walk_state); - -u32 -acpi_ex_convert_to_ascii ( - acpi_integer integer, - u32 base, - u8 *string, - u8 max_length); - -/* - * exfield - ACPI AML (p-code) execution - field manipulation - */ - -acpi_status -acpi_ex_extract_from_field ( - union acpi_operand_object *obj_desc, - void *buffer, - u32 buffer_length); - -acpi_status -acpi_ex_insert_into_field ( - union acpi_operand_object *obj_desc, - void *buffer, - u32 buffer_length); - -acpi_status -acpi_ex_setup_region ( - union acpi_operand_object *obj_desc, - u32 field_datum_byte_offset); - -acpi_status -acpi_ex_access_region ( - union acpi_operand_object *obj_desc, - u32 field_datum_byte_offset, - acpi_integer *value, - u32 read_write); - -u8 -acpi_ex_register_overflow ( - union acpi_operand_object *obj_desc, - acpi_integer value); - -acpi_status -acpi_ex_field_datum_io ( - union acpi_operand_object *obj_desc, - u32 field_datum_byte_offset, - acpi_integer *value, - u32 read_write); - -acpi_status -acpi_ex_write_with_update_rule ( - union acpi_operand_object *obj_desc, - acpi_integer mask, - acpi_integer field_value, - u32 field_datum_byte_offset); - -void -acpi_ex_get_buffer_datum( - acpi_integer *datum, - void *buffer, - u32 byte_granularity, - u32 offset); - -void -acpi_ex_set_buffer_datum ( - acpi_integer merged_datum, - void *buffer, - u32 byte_granularity, - u32 offset); - -acpi_status -acpi_ex_read_data_from_field ( - struct acpi_walk_state *walk_state, - union acpi_operand_object *obj_desc, - union acpi_operand_object **ret_buffer_desc); - -acpi_status -acpi_ex_write_data_to_field ( - union acpi_operand_object *source_desc, - union acpi_operand_object *obj_desc, - union acpi_operand_object **result_desc); - -/* - * exmisc - ACPI AML (p-code) execution - specific opcodes - */ - -acpi_status -acpi_ex_opcode_3A_0T_0R ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_opcode_3A_1T_1R ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_opcode_6A_0T_1R ( - struct acpi_walk_state *walk_state); - -u8 -acpi_ex_do_match ( - u32 match_op, - acpi_integer package_value, - acpi_integer match_value); - -acpi_status -acpi_ex_get_object_reference ( - union acpi_operand_object *obj_desc, - union acpi_operand_object **return_desc, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_resolve_multiple ( - struct acpi_walk_state *walk_state, - union acpi_operand_object *operand, - acpi_object_type *return_type, - union acpi_operand_object **return_desc); - -acpi_status -acpi_ex_concat_template ( - union acpi_operand_object *obj_desc, - union acpi_operand_object *obj_desc2, - union acpi_operand_object **actual_return_desc, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_do_concatenate ( - union acpi_operand_object *obj_desc, - union acpi_operand_object *obj_desc2, - union acpi_operand_object **actual_return_desc, - struct acpi_walk_state *walk_state); - -u8 -acpi_ex_do_logical_op ( - u16 opcode, - acpi_integer operand0, - acpi_integer operand1); - -acpi_integer -acpi_ex_do_math_op ( - u16 opcode, - acpi_integer operand0, - acpi_integer operand1); - -acpi_status -acpi_ex_create_mutex ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_create_processor ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_create_power_resource ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_create_region ( - u8 *aml_start, - u32 aml_length, - u8 region_space, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_create_table_region ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_create_event ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_create_alias ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_create_method ( - u8 *aml_start, - u32 aml_length, - struct acpi_walk_state *walk_state); - - -/* - * exconfig - dynamic table load/unload - */ - -acpi_status -acpi_ex_add_table ( - struct acpi_table_header *table, - struct acpi_namespace_node *parent_node, - union acpi_operand_object **ddb_handle); - -acpi_status -acpi_ex_load_op ( - union acpi_operand_object *obj_desc, - union acpi_operand_object *target, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_load_table_op ( - struct acpi_walk_state *walk_state, - union acpi_operand_object **return_desc); - -acpi_status -acpi_ex_unload_table ( - union acpi_operand_object *ddb_handle); - - -/* - * exmutex - mutex support - */ - -acpi_status -acpi_ex_acquire_mutex ( - union acpi_operand_object *time_desc, - union acpi_operand_object *obj_desc, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_release_mutex ( - union acpi_operand_object *obj_desc, - struct acpi_walk_state *walk_state); - -void -acpi_ex_release_all_mutexes ( - struct acpi_thread_state *thread); - -void -acpi_ex_unlink_mutex ( - union acpi_operand_object *obj_desc); - -void -acpi_ex_link_mutex ( - union acpi_operand_object *obj_desc, - struct acpi_thread_state *thread); - -/* - * exprep - ACPI AML (p-code) execution - prep utilities - */ - -acpi_status -acpi_ex_prep_common_field_object ( - union acpi_operand_object *obj_desc, - u8 field_flags, - u8 field_attribute, - u32 field_bit_position, - u32 field_bit_length); - -acpi_status -acpi_ex_prep_field_value ( - struct acpi_create_field_info *info); - -/* - * exsystem - Interface to OS services - */ - -acpi_status -acpi_ex_system_do_notify_op ( - union acpi_operand_object *value, - union acpi_operand_object *obj_desc); - -acpi_status -acpi_ex_system_do_suspend( - u32 time); - -acpi_status -acpi_ex_system_do_stall ( - u32 time); - -acpi_status -acpi_ex_system_acquire_mutex( - union acpi_operand_object *time, - union acpi_operand_object *obj_desc); - -acpi_status -acpi_ex_system_release_mutex( - union acpi_operand_object *obj_desc); - -acpi_status -acpi_ex_system_signal_event( - union acpi_operand_object *obj_desc); - -acpi_status -acpi_ex_system_wait_event( - union acpi_operand_object *time, - union acpi_operand_object *obj_desc); - -acpi_status -acpi_ex_system_reset_event( - union acpi_operand_object *obj_desc); - -acpi_status -acpi_ex_system_wait_semaphore ( - acpi_handle semaphore, - u16 timeout); - - -/* - * exmonadic - ACPI AML (p-code) execution, monadic operators - */ - -acpi_status -acpi_ex_opcode_1A_0T_0R ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_opcode_1A_0T_1R ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_opcode_1A_1T_1R ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_opcode_1A_1T_0R ( - struct acpi_walk_state *walk_state); - -/* - * exdyadic - ACPI AML (p-code) execution, dyadic operators - */ - -acpi_status -acpi_ex_opcode_2A_0T_0R ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_opcode_2A_0T_1R ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_opcode_2A_1T_1R ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_opcode_2A_2T_1R ( - struct acpi_walk_state *walk_state); - - -/* - * exresolv - Object resolution and get value functions - */ - -acpi_status -acpi_ex_resolve_to_value ( - union acpi_operand_object **stack_ptr, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_resolve_node_to_value ( - struct acpi_namespace_node **stack_ptr, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_resolve_object_to_value ( - union acpi_operand_object **stack_ptr, - struct acpi_walk_state *walk_state); - - -/* - * exdump - Scanner debug output routines - */ - -void -acpi_ex_dump_operand ( - union acpi_operand_object *entry_desc); - -void -acpi_ex_dump_operands ( - union acpi_operand_object **operands, - acpi_interpreter_mode interpreter_mode, - char *ident, - u32 num_levels, - char *note, - char *module_name, - u32 line_number); - -void -acpi_ex_dump_object_descriptor ( - union acpi_operand_object *object, - u32 flags); - -void -acpi_ex_dump_node ( - struct acpi_namespace_node *node, - u32 flags); - -void -acpi_ex_out_string ( - char *title, - char *value); - -void -acpi_ex_out_pointer ( - char *title, - void *value); - -void -acpi_ex_out_integer ( - char *title, - u32 value); - -void -acpi_ex_out_address ( - char *title, - acpi_physical_address value); - - -/* - * exnames - interpreter/scanner name load/execute - */ - -char * -acpi_ex_allocate_name_string ( - u32 prefix_count, - u32 num_name_segs); - -u32 -acpi_ex_good_char ( - u32 character); - -acpi_status -acpi_ex_name_segment ( - u8 **in_aml_address, - char *name_string); - -acpi_status -acpi_ex_get_name_string ( - acpi_object_type data_type, - u8 *in_aml_address, - char **out_name_string, - u32 *out_name_length); - -acpi_status -acpi_ex_do_name ( - acpi_object_type data_type, - acpi_interpreter_mode load_exec_mode); - - -/* - * exstore - Object store support - */ - -acpi_status -acpi_ex_store ( - union acpi_operand_object *val_desc, - union acpi_operand_object *dest_desc, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_store_object_to_index ( - union acpi_operand_object *val_desc, - union acpi_operand_object *dest_desc, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_store_object_to_node ( - union acpi_operand_object *source_desc, - struct acpi_namespace_node *node, - struct acpi_walk_state *walk_state); - - -/* - * exstoren - */ - -acpi_status -acpi_ex_resolve_object ( - union acpi_operand_object **source_desc_ptr, - acpi_object_type target_type, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_store_object_to_object ( - union acpi_operand_object *source_desc, - union acpi_operand_object *dest_desc, - union acpi_operand_object **new_desc, - struct acpi_walk_state *walk_state); - - -/* - * excopy - object copy - */ - -acpi_status -acpi_ex_store_buffer_to_buffer ( - union acpi_operand_object *source_desc, - union acpi_operand_object *target_desc); - -acpi_status -acpi_ex_store_string_to_string ( - union acpi_operand_object *source_desc, - union acpi_operand_object *target_desc); - -acpi_status -acpi_ex_copy_integer_to_index_field ( - union acpi_operand_object *source_desc, - union acpi_operand_object *target_desc); - -acpi_status -acpi_ex_copy_integer_to_bank_field ( - union acpi_operand_object *source_desc, - union acpi_operand_object *target_desc); - -acpi_status -acpi_ex_copy_data_to_named_field ( - union acpi_operand_object *source_desc, - struct acpi_namespace_node *node); - -acpi_status -acpi_ex_copy_integer_to_buffer_field ( - union acpi_operand_object *source_desc, - union acpi_operand_object *target_desc); - -/* - * exutils - interpreter/scanner utilities - */ - -acpi_status -acpi_ex_enter_interpreter ( - void); - -void -acpi_ex_exit_interpreter ( - void); - -void -acpi_ex_truncate_for32bit_table ( - union acpi_operand_object *obj_desc); - -u8 -acpi_ex_acquire_global_lock ( - u32 rule); - -void -acpi_ex_release_global_lock ( - u8 locked); - -u32 -acpi_ex_digits_needed ( - acpi_integer value, - u32 base); - -void -acpi_ex_eisa_id_to_string ( - u32 numeric_id, - char *out_string); - -void -acpi_ex_unsigned_integer_to_string ( - acpi_integer value, - char *out_string); - - -/* - * exregion - default op_region handlers - */ - -acpi_status -acpi_ex_system_memory_space_handler ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - -acpi_status -acpi_ex_system_io_space_handler ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - -acpi_status -acpi_ex_pci_config_space_handler ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - -acpi_status -acpi_ex_cmos_space_handler ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - -acpi_status -acpi_ex_pci_bar_space_handler ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - -acpi_status -acpi_ex_embedded_controller_space_handler ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - -acpi_status -acpi_ex_sm_bus_space_handler ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - - -acpi_status -acpi_ex_data_table_space_handler ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - -#endif /* __INTERP_H__ */ diff -Nru a/drivers/acpi/include/aclocal.h b/drivers/acpi/include/aclocal.h --- a/drivers/acpi/include/aclocal.h Sun Feb 9 21:13:33 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,953 +0,0 @@ -/****************************************************************************** - * - * Name: aclocal.h - Internal data types used across the ACPI subsystem - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACLOCAL_H__ -#define __ACLOCAL_H__ - - -#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */ - -typedef void * acpi_mutex; -typedef u32 acpi_mutex_handle; - - -/* Total number of aml opcodes defined */ - -#define AML_NUM_OPCODES 0x7E - - -/***************************************************************************** - * - * Mutex typedefs and structs - * - ****************************************************************************/ - - -/* - * Predefined handles for the mutex objects used within the subsystem - * All mutex objects are automatically created by acpi_ut_mutex_initialize. - * - * The acquire/release ordering protocol is implied via this list. Mutexes - * with a lower value must be acquired before mutexes with a higher value. - * - * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names table also! - */ - -#define ACPI_MTX_EXECUTE 0 -#define ACPI_MTX_INTERPRETER 1 -#define ACPI_MTX_PARSER 2 -#define ACPI_MTX_DISPATCHER 3 -#define ACPI_MTX_TABLES 4 -#define ACPI_MTX_OP_REGIONS 5 -#define ACPI_MTX_NAMESPACE 6 -#define ACPI_MTX_EVENTS 7 -#define ACPI_MTX_HARDWARE 8 -#define ACPI_MTX_CACHES 9 -#define ACPI_MTX_MEMORY 10 -#define ACPI_MTX_DEBUG_CMD_COMPLETE 11 -#define ACPI_MTX_DEBUG_CMD_READY 12 - -#define MAX_MTX 12 -#define NUM_MTX MAX_MTX+1 - - -#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) -#ifdef DEFINE_ACPI_GLOBALS - -/* Names for the mutexes used in the subsystem */ - -static char *acpi_gbl_mutex_names[] = -{ - "ACPI_MTX_Execute", - "ACPI_MTX_Interpreter", - "ACPI_MTX_Parser", - "ACPI_MTX_Dispatcher", - "ACPI_MTX_Tables", - "ACPI_MTX_op_regions", - "ACPI_MTX_Namespace", - "ACPI_MTX_Events", - "ACPI_MTX_Hardware", - "ACPI_MTX_Caches", - "ACPI_MTX_Memory", - "ACPI_MTX_debug_cmd_complete", - "ACPI_MTX_debug_cmd_ready", -}; - -#endif -#endif - - -/* Table for the global mutexes */ - -struct acpi_mutex_info -{ - acpi_mutex mutex; - u32 use_count; - u32 owner_id; -}; - -/* This owner ID means that the mutex is not in use (unlocked) */ - -#define ACPI_MUTEX_NOT_ACQUIRED (u32) (-1) - - -/* Lock flag parameter for various interfaces */ - -#define ACPI_MTX_DO_NOT_LOCK 0 -#define ACPI_MTX_LOCK 1 - - -typedef u16 acpi_owner_id; -#define ACPI_OWNER_TYPE_TABLE 0x0 -#define ACPI_OWNER_TYPE_METHOD 0x1 -#define ACPI_FIRST_METHOD_ID 0x0000 -#define ACPI_FIRST_TABLE_ID 0x8000 - -/* TBD: [Restructure] get rid of the need for this! */ - -#define TABLE_ID_DSDT (acpi_owner_id) 0x8000 - - -/* Field access granularities */ - -#define ACPI_FIELD_BYTE_GRANULARITY 1 -#define ACPI_FIELD_WORD_GRANULARITY 2 -#define ACPI_FIELD_DWORD_GRANULARITY 4 -#define ACPI_FIELD_QWORD_GRANULARITY 8 - -/***************************************************************************** - * - * Namespace typedefs and structs - * - ****************************************************************************/ - - -/* Operational modes of the AML interpreter/scanner */ - -typedef enum -{ - ACPI_IMODE_LOAD_PASS1 = 0x01, - ACPI_IMODE_LOAD_PASS2 = 0x02, - ACPI_IMODE_EXECUTE = 0x0E - -} acpi_interpreter_mode; - - -/* - * The Node describes a named object that appears in the AML - * An acpi_node is used to store Nodes. - * - * data_type is used to differentiate between internal descriptors, and MUST - * be the first byte in this structure. - */ - -union acpi_name_union -{ - u32 integer; - char ascii[4]; -}; - -struct acpi_namespace_node -{ - u8 descriptor; /* Used to differentiate object descriptor types */ - u8 type; /* Type associated with this name */ - u16 owner_id; - union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ - - - union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */ - struct acpi_namespace_node *child; /* first child */ - struct acpi_namespace_node *peer; /* Next peer*/ - u16 reference_count; /* Current count of references and children */ - u8 flags; -}; - - -#define ACPI_ENTRY_NOT_FOUND NULL - - -/* Node flags */ - -#define ANOBJ_RESERVED 0x01 -#define ANOBJ_END_OF_PEER_LIST 0x02 -#define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */ -#define ANOBJ_METHOD_ARG 0x08 -#define ANOBJ_METHOD_LOCAL 0x10 -#define ANOBJ_METHOD_NO_RETVAL 0x20 -#define ANOBJ_METHOD_SOME_NO_RETVAL 0x40 - -#define ANOBJ_IS_BIT_OFFSET 0x80 - - -/* - * ACPI Table Descriptor. One per ACPI table - */ -struct acpi_table_desc -{ - struct acpi_table_desc *prev; - struct acpi_table_desc *next; - struct acpi_table_desc *installed_desc; - struct acpi_table_header *pointer; - u8 *aml_start; - u64 physical_address; - u32 aml_length; - acpi_size length; - u32 count; - acpi_owner_id table_id; - u8 type; - u8 allocation; - u8 loaded_into_namespace; -}; - - -struct acpi_find_context -{ - char *search_for; - acpi_handle *list; - u32 *count; -}; - - -struct acpi_ns_search_data -{ - struct acpi_namespace_node *node; -}; - - -/* - * Predefined Namespace items - */ -struct acpi_predefined_names -{ - char *name; - u8 type; - char *val; -}; - - -/* Object types used during package copies */ - - -#define ACPI_COPY_TYPE_SIMPLE 0 -#define ACPI_COPY_TYPE_PACKAGE 1 - -/* Info structure used to convert external<->internal namestrings */ - -struct acpi_namestring_info -{ - char *external_name; - char *next_external_char; - char *internal_name; - u32 length; - u32 num_segments; - u32 num_carats; - u8 fully_qualified; -}; - - -/* Field creation info */ - -struct acpi_create_field_info -{ - struct acpi_namespace_node *region_node; - struct acpi_namespace_node *field_node; - struct acpi_namespace_node *register_node; - struct acpi_namespace_node *data_register_node; - u32 bank_value; - u32 field_bit_position; - u32 field_bit_length; - u8 field_flags; - u8 attribute; - u8 field_type; -}; - - -/***************************************************************************** - * - * Event typedefs and structs - * - ****************************************************************************/ - -/* Information about each GPE register block */ - -struct acpi_gpe_block_info -{ - struct acpi_generic_address *block_address; - u16 register_count; - u8 block_base_number; -}; - -/* Information about a particular GPE register pair */ - -struct acpi_gpe_register_info -{ - struct acpi_generic_address status_address; /* Address of status reg */ - struct acpi_generic_address enable_address; /* Address of enable reg */ - u8 status; /* Current value of status reg */ - u8 enable; /* Current value of enable reg */ - u8 wake_enable; /* Mask of bits to keep enabled when sleeping */ - u8 base_gpe_number; /* Base GPE number for this register */ -}; - - -#define ACPI_GPE_LEVEL_TRIGGERED 1 -#define ACPI_GPE_EDGE_TRIGGERED 2 - - -/* Information about each particular GPE level */ - -struct acpi_gpe_number_info -{ - struct acpi_namespace_node *method_node; /* Method node for this GPE level */ - acpi_gpe_handler handler; /* Address of handler, if any */ - void *context; /* Context to be passed to handler */ - u8 type; /* Level or Edge */ - u8 bit_mask; -}; - - -struct acpi_gpe_index_info -{ - u8 number_index; -}; - -/* Information about each particular fixed event */ - -struct acpi_fixed_event_handler -{ - acpi_event_handler handler; /* Address of handler. */ - void *context; /* Context to be passed to handler */ -}; - - -struct acpi_fixed_event_info -{ - u8 status_register_id; - u8 enable_register_id; - u16 status_bit_mask; - u16 enable_bit_mask; -}; - -/* Information used during field processing */ - -struct acpi_field_info -{ - u8 skip_field; - u8 field_flag; - u32 pkg_length; -}; - - -/***************************************************************************** - * - * Generic "state" object for stacks - * - ****************************************************************************/ - - -#define ACPI_CONTROL_NORMAL 0xC0 -#define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1 -#define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2 -#define ACPI_CONTROL_PREDICATE_FALSE 0xC3 -#define ACPI_CONTROL_PREDICATE_TRUE 0xC4 - - -/* Forward declarations */ -struct acpi_walk_state ; -struct acpi_obj_mutex; -union acpi_parse_object ; - - -#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ - u8 data_type; /* To differentiate various internal objs */\ - u8 flags; \ - u16 value; \ - u16 state; \ - u16 reserved; \ - void *next; \ - -struct acpi_common_state -{ - ACPI_STATE_COMMON -}; - - -/* - * Update state - used to traverse complex objects such as packages - */ -struct acpi_update_state -{ - ACPI_STATE_COMMON - union acpi_operand_object *object; -}; - - -/* - * Pkg state - used to traverse nested package structures - */ -struct acpi_pkg_state -{ - ACPI_STATE_COMMON - union acpi_operand_object *source_object; - union acpi_operand_object *dest_object; - struct acpi_walk_state *walk_state; - void *this_target_obj; - u32 num_packages; - u16 index; -}; - - -/* - * Control state - one per if/else and while constructs. - * Allows nesting of these constructs - */ -struct acpi_control_state -{ - ACPI_STATE_COMMON - union acpi_parse_object *predicate_op; - u8 *aml_predicate_start; /* Start of if/while predicate */ - u8 *package_end; /* End of if/while block */ - u16 opcode; -}; - - -/* - * Scope state - current scope during namespace lookups - */ -struct acpi_scope_state -{ - ACPI_STATE_COMMON - struct acpi_namespace_node *node; -}; - - -struct acpi_pscope_state -{ - ACPI_STATE_COMMON - union acpi_parse_object *op; /* current op being parsed */ - u8 *arg_end; /* current argument end */ - u8 *pkg_end; /* current package end */ - u32 arg_list; /* next argument to parse */ - u32 arg_count; /* Number of fixed arguments */ -}; - - -/* - * Thread state - one per thread across multiple walk states. Multiple walk - * states are created when there are nested control methods executing. - */ -struct acpi_thread_state -{ - ACPI_STATE_COMMON - struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */ - union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */ - u32 thread_id; /* Running thread ID */ - u16 current_sync_level; /* Mutex Sync (nested acquire) level */ -}; - - -/* - * Result values - used to accumulate the results of nested - * AML arguments - */ -struct acpi_result_values -{ - ACPI_STATE_COMMON - union acpi_operand_object *obj_desc [ACPI_OBJ_NUM_OPERANDS]; - u8 num_results; - u8 last_insert; -}; - - -typedef -acpi_status (*acpi_parse_downwards) ( - struct acpi_walk_state *walk_state, - union acpi_parse_object **out_op); - -typedef -acpi_status (*acpi_parse_upwards) ( - struct acpi_walk_state *walk_state); - - -/* - * Notify info - used to pass info to the deferred notify - * handler/dispatcher. - */ -struct acpi_notify_info -{ - ACPI_STATE_COMMON - struct acpi_namespace_node *node; - union acpi_operand_object *handler_obj; -}; - - -/* Generic state is union of structs above */ - -union acpi_generic_state -{ - struct acpi_common_state common; - struct acpi_control_state control; - struct acpi_update_state update; - struct acpi_scope_state scope; - struct acpi_pscope_state parse_scope; - struct acpi_pkg_state pkg; - struct acpi_thread_state thread; - struct acpi_result_values results; - struct acpi_notify_info notify; -}; - - -/***************************************************************************** - * - * Interpreter typedefs and structs - * - ****************************************************************************/ - -typedef -acpi_status (*ACPI_EXECUTE_OP) ( - struct acpi_walk_state *walk_state); - - -/***************************************************************************** - * - * Parser typedefs and structs - * - ****************************************************************************/ - -/* - * AML opcode, name, and argument layout - */ -struct acpi_opcode_info -{ -#if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT) - char *name; /* Opcode name (disassembler/debug only) */ -#endif - u32 parse_args; /* Grammar/Parse time arguments */ - u32 runtime_args; /* Interpret time arguments */ - u32 flags; /* Misc flags */ - u8 object_type; /* Corresponding internal object type */ - u8 class; /* Opcode class */ - u8 type; /* Opcode type */ -}; - - -union acpi_parse_value -{ - acpi_integer integer; /* integer constant (Up to 64 bits) */ - struct uint64_struct integer64; /* Structure overlay for 2 32-bit Dwords */ - u32 integer32; /* integer constant, 32 bits only */ - u16 integer16; /* integer constant, 16 bits only */ - u8 integer8; /* integer constant, 8 bits only */ - u32 size; /* bytelist or field size */ - char *string; /* NULL terminated string */ - u8 *buffer; /* buffer or string */ - char *name; /* NULL terminated string */ - union acpi_parse_object *arg; /* arguments and contained ops */ -}; - - -#define ACPI_PARSE_COMMON \ - u8 data_type; /* To differentiate various internal objs */\ - u8 flags; /* Type of Op */\ - u16 aml_opcode; /* AML opcode */\ - u32 aml_offset; /* offset of declaration in AML */\ - union acpi_parse_object *parent; /* parent op */\ - union acpi_parse_object *next; /* next op */\ - ACPI_DISASM_ONLY_MEMBERS (\ - u8 disasm_flags; /* Used during AML disassembly */\ - u8 disasm_opcode; /* Subtype used for disassembly */\ - char aml_op_name[16]) /* op name (debug only) */\ - /* NON-DEBUG members below: */\ - struct acpi_namespace_node *node; /* for use by interpreter */\ - union acpi_parse_value value; /* Value or args associated with the opcode */\ - - -#define ACPI_DASM_BUFFER 0x00 -#define ACPI_DASM_RESOURCE 0x01 -#define ACPI_DASM_STRING 0x02 -#define ACPI_DASM_UNICODE 0x03 -#define ACPI_DASM_EISAID 0x04 -#define ACPI_DASM_MATCHOP 0x05 - -/* - * generic operation (for example: If, While, Store) - */ -struct acpi_parse_obj_common -{ - ACPI_PARSE_COMMON -}; - - -/* - * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and op_regions), - * and bytelists. - */ -struct acpi_parse_obj_named -{ - ACPI_PARSE_COMMON - u8 *path; - u8 *data; /* AML body or bytelist data */ - u32 length; /* AML length */ - u32 name; /* 4-byte name or zero if no name */ -}; - - -/* The parse node is the fundamental element of the parse tree */ - -struct acpi_parse_obj_asl -{ - ACPI_PARSE_COMMON - union acpi_parse_object *child; - union acpi_parse_object *parent_method; - char *filename; - char *external_name; - char *namepath; - char name_seg[4]; - u32 extra_value; - u32 column; - u32 line_number; - u32 logical_line_number; - u32 logical_byte_offset; - u32 end_line; - u32 end_logical_line; - u32 acpi_btype; - u32 aml_length; - u32 aml_subtree_length; - u32 final_aml_length; - u32 final_aml_offset; - u32 compile_flags; - u16 parse_opcode; - u8 aml_opcode_length; - u8 aml_pkg_len_bytes; - u8 extra; - char parse_op_name[12]; -}; - - -union acpi_parse_object -{ - struct acpi_parse_obj_common common; - struct acpi_parse_obj_named named; - struct acpi_parse_obj_asl asl; -}; - - -/* - * Parse state - one state per parser invocation and each control - * method. - */ -struct acpi_parse_state -{ - u32 aml_size; - u8 *aml_start; /* first AML byte */ - u8 *aml; /* next AML byte */ - u8 *aml_end; /* (last + 1) AML byte */ - u8 *pkg_start; /* current package begin */ - u8 *pkg_end; /* current package end */ - union acpi_parse_object *start_op; /* root of parse tree */ - struct acpi_namespace_node *start_node; - union acpi_generic_state *scope; /* current scope */ - union acpi_parse_object *start_scope; -}; - - -/* Parse object flags */ - -#define ACPI_PARSEOP_GENERIC 0x01 -#define ACPI_PARSEOP_NAMED 0x02 -#define ACPI_PARSEOP_DEFERRED 0x04 -#define ACPI_PARSEOP_BYTELIST 0x08 -#define ACPI_PARSEOP_IN_CACHE 0x80 - -/* Parse object disasm_flags */ - -#define ACPI_PARSEOP_IGNORE 0x01 -#define ACPI_PARSEOP_PARAMLIST 0x02 -#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 -#define ACPI_PARSEOP_SPECIAL 0x10 - - -/***************************************************************************** - * - * Hardware (ACPI registers) and PNP - * - ****************************************************************************/ - -#define PCI_ROOT_HID_STRING "PNP0A03" - -struct acpi_bit_register_info -{ - u8 parent_register; - u8 bit_position; - u16 access_bit_mask; -}; - - -/* - * Register IDs - * These are the full ACPI registers - */ -#define ACPI_REGISTER_PM1_STATUS 0x01 -#define ACPI_REGISTER_PM1_ENABLE 0x02 -#define ACPI_REGISTER_PM1_CONTROL 0x03 -#define ACPI_REGISTER_PM1A_CONTROL 0x04 -#define ACPI_REGISTER_PM1B_CONTROL 0x05 -#define ACPI_REGISTER_PM2_CONTROL 0x06 -#define ACPI_REGISTER_PM_TIMER 0x07 -#define ACPI_REGISTER_PROCESSOR_BLOCK 0x08 -#define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x09 - - -/* Masks used to access the bit_registers */ - -#define ACPI_BITMASK_TIMER_STATUS 0x0001 -#define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010 -#define ACPI_BITMASK_GLOBAL_LOCK_STATUS 0x0020 -#define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100 -#define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200 -#define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400 -#define ACPI_BITMASK_WAKE_STATUS 0x8000 - -#define ACPI_BITMASK_ALL_FIXED_STATUS (ACPI_BITMASK_TIMER_STATUS | \ - ACPI_BITMASK_BUS_MASTER_STATUS | \ - ACPI_BITMASK_GLOBAL_LOCK_STATUS | \ - ACPI_BITMASK_POWER_BUTTON_STATUS | \ - ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ - ACPI_BITMASK_RT_CLOCK_STATUS | \ - ACPI_BITMASK_WAKE_STATUS) - -#define ACPI_BITMASK_TIMER_ENABLE 0x0001 -#define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020 -#define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100 -#define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200 -#define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400 - -#define ACPI_BITMASK_SCI_ENABLE 0x0001 -#define ACPI_BITMASK_BUS_MASTER_RLD 0x0002 -#define ACPI_BITMASK_GLOBAL_LOCK_RELEASE 0x0004 -#define ACPI_BITMASK_SLEEP_TYPE_X 0x1C00 -#define ACPI_BITMASK_SLEEP_ENABLE 0x2000 - -#define ACPI_BITMASK_ARB_DISABLE 0x0001 - - -/* Raw bit position of each bit_register */ - -#define ACPI_BITPOSITION_TIMER_STATUS 0x00 -#define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04 -#define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS 0x05 -#define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08 -#define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09 -#define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A -#define ACPI_BITPOSITION_WAKE_STATUS 0x0F - -#define ACPI_BITPOSITION_TIMER_ENABLE 0x00 -#define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE 0x05 -#define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08 -#define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09 -#define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A - -#define ACPI_BITPOSITION_SCI_ENABLE 0x00 -#define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01 -#define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE 0x02 -#define ACPI_BITPOSITION_SLEEP_TYPE_X 0x0A -#define ACPI_BITPOSITION_SLEEP_ENABLE 0x0D - -#define ACPI_BITPOSITION_ARB_DISABLE 0x00 - - -/***************************************************************************** - * - * Resource descriptors - * - ****************************************************************************/ - - -/* resource_type values */ - -#define ACPI_RESOURCE_TYPE_MEMORY_RANGE 0 -#define ACPI_RESOURCE_TYPE_IO_RANGE 1 -#define ACPI_RESOURCE_TYPE_BUS_NUMBER_RANGE 2 - -/* Resource descriptor types and masks */ - -#define ACPI_RDESC_TYPE_LARGE 0x80 -#define ACPI_RDESC_TYPE_SMALL 0x00 - -#define ACPI_RDESC_TYPE_MASK 0x80 -#define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */ - - -/* - * Small resource descriptor types - * Note: The 3 length bits (2:0) must be zero - */ -#define ACPI_RDESC_TYPE_IRQ_FORMAT 0x20 -#define ACPI_RDESC_TYPE_DMA_FORMAT 0x28 -#define ACPI_RDESC_TYPE_START_DEPENDENT 0x30 -#define ACPI_RDESC_TYPE_END_DEPENDENT 0x38 -#define ACPI_RDESC_TYPE_IO_PORT 0x40 -#define ACPI_RDESC_TYPE_FIXED_IO_PORT 0x48 -#define ACPI_RDESC_TYPE_SMALL_VENDOR 0x70 -#define ACPI_RDESC_TYPE_END_TAG 0x78 - -/* - * Large resource descriptor types - */ - -#define ACPI_RDESC_TYPE_MEMORY_24 0x81 -#define ACPI_RDESC_TYPE_GENERAL_REGISTER 0x82 -#define ACPI_RDESC_TYPE_LARGE_VENDOR 0x84 -#define ACPI_RDESC_TYPE_MEMORY_32 0x85 -#define ACPI_RDESC_TYPE_FIXED_MEMORY_32 0x86 -#define ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE 0x87 -#define ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE 0x88 -#define ACPI_RDESC_TYPE_EXTENDED_XRUPT 0x89 -#define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A - - -/* String version of device HIDs and UIDs */ - -#define ACPI_DEVICE_ID_LENGTH 0x09 - -struct acpi_device_id -{ - char buffer[ACPI_DEVICE_ID_LENGTH]; -}; - - -/***************************************************************************** - * - * Miscellaneous - * - ****************************************************************************/ - -#define ACPI_ASCII_ZERO 0x30 - - -/***************************************************************************** - * - * Debugger - * - ****************************************************************************/ - -struct acpi_db_method_info -{ - acpi_handle thread_gate; - char *name; - char **args; - u32 flags; - u32 num_loops; - char pathname[128]; -}; - -struct acpi_integrity_info -{ - u32 nodes; - u32 objects; -}; - - -#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 -#define ACPI_DB_CONSOLE_OUTPUT 0x02 -#define ACPI_DB_DUPLICATE_OUTPUT 0x03 - - -/***************************************************************************** - * - * Debug - * - ****************************************************************************/ - -struct acpi_debug_print_info -{ - u32 component_id; - char *proc_name; - char *module_name; -}; - - -/* Entry for a memory allocation (debug only) */ - -#define ACPI_MEM_MALLOC 0 -#define ACPI_MEM_CALLOC 1 -#define ACPI_MAX_MODULE_NAME 16 - -#define ACPI_COMMON_DEBUG_MEM_HEADER \ - struct acpi_debug_mem_block *previous; \ - struct acpi_debug_mem_block *next; \ - u32 size; \ - u32 component; \ - u32 line; \ - char module[ACPI_MAX_MODULE_NAME]; \ - u8 alloc_type; - -struct acpi_debug_mem_header -{ - ACPI_COMMON_DEBUG_MEM_HEADER -}; - -struct acpi_debug_mem_block -{ - ACPI_COMMON_DEBUG_MEM_HEADER - u64 user_space; -}; - - -#define ACPI_MEM_LIST_GLOBAL 0 -#define ACPI_MEM_LIST_NSNODE 1 - -#define ACPI_MEM_LIST_FIRST_CACHE_LIST 2 -#define ACPI_MEM_LIST_STATE 2 -#define ACPI_MEM_LIST_PSNODE 3 -#define ACPI_MEM_LIST_PSNODE_EXT 4 -#define ACPI_MEM_LIST_OPERAND 5 -#define ACPI_MEM_LIST_WALK 6 -#define ACPI_MEM_LIST_MAX 6 -#define ACPI_NUM_MEM_LISTS 7 - - -struct acpi_memory_list -{ - void *list_head; - u16 link_offset; - u16 max_cache_depth; - u16 cache_depth; - u16 object_size; - -#ifdef ACPI_DBG_TRACK_ALLOCATIONS - - /* Statistics for debug memory tracking only */ - - u32 total_allocated; - u32 total_freed; - u32 current_total_size; - u32 cache_requests; - u32 cache_hits; - char *list_name; -#endif -}; - - -#endif /* __ACLOCAL_H__ */ diff -Nru a/drivers/acpi/include/acmacros.h b/drivers/acpi/include/acmacros.h --- a/drivers/acpi/include/acmacros.h Sun Feb 9 21:13:32 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,578 +0,0 @@ -/****************************************************************************** - * - * Name: acmacros.h - C macros for the entire subsystem. - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACMACROS_H__ -#define __ACMACROS_H__ - - -/* - * Data manipulation macros - */ - -#define ACPI_LOWORD(l) ((u16)(u32)(l)) -#define ACPI_HIWORD(l) ((u16)((((u32)(l)) >> 16) & 0xFFFF)) -#define ACPI_LOBYTE(l) ((u8)(u16)(l)) -#define ACPI_HIBYTE(l) ((u8)((((u16)(l)) >> 8) & 0xFF)) - - -#if ACPI_MACHINE_WIDTH == 16 - -/* - * For 16-bit addresses, we have to assume that the upper 32 bits - * are zero. - */ -#define ACPI_LODWORD(l) ((u32)(l)) -#define ACPI_HIDWORD(l) ((u32)(0)) - -#define ACPI_GET_ADDRESS(a) ((a).lo) -#define ACPI_STORE_ADDRESS(a,b) {(a).hi=0;(a).lo=(u32)(b);} -#define ACPI_VALID_ADDRESS(a) ((a).hi | (a).lo) - -#else -#ifdef ACPI_NO_INTEGER64_SUPPORT -/* - * acpi_integer is 32-bits, no 64-bit support on this platform - */ -#define ACPI_LODWORD(l) ((u32)(l)) -#define ACPI_HIDWORD(l) ((u32)(0)) - -#define ACPI_GET_ADDRESS(a) (a) -#define ACPI_STORE_ADDRESS(a,b) ((a)=(b)) -#define ACPI_VALID_ADDRESS(a) (a) - -#else - -/* - * Full 64-bit address/integer on both 32-bit and 64-bit platforms - */ -#define ACPI_LODWORD(l) ((u32)(u64)(l)) -#define ACPI_HIDWORD(l) ((u32)(((*(struct uint64_struct *)(void *)(&l))).hi)) - -#define ACPI_GET_ADDRESS(a) (a) -#define ACPI_STORE_ADDRESS(a,b) ((a)=(acpi_physical_address)(b)) -#define ACPI_VALID_ADDRESS(a) (a) -#endif -#endif - - /* - * Extract a byte of data using a pointer. Any more than a byte and we - * get into potential aligment issues -- see the STORE macros below - */ -#define ACPI_GET8(addr) (*(u8*)(addr)) - -/* Pointer arithmetic */ - -#define ACPI_PTR_ADD(t,a,b) (t *) (void *)((char *)(a) + (acpi_native_uint)(b)) -#define ACPI_PTR_DIFF(a,b) (acpi_native_uint) ((char *)(a) - (char *)(b)) - -/* Pointer/Integer type conversions */ - -#define ACPI_TO_POINTER(i) ACPI_PTR_ADD (void, (void *) NULL,(acpi_native_uint)i) -#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) -#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) -#define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f) - -#define ACPI_CAST_PTR(t, p) ((t *)(void *)(p)) -#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **)(void *)(p)) - -#if ACPI_MACHINE_WIDTH == 16 -#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_UNALIGNED32_TO_32(d,s) -#define ACPI_PHYSADDR_TO_PTR(i) (void *)(i) -#define ACPI_PTR_TO_PHYSADDR(i) (u32) (char *)(i) -#else -#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) -#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) -#endif - -/* - * Macros for moving data around to/from buffers that are possibly unaligned. - * If the hardware supports the transfer of unaligned data, just do the store. - * Otherwise, we have to move one byte at a time. - */ - -#ifdef _HW_ALIGNMENT_SUPPORT - -/* The hardware supports unaligned transfers, just do the move */ - -#define ACPI_MOVE_UNALIGNED16_TO_16(d,s) *(u16 *)(void *)(d) = *(u16 *)(void *)(s) -#define ACPI_MOVE_UNALIGNED32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) -#define ACPI_MOVE_UNALIGNED16_TO_32(d,s) *(u32 *)(void *)(d) = *(u16 *)(void *)(s) -#define ACPI_MOVE_UNALIGNED64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s) - -#else -/* - * The hardware does not support unaligned transfers. We must move the - * data one byte at a time. These macros work whether the source or - * the destination (or both) is/are unaligned. - */ - -#define ACPI_MOVE_UNALIGNED16_TO_16(d,s) {((u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ - ((u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];} - -#define ACPI_MOVE_UNALIGNED32_TO_32(d,s) {((u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ - ((u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ - ((u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\ - ((u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[3];} - -#define ACPI_MOVE_UNALIGNED16_TO_32(d,s) {(*(u32*)(void *)(d)) = 0; ACPI_MOVE_UNALIGNED16_TO_16(d,s);} - -#define ACPI_MOVE_UNALIGNED64_TO_64(d,s) {((u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ - ((u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ - ((u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\ - ((u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[3];\ - ((u8 *)(void *)(d))[4] = ((u8 *)(void *)(s))[4];\ - ((u8 *)(void *)(d))[5] = ((u8 *)(void *)(s))[5];\ - ((u8 *)(void *)(d))[6] = ((u8 *)(void *)(s))[6];\ - ((u8 *)(void *)(d))[7] = ((u8 *)(void *)(s))[7];} - -#endif - - -/* - * Fast power-of-two math macros for non-optimized compilers - */ - -#define _ACPI_DIV(value,power_of2) ((u32) ((value) >> (power_of2))) -#define _ACPI_MUL(value,power_of2) ((u32) ((value) << (power_of2))) -#define _ACPI_MOD(value,divisor) ((u32) ((value) & ((divisor) -1))) - -#define ACPI_DIV_2(a) _ACPI_DIV(a,1) -#define ACPI_MUL_2(a) _ACPI_MUL(a,1) -#define ACPI_MOD_2(a) _ACPI_MOD(a,2) - -#define ACPI_DIV_4(a) _ACPI_DIV(a,2) -#define ACPI_MUL_4(a) _ACPI_MUL(a,2) -#define ACPI_MOD_4(a) _ACPI_MOD(a,4) - -#define ACPI_DIV_8(a) _ACPI_DIV(a,3) -#define ACPI_MUL_8(a) _ACPI_MUL(a,3) -#define ACPI_MOD_8(a) _ACPI_MOD(a,8) - -#define ACPI_DIV_16(a) _ACPI_DIV(a,4) -#define ACPI_MUL_16(a) _ACPI_MUL(a,4) -#define ACPI_MOD_16(a) _ACPI_MOD(a,16) - - -/* - * Rounding macros (Power of two boundaries only) - */ -#define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & (~(((acpi_native_uint) boundary)-1))) -#define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + (((acpi_native_uint) boundary)-1)) & (~(((acpi_native_uint) boundary)-1))) - -#define ACPI_ROUND_DOWN_TO_32_BITS(a) ACPI_ROUND_DOWN(a,4) -#define ACPI_ROUND_DOWN_TO_64_BITS(a) ACPI_ROUND_DOWN(a,8) -#define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,ALIGNED_ADDRESS_BOUNDARY) - -#define ACPI_ROUND_UP_to_32_bITS(a) ACPI_ROUND_UP(a,4) -#define ACPI_ROUND_UP_to_64_bITS(a) ACPI_ROUND_UP(a,8) -#define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY) - - -#define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) -#define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) - -#define ACPI_ROUND_UP_TO_1K(a) (((a) + 1023) >> 10) - -/* Generic (non-power-of-two) rounding */ - -#define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) - -/* - * Bitmask creation - * Bit positions start at zero. - * MASK_BITS_ABOVE creates a mask starting AT the position and above - * MASK_BITS_BELOW creates a mask starting one bit BELOW the position - */ -#define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_INTEGER_MAX) << ((u32) (position)))) -#define ACPI_MASK_BITS_BELOW(position) ((ACPI_INTEGER_MAX) << ((u32) (position))) - -#define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) - -/* Macros for GAS addressing */ - -#if ACPI_MACHINE_WIDTH != 16 - -#define ACPI_PCI_DEVICE_MASK (u64) 0x0000FFFF00000000 -#define ACPI_PCI_FUNCTION_MASK (u64) 0x00000000FFFF0000 -#define ACPI_PCI_REGISTER_MASK (u64) 0x000000000000FFFF - -/* - * Obsolete - */ - -/* -#define ACPI_PCI_FUNCTION(a) (u16) ((((u64)((u64)(a) & ACPI_PCI_FUNCTION_MASK)) >> 16)) -#define ACPI_PCI_DEVICE(a) (u16) ((((u64)((u64)(a) & ACPI_PCI_DEVICE_MASK)) >> 32)) -#define ACPI_PCI_REGISTER(a) (u16) (((u64)((u64)(a) & ACPI_PCI_REGISTER_MASK))) -*/ - - -#define ACPI_PCI_DEVICE(a) (u16) ((ACPI_HIDWORD ((a))) & 0x0000FFFF) -#define ACPI_PCI_FUNCTION(a) (u16) ((ACPI_LODWORD ((a))) >> 16) -#define ACPI_PCI_REGISTER(a) (u16) ((ACPI_LODWORD ((a))) & 0x0000FFFF) - -#else - -/* No support for GAS and PCI IDs in 16-bit mode */ - -#define ACPI_PCI_FUNCTION(a) (u16) ((a) & 0xFFFF0000) -#define ACPI_PCI_DEVICE(a) (u16) ((a) & 0x0000FFFF) -#define ACPI_PCI_REGISTER(a) (u16) ((a) & 0x0000FFFF) - -#endif - - -/* Bitfields within ACPI registers */ - -#define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) -#define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask) - -/* - * An struct acpi_namespace_node * can appear in some contexts, - * where a pointer to an union acpi_operand_object can also - * appear. This macro is used to distinguish them. - * - * The "Descriptor" field is the first field in both structures. - */ -#define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->descriptor_id) -#define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->descriptor_id = t) - - -/* Macro to test the object type */ - -#define ACPI_GET_OBJECT_TYPE(d) (((union acpi_operand_object *)(void *)(d))->common.type) - -/* Macro to check the table flags for SINGLE or MULTIPLE tables are allowed */ - -#define ACPI_IS_SINGLE_TABLE(x) (((x) & 0x01) == ACPI_TABLE_SINGLE ? 1 : 0) - -/* - * Macros for the master AML opcode table - */ -#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUG_OUTPUT) -#define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags) {name,(u32)(Pargs),(u32)(Iargs),(u32)(flags),obj_type,class,type} -#else -#define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags) {(u32)(Pargs),(u32)(Iargs),(u32)(flags),obj_type,class,type} -#endif - -#ifdef ACPI_DISASSEMBLER -#define ACPI_DISASM_ONLY_MEMBERS(a) a; -#else -#define ACPI_DISASM_ONLY_MEMBERS(a) -#endif - -#define ARG_TYPE_WIDTH 5 -#define ARG_1(x) ((u32)(x)) -#define ARG_2(x) ((u32)(x) << (1 * ARG_TYPE_WIDTH)) -#define ARG_3(x) ((u32)(x) << (2 * ARG_TYPE_WIDTH)) -#define ARG_4(x) ((u32)(x) << (3 * ARG_TYPE_WIDTH)) -#define ARG_5(x) ((u32)(x) << (4 * ARG_TYPE_WIDTH)) -#define ARG_6(x) ((u32)(x) << (5 * ARG_TYPE_WIDTH)) - -#define ARGI_LIST1(a) (ARG_1(a)) -#define ARGI_LIST2(a,b) (ARG_1(b)|ARG_2(a)) -#define ARGI_LIST3(a,b,c) (ARG_1(c)|ARG_2(b)|ARG_3(a)) -#define ARGI_LIST4(a,b,c,d) (ARG_1(d)|ARG_2(c)|ARG_3(b)|ARG_4(a)) -#define ARGI_LIST5(a,b,c,d,e) (ARG_1(e)|ARG_2(d)|ARG_3(c)|ARG_4(b)|ARG_5(a)) -#define ARGI_LIST6(a,b,c,d,e,f) (ARG_1(f)|ARG_2(e)|ARG_3(d)|ARG_4(c)|ARG_5(b)|ARG_6(a)) - -#define ARGP_LIST1(a) (ARG_1(a)) -#define ARGP_LIST2(a,b) (ARG_1(a)|ARG_2(b)) -#define ARGP_LIST3(a,b,c) (ARG_1(a)|ARG_2(b)|ARG_3(c)) -#define ARGP_LIST4(a,b,c,d) (ARG_1(a)|ARG_2(b)|ARG_3(c)|ARG_4(d)) -#define ARGP_LIST5(a,b,c,d,e) (ARG_1(a)|ARG_2(b)|ARG_3(c)|ARG_4(d)|ARG_5(e)) -#define ARGP_LIST6(a,b,c,d,e,f) (ARG_1(a)|ARG_2(b)|ARG_3(c)|ARG_4(d)|ARG_5(e)|ARG_6(f)) - -#define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F)) -#define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) - - -/* - * Build a GAS structure from earlier ACPI table entries (V1.0 and 0.71 extensions) - * - * 1) Address space - * 2) Length in bytes -- convert to length in bits - * 3) Bit offset is zero - * 4) Reserved field is zero - * 5) Expand address to 64 bits - */ -#define ASL_BUILD_GAS_FROM_ENTRY(a,b,c,d) do {a.address_space_id = (u8) d;\ - a.register_bit_width = (u8) ACPI_MUL_8 (b);\ - a.register_bit_offset = 0;\ - a.reserved = 0;\ - ACPI_STORE_ADDRESS (a.address,(acpi_physical_address) c);} while (0) - -/* ACPI V1.0 entries -- address space is always I/O */ - -#define ASL_BUILD_GAS_FROM_V1_ENTRY(a,b,c) ASL_BUILD_GAS_FROM_ENTRY(a,b,c,ACPI_ADR_SPACE_SYSTEM_IO) - - -/* - * Reporting macros that are never compiled out - */ - -#define ACPI_PARAM_LIST(pl) pl - -/* - * Error reporting. These versions add callers module and line#. Since - * _THIS_MODULE gets compiled out when ACPI_DEBUG_OUTPUT isn't defined, only - * use it in debug mode. - */ - -#ifdef ACPI_DEBUG_OUTPUT - -#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} -#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_THIS_MODULE,__LINE__,_COMPONENT); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} -#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_THIS_MODULE,__LINE__,_COMPONENT); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} -#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_THIS_MODULE,__LINE__,_COMPONENT, s, e); - -#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_THIS_MODULE,__LINE__,_COMPONENT, s, n, p, e); - -#else - -#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info("ACPI",__LINE__,_COMPONENT); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} -#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error("ACPI",__LINE__,_COMPONENT); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} -#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning("ACPI",__LINE__,_COMPONENT); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} -#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error("ACPI",__LINE__,_COMPONENT, s, e); - -#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error("ACPI",__LINE__,_COMPONENT, s, n, p, e); - -#endif - -/* Error reporting. These versions pass thru the module and line# */ - -#define _ACPI_REPORT_INFO(a,b,c,fp) {acpi_ut_report_info(a,b,c); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} -#define _ACPI_REPORT_ERROR(a,b,c,fp) {acpi_ut_report_error(a,b,c); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} -#define _ACPI_REPORT_WARNING(a,b,c,fp) {acpi_ut_report_warning(a,b,c); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} - -/* - * Debug macros that are conditionally compiled - */ - -#ifdef ACPI_DEBUG_OUTPUT - -#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_THIS_MODULE = name; - -/* - * Function entry tracing. - * The first parameter should be the procedure name as a quoted string. This is declared - * as a local string ("_proc_name) so that it can be also used by the function exit macros below. - */ - -#define ACPI_FUNCTION_NAME(a) struct acpi_debug_print_info _dbg; \ - _dbg.component_id = _COMPONENT; \ - _dbg.proc_name = a; \ - _dbg.module_name = _THIS_MODULE; - -#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a)\ - acpi_ut_trace(__LINE__,&_dbg) -#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a)\ - acpi_ut_trace_ptr(__LINE__,&_dbg,(void *)b) -#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a)\ - acpi_ut_trace_u32(__LINE__,&_dbg,(u32)b) -#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a)\ - acpi_ut_trace_str(__LINE__,&_dbg,(char *)b) - -#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() - -/* - * Function exit tracing. - * WARNING: These macros include a return statement. This is usually considered - * bad form, but having a separate exit macro is very ugly and difficult to maintain. - * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros - * so that "_proc_name" is defined. - */ -#ifdef ACPI_USE_DO_WHILE_0 -#define ACPI_DO_WHILE0(a) do a while(0) -#else -#define ACPI_DO_WHILE0(a) a -#endif - -#define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(__LINE__,&_dbg);return;}) -#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(__LINE__,&_dbg,(s));return((s));}) -#define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(__LINE__,&_dbg,(acpi_integer)(s));return((s));}) -#define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(__LINE__,&_dbg,(u8 *)(s));return((s));}) - -/* Conditional execution */ - -#define ACPI_DEBUG_EXEC(a) a -#define ACPI_NORMAL_EXEC(a) - -#define ACPI_DEBUG_DEFINE(a) a; -#define ACPI_DEBUG_ONLY_MEMBERS(a) a; -#define _VERBOSE_STRUCTURES - - -/* Stack and buffer dumping */ - -#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand(a) -#define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_THIS_MODULE,__LINE__) - - -#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) -#define ACPI_DUMP_TABLES(a,b) acpi_ns_dump_tables(a,b) -#define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) -#define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) -#define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) -#define ACPI_BREAK_MSG(a) acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a)) - - -/* - * Generate INT3 on ACPI_ERROR (Debug only!) - */ - -#define ACPI_ERROR_BREAK -#ifdef ACPI_ERROR_BREAK -#define ACPI_BREAK_ON_ERROR(lvl) if ((lvl)&ACPI_ERROR) \ - acpi_os_signal(ACPI_SIGNAL_BREAKPOINT,"Fatal error encountered\n") -#else -#define ACPI_BREAK_ON_ERROR(lvl) -#endif - -/* - * Master debug print macros - * Print iff: - * 1) Debug print for the current component is enabled - * 2) Debug error level or trace level for the print statement is enabled - */ - -#define ACPI_DEBUG_PRINT(pl) acpi_ut_debug_print ACPI_PARAM_LIST(pl) -#define ACPI_DEBUG_PRINT_RAW(pl) acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl) - - -#else -/* - * This is the non-debug case -- make everything go away, - * leaving no executable debug code! - */ - -#define ACPI_MODULE_NAME(name) -#define _THIS_MODULE "" - -#define ACPI_DEBUG_EXEC(a) -#define ACPI_NORMAL_EXEC(a) a; - -#define ACPI_DEBUG_DEFINE(a) -#define ACPI_DEBUG_ONLY_MEMBERS(a) -#define ACPI_FUNCTION_NAME(a) -#define ACPI_FUNCTION_TRACE(a) -#define ACPI_FUNCTION_TRACE_PTR(a,b) -#define ACPI_FUNCTION_TRACE_U32(a,b) -#define ACPI_FUNCTION_TRACE_STR(a,b) -#define ACPI_FUNCTION_EXIT -#define ACPI_FUNCTION_STATUS_EXIT(s) -#define ACPI_FUNCTION_VALUE_EXIT(s) -#define ACPI_FUNCTION_ENTRY() -#define ACPI_DUMP_STACK_ENTRY(a) -#define ACPI_DUMP_OPERANDS(a,b,c,d,e) -#define ACPI_DUMP_ENTRY(a,b) -#define ACPI_DUMP_TABLES(a,b) -#define ACPI_DUMP_PATHNAME(a,b,c,d) -#define ACPI_DUMP_RESOURCE_LIST(a) -#define ACPI_DUMP_BUFFER(a,b) -#define ACPI_DEBUG_PRINT(pl) -#define ACPI_DEBUG_PRINT_RAW(pl) -#define ACPI_BREAK_MSG(a) - -#define return_VOID return -#define return_ACPI_STATUS(s) return(s) -#define return_VALUE(s) return(s) -#define return_PTR(s) return(s) - -#endif - -/* - * Some code only gets executed when the debugger is built in. - * Note that this is entirely independent of whether the - * DEBUG_PRINT stuff (set by ACPI_DEBUG_OUTPUT) is on, or not. - */ -#ifdef ACPI_DEBUGGER -#define ACPI_DEBUGGER_EXEC(a) a -#else -#define ACPI_DEBUGGER_EXEC(a) -#endif - - -/* - * For 16-bit code, we want to shrink some things even though - * we are using ACPI_DEBUG_OUTPUT to get the debug output - */ -#if ACPI_MACHINE_WIDTH == 16 -#undef ACPI_DEBUG_ONLY_MEMBERS -#undef _VERBOSE_STRUCTURES -#define ACPI_DEBUG_ONLY_MEMBERS(a) -#endif - - -#ifdef ACPI_DEBUG_OUTPUT -/* - * 1) Set name to blanks - * 2) Copy the object name - */ -#define ACPI_ADD_OBJECT_NAME(a,b) ACPI_MEMSET (a->common.name, ' ', sizeof (a->common.name));\ - ACPI_STRNCPY (a->common.name, acpi_gbl_ns_type_names[b], sizeof (a->common.name)) -#else - -#define ACPI_ADD_OBJECT_NAME(a,b) -#endif - - -/* - * Memory allocation tracking (DEBUG ONLY) - */ - -#ifndef ACPI_DBG_TRACK_ALLOCATIONS - -/* Memory allocation */ - -#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__) -#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__) -#define ACPI_MEM_FREE(a) acpi_os_free(a) -#define ACPI_MEM_TRACKING(a) - - -#else - -/* Memory allocation */ - -#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__) -#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__) -#define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_THIS_MODULE,__LINE__) -#define ACPI_MEM_TRACKING(a) a - -#endif /* ACPI_DBG_TRACK_ALLOCATIONS */ - - -#define ACPI_GET_STACK_POINTER _asm {mov eax, ebx} - -#endif /* ACMACROS_H */ diff -Nru a/drivers/acpi/include/acnamesp.h b/drivers/acpi/include/acnamesp.h --- a/drivers/acpi/include/acnamesp.h Sun Feb 9 21:13:29 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,489 +0,0 @@ -/****************************************************************************** - * - * Name: acnamesp.h - Namespace subcomponent prototypes and defines - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACNAMESP_H__ -#define __ACNAMESP_H__ - - -/* To search the entire name space, pass this as search_base */ - -#define ACPI_NS_ALL ((acpi_handle)0) - -/* - * Elements of acpi_ns_properties are bit significant - * and should be one-to-one with values of acpi_object_type - */ -#define ACPI_NS_NORMAL 0 -#define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */ -#define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */ - - -/* Definitions of the predefined namespace names */ - -#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */ -#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */ -#define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */ - -#define ACPI_NS_ROOT_PATH "\\" -#define ACPI_NS_SYSTEM_BUS "_SB_" - - -/* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */ - -#define ACPI_NS_NO_UPSEARCH 0 -#define ACPI_NS_SEARCH_PARENT 0x01 -#define ACPI_NS_DONT_OPEN_SCOPE 0x02 -#define ACPI_NS_NO_PEER_SEARCH 0x04 -#define ACPI_NS_ERROR_IF_FOUND 0x08 - -#define ACPI_NS_WALK_UNLOCK TRUE -#define ACPI_NS_WALK_NO_UNLOCK FALSE - - -acpi_status -acpi_ns_load_namespace ( - void); - -acpi_status -acpi_ns_initialize_objects ( - void); - -acpi_status -acpi_ns_initialize_devices ( - void); - - -/* Namespace init - nsxfinit */ - -acpi_status -acpi_ns_init_one_device ( - acpi_handle obj_handle, - u32 nesting_level, - void *context, - void **return_value); - -acpi_status -acpi_ns_init_one_object ( - acpi_handle obj_handle, - u32 level, - void *context, - void **return_value); - - -acpi_status -acpi_ns_walk_namespace ( - acpi_object_type type, - acpi_handle start_object, - u32 max_depth, - u8 unlock_before_callback, - acpi_walk_callback user_function, - void *context, - void **return_value); - -struct acpi_namespace_node * -acpi_ns_get_next_node ( - acpi_object_type type, - struct acpi_namespace_node *parent, - struct acpi_namespace_node *child); - -void -acpi_ns_delete_namespace_by_owner ( - u16 table_id); - - -/* Namespace loading - nsload */ - -acpi_status -acpi_ns_one_complete_parse ( - u32 pass_number, - struct acpi_table_desc *table_desc); - -acpi_status -acpi_ns_parse_table ( - struct acpi_table_desc *table_desc, - struct acpi_namespace_node *scope); - -acpi_status -acpi_ns_load_table ( - struct acpi_table_desc *table_desc, - struct acpi_namespace_node *node); - -acpi_status -acpi_ns_load_table_by_type ( - acpi_table_type table_type); - - -/* - * Top-level namespace access - nsaccess - */ - -acpi_status -acpi_ns_root_initialize ( - void); - -acpi_status -acpi_ns_lookup ( - union acpi_generic_state *scope_info, - char *name, - acpi_object_type type, - acpi_interpreter_mode interpreter_mode, - u32 flags, - struct acpi_walk_state *walk_state, - struct acpi_namespace_node **ret_node); - - -/* - * Named object allocation/deallocation - nsalloc - */ - -struct acpi_namespace_node * -acpi_ns_create_node ( - u32 name); - -void -acpi_ns_delete_node ( - struct acpi_namespace_node *node); - -void -acpi_ns_delete_namespace_subtree ( - struct acpi_namespace_node *parent_handle); - -void -acpi_ns_detach_object ( - struct acpi_namespace_node *node); - -void -acpi_ns_delete_children ( - struct acpi_namespace_node *parent); - -int -acpi_ns_compare_names ( - char *name1, - char *name2); - -/* - * Namespace modification - nsmodify - */ - -acpi_status -acpi_ns_unload_namespace ( - acpi_handle handle); - -acpi_status -acpi_ns_delete_subtree ( - acpi_handle start_handle); - - -/* - * Namespace dump/print utilities - nsdump - */ - -void -acpi_ns_dump_tables ( - acpi_handle search_base, - u32 max_depth); - -void -acpi_ns_dump_entry ( - acpi_handle handle, - u32 debug_level); - -void -acpi_ns_dump_pathname ( - acpi_handle handle, - char *msg, - u32 level, - u32 component); - -void -acpi_ns_print_pathname ( - u32 num_segments, - char *pathname); - -acpi_status -acpi_ns_dump_one_device ( - acpi_handle obj_handle, - u32 level, - void *context, - void **return_value); - -void -acpi_ns_dump_root_devices ( - void); - -acpi_status -acpi_ns_dump_one_object ( - acpi_handle obj_handle, - u32 level, - void *context, - void **return_value); - -void -acpi_ns_dump_objects ( - acpi_object_type type, - u8 display_type, - u32 max_depth, - u32 ownder_id, - acpi_handle start_handle); - - -/* - * Namespace evaluation functions - nseval - */ - -acpi_status -acpi_ns_evaluate_by_handle ( - struct acpi_namespace_node *prefix_node, - union acpi_operand_object **params, - union acpi_operand_object **return_object); - -acpi_status -acpi_ns_evaluate_by_name ( - char *pathname, - union acpi_operand_object **params, - union acpi_operand_object **return_object); - -acpi_status -acpi_ns_evaluate_relative ( - struct acpi_namespace_node *prefix_node, - char *pathname, - union acpi_operand_object **params, - union acpi_operand_object **return_object); - -acpi_status -acpi_ns_execute_control_method ( - struct acpi_namespace_node *method_node, - union acpi_operand_object **params, - union acpi_operand_object **return_obj_desc); - -acpi_status -acpi_ns_get_object_value ( - struct acpi_namespace_node *object_node, - union acpi_operand_object **return_obj_desc); - - -/* - * Parent/Child/Peer utility functions - */ - -acpi_name -acpi_ns_find_parent_name ( - struct acpi_namespace_node *node_to_search); - - -/* - * Name and Scope manipulation - nsnames - */ - -u32 -acpi_ns_opens_scope ( - acpi_object_type type); - -void -acpi_ns_build_external_path ( - struct acpi_namespace_node *node, - acpi_size size, - char *name_buffer); - -char * -acpi_ns_get_external_pathname ( - struct acpi_namespace_node *node); - -char * -acpi_ns_name_of_current_scope ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ns_handle_to_pathname ( - acpi_handle target_handle, - struct acpi_buffer *buffer); - -u8 -acpi_ns_pattern_match ( - struct acpi_namespace_node *obj_node, - char *search_for); - -acpi_status -acpi_ns_get_node_by_path ( - char *external_pathname, - struct acpi_namespace_node *in_prefix_node, - u32 flags, - struct acpi_namespace_node **out_node); - -acpi_size -acpi_ns_get_pathname_length ( - struct acpi_namespace_node *node); - - -/* - * Object management for namespace nodes - nsobject - */ - -acpi_status -acpi_ns_attach_object ( - struct acpi_namespace_node *node, - union acpi_operand_object *object, - acpi_object_type type); - -union acpi_operand_object * -acpi_ns_get_attached_object ( - struct acpi_namespace_node *node); - -union acpi_operand_object * -acpi_ns_get_secondary_object ( - union acpi_operand_object *obj_desc); - -acpi_status -acpi_ns_attach_data ( - struct acpi_namespace_node *node, - acpi_object_handler handler, - void *data); - -acpi_status -acpi_ns_detach_data ( - struct acpi_namespace_node *node, - acpi_object_handler handler); - -acpi_status -acpi_ns_get_attached_data ( - struct acpi_namespace_node *node, - acpi_object_handler handler, - void **data); - - -/* - * Namespace searching and entry - nssearch - */ - -acpi_status -acpi_ns_search_and_enter ( - u32 entry_name, - struct acpi_walk_state *walk_state, - struct acpi_namespace_node *node, - acpi_interpreter_mode interpreter_mode, - acpi_object_type type, - u32 flags, - struct acpi_namespace_node **ret_node); - -acpi_status -acpi_ns_search_node ( - u32 entry_name, - struct acpi_namespace_node *node, - acpi_object_type type, - struct acpi_namespace_node **ret_node); - -void -acpi_ns_install_node ( - struct acpi_walk_state *walk_state, - struct acpi_namespace_node *parent_node, - struct acpi_namespace_node *node, - acpi_object_type type); - - -/* - * Utility functions - nsutils - */ - -u8 -acpi_ns_valid_root_prefix ( - char prefix); - -u8 -acpi_ns_valid_path_separator ( - char sep); - -acpi_object_type -acpi_ns_get_type ( - struct acpi_namespace_node *node); - -u32 -acpi_ns_local ( - acpi_object_type type); - -void -acpi_ns_report_error ( - char *module_name, - u32 line_number, - u32 component_id, - char *internal_name, - acpi_status lookup_status); - -void -acpi_ns_report_method_error ( - char *module_name, - u32 line_number, - u32 component_id, - char *message, - struct acpi_namespace_node *node, - char *path, - acpi_status lookup_status); - -void -acpi_ns_print_node_pathname ( - struct acpi_namespace_node *node, - char *msg); - -acpi_status -acpi_ns_build_internal_name ( - struct acpi_namestring_info *info); - -void -acpi_ns_get_internal_name_length ( - struct acpi_namestring_info *info); - -acpi_status -acpi_ns_internalize_name ( - char *dotted_name, - char **converted_name); - -acpi_status -acpi_ns_externalize_name ( - u32 internal_name_length, - char *internal_name, - u32 *converted_name_length, - char **converted_name); - -struct acpi_namespace_node * -acpi_ns_map_handle_to_node ( - acpi_handle handle); - -acpi_handle -acpi_ns_convert_entry_to_handle( - struct acpi_namespace_node *node); - -void -acpi_ns_terminate ( - void); - -struct acpi_namespace_node * -acpi_ns_get_parent_node ( - struct acpi_namespace_node *node); - - -struct acpi_namespace_node * -acpi_ns_get_next_valid_node ( - struct acpi_namespace_node *node); - - -#endif /* __ACNAMESP_H__ */ diff -Nru a/drivers/acpi/include/acobject.h b/drivers/acpi/include/acobject.h --- a/drivers/acpi/include/acobject.h Sun Feb 9 21:13:29 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,473 +0,0 @@ - -/****************************************************************************** - * - * Name: acobject.h - Definition of union acpi_operand_object (Internal object only) - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _ACOBJECT_H -#define _ACOBJECT_H - - -/* - * The union acpi_operand_object is used to pass AML operands from the dispatcher - * to the interpreter, and to keep track of the various handlers such as - * address space handlers and notify handlers. The object is a constant - * size in order to allow it to be cached and reused. - */ - -/******************************************************************************* - * - * Common Descriptors - * - ******************************************************************************/ - -/* - * Common area for all objects. - * - * data_type is used to differentiate between internal descriptors, and MUST - * be the first byte in this structure. - */ -#define ACPI_OBJECT_COMMON_HEADER /* SIZE/ALIGNMENT: 32 bits, one ptr plus trailing 8-bit flag */\ - u8 descriptor; /* To differentiate various internal objs */\ - u8 type; /* acpi_object_type */\ - u16 reference_count; /* For object deletion management */\ - union acpi_operand_object *next_object; /* Objects linked to parent NS node */\ - u8 flags; \ - -/* Values for flag byte above */ - -#define AOPOBJ_AML_CONSTANT 0x01 -#define AOPOBJ_STATIC_POINTER 0x02 -#define AOPOBJ_DATA_VALID 0x04 -#define AOPOBJ_OBJECT_INITIALIZED 0x08 -#define AOPOBJ_SETUP_COMPLETE 0x10 -#define AOPOBJ_SINGLE_DATUM 0x20 - - -/* - * Common bitfield for the field objects - * "Field Datum" -- a datum from the actual field object - * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field - */ -#define ACPI_COMMON_FIELD_INFO /* SIZE/ALIGNMENT: 24 bits + three 32-bit values */\ - u8 field_flags; /* Access, update, and lock bits */\ - u8 attribute; /* From access_as keyword */\ - u8 access_byte_width; /* Read/Write size in bytes */\ - u32 bit_length; /* Length of field in bits */\ - u32 base_byte_offset; /* Byte offset within containing object */\ - u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\ - u8 datum_valid_bits; /* Valid bit in first "Field datum" */\ - u8 end_field_valid_bits; /* Valid bits in the last "field datum" */\ - u8 end_buffer_valid_bits; /* Valid bits in the last "buffer datum" */\ - u32 value; /* Value to store into the Bank or Index register */\ - struct acpi_namespace_node *node; /* Link back to parent node */ - - -/* - * Fields common to both Strings and Buffers - */ -#define ACPI_COMMON_BUFFER_INFO \ - u32 length; - - -/* - * Common fields for objects that support ASL notifications - */ -#define ACPI_COMMON_NOTIFY_INFO \ - union acpi_operand_object *sys_handler; /* Handler for system notifies */\ - union acpi_operand_object *drv_handler; /* Handler for driver notifies */\ - union acpi_operand_object *addr_handler; /* Handler for Address space */ - - -/****************************************************************************** - * - * Basic data types - * - *****************************************************************************/ - -struct acpi_object_common -{ - ACPI_OBJECT_COMMON_HEADER -}; - - -struct acpi_object_integer -{ - ACPI_OBJECT_COMMON_HEADER - acpi_integer value; -}; - - -struct acpi_object_string /* Null terminated, ASCII characters only */ -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_BUFFER_INFO - char *pointer; /* String in AML stream or allocated string */ -}; - - -struct acpi_object_buffer -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_BUFFER_INFO - u8 *pointer; /* Buffer in AML stream or allocated buffer */ - struct acpi_namespace_node *node; /* Link back to parent node */ - u8 *aml_start; - u32 aml_length; -}; - - -struct acpi_object_package -{ - ACPI_OBJECT_COMMON_HEADER - - u32 count; /* # of elements in package */ - u32 aml_length; - u8 *aml_start; - struct acpi_namespace_node *node; /* Link back to parent node */ - union acpi_operand_object **elements; /* Array of pointers to acpi_objects */ -}; - - -/****************************************************************************** - * - * Complex data types - * - *****************************************************************************/ - -struct acpi_object_event -{ - ACPI_OBJECT_COMMON_HEADER - void *semaphore; -}; - - -#define INFINITE_CONCURRENCY 0xFF - -struct acpi_object_method -{ - ACPI_OBJECT_COMMON_HEADER - u8 method_flags; - u8 param_count; - u32 aml_length; - void *semaphore; - u8 *aml_start; - u8 concurrency; - u8 thread_count; - acpi_owner_id owning_id; -}; - - -struct acpi_object_mutex -{ - ACPI_OBJECT_COMMON_HEADER - u16 sync_level; - u16 acquisition_depth; - struct acpi_thread_state *owner_thread; - void *semaphore; - union acpi_operand_object *prev; /* Link for list of acquired mutexes */ - union acpi_operand_object *next; /* Link for list of acquired mutexes */ - struct acpi_namespace_node *node; /* containing object */ -}; - - -struct acpi_object_region -{ - ACPI_OBJECT_COMMON_HEADER - - u8 space_id; - union acpi_operand_object *addr_handler; /* Handler for system notifies */ - struct acpi_namespace_node *node; /* containing object */ - union acpi_operand_object *next; - u32 length; - acpi_physical_address address; -}; - - -/****************************************************************************** - * - * Objects that can be notified. All share a common notify_info area. - * - *****************************************************************************/ - -struct acpi_object_notify_common /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_NOTIFY_INFO -}; - - -struct acpi_object_device -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_NOTIFY_INFO -}; - - -struct acpi_object_power_resource -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_NOTIFY_INFO - u32 system_level; - u32 resource_order; -}; - - -struct acpi_object_processor -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_NOTIFY_INFO - u32 proc_id; - u32 length; - acpi_io_address address; -}; - - -struct acpi_object_thermal_zone -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_NOTIFY_INFO -}; - - -/****************************************************************************** - * - * Fields. All share a common header/info field. - * - *****************************************************************************/ - -struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_FIELD_INFO - union acpi_operand_object *region_obj; /* Containing Operation Region object */ - /* (REGION/BANK fields only) */ -}; - - -struct acpi_object_region_field -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_FIELD_INFO - union acpi_operand_object *region_obj; /* Containing op_region object */ -}; - - -struct acpi_object_bank_field -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_FIELD_INFO - union acpi_operand_object *region_obj; /* Containing op_region object */ - union acpi_operand_object *bank_obj; /* bank_select Register object */ -}; - - -struct acpi_object_index_field -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_FIELD_INFO - - /* - * No "region_obj" pointer needed since the Index and Data registers - * are each field definitions unto themselves. - */ - union acpi_operand_object *index_obj; /* Index register */ - union acpi_operand_object *data_obj; /* Data register */ -}; - - -/* The buffer_field is different in that it is part of a Buffer, not an op_region */ - -struct acpi_object_buffer_field -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_FIELD_INFO - union acpi_operand_object *buffer_obj; /* Containing Buffer object */ -}; - - -/****************************************************************************** - * - * Objects for handlers - * - *****************************************************************************/ - -struct acpi_object_notify_handler -{ - ACPI_OBJECT_COMMON_HEADER - struct acpi_namespace_node *node; /* Parent device */ - acpi_notify_handler handler; - void *context; -}; - - -/* Flags for address handler */ - -#define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x1 - - -struct acpi_object_addr_handler -{ - ACPI_OBJECT_COMMON_HEADER - u8 space_id; - u16 hflags; - acpi_adr_space_handler handler; - struct acpi_namespace_node *node; /* Parent device */ - void *context; - acpi_adr_space_setup setup; - union acpi_operand_object *region_list; /* regions using this handler */ - union acpi_operand_object *next; -}; - - -/****************************************************************************** - * - * Special internal objects - * - *****************************************************************************/ - -/* - * The Reference object type is used for these opcodes: - * Arg[0-6], Local[0-7], index_op, name_op, zero_op, one_op, ones_op, debug_op - */ -struct acpi_object_reference -{ - ACPI_OBJECT_COMMON_HEADER - u8 target_type; /* Used for index_op */ - u16 opcode; - u32 offset; /* Used for arg_op, local_op, and index_op */ - void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */ - struct acpi_namespace_node *node; - union acpi_operand_object **where; -}; - - -/* - * Extra object is used as additional storage for types that - * have AML code in their declarations (term_args) that must be - * evaluated at run time. - * - * Currently: Region and field_unit types - */ -struct acpi_object_extra -{ - ACPI_OBJECT_COMMON_HEADER - u8 byte_fill1; - u16 word_fill1; - u32 aml_length; - u8 *aml_start; - struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */ - void *region_context; /* Region-specific data */ -}; - - -/* Additional data that can be attached to namespace nodes */ - -struct acpi_object_data -{ - ACPI_OBJECT_COMMON_HEADER - acpi_object_handler handler; - void *pointer; -}; - - -/* Structure used when objects are cached for reuse */ - -struct acpi_object_cache_list -{ - ACPI_OBJECT_COMMON_HEADER - union acpi_operand_object *next; /* Link for object cache and internal lists*/ -}; - - -/****************************************************************************** - * - * union acpi_operand_object Descriptor - a giant union of all of the above - * - *****************************************************************************/ - -union acpi_operand_object -{ - struct acpi_object_common common; - struct acpi_object_integer integer; - struct acpi_object_string string; - struct acpi_object_buffer buffer; - struct acpi_object_package package; - struct acpi_object_event event; - struct acpi_object_method method; - struct acpi_object_mutex mutex; - struct acpi_object_region region; - struct acpi_object_notify_common common_notify; - struct acpi_object_device device; - struct acpi_object_power_resource power_resource; - struct acpi_object_processor processor; - struct acpi_object_thermal_zone thermal_zone; - struct acpi_object_field_common common_field; - struct acpi_object_region_field field; - struct acpi_object_buffer_field buffer_field; - struct acpi_object_bank_field bank_field; - struct acpi_object_index_field index_field; - struct acpi_object_notify_handler notify_handler; - struct acpi_object_addr_handler addr_handler; - struct acpi_object_reference reference; - struct acpi_object_extra extra; - struct acpi_object_data data; - struct acpi_object_cache_list cache; -}; - - -/****************************************************************************** - * - * union acpi_descriptor - objects that share a common descriptor identifier - * - *****************************************************************************/ - - -/* Object descriptor types */ - -#define ACPI_DESC_TYPE_CACHED 0x11 /* Used only when object is cached */ -#define ACPI_DESC_TYPE_STATE 0x20 -#define ACPI_DESC_TYPE_STATE_UPDATE 0x21 -#define ACPI_DESC_TYPE_STATE_PACKAGE 0x22 -#define ACPI_DESC_TYPE_STATE_CONTROL 0x23 -#define ACPI_DESC_TYPE_STATE_RPSCOPE 0x24 -#define ACPI_DESC_TYPE_STATE_PSCOPE 0x25 -#define ACPI_DESC_TYPE_STATE_WSCOPE 0x26 -#define ACPI_DESC_TYPE_STATE_RESULT 0x27 -#define ACPI_DESC_TYPE_STATE_NOTIFY 0x28 -#define ACPI_DESC_TYPE_STATE_THREAD 0x29 -#define ACPI_DESC_TYPE_WALK 0x44 -#define ACPI_DESC_TYPE_PARSER 0x66 -#define ACPI_DESC_TYPE_OPERAND 0x88 -#define ACPI_DESC_TYPE_NAMED 0xAA - - -union acpi_descriptor -{ - u8 descriptor_id; /* To differentiate various internal objs */\ - union acpi_operand_object object; - struct acpi_namespace_node node; - union acpi_parse_object op; -}; - - -#endif /* _ACOBJECT_H */ diff -Nru a/drivers/acpi/include/acoutput.h b/drivers/acpi/include/acoutput.h --- a/drivers/acpi/include/acoutput.h Sun Feb 9 21:13:31 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,166 +0,0 @@ -/****************************************************************************** - * - * Name: acoutput.h -- debug output - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACOUTPUT_H__ -#define __ACOUTPUT_H__ - -/* - * Debug levels and component IDs. These are used to control the - * granularity of the output of the DEBUG_PRINT macro -- on a per- - * component basis and a per-exception-type basis. - */ - -/* Component IDs are used in the global "debug_layer" */ - -#define ACPI_UTILITIES 0x00000001 -#define ACPI_HARDWARE 0x00000002 -#define ACPI_EVENTS 0x00000004 -#define ACPI_TABLES 0x00000008 -#define ACPI_NAMESPACE 0x00000010 -#define ACPI_PARSER 0x00000020 -#define ACPI_DISPATCHER 0x00000040 -#define ACPI_EXECUTER 0x00000080 -#define ACPI_RESOURCES 0x00000100 -#define ACPI_CA_DEBUGGER 0x00000200 -#define ACPI_OS_SERVICES 0x00000400 -#define ACPI_CA_DISASSEMBLER 0x00000800 - -/* Component IDs for ACPI tools and utilities */ - -#define ACPI_COMPILER 0x00001000 -#define ACPI_TOOLS 0x00002000 - -#define ACPI_ALL_COMPONENTS 0x00003FFF -#define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS) - - -/* Component IDs reserved for ACPI drivers */ - -#define ACPI_ALL_DRIVERS 0xFFFF0000 - - -/* - * Raw debug output levels, do not use these in the DEBUG_PRINT macros - */ -#define ACPI_LV_ERROR 0x00000001 -#define ACPI_LV_WARN 0x00000002 -#define ACPI_LV_INIT 0x00000004 -#define ACPI_LV_DEBUG_OBJECT 0x00000008 -#define ACPI_LV_INFO 0x00000010 -#define ACPI_LV_ALL_EXCEPTIONS 0x0000001F - -/* Trace verbosity level 1 [Standard Trace Level] */ - -#define ACPI_LV_INIT_NAMES 0x00000020 -#define ACPI_LV_PARSE 0x00000040 -#define ACPI_LV_LOAD 0x00000080 -#define ACPI_LV_DISPATCH 0x00000100 -#define ACPI_LV_EXEC 0x00000200 -#define ACPI_LV_NAMES 0x00000400 -#define ACPI_LV_OPREGION 0x00000800 -#define ACPI_LV_BFIELD 0x00001000 -#define ACPI_LV_TABLES 0x00002000 -#define ACPI_LV_VALUES 0x00004000 -#define ACPI_LV_OBJECTS 0x00008000 -#define ACPI_LV_RESOURCES 0x00010000 -#define ACPI_LV_USER_REQUESTS 0x00020000 -#define ACPI_LV_PACKAGE 0x00040000 -#define ACPI_LV_VERBOSITY1 0x0007FF40 | ACPI_LV_ALL_EXCEPTIONS - -/* Trace verbosity level 2 [Function tracing and memory allocation] */ - -#define ACPI_LV_ALLOCATIONS 0x00100000 -#define ACPI_LV_FUNCTIONS 0x00200000 -#define ACPI_LV_OPTIMIZATIONS 0x00400000 -#define ACPI_LV_VERBOSITY2 0x00700000 | ACPI_LV_VERBOSITY1 -#define ACPI_LV_ALL ACPI_LV_VERBOSITY2 - -/* Trace verbosity level 3 [Threading, I/O, and Interrupts] */ - -#define ACPI_LV_MUTEX 0x01000000 -#define ACPI_LV_THREADS 0x02000000 -#define ACPI_LV_IO 0x04000000 -#define ACPI_LV_INTERRUPTS 0x08000000 -#define ACPI_LV_VERBOSITY3 0x0F000000 | ACPI_LV_VERBOSITY2 - -/* Exceptionally verbose output -- also used in the global "debug_level" */ - -#define ACPI_LV_AML_DISASSEMBLE 0x10000000 -#define ACPI_LV_VERBOSE_INFO 0x20000000 -#define ACPI_LV_FULL_TABLES 0x40000000 -#define ACPI_LV_EVENTS 0x80000000 - -#define ACPI_LV_VERBOSE 0xF0000000 - - -/* - * Debug level macros that are used in the DEBUG_PRINT macros - */ -#define ACPI_DEBUG_LEVEL(dl) (u32) dl,__LINE__,&_dbg - -/* Exception level -- used in the global "debug_level" */ - -#define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR) -#define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN) -#define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) -#define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) -#define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) -#define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) - - -/* Trace level -- also used in the global "debug_level" */ - -#define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) -#define ACPI_DB_THREADS ACPI_DEBUG_LEVEL (ACPI_LV_THREADS) -#define ACPI_DB_PARSE ACPI_DEBUG_LEVEL (ACPI_LV_PARSE) -#define ACPI_DB_DISPATCH ACPI_DEBUG_LEVEL (ACPI_LV_DISPATCH) -#define ACPI_DB_LOAD ACPI_DEBUG_LEVEL (ACPI_LV_LOAD) -#define ACPI_DB_EXEC ACPI_DEBUG_LEVEL (ACPI_LV_EXEC) -#define ACPI_DB_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_NAMES) -#define ACPI_DB_OPREGION ACPI_DEBUG_LEVEL (ACPI_LV_OPREGION) -#define ACPI_DB_BFIELD ACPI_DEBUG_LEVEL (ACPI_LV_BFIELD) -#define ACPI_DB_TABLES ACPI_DEBUG_LEVEL (ACPI_LV_TABLES) -#define ACPI_DB_FUNCTIONS ACPI_DEBUG_LEVEL (ACPI_LV_FUNCTIONS) -#define ACPI_DB_OPTIMIZATIONS ACPI_DEBUG_LEVEL (ACPI_LV_OPTIMIZATIONS) -#define ACPI_DB_VALUES ACPI_DEBUG_LEVEL (ACPI_LV_VALUES) -#define ACPI_DB_OBJECTS ACPI_DEBUG_LEVEL (ACPI_LV_OBJECTS) -#define ACPI_DB_ALLOCATIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALLOCATIONS) -#define ACPI_DB_RESOURCES ACPI_DEBUG_LEVEL (ACPI_LV_RESOURCES) -#define ACPI_DB_IO ACPI_DEBUG_LEVEL (ACPI_LV_IO) -#define ACPI_DB_INTERRUPTS ACPI_DEBUG_LEVEL (ACPI_LV_INTERRUPTS) -#define ACPI_DB_USER_REQUESTS ACPI_DEBUG_LEVEL (ACPI_LV_USER_REQUESTS) -#define ACPI_DB_PACKAGE ACPI_DEBUG_LEVEL (ACPI_LV_PACKAGE) -#define ACPI_DB_MUTEX ACPI_DEBUG_LEVEL (ACPI_LV_MUTEX) - -#define ACPI_DB_ALL ACPI_DEBUG_LEVEL (ACPI_LV_ALL) - - -/* Defaults for debug_level, debug and normal */ - -#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) -#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) -#define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) - - -#endif /* __ACOUTPUT_H__ */ diff -Nru a/drivers/acpi/include/acparser.h b/drivers/acpi/include/acparser.h --- a/drivers/acpi/include/acparser.h Sun Feb 9 21:13:33 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,328 +0,0 @@ -/****************************************************************************** - * - * Module Name: acparser.h - AML Parser subcomponent prototypes and defines - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef __ACPARSER_H__ -#define __ACPARSER_H__ - - -#define OP_HAS_RETURN_VALUE 1 - -/* variable # arguments */ - -#define ACPI_VAR_ARGS ACPI_UINT32_MAX - - -#define ACPI_PARSE_DELETE_TREE 0x0001 -#define ACPI_PARSE_NO_TREE_DELETE 0x0000 -#define ACPI_PARSE_TREE_MASK 0x0001 - -#define ACPI_PARSE_LOAD_PASS1 0x0010 -#define ACPI_PARSE_LOAD_PASS2 0x0020 -#define ACPI_PARSE_EXECUTE 0x0030 -#define ACPI_PARSE_MODE_MASK 0x0030 - -#define ACPI_PARSE_DEFERRED_OP 0x0100 - -/* Parser external interfaces */ - -acpi_status -acpi_psx_load_table ( - u8 *pcode_addr, - u32 pcode_length); - -acpi_status -acpi_psx_execute ( - struct acpi_namespace_node *method_node, - union acpi_operand_object **params, - union acpi_operand_object **return_obj_desc); - - -/****************************************************************************** - * - * Parser interfaces - * - *****************************************************************************/ - - -/* psargs - Parse AML opcode arguments */ - -u8 * -acpi_ps_get_next_package_end ( - struct acpi_parse_state *parser_state); - -u32 -acpi_ps_get_next_package_length ( - struct acpi_parse_state *parser_state); - -char * -acpi_ps_get_next_namestring ( - struct acpi_parse_state *parser_state); - -void -acpi_ps_get_next_simple_arg ( - struct acpi_parse_state *parser_state, - u32 arg_type, - union acpi_parse_object *arg); - -acpi_status -acpi_ps_get_next_namepath ( - struct acpi_walk_state *walk_state, - struct acpi_parse_state *parser_state, - union acpi_parse_object *arg, - u8 method_call); - -union acpi_parse_object * -acpi_ps_get_next_field ( - struct acpi_parse_state *parser_state); - -acpi_status -acpi_ps_get_next_arg ( - struct acpi_walk_state *walk_state, - struct acpi_parse_state *parser_state, - u32 arg_type, - union acpi_parse_object **return_arg); - - -/* psfind */ - -union acpi_parse_object * -acpi_ps_find_name ( - union acpi_parse_object *scope, - u32 name, - u32 opcode); - -union acpi_parse_object* -acpi_ps_get_parent ( - union acpi_parse_object *op); - - -/* psopcode - AML Opcode information */ - -const struct acpi_opcode_info * -acpi_ps_get_opcode_info ( - u16 opcode); - -char * -acpi_ps_get_opcode_name ( - u16 opcode); - - -/* psparse - top level parsing routines */ - -u32 -acpi_ps_get_opcode_size ( - u32 opcode); - -void -acpi_ps_complete_this_op ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); - -acpi_status -acpi_ps_next_parse_state ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - acpi_status callback_status); - -acpi_status -acpi_ps_find_object ( - struct acpi_walk_state *walk_state, - union acpi_parse_object **out_op); - -void -acpi_ps_delete_parse_tree ( - union acpi_parse_object *root); - -acpi_status -acpi_ps_parse_loop ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ps_parse_aml ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ps_parse_table ( - u8 *aml, - u32 aml_size, - acpi_parse_downwards descending_callback, - acpi_parse_upwards ascending_callback, - union acpi_parse_object **root_object); - -u16 -acpi_ps_peek_opcode ( - struct acpi_parse_state *state); - - -/* psscope - Scope stack management routines */ - - -acpi_status -acpi_ps_init_scope ( - struct acpi_parse_state *parser_state, - union acpi_parse_object *root); - -union acpi_parse_object * -acpi_ps_get_parent_scope ( - struct acpi_parse_state *state); - -u8 -acpi_ps_has_completed_scope ( - struct acpi_parse_state *parser_state); - -void -acpi_ps_pop_scope ( - struct acpi_parse_state *parser_state, - union acpi_parse_object **op, - u32 *arg_list, - u32 *arg_count); - -acpi_status -acpi_ps_push_scope ( - struct acpi_parse_state *parser_state, - union acpi_parse_object *op, - u32 remaining_args, - u32 arg_count); - -void -acpi_ps_cleanup_scope ( - struct acpi_parse_state *state); - - -/* pstree - parse tree manipulation routines */ - -void -acpi_ps_append_arg( - union acpi_parse_object *op, - union acpi_parse_object *arg); - -union acpi_parse_object* -acpi_ps_find ( - union acpi_parse_object *scope, - char *path, - u16 opcode, - u32 create); - -union acpi_parse_object * -acpi_ps_get_arg( - union acpi_parse_object *op, - u32 argn); - -union acpi_parse_object * -acpi_ps_get_child ( - union acpi_parse_object *op); - -union acpi_parse_object * -acpi_ps_get_depth_next ( - union acpi_parse_object *origin, - union acpi_parse_object *op); - - -/* pswalk - parse tree walk routines */ - -acpi_status -acpi_ps_walk_parsed_aml ( - union acpi_parse_object *start_op, - union acpi_parse_object *end_op, - union acpi_operand_object *mth_desc, - struct acpi_namespace_node *start_node, - union acpi_operand_object **params, - union acpi_operand_object **caller_return_desc, - acpi_owner_id owner_id, - acpi_parse_downwards descending_callback, - acpi_parse_upwards ascending_callback); - -acpi_status -acpi_ps_get_next_walk_op ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - acpi_parse_upwards ascending_callback); - -acpi_status -acpi_ps_delete_completed_op ( - struct acpi_walk_state *walk_state); - - -/* psutils - parser utilities */ - -union acpi_parse_object * -acpi_ps_create_scope_op ( - void); - -void -acpi_ps_init_op ( - union acpi_parse_object *op, - u16 opcode); - -union acpi_parse_object * -acpi_ps_alloc_op ( - u16 opcode); - -void -acpi_ps_free_op ( - union acpi_parse_object *op); - -void -acpi_ps_delete_parse_cache ( - void); - -u8 -acpi_ps_is_leading_char ( - u32 c); - -u8 -acpi_ps_is_prefix_char ( - u32 c); - -u32 -acpi_ps_get_name( - union acpi_parse_object *op); - -void -acpi_ps_set_name( - union acpi_parse_object *op, - u32 name); - - -/* psdump - display parser tree */ - -u32 -acpi_ps_sprint_path ( - char *buffer_start, - u32 buffer_size, - union acpi_parse_object *op); - -u32 -acpi_ps_sprint_op ( - char *buffer_start, - u32 buffer_size, - union acpi_parse_object *op); - -void -acpi_ps_show ( - union acpi_parse_object *op); - - -#endif /* __ACPARSER_H__ */ diff -Nru a/drivers/acpi/include/acpi.h b/drivers/acpi/include/acpi.h --- a/drivers/acpi/include/acpi.h Sun Feb 9 21:13:32 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,50 +0,0 @@ -/****************************************************************************** - * - * Name: acpi.h - Master include file, Publics and external data. - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACPI_H__ -#define __ACPI_H__ - -/* - * Common includes for all ACPI driver files - * We put them here because we don't want to duplicate them - * in the rest of the source code again and again. - */ -#include "acconfig.h" /* Configuration constants */ -#include "platform/acenv.h" /* Target environment specific items */ -#include "actypes.h" /* Fundamental common data types */ -#include "acexcep.h" /* ACPI exception codes */ -#include "acmacros.h" /* C macros */ -#include "actbl.h" /* ACPI table definitions */ -#include "aclocal.h" /* Internal data types */ -#include "acoutput.h" /* Error output and Debug macros */ -#include "acpiosxf.h" /* Interfaces to the ACPI-to-OS layer*/ -#include "acpixf.h" /* ACPI core subsystem external interfaces */ -#include "acobject.h" /* ACPI internal object */ -#include "acstruct.h" /* Common structures */ -#include "acglobal.h" /* All global variables */ -#include "achware.h" /* Hardware defines and interfaces */ -#include "acutils.h" /* Utility interfaces */ - - -#endif /* __ACPI_H__ */ diff -Nru a/drivers/acpi/include/acpiosxf.h b/drivers/acpi/include/acpiosxf.h --- a/drivers/acpi/include/acpiosxf.h Sun Feb 9 21:13:28 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,337 +0,0 @@ - -/****************************************************************************** - * - * Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL). These - * interfaces must be implemented by OSL to interface the - * ACPI components to the host operating system. - * - *****************************************************************************/ - - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACPIOSXF_H__ -#define __ACPIOSXF_H__ - -#include "platform/acenv.h" -#include "actypes.h" - - -/* Priorities for acpi_os_queue_for_execution */ - -#define OSD_PRIORITY_GPE 1 -#define OSD_PRIORITY_HIGH 2 -#define OSD_PRIORITY_MED 3 -#define OSD_PRIORITY_LO 4 - -#define ACPI_NO_UNIT_LIMIT ((u32) -1) -#define ACPI_MUTEX_SEM 1 - - -/* Functions for acpi_os_signal */ - -#define ACPI_SIGNAL_FATAL 0 -#define ACPI_SIGNAL_BREAKPOINT 1 - -struct acpi_signal_fatal_info -{ - u32 type; - u32 code; - u32 argument; -}; - - -/* - * Types specific to the OS service interfaces - */ - -typedef u32 -(ACPI_SYSTEM_XFACE *OSD_HANDLER) ( - void *context); - -typedef void -(ACPI_SYSTEM_XFACE *OSD_EXECUTION_CALLBACK) ( - void *context); - - -/* - * OSL Initialization and shutdown primitives - */ - -acpi_status -acpi_os_initialize ( - void); - -acpi_status -acpi_os_terminate ( - void); - - -/* - * ACPI Table interfaces - */ - -acpi_status -acpi_os_get_root_pointer ( - u32 flags, - struct acpi_pointer *address); - -acpi_status -acpi_os_table_override ( - struct acpi_table_header *existing_table, - struct acpi_table_header **new_table); - - -/* - * Synchronization primitives - */ - -acpi_status -acpi_os_create_semaphore ( - u32 max_units, - u32 initial_units, - acpi_handle *out_handle); - -acpi_status -acpi_os_delete_semaphore ( - acpi_handle handle); - -acpi_status -acpi_os_wait_semaphore ( - acpi_handle handle, - u32 units, - u16 timeout); - -acpi_status -acpi_os_signal_semaphore ( - acpi_handle handle, - u32 units); - - -/* - * Memory allocation and mapping - */ - -void * -acpi_os_allocate ( - acpi_size size); - -void -acpi_os_free ( - void * memory); - -acpi_status -acpi_os_map_memory ( - acpi_physical_address physical_address, - acpi_size size, - void **logical_address); - -void -acpi_os_unmap_memory ( - void *logical_address, - acpi_size size); - -acpi_status -acpi_os_get_physical_address ( - void *logical_address, - acpi_physical_address *physical_address); - - -/* - * Interrupt handlers - */ - -acpi_status -acpi_os_install_interrupt_handler ( - u32 interrupt_number, - OSD_HANDLER service_routine, - void *context); - -acpi_status -acpi_os_remove_interrupt_handler ( - u32 interrupt_number, - OSD_HANDLER service_routine); - - -/* - * Threads and Scheduling - */ - -u32 -acpi_os_get_thread_id ( - void); - -acpi_status -acpi_os_queue_for_execution ( - u32 priority, - OSD_EXECUTION_CALLBACK function, - void *context); - -void -acpi_os_sleep ( - u32 seconds, - u32 milliseconds); - -void -acpi_os_stall ( - u32 microseconds); - - -/* - * Platform and hardware-independent I/O interfaces - */ - -acpi_status -acpi_os_read_port ( - acpi_io_address address, - void *value, - u32 width); - -acpi_status -acpi_os_write_port ( - acpi_io_address address, - acpi_integer value, - u32 width); - - -/* - * Platform and hardware-independent physical memory interfaces - */ - -acpi_status -acpi_os_read_memory ( - acpi_physical_address address, - void *value, - u32 width); - -acpi_status -acpi_os_write_memory ( - acpi_physical_address address, - acpi_integer value, - u32 width); - - -/* - * Platform and hardware-independent PCI configuration space access - */ - -acpi_status -acpi_os_read_pci_configuration ( - struct acpi_pci_id *pci_id, - u32 register, - void *value, - u32 width); - -acpi_status -acpi_os_write_pci_configuration ( - struct acpi_pci_id *pci_id, - u32 register, - acpi_integer value, - u32 width); - -/* - * Interim function needed for PCI IRQ routing - */ -void -acpi_os_derive_pci_id( - acpi_handle rhandle, - acpi_handle chandle, - struct acpi_pci_id **pci_id); - -/* - * Miscellaneous - */ - -u8 -acpi_os_readable ( - void *pointer, - u32 length); - -u8 -acpi_os_writable ( - void *pointer, - u32 length); - -u32 -acpi_os_get_timer ( - void); - -acpi_status -acpi_os_signal ( - u32 function, - void *info); - -/* - * Debug print routines - */ - -void ACPI_INTERNAL_VAR_XFACE -acpi_os_printf ( - const char *format, - ...); - -void -acpi_os_vprintf ( - const char *format, - va_list args); - -void -acpi_os_redirect_output ( - void *destination); - - -/* - * Debug input - */ - -u32 -acpi_os_get_line ( - char *buffer); - - -/* - * Directory manipulation - */ - -void * -acpi_os_open_directory ( - char *pathname, - char *wildcard_spec); - -char * -acpi_os_get_next_filename ( - void *dir_handle); - -void -acpi_os_close_directory ( - void *dir_handle); - -/* - * Debug - */ - -void -acpi_os_dbg_assert( - void *failed_assertion, - void *file_name, - u32 line_number, - char *message); - - -#endif /* __ACPIOSXF_H__ */ diff -Nru a/drivers/acpi/include/acpixf.h b/drivers/acpi/include/acpixf.h --- a/drivers/acpi/include/acpixf.h Sun Feb 9 21:13:28 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,387 +0,0 @@ - -/****************************************************************************** - * - * Name: acpixf.h - External interfaces to the ACPI subsystem - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef __ACXFACE_H__ -#define __ACXFACE_H__ - -#include "actypes.h" -#include "actbl.h" - - - /* - * Global interfaces - */ - -acpi_status -acpi_initialize_subsystem ( - void); - -acpi_status -acpi_enable_subsystem ( - u32 flags); - -acpi_status -acpi_initialize_objects ( - u32 flags); - -acpi_status -acpi_terminate ( - void); - -acpi_status -acpi_subsystem_status ( - void); - -acpi_status -acpi_enable ( - void); - -acpi_status -acpi_disable ( - void); - -acpi_status -acpi_get_system_info ( - struct acpi_buffer *ret_buffer); - -const char * -acpi_format_exception ( - acpi_status exception); - -acpi_status -acpi_purge_cached_objects ( - void); - -acpi_status -acpi_install_initialization_handler ( - acpi_init_handler handler, - u32 function); - -/* - * ACPI Memory manager - */ - -void * -acpi_allocate ( - u32 size); - -void * -acpi_callocate ( - u32 size); - -void -acpi_free ( - void *address); - - -/* - * ACPI table manipulation interfaces - */ - -acpi_status -acpi_find_root_pointer ( - u32 flags, - struct acpi_pointer *rsdp_address); - -acpi_status -acpi_load_tables ( - void); - -acpi_status -acpi_load_table ( - struct acpi_table_header *table_ptr); - -acpi_status -acpi_unload_table ( - acpi_table_type table_type); - -acpi_status -acpi_get_table_header ( - acpi_table_type table_type, - u32 instance, - struct acpi_table_header *out_table_header); - -acpi_status -acpi_get_table ( - acpi_table_type table_type, - u32 instance, - struct acpi_buffer *ret_buffer); - -acpi_status -acpi_get_firmware_table ( - acpi_string signature, - u32 instance, - u32 flags, - struct acpi_table_header **table_pointer); - - -/* - * Namespace and name interfaces - */ - -acpi_status -acpi_walk_namespace ( - acpi_object_type type, - acpi_handle start_object, - u32 max_depth, - acpi_walk_callback user_function, - void *context, - void **return_value); - -acpi_status -acpi_get_devices ( - char *HID, - acpi_walk_callback user_function, - void *context, - void **return_value); - -acpi_status -acpi_get_name ( - acpi_handle handle, - u32 name_type, - struct acpi_buffer *ret_path_ptr); - -acpi_status -acpi_get_handle ( - acpi_handle parent, - acpi_string pathname, - acpi_handle *ret_handle); - -acpi_status -acpi_attach_data ( - acpi_handle obj_handle, - acpi_object_handler handler, - void *data); - -acpi_status -acpi_detach_data ( - acpi_handle obj_handle, - acpi_object_handler handler); - -acpi_status -acpi_get_data ( - acpi_handle obj_handle, - acpi_object_handler handler, - void **data); - - -/* - * Object manipulation and enumeration - */ - -acpi_status -acpi_evaluate_object ( - acpi_handle object, - acpi_string pathname, - struct acpi_object_list *parameter_objects, - struct acpi_buffer *return_object_buffer); - -acpi_status -acpi_evaluate_object_typed ( - acpi_handle object, - acpi_string pathname, - struct acpi_object_list *external_params, - struct acpi_buffer *return_buffer, - acpi_object_type return_type); - -acpi_status -acpi_get_object_info ( - acpi_handle device, - struct acpi_device_info *info); - -acpi_status -acpi_get_next_object ( - acpi_object_type type, - acpi_handle parent, - acpi_handle child, - acpi_handle *out_handle); - -acpi_status -acpi_get_type ( - acpi_handle object, - acpi_object_type *out_type); - -acpi_status -acpi_get_parent ( - acpi_handle object, - acpi_handle *out_handle); - - -/* - * Event handler interfaces - */ - -acpi_status -acpi_install_fixed_event_handler ( - u32 acpi_event, - acpi_event_handler handler, - void *context); - -acpi_status -acpi_remove_fixed_event_handler ( - u32 acpi_event, - acpi_event_handler handler); - -acpi_status -acpi_install_notify_handler ( - acpi_handle device, - u32 handler_type, - acpi_notify_handler handler, - void *context); - -acpi_status -acpi_remove_notify_handler ( - acpi_handle device, - u32 handler_type, - acpi_notify_handler handler); - -acpi_status -acpi_install_address_space_handler ( - acpi_handle device, - acpi_adr_space_type space_id, - acpi_adr_space_handler handler, - acpi_adr_space_setup setup, - void *context); - -acpi_status -acpi_remove_address_space_handler ( - acpi_handle device, - acpi_adr_space_type space_id, - acpi_adr_space_handler handler); - -acpi_status -acpi_install_gpe_handler ( - u32 gpe_number, - u32 type, - acpi_gpe_handler handler, - void *context); - -acpi_status -acpi_acquire_global_lock ( - u16 timeout, - u32 *handle); - -acpi_status -acpi_release_global_lock ( - u32 handle); - -acpi_status -acpi_remove_gpe_handler ( - u32 gpe_number, - acpi_gpe_handler handler); - -acpi_status -acpi_enable_event ( - u32 acpi_event, - u32 type, - u32 flags); - -acpi_status -acpi_disable_event ( - u32 acpi_event, - u32 type, - u32 flags); - -acpi_status -acpi_clear_event ( - u32 acpi_event, - u32 type); - -acpi_status -acpi_get_event_status ( - u32 acpi_event, - u32 type, - acpi_event_status *event_status); - -/* - * Resource interfaces - */ - -acpi_status -acpi_get_current_resources( - acpi_handle device_handle, - struct acpi_buffer *ret_buffer); - -acpi_status -acpi_get_possible_resources( - acpi_handle device_handle, - struct acpi_buffer *ret_buffer); - -acpi_status -acpi_set_current_resources ( - acpi_handle device_handle, - struct acpi_buffer *in_buffer); - -acpi_status -acpi_get_irq_routing_table ( - acpi_handle bus_device_handle, - struct acpi_buffer *ret_buffer); - - -/* - * Hardware (ACPI device) interfaces - */ - -acpi_status -acpi_get_register ( - u32 register_id, - u32 *return_value, - u32 flags); - -acpi_status -acpi_set_register ( - u32 register_id, - u32 value, - u32 flags); - -acpi_status -acpi_set_firmware_waking_vector ( - acpi_physical_address physical_address); - -acpi_status -acpi_get_firmware_waking_vector ( - acpi_physical_address *physical_address); - -acpi_status -acpi_get_sleep_type_data ( - u8 sleep_state, - u8 *slp_typ_a, - u8 *slp_typ_b); - -acpi_status -acpi_enter_sleep_state_prep ( - u8 sleep_state); - -acpi_status -acpi_enter_sleep_state ( - u8 sleep_state); - -acpi_status -acpi_leave_sleep_state ( - u8 sleep_state); - - -#endif /* __ACXFACE_H__ */ diff -Nru a/drivers/acpi/include/acresrc.h b/drivers/acpi/include/acresrc.h --- a/drivers/acpi/include/acresrc.h Sun Feb 9 21:13:29 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,366 +0,0 @@ -/****************************************************************************** - * - * Name: acresrc.h - Resource Manager function prototypes - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACRESRC_H__ -#define __ACRESRC_H__ - - -/* - * Function prototypes called from Acpi* APIs - */ - -acpi_status -acpi_rs_get_prt_method_data ( - acpi_handle handle, - struct acpi_buffer *ret_buffer); - - -acpi_status -acpi_rs_get_crs_method_data ( - acpi_handle handle, - struct acpi_buffer *ret_buffer); - -acpi_status -acpi_rs_get_prs_method_data ( - acpi_handle handle, - struct acpi_buffer *ret_buffer); - -acpi_status -acpi_rs_set_srs_method_data ( - acpi_handle handle, - struct acpi_buffer *ret_buffer); - -acpi_status -acpi_rs_create_resource_list ( - union acpi_operand_object *byte_stream_buffer, - struct acpi_buffer *output_buffer); - -acpi_status -acpi_rs_create_byte_stream ( - struct acpi_resource *linked_list_buffer, - struct acpi_buffer *output_buffer); - -acpi_status -acpi_rs_create_pci_routing_table ( - union acpi_operand_object *package_object, - struct acpi_buffer *output_buffer); - - -/* - * Function prototypes called from acpi_rs_create* - */ -void -acpi_rs_dump_irq ( - union acpi_resource_data *data); - -void -acpi_rs_dump_address16 ( - union acpi_resource_data *data); - -void -acpi_rs_dump_address32 ( - union acpi_resource_data *data); - -void -acpi_rs_dump_address64 ( - union acpi_resource_data *data); - -void -acpi_rs_dump_dma ( - union acpi_resource_data *data); - -void -acpi_rs_dump_io ( - union acpi_resource_data *data); - -void -acpi_rs_dump_extended_irq ( - union acpi_resource_data *data); - -void -acpi_rs_dump_fixed_io ( - union acpi_resource_data *data); - -void -acpi_rs_dump_fixed_memory32 ( - union acpi_resource_data *data); - -void -acpi_rs_dump_memory24 ( - union acpi_resource_data *data); - -void -acpi_rs_dump_memory32 ( - union acpi_resource_data *data); - -void -acpi_rs_dump_start_depend_fns ( - union acpi_resource_data *data); - -void -acpi_rs_dump_vendor_specific ( - union acpi_resource_data *data); - -void -acpi_rs_dump_resource_list ( - struct acpi_resource *resource); - -void -acpi_rs_dump_irq_list ( - u8 *route_table); - -acpi_status -acpi_rs_get_byte_stream_start ( - u8 *byte_stream_buffer, - u8 **byte_stream_start, - u32 *size); - -acpi_status -acpi_rs_get_list_length ( - u8 *byte_stream_buffer, - u32 byte_stream_buffer_length, - acpi_size *size_needed); - -acpi_status -acpi_rs_get_byte_stream_length ( - struct acpi_resource *linked_list_buffer, - acpi_size *size_needed); - -acpi_status -acpi_rs_get_pci_routing_table_length ( - union acpi_operand_object *package_object, - acpi_size *buffer_size_needed); - -acpi_status -acpi_rs_byte_stream_to_list ( - u8 *byte_stream_buffer, - u32 byte_stream_buffer_length, - u8 *output_buffer); - -acpi_status -acpi_rs_list_to_byte_stream ( - struct acpi_resource *linked_list, - acpi_size byte_stream_size_needed, - u8 *output_buffer); - -acpi_status -acpi_rs_io_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); - -acpi_status -acpi_rs_fixed_io_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); - -acpi_status -acpi_rs_io_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); - -acpi_status -acpi_rs_fixed_io_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); - -acpi_status -acpi_rs_irq_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); - -acpi_status -acpi_rs_irq_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); - -acpi_status -acpi_rs_dma_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); - -acpi_status -acpi_rs_dma_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); - -acpi_status -acpi_rs_address16_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); - -acpi_status -acpi_rs_address16_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); - -acpi_status -acpi_rs_address32_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); - -acpi_status -acpi_rs_address32_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); - -acpi_status -acpi_rs_address64_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); - -acpi_status -acpi_rs_address64_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); - -acpi_status -acpi_rs_start_depend_fns_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); - -acpi_status -acpi_rs_end_depend_fns_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); - -acpi_status -acpi_rs_start_depend_fns_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); - -acpi_status -acpi_rs_end_depend_fns_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); - -acpi_status -acpi_rs_memory24_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); - -acpi_status -acpi_rs_memory24_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); - -acpi_status -acpi_rs_memory32_range_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); - -acpi_status -acpi_rs_fixed_memory32_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); - -acpi_status -acpi_rs_memory32_range_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); - -acpi_status -acpi_rs_fixed_memory32_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); - -acpi_status -acpi_rs_extended_irq_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); - -acpi_status -acpi_rs_extended_irq_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); - -acpi_status -acpi_rs_end_tag_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); - -acpi_status -acpi_rs_end_tag_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); - -acpi_status -acpi_rs_vendor_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); - -acpi_status -acpi_rs_vendor_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); - -u8 -acpi_rs_get_resource_type ( - u8 resource_start_byte); - -#endif /* __ACRESRC_H__ */ diff -Nru a/drivers/acpi/include/acstruct.h b/drivers/acpi/include/acstruct.h --- a/drivers/acpi/include/acstruct.h Sun Feb 9 21:13:29 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,183 +0,0 @@ -/****************************************************************************** - * - * Name: acstruct.h - Internal structs - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACSTRUCT_H__ -#define __ACSTRUCT_H__ - - -/***************************************************************************** - * - * Tree walking typedefs and structs - * - ****************************************************************************/ - - -/* - * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through - * the tree (for whatever reason), and for control method execution. - */ - -#define ACPI_NEXT_OP_DOWNWARD 1 -#define ACPI_NEXT_OP_UPWARD 2 - -#define ACPI_WALK_NON_METHOD 0 -#define ACPI_WALK_METHOD 1 -#define ACPI_WALK_METHOD_RESTART 2 -#define ACPI_WALK_CONST_REQUIRED 3 -#define ACPI_WALK_CONST_OPTIONAL 4 - -struct acpi_walk_state -{ - u8 data_type; /* To differentiate various internal objs MUST BE FIRST!*/\ - acpi_owner_id owner_id; /* Owner of objects created during the walk */ - u8 last_predicate; /* Result of last predicate */ - u8 current_result; /* */ - u8 next_op_info; /* Info about next_op */ - u8 num_operands; /* Stack pointer for Operands[] array */ - u8 return_used; - u8 walk_type; - u16 opcode; /* Current AML opcode */ - u8 scope_depth; - u8 reserved1; - u32 arg_count; /* push for fixed or var args */ - u32 aml_offset; - u32 arg_types; - u32 method_breakpoint; /* For single stepping */ - u32 user_breakpoint; /* User AML breakpoint */ - u32 parse_flags; - u32 prev_arg_types; - - u8 *aml_last_while; - struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ - union acpi_operand_object **caller_return_desc; - union acpi_generic_state *control_state; /* List of control states (nested IFs) */ - struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ - struct acpi_namespace_node *method_call_node; /* Called method Node*/ - union acpi_parse_object *method_call_op; /* method_call Op if running a method */ - union acpi_operand_object *method_desc; /* Method descriptor if running a method */ - struct acpi_namespace_node *method_node; /* Method Node if running a method */ - union acpi_parse_object *op; /* Current parser op */ - union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS+1]; /* Operands passed to the interpreter (+1 for NULL terminator) */ - const struct acpi_opcode_info *op_info; /* Info on current opcode */ - union acpi_parse_object *origin; /* Start of walk [Obsolete] */ - union acpi_operand_object **params; - struct acpi_parse_state parser_state; /* Current state of parser */ - union acpi_operand_object *result_obj; - union acpi_generic_state *results; /* Stack of accumulated results */ - union acpi_operand_object *return_desc; /* Return object, if any */ - union acpi_generic_state *scope_info; /* Stack of nested scopes */ - - union acpi_parse_object *prev_op; /* Last op that was processed */ - union acpi_parse_object *next_op; /* next op to be processed */ - acpi_parse_downwards descending_callback; - acpi_parse_upwards ascending_callback; - struct acpi_thread_state *thread; - struct acpi_walk_state *next; /* Next walk_state in list */ -}; - - -/* Info used by acpi_ps_init_objects */ - -struct acpi_init_walk_info -{ - u16 method_count; - u16 device_count; - u16 op_region_count; - u16 field_count; - u16 buffer_count; - u16 package_count; - u16 op_region_init; - u16 field_init; - u16 buffer_init; - u16 package_init; - u16 object_count; - struct acpi_table_desc *table_desc; -}; - - -/* Info used by acpi_ns_initialize_devices */ - -struct acpi_device_walk_info -{ - u16 device_count; - u16 num_STA; - u16 num_INI; - struct acpi_table_desc *table_desc; -}; - - -/* TBD: [Restructure] Merge with struct above */ - -struct acpi_walk_info -{ - u32 debug_level; - u32 owner_id; - u8 display_type; -}; - -/* Display Types */ - -#define ACPI_DISPLAY_SUMMARY 0 -#define ACPI_DISPLAY_OBJECTS 1 - -struct acpi_get_devices_info -{ - acpi_walk_callback user_function; - void *context; - char *hid; -}; - - -union acpi_aml_operands -{ - union acpi_operand_object *operands[7]; - - struct - { - struct acpi_object_integer *type; - struct acpi_object_integer *code; - struct acpi_object_integer *argument; - - } fatal; - - struct - { - union acpi_operand_object *source; - struct acpi_object_integer *index; - union acpi_operand_object *target; - - } index; - - struct - { - union acpi_operand_object *source; - struct acpi_object_integer *index; - struct acpi_object_integer *length; - union acpi_operand_object *target; - - } mid; -}; - - -#endif diff -Nru a/drivers/acpi/include/actables.h b/drivers/acpi/include/actables.h --- a/drivers/acpi/include/actables.h Sun Feb 9 21:13:30 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,218 +0,0 @@ -/****************************************************************************** - * - * Name: actables.h - ACPI table management - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACTABLES_H__ -#define __ACTABLES_H__ - - -/* Used in acpi_tb_map_acpi_table for size parameter if table header is to be used */ - -#define SIZE_IN_HEADER 0 - - -acpi_status -acpi_tb_handle_to_object ( - u16 table_id, - struct acpi_table_desc **table_desc); - -/* - * tbconvrt - Table conversion routines - */ - -acpi_status -acpi_tb_convert_to_xsdt ( - struct acpi_table_desc *table_info); - -acpi_status -acpi_tb_convert_table_fadt ( - void); - -acpi_status -acpi_tb_build_common_facs ( - struct acpi_table_desc *table_info); - -u32 -acpi_tb_get_table_count ( - struct rsdp_descriptor *RSDP, - struct acpi_table_header *RSDT); - -/* - * tbget - Table "get" routines - */ - -acpi_status -acpi_tb_get_table ( - struct acpi_pointer *address, - struct acpi_table_desc *table_info); - -acpi_status -acpi_tb_get_table_header ( - struct acpi_pointer *address, - struct acpi_table_header *return_header); - -acpi_status -acpi_tb_get_table_body ( - struct acpi_pointer *address, - struct acpi_table_header *header, - struct acpi_table_desc *table_info); - -acpi_status -acpi_tb_get_this_table ( - struct acpi_pointer *address, - struct acpi_table_header *header, - struct acpi_table_desc *table_info); - -acpi_status -acpi_tb_table_override ( - struct acpi_table_header *header, - struct acpi_table_desc *table_info); - -acpi_status -acpi_tb_get_table_ptr ( - acpi_table_type table_type, - u32 instance, - struct acpi_table_header **table_ptr_loc); - -acpi_status -acpi_tb_verify_rsdp ( - struct acpi_pointer *address); - -void -acpi_tb_get_rsdt_address ( - struct acpi_pointer *out_address); - -acpi_status -acpi_tb_validate_rsdt ( - struct acpi_table_header *table_ptr); - -acpi_status -acpi_tb_get_required_tables ( - void); - -acpi_status -acpi_tb_get_primary_table ( - struct acpi_pointer *address, - struct acpi_table_desc *table_info); - -acpi_status -acpi_tb_get_secondary_table ( - struct acpi_pointer *address, - acpi_string signature, - struct acpi_table_desc *table_info); - -/* - * tbinstall - Table installation - */ - -acpi_status -acpi_tb_install_table ( - struct acpi_table_desc *table_info); - -acpi_status -acpi_tb_match_signature ( - char *signature, - struct acpi_table_desc *table_info, - u8 search_type); - -acpi_status -acpi_tb_recognize_table ( - struct acpi_table_desc *table_info, - u8 search_type); - -acpi_status -acpi_tb_init_table_descriptor ( - acpi_table_type table_type, - struct acpi_table_desc *table_info); - - -/* - * tbremove - Table removal and deletion - */ - -void -acpi_tb_delete_acpi_tables ( - void); - -void -acpi_tb_delete_acpi_table ( - acpi_table_type type); - -void -acpi_tb_delete_single_table ( - struct acpi_table_desc *table_desc); - -struct acpi_table_desc * -acpi_tb_uninstall_table ( - struct acpi_table_desc *table_desc); - -void -acpi_tb_free_acpi_tables_of_type ( - struct acpi_table_desc *table_info); - - -/* - * tbrsd - RSDP, RSDT utilities - */ - -acpi_status -acpi_tb_get_table_rsdt ( - void); - -u8 * -acpi_tb_scan_memory_for_rsdp ( - u8 *start_address, - u32 length); - -acpi_status -acpi_tb_find_rsdp ( - struct acpi_table_desc *table_info, - u32 flags); - - -/* - * tbutils - common table utilities - */ - -acpi_status -acpi_tb_find_table ( - char *signature, - char *oem_id, - char *oem_table_id, - struct acpi_table_header **table_ptr); - -acpi_status -acpi_tb_verify_table_checksum ( - struct acpi_table_header *table_header); - -u8 -acpi_tb_checksum ( - void *buffer, - u32 length); - -acpi_status -acpi_tb_validate_table_header ( - struct acpi_table_header *table_header); - - -#endif /* __ACTABLES_H__ */ diff -Nru a/drivers/acpi/include/actbl.h b/drivers/acpi/include/actbl.h --- a/drivers/acpi/include/actbl.h Sun Feb 9 21:13:32 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,208 +0,0 @@ -/****************************************************************************** - * - * Name: actbl.h - Table data structures defined in ACPI specification - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACTBL_H__ -#define __ACTBL_H__ - - -/* - * Values for description table header signatures - */ -#define RSDP_NAME "RSDP" -#define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */ -#define APIC_SIG "APIC" /* Multiple APIC Description Table */ -#define DSDT_SIG "DSDT" /* Differentiated System Description Table */ -#define FADT_SIG "FACP" /* Fixed ACPI Description Table */ -#define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ -#define PSDT_SIG "PSDT" /* Persistent System Description Table */ -#define RSDT_SIG "RSDT" /* Root System Description Table */ -#define XSDT_SIG "XSDT" /* Extended System Description Table */ -#define SSDT_SIG "SSDT" /* Secondary System Description Table */ -#define SBST_SIG "SBST" /* Smart Battery Specification Table */ -#define SPIC_SIG "SPIC" /* IOSAPIC table */ -#define BOOT_SIG "BOOT" /* Boot table */ - - -#define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */ - -/* values of Mapic.Model */ - -#define DUAL_PIC 0 -#define MULTIPLE_APIC 1 - -/* values of Type in struct apic_header */ - -#define APIC_PROC 0 -#define APIC_IO 1 - - -/* - * Common table types. The base code can remain - * constant if the underlying tables are changed - */ -#define RSDT_DESCRIPTOR struct rsdt_descriptor_rev2 -#define XSDT_DESCRIPTOR struct xsdt_descriptor_rev2 -#define FACS_DESCRIPTOR struct facs_descriptor_rev2 -#define FADT_DESCRIPTOR struct fadt_descriptor_rev2 - - -#pragma pack(1) - -/* - * Architecture-independent tables - * The architecture dependent tables are in separate files - */ -struct rsdp_descriptor /* Root System Descriptor Pointer */ -{ - char signature [8]; /* ACPI signature, contains "RSD PTR " */ - u8 checksum; /* To make sum of struct == 0 */ - char oem_id [6]; /* OEM identification */ - u8 revision; /* Must be 0 for 1.0, 2 for 2.0 */ - u32 rsdt_physical_address; /* 32-bit physical address of RSDT */ - u32 length; /* XSDT Length in bytes including hdr */ - u64 xsdt_physical_address; /* 64-bit physical address of XSDT */ - u8 extended_checksum; /* Checksum of entire table */ - char reserved [3]; /* Reserved field must be 0 */ -}; - - -struct acpi_table_header /* ACPI common table header */ -{ - char signature [4]; /* ACPI signature (4 ASCII characters) */ - u32 length; /* Length of table, in bytes, including header */ - u8 revision; /* ACPI Specification minor version # */ - u8 checksum; /* To make sum of entire table == 0 */ - char oem_id [6]; /* OEM identification */ - char oem_table_id [8]; /* OEM table identification */ - u32 oem_revision; /* OEM revision number */ - char asl_compiler_id [4]; /* ASL compiler vendor ID */ - u32 asl_compiler_revision; /* ASL compiler revision number */ -}; - - -struct acpi_common_facs /* Common FACS for internal use */ -{ - u32 *global_lock; - u64 *firmware_waking_vector; - u8 vector_width; -}; - - -struct apic_table -{ - struct acpi_table_header header; /* ACPI table header */ - u32 local_apic_address; /* Physical address for accessing local APICs */ - u32 PCATcompat : 1; /* a one indicates system also has dual 8259s */ - u32 reserved1 : 31; -}; - - -struct apic_header -{ - u8 type; /* APIC type. Either APIC_PROC or APIC_IO */ - u8 length; /* Length of APIC structure */ -}; - - -struct processor_apic -{ - struct apic_header header; - u8 processor_apic_id; /* ACPI processor id */ - u8 local_apic_id; /* Processor's local APIC id */ - u32 processor_enabled: 1; /* Processor is usable if set */ - u32 reserved1 : 31; -}; - - -struct io_apic -{ - struct apic_header header; - u8 io_apic_id; /* I/O APIC ID */ - u8 reserved; /* Reserved - must be zero */ - u32 io_apic_address; /* APIC's physical address */ - u32 vector; /* Interrupt vector index where INTI - * lines start */ -}; - - -/* - * IA64 TBD: Add SAPIC Tables - */ - -/* - * IA64 TBD: Modify Smart Battery Description to comply with ACPI IA64 - * extensions. - */ -struct smart_battery_description_table -{ - struct acpi_table_header header; - u32 warning_level; - u32 low_level; - u32 critical_level; -}; - - -#pragma pack() - - -/* - * ACPI Table information. We save the table address, length, - * and type of memory allocation (mapped or allocated) for each - * table for 1) when we exit, and 2) if a new table is installed - */ -#define ACPI_MEM_NOT_ALLOCATED 0 -#define ACPI_MEM_ALLOCATED 1 -#define ACPI_MEM_MAPPED 2 - -/* Definitions for the Flags bitfield member of struct acpi_table_support */ - -#define ACPI_TABLE_SINGLE 0x00 -#define ACPI_TABLE_MULTIPLE 0x01 -#define ACPI_TABLE_EXECUTABLE 0x02 - -#define ACPI_TABLE_ROOT 0x00 -#define ACPI_TABLE_PRIMARY 0x10 -#define ACPI_TABLE_SECONDARY 0x20 -#define ACPI_TABLE_OTHER 0x30 -#define ACPI_TABLE_TYPE_MASK 0x30 - -/* Data about each known table type */ - -struct acpi_table_support -{ - char *name; - char *signature; - void **global_ptr; - u8 sig_length; - u8 flags; -}; - - -/* - * Get the architecture-specific tables - */ -#include "actbl1.h" /* Acpi 1.0 table definitions */ -#include "actbl2.h" /* Acpi 2.0 table definitions */ - -#endif /* __ACTBL_H__ */ diff -Nru a/drivers/acpi/include/actbl1.h b/drivers/acpi/include/actbl1.h --- a/drivers/acpi/include/actbl1.h Sun Feb 9 21:13:29 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,117 +0,0 @@ -/****************************************************************************** - * - * Name: actbl1.h - ACPI 1.0 tables - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACTBL1_H__ -#define __ACTBL1_H__ - -#pragma pack(1) - -/* - * ACPI 1.0 Root System Description Table (RSDT) - */ -struct rsdt_descriptor_rev1 -{ - struct acpi_table_header header; /* ACPI Table header */ - u32 table_offset_entry [1]; /* Array of pointers to other */ - /* ACPI tables */ -}; - - -/* - * ACPI 1.0 Firmware ACPI Control Structure (FACS) - */ -struct facs_descriptor_rev1 -{ - char signature[4]; /* ACPI Signature */ - u32 length; /* Length of structure, in bytes */ - u32 hardware_signature; /* Hardware configuration signature */ - u32 firmware_waking_vector; /* ACPI OS waking vector */ - u32 global_lock; /* Global Lock */ - u32 S4bios_f : 1; /* Indicates if S4BIOS support is present */ - u32 reserved1 : 31; /* Must be 0 */ - u8 resverved3 [40]; /* Reserved - must be zero */ -}; - - -/* - * ACPI 1.0 Fixed ACPI Description Table (FADT) - */ -struct fadt_descriptor_rev1 -{ - struct acpi_table_header header; /* ACPI Table header */ - u32 firmware_ctrl; /* Physical address of FACS */ - u32 dsdt; /* Physical address of DSDT */ - u8 model; /* System Interrupt Model */ - u8 reserved1; /* Reserved */ - u16 sci_int; /* System vector of SCI interrupt */ - u32 smi_cmd; /* Port address of SMI command port */ - u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ - u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ - u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ - u8 reserved2; /* Reserved - must be zero */ - u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ - u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ - u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ - u32 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ - u32 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ - u32 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ - u32 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ - u32 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ - u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ - u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ - u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ - u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ - u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ - u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ - u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ - u8 reserved3; /* Reserved */ - u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ - u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ - u16 flush_size; /* Size of area read to flush caches */ - u16 flush_stride; /* Stride used in flushing caches */ - u8 duty_offset; /* Bit location of duty cycle field in p_cnt reg */ - u8 duty_width; /* Bit width of duty cycle field in p_cnt reg */ - u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ - u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ - u8 century; /* Index to century in RTC CMOS RAM */ - u8 reserved4; /* Reserved */ - u8 reserved4a; /* Reserved */ - u8 reserved4b; /* Reserved */ - u32 wb_invd : 1; /* The wbinvd instruction works properly */ - u32 wb_invd_flush : 1; /* The wbinvd flushes but does not invalidate */ - u32 proc_c1 : 1; /* All processors support C1 state */ - u32 plvl2_up : 1; /* C2 state works on MP system */ - u32 pwr_button : 1; /* Power button is handled as a generic feature */ - u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */ - u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */ - u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ - u32 tmr_val_ext : 1; /* The tmr_val width is 32 bits (0 = 24 bits) */ - u32 reserved5 : 23; /* Reserved - must be zero */ -}; - -#pragma pack() - -#endif /* __ACTBL1_H__ */ - - diff -Nru a/drivers/acpi/include/actbl2.h b/drivers/acpi/include/actbl2.h --- a/drivers/acpi/include/actbl2.h Sun Feb 9 21:13:33 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,182 +0,0 @@ -/****************************************************************************** - * - * Name: actbl2.h - ACPI Specification Revision 2.0 Tables - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACTBL2_H__ -#define __ACTBL2_H__ - -/* - * Prefered Power Management Profiles - */ -#define PM_UNSPECIFIED 0 -#define PM_DESKTOP 1 -#define PM_MOBILE 2 -#define PM_WORKSTATION 3 -#define PM_ENTERPRISE_SERVER 4 -#define PM_SOHO_SERVER 5 -#define PM_APPLIANCE_PC 6 - -/* - * ACPI Boot Arch Flags - */ -#define BAF_LEGACY_DEVICES 0x0001 -#define BAF_8042_KEYBOARD_CONTROLLER 0x0002 - -#define FADT2_REVISION_ID 3 - - -#pragma pack(1) - -/* - * ACPI 2.0 Root System Description Table (RSDT) - */ -struct rsdt_descriptor_rev2 -{ - struct acpi_table_header header; /* ACPI table header */ - u32 table_offset_entry [1]; /* Array of pointers to */ - /* ACPI table headers */ -}; - - -/* - * ACPI 2.0 Extended System Description Table (XSDT) - */ -struct xsdt_descriptor_rev2 -{ - struct acpi_table_header header; /* ACPI table header */ - u64 table_offset_entry [1]; /* Array of pointers to */ - /* ACPI table headers */ -}; - - -/* - * ACPI 2.0 Firmware ACPI Control Structure (FACS) - */ -struct facs_descriptor_rev2 -{ - char signature[4]; /* ACPI signature */ - u32 length; /* Length of structure, in bytes */ - u32 hardware_signature; /* Hardware configuration signature */ - u32 firmware_waking_vector; /* 32bit physical address of the Firmware Waking Vector. */ - u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */ - u32 S4bios_f : 1; /* S4Bios_f - Indicates if S4BIOS support is present */ - u32 reserved1 : 31; /* Must be 0 */ - u64 xfirmware_waking_vector; /* 64bit physical address of the Firmware Waking Vector. */ - u8 version; /* Version of this table */ - u8 reserved3 [31]; /* Reserved - must be zero */ -}; - - -/* - * ACPI 2.0 Generic Address Structure (GAS) - */ -struct acpi_generic_address -{ - u8 address_space_id; /* Address space where struct or register exists. */ - u8 register_bit_width; /* Size in bits of given register */ - u8 register_bit_offset; /* Bit offset within the register */ - u8 reserved; /* Must be 0 */ - u64 address; /* 64-bit address of struct or register */ -}; - - -/* - * ACPI 2.0 Fixed ACPI Description Table (FADT) - */ -struct fadt_descriptor_rev2 -{ - struct acpi_table_header header; /* ACPI table header */ - u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ - u32 V1_dsdt; /* 32-bit physical address of DSDT */ - u8 reserved1; /* System Interrupt Model isn't used in ACPI 2.0*/ - u8 prefer_PM_profile; /* Conveys preferred power management profile to OSPM. */ - u16 sci_int; /* System vector of SCI interrupt */ - u32 smi_cmd; /* Port address of SMI command port */ - u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ - u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ - u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ - u8 pstate_cnt; /* Processor performance state control*/ - u32 V1_pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ - u32 V1_pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ - u32 V1_pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ - u32 V1_pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ - u32 V1_pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ - u32 V1_pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ - u32 V1_gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ - u32 V1_gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ - u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ - u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ - u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ - u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ - u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ - u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ - u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ - u8 cst_cnt; /* Support for the _CST object and C States change notification.*/ - u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ - u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ - u16 flush_size; /* Number of flush strides that need to be read */ - u16 flush_stride; /* Processor's memory cache line width, in bytes */ - u8 duty_offset; /* Processor's duty cycle index in processor's P_CNT reg*/ - u8 duty_width; /* Processor's duty cycle value bit width in P_CNT register.*/ - u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ - u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ - u8 century; /* Index to century in RTC CMOS RAM */ - u16 iapc_boot_arch; /* IA-PC Boot Architecture Flags. See Table 5-10 for description*/ - u8 reserved2; /* Reserved */ - u32 wb_invd : 1; /* The wbinvd instruction works properly */ - u32 wb_invd_flush : 1; /* The wbinvd flushes but does not invalidate */ - u32 proc_c1 : 1; /* All processors support C1 state */ - u32 plvl2_up : 1; /* C2 state works on MP system */ - u32 pwr_button : 1; /* Power button is handled as a generic feature */ - u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */ - u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */ - u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ - u32 tmr_val_ext : 1; /* Indicates tmr_val is 32 bits 0=24-bits*/ - u32 dock_cap : 1; /* Supports Docking */ - u32 reset_reg_sup : 1; /* Indicates system supports system reset via the FADT RESET_REG*/ - u32 sealed_case : 1; /* Indicates system has no internal expansion capabilities and case is sealed. */ - u32 headless : 1; /* Indicates system does not have local video capabilities or local input devices.*/ - u32 cpu_sw_sleep : 1; /* Indicates to OSPM that a processor native instruction */ - /* Must be executed after writing the SLP_TYPx register. */ - u32 reserved6 : 18; /* Reserved - must be zero */ - - struct acpi_generic_address reset_register; /* Reset register address in GAS format */ - u8 reset_value; /* Value to write to the reset_register port to reset the system. */ - u8 reserved7[3]; /* These three bytes must be zero */ - u64 xfirmware_ctrl; /* 64-bit physical address of FACS */ - u64 Xdsdt; /* 64-bit physical address of DSDT */ - struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */ - struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */ - struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */ - struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */ - struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */ - struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */ - struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */ - struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */ -}; - - -#pragma pack() - -#endif /* __ACTBL2_H__ */ - diff -Nru a/drivers/acpi/include/actbl71.h b/drivers/acpi/include/actbl71.h --- a/drivers/acpi/include/actbl71.h Sun Feb 9 21:13:31 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,144 +0,0 @@ -/****************************************************************************** - * - * Name: actbl71.h - IA-64 Extensions to the ACPI Spec Rev. 0.71 - * This file includes tables specific to this - * specification revision. - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACTBL71_H__ -#define __ACTBL71_H__ - - -/* 0.71 FADT address_space data item bitmasks defines */ -/* If the associated bit is zero then it is in memory space else in io space */ - -#define SMI_CMD_ADDRESS_SPACE 0x01 -#define PM1_BLK_ADDRESS_SPACE 0x02 -#define PM2_CNT_BLK_ADDRESS_SPACE 0x04 -#define PM_TMR_BLK_ADDRESS_SPACE 0x08 -#define GPE0_BLK_ADDRESS_SPACE 0x10 -#define GPE1_BLK_ADDRESS_SPACE 0x20 - -/* Only for clarity in declarations */ - -typedef u64 IO_ADDRESS; - - -#pragma pack(1) -struct /* Root System Descriptor Pointer */ -{ - NATIVE_CHAR signature [8]; /* contains "RSD PTR " */ - u8 checksum; /* to make sum of struct == 0 */ - NATIVE_CHAR oem_id [6]; /* OEM identification */ - u8 reserved; /* Must be 0 for 1.0, 2 for 2.0 */ - u64 rsdt_physical_address; /* 64-bit physical address of RSDT */ -}; - - -/*****************************************/ -/* IA64 Extensions to ACPI Spec Rev 0.71 */ -/* for the Root System Description Table */ -/*****************************************/ -struct -{ - struct acpi_table_header header; /* Table header */ - u32 reserved_pad; /* IA64 alignment, must be 0 */ - u64 table_offset_entry [1]; /* Array of pointers to other */ - /* tables' headers */ -}; - - -/*******************************************/ -/* IA64 Extensions to ACPI Spec Rev 0.71 */ -/* for the Firmware ACPI Control Structure */ -/*******************************************/ -struct -{ - NATIVE_CHAR signature[4]; /* signature "FACS" */ - u32 length; /* length of structure, in bytes */ - u32 hardware_signature; /* hardware configuration signature */ - u32 reserved4; /* must be 0 */ - u64 firmware_waking_vector; /* ACPI OS waking vector */ - u64 global_lock; /* Global Lock */ - u32 S4bios_f : 1; /* Indicates if S4BIOS support is present */ - u32 reserved1 : 31; /* must be 0 */ - u8 reserved3 [28]; /* reserved - must be zero */ -}; - - -/******************************************/ -/* IA64 Extensions to ACPI Spec Rev 0.71 */ -/* for the Fixed ACPI Description Table */ -/******************************************/ -struct -{ - struct acpi_table_header header; /* table header */ - u32 reserved_pad; /* IA64 alignment, must be 0 */ - u64 firmware_ctrl; /* 64-bit Physical address of FACS */ - u64 dsdt; /* 64-bit Physical address of DSDT */ - u8 model; /* System Interrupt Model */ - u8 address_space; /* Address Space Bitmask */ - u16 sci_int; /* System vector of SCI interrupt */ - u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */ - u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */ - u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ - u8 reserved2; /* reserved - must be zero */ - u64 smi_cmd; /* Port address of SMI command port */ - u64 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ - u64 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ - u64 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ - u64 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ - u64 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ - u64 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ - u64 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ - u64 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ - u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ - u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ - u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ - u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ - u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ - u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ - u8 gpe1_base; /* offset in gpe model where gpe1 events start */ - u8 reserved3; /* reserved */ - u16 plvl2_lat; /* worst case HW latency to enter/exit C2 state */ - u16 plvl3_lat; /* worst case HW latency to enter/exit C3 state */ - u8 day_alrm; /* index to day-of-month alarm in RTC CMOS RAM */ - u8 mon_alrm; /* index to month-of-year alarm in RTC CMOS RAM */ - u8 century; /* index to century in RTC CMOS RAM */ - u8 reserved4; /* reserved */ - u32 flush_cash : 1; /* PAL_FLUSH_CACHE is correctly supported */ - u32 reserved5 : 1; /* reserved - must be zero */ - u32 proc_c1 : 1; /* all processors support C1 state */ - u32 plvl2_up : 1; /* C2 state works on MP system */ - u32 pwr_button : 1; /* Power button is handled as a generic feature */ - u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */ - u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */ - u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ - u32 tmr_val_ext : 1; /* tmr_val is 32 bits */ - u32 dock_cap : 1; /* Supports Docking */ - u32 reserved6 : 22; /* reserved - must be zero */ -}; - -#pragma pack() - -#endif /* __ACTBL71_H__ */ - diff -Nru a/drivers/acpi/include/actypes.h b/drivers/acpi/include/actypes.h --- a/drivers/acpi/include/actypes.h Sun Feb 9 21:13:33 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,1189 +0,0 @@ -/****************************************************************************** - * - * Name: actypes.h - Common data types for the entire ACPI subsystem - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2003, R. Byron Moore - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACTYPES_H__ -#define __ACTYPES_H__ - -/*! [Begin] no source code translation (keep the typedefs) */ - - - -/* - * Data type ranges - */ -#define ACPI_UINT8_MAX (UINT8) 0xFF -#define ACPI_UINT16_MAX (UINT16) 0xFFFF -#define ACPI_UINT32_MAX (UINT32) 0xFFFFFFFF -#define ACPI_UINT64_MAX (UINT64) 0xFFFFFFFFFFFFFFFF -#define ACPI_ASCII_MAX 0x7F - - -#ifdef DEFINE_ALTERNATE_TYPES -/* - * Types used only in translated source, defined here to enable - * cross-platform compilation only. - */ -typedef int s32; -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; -typedef COMPILER_DEPENDENT_UINT64 u64; - -#endif - - -/* - * Data types - Fixed across all compilation models (16/32/64) - * - * BOOLEAN Logical Boolean. - * INT8 8-bit (1 byte) signed value - * UINT8 8-bit (1 byte) unsigned value - * INT16 16-bit (2 byte) signed value - * UINT16 16-bit (2 byte) unsigned value - * INT32 32-bit (4 byte) signed value - * UINT32 32-bit (4 byte) unsigned value - * INT64 64-bit (8 byte) signed value - * UINT64 64-bit (8 byte) unsigned value - * ACPI_NATIVE_INT 32-bit on IA-32, 64-bit on IA-64 signed value - * ACPI_NATIVE_UINT 32-bit on IA-32, 64-bit on IA-64 unsigned value - */ - -#ifndef ACPI_MACHINE_WIDTH -#error ACPI_MACHINE_WIDTH not defined -#endif - -#if ACPI_MACHINE_WIDTH == 64 - -/*! [Begin] no source code translation (keep the typedefs) */ - -/* - * 64-bit type definitions - */ -typedef unsigned char UINT8; -typedef unsigned char BOOLEAN; -typedef unsigned short UINT16; -typedef int INT32; -typedef unsigned int UINT32; -typedef COMPILER_DEPENDENT_INT64 INT64; -typedef COMPILER_DEPENDENT_UINT64 UINT64; - -/*! [End] no source code translation !*/ - -typedef s64 acpi_native_int; -typedef u64 acpi_native_uint; - -typedef u64 acpi_table_ptr; -typedef u64 acpi_io_address; -typedef u64 acpi_physical_address; -typedef u64 acpi_size; - -#define ALIGNED_ADDRESS_BOUNDARY 0x00000008 /* No hardware alignment support in IA64 */ -#define ACPI_USE_NATIVE_DIVIDE /* Native 64-bit integer support */ -#define ACPI_MAX_PTR ACPI_UINT64_MAX -#define ACPI_SIZE_MAX ACPI_UINT64_MAX - - -#elif ACPI_MACHINE_WIDTH == 16 - -/*! [Begin] no source code translation (keep the typedefs) */ - -/* - * 16-bit type definitions - */ -typedef unsigned char UINT8; -typedef unsigned char BOOLEAN; -typedef unsigned int UINT16; -typedef long INT32; -typedef int INT16; -typedef unsigned long UINT32; - -struct -{ - UINT32 Lo; - UINT32 Hi; -}; - -/*! [End] no source code translation !*/ - -typedef u16 acpi_native_uint; -typedef s16 acpi_native_int; - -typedef u32 acpi_table_ptr; -typedef u32 acpi_io_address; -typedef char *acpi_physical_address; -typedef u16 acpi_size; - -#define ALIGNED_ADDRESS_BOUNDARY 0x00000002 -#define _HW_ALIGNMENT_SUPPORT -#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ -#define ACPI_MAX_PTR ACPI_UINT16_MAX -#define ACPI_SIZE_MAX ACPI_UINT16_MAX - -/* - * (16-bit only) internal integers must be 32-bits, so - * 64-bit integers cannot be supported - */ -#define ACPI_NO_INTEGER64_SUPPORT - - -#elif ACPI_MACHINE_WIDTH == 32 - -/*! [Begin] no source code translation (keep the typedefs) */ - -/* - * 32-bit type definitions (default) - */ -typedef unsigned char UINT8; -typedef unsigned char BOOLEAN; -typedef unsigned short UINT16; -typedef int INT32; -typedef unsigned int UINT32; -typedef COMPILER_DEPENDENT_INT64 INT64; -typedef COMPILER_DEPENDENT_UINT64 UINT64; - -/*! [End] no source code translation !*/ - -typedef s32 acpi_native_int; -typedef u32 acpi_native_uint; - -typedef u64 acpi_table_ptr; -typedef u32 acpi_io_address; -typedef u64 acpi_physical_address; -typedef u32 acpi_size; - -#define ALIGNED_ADDRESS_BOUNDARY 0x00000004 -#define _HW_ALIGNMENT_SUPPORT -#define ACPI_MAX_PTR ACPI_UINT32_MAX -#define ACPI_SIZE_MAX ACPI_UINT32_MAX - -#else -#error unknown ACPI_MACHINE_WIDTH -#endif - - -/* - * Miscellaneous common types - */ -typedef u32 UINT32_BIT; -typedef acpi_native_uint ACPI_PTRDIFF; - -/* - * Pointer overlays to avoid lots of typecasting for - * code that accepts both physical and logical pointers. - */ -union acpi_pointers -{ - acpi_physical_address physical; - void *logical; - acpi_table_ptr value; -}; - -struct acpi_pointer -{ - u32 pointer_type; - union acpi_pointers pointer; -}; - -/* pointer_types for above */ - -#define ACPI_PHYSICAL_POINTER 0x01 -#define ACPI_LOGICAL_POINTER 0x02 - -/* Processor mode */ - -#define ACPI_PHYSICAL_ADDRESSING 0x04 -#define ACPI_LOGICAL_ADDRESSING 0x08 -#define ACPI_MEMORY_MODE 0x0C - -#define ACPI_PHYSMODE_PHYSPTR ACPI_PHYSICAL_ADDRESSING | ACPI_PHYSICAL_POINTER -#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER -#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER - - -/* - * Useful defines - */ -#ifdef FALSE -#undef FALSE -#endif -#define FALSE (1 == 0) - -#ifdef TRUE -#undef TRUE -#endif -#define TRUE (1 == 1) - -#ifndef NULL -#define NULL (void *) 0 -#endif - - -/* - * Local datatypes - */ -typedef u32 acpi_status; /* All ACPI Exceptions */ -typedef u32 acpi_name; /* 4-byte ACPI name */ -typedef char * acpi_string; /* Null terminated ASCII string */ -typedef void * acpi_handle; /* Actually a ptr to an Node */ - -struct uint64_struct -{ - u32 lo; - u32 hi; -}; - -union uint64_overlay -{ - u64 full; - struct uint64_struct part; -}; - -struct uint32_struct -{ - u32 lo; - u32 hi; -}; - - -/* - * Acpi integer width. In ACPI version 1, integers are - * 32 bits. In ACPI version 2, integers are 64 bits. - * Note that this pertains to the ACPI integer type only, not - * other integers used in the implementation of the ACPI CA - * subsystem. - */ -#ifdef ACPI_NO_INTEGER64_SUPPORT - -/* 32-bit integers only, no 64-bit support */ - -typedef u32 acpi_integer; -#define ACPI_INTEGER_MAX ACPI_UINT32_MAX -#define ACPI_INTEGER_BIT_SIZE 32 -#define ACPI_MAX_BCD_VALUE 99999999 -#define ACPI_MAX_BCD_DIGITS 8 -#define ACPI_MAX_DECIMAL_DIGITS 10 - -#define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 32-bit divide */ - - -#else - -/* 64-bit integers */ - -typedef u64 acpi_integer; -#define ACPI_INTEGER_MAX ACPI_UINT64_MAX -#define ACPI_INTEGER_BIT_SIZE 64 -#define ACPI_MAX_BCD_VALUE 9999999999999999 -#define ACPI_MAX_BCD_DIGITS 16 -#define ACPI_MAX_DECIMAL_DIGITS 19 - -#if ACPI_MACHINE_WIDTH == 64 -#define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 64-bit divide */ -#endif -#endif - - -/* - * Constants with special meanings - */ -#define ACPI_ROOT_OBJECT (acpi_handle) ACPI_PTR_ADD (char, NULL, ACPI_MAX_PTR) - - -/* - * Initialization sequence - */ -#define ACPI_FULL_INITIALIZATION 0x00 -#define ACPI_NO_ADDRESS_SPACE_INIT 0x01 -#define ACPI_NO_HARDWARE_INIT 0x02 -#define ACPI_NO_EVENT_INIT 0x04 -#define ACPI_NO_HANDLER_INIT 0x08 -#define ACPI_NO_ACPI_ENABLE 0x10 -#define ACPI_NO_DEVICE_INIT 0x20 -#define ACPI_NO_OBJECT_INIT 0x40 - -/* - * Initialization state - */ -#define ACPI_INITIALIZED_OK 0x01 - -/* - * Power state values - */ - -#define ACPI_STATE_UNKNOWN (u8) 0xFF - -#define ACPI_STATE_S0 (u8) 0 -#define ACPI_STATE_S1 (u8) 1 -#define ACPI_STATE_S2 (u8) 2 -#define ACPI_STATE_S3 (u8) 3 -#define ACPI_STATE_S4 (u8) 4 -#define ACPI_STATE_S5 (u8) 5 -#define ACPI_S_STATES_MAX ACPI_STATE_S5 -#define ACPI_S_STATE_COUNT 6 - -#define ACPI_STATE_D0 (u8) 0 -#define ACPI_STATE_D1 (u8) 1 -#define ACPI_STATE_D2 (u8) 2 -#define ACPI_STATE_D3 (u8) 3 -#define ACPI_D_STATES_MAX ACPI_STATE_D3 -#define ACPI_D_STATE_COUNT 4 - -#define ACPI_STATE_C0 (u8) 0 -#define ACPI_STATE_C1 (u8) 1 -#define ACPI_STATE_C2 (u8) 2 -#define ACPI_STATE_C3 (u8) 3 -#define ACPI_C_STATES_MAX ACPI_STATE_C3 -#define ACPI_C_STATE_COUNT 4 - -/* - * Sleep type invalid value - */ -#define ACPI_SLEEP_TYPE_MAX 0x7 -#define ACPI_SLEEP_TYPE_INVALID 0xFF - -/* - * Standard notify values - */ -#define ACPI_NOTIFY_BUS_CHECK (u8) 0 -#define ACPI_NOTIFY_DEVICE_CHECK (u8) 1 -#define ACPI_NOTIFY_DEVICE_WAKE (u8) 2 -#define ACPI_NOTIFY_EJECT_REQUEST (u8) 3 -#define ACPI_NOTIFY_DEVICE_CHECK_LIGHT (u8) 4 -#define ACPI_NOTIFY_FREQUENCY_MISMATCH (u8) 5 -#define ACPI_NOTIFY_BUS_MODE_MISMATCH (u8) 6 -#define ACPI_NOTIFY_POWER_FAULT (u8) 7 - - -/* - * Table types. These values are passed to the table related APIs - */ -typedef u32 acpi_table_type; - -#define ACPI_TABLE_RSDP (acpi_table_type) 0 -#define ACPI_TABLE_DSDT (acpi_table_type) 1 -#define ACPI_TABLE_FADT (acpi_table_type) 2 -#define ACPI_TABLE_FACS (acpi_table_type) 3 -#define ACPI_TABLE_PSDT (acpi_table_type) 4 -#define ACPI_TABLE_SSDT (acpi_table_type) 5 -#define ACPI_TABLE_XSDT (acpi_table_type) 6 -#define ACPI_TABLE_MAX 6 -#define NUM_ACPI_TABLES (ACPI_TABLE_MAX+1) - - -/* - * Types associated with ACPI names and objects. The first group of - * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition - * of the ACPI object_type() operator (See the ACPI Spec). Therefore, - * only add to the first group if the spec changes. - * - * Types must be kept in sync with the global acpi_ns_properties - * and acpi_ns_type_names arrays. - */ -typedef u32 acpi_object_type; - -#define ACPI_TYPE_ANY 0x00 -#define ACPI_TYPE_INTEGER 0x01 /* Byte/Word/Dword/Zero/One/Ones */ -#define ACPI_TYPE_STRING 0x02 -#define ACPI_TYPE_BUFFER 0x03 -#define ACPI_TYPE_PACKAGE 0x04 /* byte_const, multiple data_term/Constant/super_name */ -#define ACPI_TYPE_FIELD_UNIT 0x05 -#define ACPI_TYPE_DEVICE 0x06 /* Name, multiple Node */ -#define ACPI_TYPE_EVENT 0x07 -#define ACPI_TYPE_METHOD 0x08 /* Name, byte_const, multiple Code */ -#define ACPI_TYPE_MUTEX 0x09 -#define ACPI_TYPE_REGION 0x0A -#define ACPI_TYPE_POWER 0x0B /* Name,byte_const,word_const,multi Node */ -#define ACPI_TYPE_PROCESSOR 0x0C /* Name,byte_const,Dword_const,byte_const,multi nm_o */ -#define ACPI_TYPE_THERMAL 0x0D /* Name, multiple Node */ -#define ACPI_TYPE_BUFFER_FIELD 0x0E -#define ACPI_TYPE_DDB_HANDLE 0x0F -#define ACPI_TYPE_DEBUG_OBJECT 0x10 - -#define ACPI_TYPE_EXTERNAL_MAX 0x10 - -/* - * These are object types that do not map directly to the ACPI - * object_type() operator. They are used for various internal purposes only. - * If new predefined ACPI_TYPEs are added (via the ACPI specification), these - * internal types must move upwards. (There is code that depends on these - * values being contiguous with the external types above.) - */ -#define ACPI_TYPE_LOCAL_REGION_FIELD 0x11 -#define ACPI_TYPE_LOCAL_BANK_FIELD 0x12 -#define ACPI_TYPE_LOCAL_INDEX_FIELD 0x13 -#define ACPI_TYPE_LOCAL_REFERENCE 0x14 /* Arg#, Local#, Name, Debug, ref_of, Index */ -#define ACPI_TYPE_LOCAL_ALIAS 0x15 -#define ACPI_TYPE_LOCAL_NOTIFY 0x16 -#define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x17 -#define ACPI_TYPE_LOCAL_RESOURCE 0x18 -#define ACPI_TYPE_LOCAL_RESOURCE_FIELD 0x19 -#define ACPI_TYPE_LOCAL_SCOPE 0x1A /* 1 Name, multiple object_list Nodes */ - -#define ACPI_TYPE_NS_NODE_MAX 0x1A /* Last typecode used within a NS Node */ - -/* - * These are special object types that never appear in - * a Namespace node, only in an union acpi_operand_object - */ -#define ACPI_TYPE_LOCAL_EXTRA 0x1B -#define ACPI_TYPE_LOCAL_DATA 0x1C - -#define ACPI_TYPE_LOCAL_MAX 0x1C - -/* All types above here are invalid */ - -#define ACPI_TYPE_INVALID 0x1D -#define ACPI_TYPE_NOT_FOUND 0xFF - - -/* - * Bitmapped ACPI types. Used internally only - */ -#define ACPI_BTYPE_ANY 0x00000000 -#define ACPI_BTYPE_INTEGER 0x00000001 -#define ACPI_BTYPE_STRING 0x00000002 -#define ACPI_BTYPE_BUFFER 0x00000004 -#define ACPI_BTYPE_PACKAGE 0x00000008 -#define ACPI_BTYPE_FIELD_UNIT 0x00000010 -#define ACPI_BTYPE_DEVICE 0x00000020 -#define ACPI_BTYPE_EVENT 0x00000040 -#define ACPI_BTYPE_METHOD 0x00000080 -#define ACPI_BTYPE_MUTEX 0x00000100 -#define ACPI_BTYPE_REGION 0x00000200 -#define ACPI_BTYPE_POWER 0x00000400 -#define ACPI_BTYPE_PROCESSOR 0x00000800 -#define ACPI_BTYPE_THERMAL 0x00001000 -#define ACPI_BTYPE_BUFFER_FIELD 0x00002000 -#define ACPI_BTYPE_DDB_HANDLE 0x00004000 -#define ACPI_BTYPE_DEBUG_OBJECT 0x00008000 -#define ACPI_BTYPE_REFERENCE 0x00010000 -#define ACPI_BTYPE_RESOURCE 0x00020000 - -#define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER) - -#define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) -#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE) -#define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) -#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ -#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF - -/* - * All I/O - */ -#define ACPI_READ 0 -#define ACPI_WRITE 1 -#define ACPI_IO_MASK 1 - - -/* - * acpi_event Types: Fixed & General Purpose - */ -typedef u32 acpi_event_type; - -#define ACPI_EVENT_FIXED 0 -#define ACPI_EVENT_GPE 1 - -/* - * Fixed events - */ -#define ACPI_EVENT_PMTIMER 0 -#define ACPI_EVENT_GLOBAL 1 -#define ACPI_EVENT_POWER_BUTTON 2 -#define ACPI_EVENT_SLEEP_BUTTON 3 -#define ACPI_EVENT_RTC 4 -#define ACPI_EVENT_MAX 4 -#define ACPI_NUM_FIXED_EVENTS ACPI_EVENT_MAX + 1 - -#define ACPI_GPE_INVALID 0xFF -#define ACPI_GPE_MAX 0xFF -#define ACPI_NUM_GPE 256 - -#define ACPI_EVENT_LEVEL_TRIGGERED 1 -#define ACPI_EVENT_EDGE_TRIGGERED 2 - -/* - * GPEs - */ -#define ACPI_EVENT_WAKE_ENABLE 0x1 -#define ACPI_EVENT_WAKE_DISABLE 0x1 - - -/* - * acpi_event Status: - * ------------- - * The encoding of acpi_event_status is illustrated below. - * Note that a set bit (1) indicates the property is TRUE - * (e.g. if bit 0 is set then the event is enabled). - * +-------------+-+-+-+ - * | Bits 31:3 |2|1|0| - * +-------------+-+-+-+ - * | | | | - * | | | +- Enabled? - * | | +--- Enabled for wake? - * | +----- Set? - * +----------- - */ -typedef u32 acpi_event_status; - -#define ACPI_EVENT_FLAG_DISABLED (acpi_event_status) 0x00 -#define ACPI_EVENT_FLAG_ENABLED (acpi_event_status) 0x01 -#define ACPI_EVENT_FLAG_WAKE_ENABLED (acpi_event_status) 0x02 -#define ACPI_EVENT_FLAG_SET (acpi_event_status) 0x04 - - -/* Notify types */ - -#define ACPI_SYSTEM_NOTIFY 0 -#define ACPI_DEVICE_NOTIFY 1 -#define ACPI_MAX_NOTIFY_HANDLER_TYPE 1 - -#define ACPI_MAX_SYS_NOTIFY 0x7f - - -/* Address Space (Operation Region) Types */ - -typedef u8 acpi_adr_space_type; - -#define ACPI_ADR_SPACE_SYSTEM_MEMORY (acpi_adr_space_type) 0 -#define ACPI_ADR_SPACE_SYSTEM_IO (acpi_adr_space_type) 1 -#define ACPI_ADR_SPACE_PCI_CONFIG (acpi_adr_space_type) 2 -#define ACPI_ADR_SPACE_EC (acpi_adr_space_type) 3 -#define ACPI_ADR_SPACE_SMBUS (acpi_adr_space_type) 4 -#define ACPI_ADR_SPACE_CMOS (acpi_adr_space_type) 5 -#define ACPI_ADR_SPACE_PCI_BAR_TARGET (acpi_adr_space_type) 6 -#define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 7 -#define ACPI_ADR_SPACE_FIXED_HARDWARE (acpi_adr_space_type) 127 - - -/* - * bit_register IDs - * These are bitfields defined within the full ACPI registers - */ -#define ACPI_BITREG_TIMER_STATUS 0x00 -#define ACPI_BITREG_BUS_MASTER_STATUS 0x01 -#define ACPI_BITREG_GLOBAL_LOCK_STATUS 0x02 -#define ACPI_BITREG_POWER_BUTTON_STATUS 0x03 -#define ACPI_BITREG_SLEEP_BUTTON_STATUS 0x04 -#define ACPI_BITREG_RT_CLOCK_STATUS 0x05 -#define ACPI_BITREG_WAKE_STATUS 0x06 - -#define ACPI_BITREG_TIMER_ENABLE 0x07 -#define ACPI_BITREG_GLOBAL_LOCK_ENABLE 0x08 -#define ACPI_BITREG_POWER_BUTTON_ENABLE 0x09 -#define ACPI_BITREG_SLEEP_BUTTON_ENABLE 0x0A -#define ACPI_BITREG_RT_CLOCK_ENABLE 0x0B -#define ACPI_BITREG_WAKE_ENABLE 0x0C - -#define ACPI_BITREG_SCI_ENABLE 0x0D -#define ACPI_BITREG_BUS_MASTER_RLD 0x0E -#define ACPI_BITREG_GLOBAL_LOCK_RELEASE 0x0F -#define ACPI_BITREG_SLEEP_TYPE_A 0x10 -#define ACPI_BITREG_SLEEP_TYPE_B 0x11 -#define ACPI_BITREG_SLEEP_ENABLE 0x12 - -#define ACPI_BITREG_ARB_DISABLE 0x13 - -#define ACPI_BITREG_MAX 0x13 -#define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1 - - -/* - * External ACPI object definition - */ -union acpi_object -{ - acpi_object_type type; /* See definition of acpi_ns_type for values */ - struct - { - acpi_object_type type; - acpi_integer value; /* The actual number */ - } integer; - - struct - { - acpi_object_type type; - u32 length; /* # of bytes in string, excluding trailing null */ - char *pointer; /* points to the string value */ - } string; - - struct - { - acpi_object_type type; - u32 length; /* # of bytes in buffer */ - u8 *pointer; /* points to the buffer */ - } buffer; - - struct - { - acpi_object_type type; - u32 fill1; - acpi_handle handle; /* object reference */ - } reference; - - struct - { - acpi_object_type type; - u32 count; /* # of elements in package */ - union acpi_object *elements; /* Pointer to an array of ACPI_OBJECTs */ - } package; - - struct - { - acpi_object_type type; - u32 proc_id; - acpi_io_address pblk_address; - u32 pblk_length; - } processor; - - struct - { - acpi_object_type type; - u32 system_level; - u32 resource_order; - } power_resource; -}; - - -/* - * List of objects, used as a parameter list for control method evaluation - */ -struct acpi_object_list -{ - u32 count; - union acpi_object *pointer; -}; - - -/* - * Miscellaneous common Data Structures used by the interfaces - */ -#define ACPI_NO_BUFFER 0 -#define ACPI_ALLOCATE_BUFFER (acpi_size) (-1) -#define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2) - -struct acpi_buffer -{ - acpi_size length; /* Length in bytes of the buffer */ - void *pointer; /* pointer to buffer */ -}; - - -/* - * name_type for acpi_get_name - */ -#define ACPI_FULL_PATHNAME 0 -#define ACPI_SINGLE_NAME 1 -#define ACPI_NAME_TYPE_MAX 1 - - -/* - * Structure and flags for acpi_get_system_info - */ -#define ACPI_SYS_MODE_UNKNOWN 0x0000 -#define ACPI_SYS_MODE_ACPI 0x0001 -#define ACPI_SYS_MODE_LEGACY 0x0002 -#define ACPI_SYS_MODES_MASK 0x0003 - - -/* - * ACPI Table Info. One per ACPI table _type_ - */ -struct acpi_table_info -{ - u32 count; -}; - - -/* - * System info returned by acpi_get_system_info() - */ -struct acpi_system_info -{ - u32 acpi_ca_version; - u32 flags; - u32 timer_resolution; - u32 reserved1; - u32 reserved2; - u32 debug_level; - u32 debug_layer; - u32 num_table_types; - struct acpi_table_info table_info [NUM_ACPI_TABLES]; -}; - - -/* - * Various handlers and callback procedures - */ -typedef -u32 (*acpi_event_handler) ( - void *context); - -typedef -void (*acpi_gpe_handler) ( - void *context); - -typedef -void (*acpi_notify_handler) ( - acpi_handle device, - u32 value, - void *context); - -typedef -void (*acpi_object_handler) ( - acpi_handle object, - u32 function, - void *data); - -typedef -acpi_status (*acpi_init_handler) ( - acpi_handle object, - u32 function); - -#define ACPI_INIT_DEVICE_INI 1 - - -/* Address Spaces (Operation Regions */ - -typedef -acpi_status (*acpi_adr_space_handler) ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - -#define ACPI_DEFAULT_HANDLER NULL - - -typedef -acpi_status (*acpi_adr_space_setup) ( - acpi_handle region_handle, - u32 function, - void *handler_context, - void **region_context); - -#define ACPI_REGION_ACTIVATE 0 -#define ACPI_REGION_DEACTIVATE 1 - -typedef -acpi_status (*acpi_walk_callback) ( - acpi_handle obj_handle, - u32 nesting_level, - void *context, - void **return_value); - - -/* Interrupt handler return values */ - -#define ACPI_INTERRUPT_NOT_HANDLED 0x00 -#define ACPI_INTERRUPT_HANDLED 0x01 - - -/* Structure and flags for acpi_get_device_info */ - -#define ACPI_VALID_HID 0x1 -#define ACPI_VALID_UID 0x2 -#define ACPI_VALID_ADR 0x4 -#define ACPI_VALID_STA 0x8 - - -#define ACPI_COMMON_OBJ_INFO \ - acpi_object_type type; /* ACPI object type */ \ - acpi_name name /* ACPI object Name */ - - -struct acpi_obj_info_header -{ - ACPI_COMMON_OBJ_INFO; -}; - - -struct acpi_device_info -{ - ACPI_COMMON_OBJ_INFO; - - u32 valid; /* Are the next bits legit? */ - char