# 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.60 -> 1.1060 # drivers/net/8139too.c 1.49 -> 1.50 # drivers/acpi/namespace/nsxfobj.c 1.16 -> 1.17 # drivers/media/video/saa7110.c 1.7 -> 1.8 # net/ipv4/netfilter/ip_conntrack_core.c 1.15 -> 1.16 # arch/ppc64/kernel/signal.c 1.25 -> 1.26 # include/acpi/acpixf.h 1.16 -> 1.17 # drivers/net/3c59x.c 1.28 -> 1.29 # drivers/acpi/resources/rsio.c 1.11 -> 1.12 # arch/sparc64/kernel/signal32.c 1.26 -> 1.27 # arch/i386/kernel/timers/Makefile 1.5 -> 1.6 # arch/i386/kernel/cpu/cpufreq/speedstep.c 1.10 -> 1.11 # include/asm-x86_64/smp.h 1.4 -> 1.5 # drivers/input/keyboard/sunkbd.c 1.8 -> 1.10 # net/ipv4/netfilter/arptable_filter.c 1.1 -> 1.2 # drivers/media/dvb/av7110/av7110.c 1.3 -> 1.5 # drivers/input/keyboard/newtonkbd.c 1.6 -> 1.7 # drivers/media/video/saa7134/saa7134-tvaudio.c 1.3 -> 1.4 # drivers/usb/input/hid.h 1.21 -> 1.23 # drivers/acpi/namespace/nsdumpdv.c 1.6 -> 1.7 # drivers/input/joystick/stinger.c 1.8 -> 1.9 # drivers/net/irda/smc-ircc.c 1.15 -> 1.16 # drivers/scsi/ips.c 1.43 -> 1.47 # drivers/scsi/scsi_error.c 1.33 -> 1.34 # drivers/acpi/executer/exoparg3.c 1.8 -> 1.9 # include/asm-sparc64/system.h 1.23 -> 1.24 # fs/jffs2/background.c 1.16 -> 1.18 # net/bluetooth/rfcomm/core.c 1.8 -> 1.9 # drivers/acpi/hardware/hwacpi.c 1.13 -> 1.14 # drivers/acpi/event.c 1.3 -> 1.4 # arch/x86_64/kernel/traps.c 1.15 -> 1.16 # fs/nfsd/nfssvc.c 1.32 -> 1.33 # drivers/scsi/aic7xxx/aic79xx_osm.c 1.17 -> 1.19 # arch/x86_64/kernel/process.c 1.12 -> 1.13 # arch/x86_64/mm/fault.c 1.9 -> 1.10 # drivers/acpi/sleep.c 1.11 -> 1.20 drivers/acpi/sleep/main.c (moved) # sound/pci/korg1212/korg1212.c 1.16 -> 1.17 # drivers/char/n_tty.c 1.10 -> 1.11 # kernel/ksyms.c 1.181 -> 1.183 # fs/sysv/inode.c 1.25 -> 1.26 # include/asm-i386/msr.h 1.11 -> 1.12 # drivers/acpi/blacklist.c 1.5 -> 1.6 # drivers/input/joystick/magellan.c 1.10 -> 1.11 # drivers/input/joystick/iforce/iforce-serio.c 1.2 -> 1.3 # net/rxrpc/krxiod.c 1.3 -> 1.4 # include/asm-x86_64/signal.h 1.5 -> 1.6 # include/acpi/acpiosxf.h 1.20 -> 1.21 # arch/x86_64/ia32/fpu32.c 1.4 -> 1.5 # drivers/oprofile/cpu_buffer.c 1.4 -> 1.5 # include/net/sctp/user.h 1.4 -> 1.5 # arch/arm/kernel/signal.c 1.19 -> 1.20 # net/ipv4/proc.c 1.9 -> 1.10 # drivers/net/tulip/de4x5.c 1.21 -> 1.23 # include/linux/jiffies.h 1.5 -> 1.6 # drivers/acpi/dispatcher/dsobject.c 1.21 -> 1.22 # drivers/acpi/hardware/hwgpe.c 1.13 -> 1.14 # drivers/input/serio/serio.c 1.12 -> 1.14 # include/linux/buffer_head.h 1.37 -> 1.38 # drivers/pnp/pnpbios/core.c 1.21 -> 1.22 # drivers/mtd/devices/blkmtd.c 1.24 -> 1.25 # fs/xfs/pagebuf/page_buf.c 1.37 -> 1.38 # drivers/net/3c509.c 1.30 -> 1.31 # net/sctp/associola.c 1.18 -> 1.26 # drivers/input/serio/ct82c710.c 1.4 -> 1.5 # drivers/acpi/button.c 1.16 -> 1.17 # drivers/acpi/executer/exconvrt.c 1.18 -> 1.19 # arch/x86_64/kernel/setup.c 1.8 -> 1.9 # drivers/input/serio/parkbd.c 1.3 -> 1.4 # include/asm-x86_64/page.h 1.7 -> 1.8 # drivers/char/agp/sis-agp.c 1.13 -> 1.14 # drivers/input/serio/rpckbd.c 1.7 -> 1.8 # drivers/input/joystick/spaceball.c 1.10 -> 1.11 # arch/cris/kernel/signal.c 1.9 -> 1.10 # arch/i386/kernel/apm.c 1.43 -> 1.46 # arch/x86_64/vmlinux.lds.S 1.12 -> 1.13 # arch/i386/kernel/cpu/cpufreq/longhaul.c 1.8 -> 1.9 # drivers/ide/pci/amd74xx.h 1.5 -> 1.6 # drivers/acpi/parser/psscope.c 1.9 -> 1.10 # drivers/acpi/executer/exfield.c 1.16 -> 1.17 # drivers/usb/input/wacom.c 1.25 -> 1.27 # include/asm-i386/fixmap.h 1.10 -> 1.11 # net/sctp/objcnt.c 1.4 -> 1.5 # include/asm-x86_64/current.h 1.2 -> 1.3 # net/sctp/input.c 1.14.1.1 -> 1.20 # arch/parisc/oprofile/timer_int.c 1.1 -> 1.3 # drivers/acpi/toshiba_acpi.c 1.5 -> 1.7 # drivers/acpi/fan.c 1.10 -> 1.11 # net/x25/x25_link.c 1.8 -> 1.9 # net/sunrpc/sysctl.c 1.2 -> 1.3 # net/sctp/sm_statefuns.c 1.27 -> 1.31 # drivers/char/ftape/lowlevel/ftape-read.c 1.2 -> 1.3 # drivers/scsi/aic7xxx/aic7xxx_osm.c 1.16 -> 1.17 # fs/ext2/inode.c 1.61 -> 1.62 # drivers/char/watchdog/pcwd.c 1.16 -> 1.19 # drivers/acpi/utilities/uteval.c 1.15 -> 1.16 # drivers/acpi/dispatcher/dswload.c 1.20 -> 1.21 # drivers/acpi/resources/rsutils.c 1.12 -> 1.13 # net/ipv6/netfilter/ip6table_filter.c 1.3 -> 1.4 # include/asm-ppc/signal.h 1.5 -> 1.6 # drivers/acpi/utilities/utmisc.c 1.20 -> 1.21 # net/ipv6/sysctl_net_ipv6.c 1.4 -> 1.5 # include/linux/ext3_jbd.h 1.8 -> 1.9 # drivers/acpi/events/evrgnini.c 1.13 -> 1.14 # drivers/acpi/hardware/hwsleep.c 1.14 -> 1.15 # drivers/input/serio/i8042.c 1.22 -> 1.23 # drivers/input/joystick/twidjoy.c 1.5 -> 1.6 # drivers/acpi/pci_link.c 1.11 -> 1.12 # drivers/acpi/executer/exdump.c 1.17 -> 1.18 # drivers/char/agp/i7x05-agp.c 1.7 -> 1.8 # drivers/net/wan/comx-hw-comx.c 1.8 -> 1.9 # include/linux/sched.h 1.128 -> 1.131 # kernel/sys.c 1.40 -> 1.42 # drivers/block/ll_rw_blk.c 1.149 -> 1.151 # drivers/net/Space.c 1.16 -> 1.17 # drivers/acpi/namespace/nsparse.c 1.5 -> 1.6 # Makefile 1.370 -> 1.372 # drivers/acpi/dispatcher/dsfield.c 1.15 -> 1.16 # drivers/acpi/events/evregion.c 1.14 -> 1.15 # include/linux/hfs_sysdep.h 1.8 -> 1.9 # include/asm-x86_64/e820.h 1.3 -> 1.4 # drivers/acpi/executer/exstoren.c 1.15 -> 1.16 # drivers/acpi/utilities/utglobal.c 1.21 -> 1.22 # net/rxrpc/krxtimod.c 1.3 -> 1.4 # include/net/tcp.h 1.29 -> 1.30 # drivers/acpi/hardware/hwtimer.c 1.12 -> 1.13 # drivers/s390/net/lcs.c 1.9 -> 1.10 # include/asm-ia64/signal.h 1.8 -> 1.9 # drivers/acpi/utilities/utalloc.c 1.13 -> 1.14 # fs/ext3/xattr_user.c 1.2 -> 1.3 # include/asm-i386/module.h 1.4 -> 1.5 # drivers/acpi/utilities/utxface.c 1.14 -> 1.15 # arch/x86_64/kernel/acpi.c 1.3 -> 1.4 # drivers/oprofile/event_buffer.h 1.2 -> 1.3 # net/sctp/endpointola.c 1.10 -> 1.13 # include/linux/keyboard.h 1.3 -> 1.4 # mm/vmscan.c 1.146 -> 1.148 # arch/i386/kernel/cpu/cpufreq/powernow-k6.c 1.9 -> 1.10 # drivers/char/agp/frontend.c 1.26 -> 1.28 # drivers/acpi/executer/exregion.c 1.13 -> 1.14 # arch/sparc/Makefile 1.19 -> 1.20 # drivers/scsi/sym53c416.c 1.10 -> 1.11 # drivers/input/mouse/amimouse.c 1.6 -> 1.7 # net/sctp/sm_make_chunk.c 1.20 -> 1.25 # drivers/i2c/i2c-core.c 1.15 -> 1.16 # arch/x86_64/kernel/apic.c 1.9 -> 1.10 # drivers/char/agp/generic-3.0.c 1.5 -> 1.7 # arch/i386/Kconfig 1.36 -> 1.38 # drivers/acpi/parser/psopcode.c 1.17 -> 1.18 # fs/jfs/jfs_imap.c 1.19 -> 1.20 # drivers/acpi/events/evxfregn.c 1.12 -> 1.13 # drivers/sbus/char/envctrl.c 1.10 -> 1.11 # drivers/oprofile/oprof.h 1.2 -> 1.3 # fs/jbd/journal.c 1.25 -> 1.28 # include/asm-i386/signal.h 1.5 -> 1.6 # drivers/acpi/parser/psparse.c 1.19 -> 1.20 # arch/x86_64/kernel/msr.c 1.5 -> 1.6 # net/sctp/ulpevent.c 1.7 -> 1.10 # fs/devfs/base.c 1.69 -> 1.70 # arch/i386/kernel/Makefile 1.33 -> 1.34 # include/linux/signal.h 1.7 -> 1.8 # kernel/pm.c 1.6 -> 1.7 # drivers/char/watchdog/machzwd.c 1.14 -> 1.15 # net/bluetooth/af_bluetooth.c 1.11 -> 1.12 # arch/i386/kernel/acpi_wakeup.S 1.11 -> 1.13 arch/i386/kernel/acpi/wakeup.S (moved) # drivers/char/watchdog/sc1200wdt.c 1.3 -> 1.7 # drivers/acpi/executer/exprep.c 1.15 -> 1.16 # drivers/acpi/executer/exutils.c 1.17 -> 1.18 # fs/ufs/inode.c 1.18 -> 1.19 # net/sctp/transport.c 1.11 -> 1.15 # drivers/serial/sunsu.c 1.28 -> 1.29 # arch/x86_64/mm/init.c 1.15 -> 1.16 # net/sctp/Kconfig 1.1.1.1 -> 1.3 # net/sctp/output.c 1.12 -> 1.17 # arch/parisc/kernel/signal32.c 1.3 -> 1.4 # kernel/cpufreq.c 1.14 -> 1.15 # kernel/time.c 1.9 -> 1.10 # include/acpi/platform/acenv.h 1.14 -> 1.15 # lib/radix-tree.c 1.12 -> 1.13 # drivers/i2c/i2c-adap-ite.c 1.8 -> 1.9 # drivers/net/fc/iph5526.c 1.14 -> 1.15 # arch/i386/oprofile/op_x86_model.h 1.1 -> 1.2 # drivers/block/nbd.c 1.49 -> 1.50 # drivers/acpi/tables/tbinstal.c 1.16 -> 1.17 # drivers/input/mouse/psmouse.c 1.19 -> 1.21 # drivers/acpi/namespace/nsxfname.c 1.13 -> 1.14 # drivers/acpi/executer/exresnte.c 1.18 -> 1.19 # drivers/media/dvb/dvb-core/dvb_frontend.c 1.2 -> 1.3 # net/rxrpc/krxsecd.c 1.4 -> 1.5 # drivers/scsi/ips.h 1.22 -> 1.25 # kernel/softirq.c 1.32 -> 1.33 # net/key/af_key.c 1.12 -> 1.20 # drivers/net/starfire.c 1.23 -> 1.24 # arch/x86_64/kernel/smp.c 1.10 -> 1.11 # drivers/oprofile/oprof.c 1.3 -> 1.4 # include/linux/hiddev.h 1.7 -> 1.8 # arch/x86_64/boot/tools/build.c 1.1 -> 1.2 # include/asm-sparc64/signal.h 1.6 -> 1.7 # arch/mips64/kernel/signal.c 1.7 -> 1.8 # drivers/usb/storage/usb.c 1.56 -> 1.57 # fs/jfs/jfs_mount.c 1.13 -> 1.14 # drivers/input/serio/q40kbd.c 1.6 -> 1.7 # arch/alpha/kernel/init_task.c 1.2 -> 1.3 # drivers/acpi/pci_root.c 1.12 -> 1.13 # net/rxrpc/internal.h 1.3 -> 1.4 # drivers/acpi/resources/rsmisc.c 1.9 -> 1.10 # drivers/oprofile/buffer_sync.c 1.6 -> 1.7 # fs/sysv/itree.c 1.18 -> 1.19 # drivers/hotplug/ibmphp_hpc.c 1.8 -> 1.9 # include/asm-sparc/page.h 1.7 -> 1.8 # include/net/sctp/sctp.h 1.16 -> 1.21 # arch/x86_64/kernel/e820.c 1.2 -> 1.3 # arch/i386/kernel/ptrace.c 1.18 -> 1.19 # net/ipv6/netfilter/ip6_queue.c 1.5 -> 1.6 # arch/x86_64/kernel/setup64.c 1.8 -> 1.9 # drivers/acpi/events/evxfevnt.c 1.12 -> 1.13 # drivers/md/md.c 1.134 -> 1.135 # kernel/kmod.c 1.20 -> 1.22 # drivers/acpi/parser/pstree.c 1.11 -> 1.12 # include/net/sctp/ulpqueue.h 1.4 -> 1.5 # fs/jbd/transaction.c 1.25 -> 1.28 # net/sunrpc/rpc_pipe.c 1.3 -> 1.5 # drivers/acpi/parser/psargs.c 1.14 -> 1.15 # drivers/scsi/u14-34f.c 1.22 -> 1.23 # arch/ppc64/kernel/rtasd.c 1.8 -> 1.9 # drivers/acpi/executer/exnames.c 1.11 -> 1.12 # drivers/input/misc/gsc_ps2.c 1.1 -> 1.2 # drivers/char/agp/Makefile 1.15 -> 1.17 # drivers/acpi/executer/exfldio.c 1.19 -> 1.20 # arch/x86_64/kernel/mpparse.c 1.5 -> 1.6 # net/irda/ircomm/ircomm_tty.c 1.15 -> 1.16 # sound/oss/rme96xx.h 1.2 -> 1.3 # arch/cris/drivers/usb-host.c 1.10 -> 1.11 # net/sctp/outqueue.c 1.11 -> 1.17 # include/asm-mips/signal.h 1.2 -> 1.3 # drivers/media/video/tvaudio.c 1.12 -> 1.13 # arch/i386/kernel/io_apic.c 1.41 -> 1.43 # include/asm-sparc/cacheflush.h 1.1 -> 1.2 # drivers/input/mouse/pc110pad.c 1.5 -> 1.6 # fs/ext3/acl.c 1.2 -> 1.3 # net/sctp/debug.c 1.6 -> 1.8 # include/net/sctp/constants.h 1.5 -> 1.9 # drivers/acpi/acpi_ksyms.c 1.20 -> 1.21 # fs/reiserfs/resize.c 1.10 -> 1.11 # drivers/acpi/resources/rscreate.c 1.15 -> 1.16 # arch/i386/oprofile/timer_int.c 1.2 -> 1.4 # drivers/input/touchscreen/gunze.c 1.5 -> 1.6 # drivers/hotplug/cpqphp_ctrl.c 1.8 -> 1.9 # drivers/char/agp/generic.c 1.15 -> 1.19 # drivers/acorn/char/keyb_arc.c 1.4 -> 1.5 # arch/i386/Makefile 1.43 -> 1.44 # arch/x86_64/kernel/entry.S 1.8 -> 1.9 # kernel/user.c 1.5 -> 1.6 # drivers/acpi/namespace/nsinit.c 1.18 -> 1.19 # net/ipv4/netfilter/iptable_filter.c 1.3 -> 1.4 # fs/ncpfs/sock.c 1.13 -> 1.14 # drivers/char/agp/sworks-agp.c 1.21 -> 1.22 # drivers/acpi/dispatcher/dsmthdat.c 1.17 -> 1.18 # sound/oss/rme96xx.c 1.9 -> 1.10 # net/core/sysctl_net_core.c 1.2 -> 1.3 # drivers/oprofile/oprofilefs.c 1.2 -> 1.4 # net/sctp/sysctl.c 1.5 -> 1.6 # include/asm-x86_64/pda.h 1.6 -> 1.7 # fs/exec.c 1.69 -> 1.70 # drivers/mtd/mtdblock.c 1.36 -> 1.37 # fs/ext2/balloc.c 1.26 -> 1.27 # arch/x86_64/boot/Makefile 1.13 -> 1.14 # arch/i386/mach-voyager/voyager_smp.c 1.5 -> 1.6 # net/unix/sysctl_net_unix.c 1.3 -> 1.4 # net/sunrpc/clnt.c 1.30 -> 1.31 # include/asm-v850/signal.h 1.2 -> 1.3 # fs/eventpoll.c 1.13 -> 1.14 # drivers/net/pcmcia/xirc2ps_cs.c 1.13 -> 1.14 # drivers/acpi/namespace/nsobject.c 1.15 -> 1.16 # drivers/acpi/executer/exresolv.c 1.17 -> 1.18 # net/ipv6/netfilter/ip6table_mangle.c 1.4 -> 1.5 # drivers/char/nvram.c 1.16 -> 1.17 # mm/fadvise.c 1.1 -> 1.2 # arch/parisc/kernel/binfmt_elf32.c 1.2 -> 1.3 # net/irda/irsysctl.c 1.8 -> 1.9 # kernel/signal.c 1.67 -> 1.71 # scripts/Makefile.modver 1.11 -> 1.12 # fs/afs/internal.h 1.3 -> 1.4 # drivers/char/keyboard.c 1.24 -> 1.28 # drivers/acpi/tables/tbconvrt.c 1.17 -> 1.18 # arch/x86_64/kernel/head64.c 1.4 -> 1.5 # net/ipv4/netfilter/ip_nat_rule.c 1.5 -> 1.6 # net/netsyms.c 1.46 -> 1.48 # arch/i386/kernel/cpu/cpufreq/elanfreq.c 1.8 -> 1.9 # drivers/acpi/namespace/nseval.c 1.17 -> 1.18 # drivers/char/sx.c 1.17 -> 1.18 # drivers/sbus/char/bbc_envctrl.c 1.3 -> 1.4 # drivers/acpi/scan.c 1.14 -> 1.16 # include/asm-x86_64/io.h 1.5 -> 1.6 # drivers/input/joystick/iforce/iforce.h 1.2 -> 1.3 # drivers/acpi/ac.c 1.13 -> 1.14 # drivers/usb/input/hid-input.c 1.13 -> 1.15 # include/asm-ppc64/signal.h 1.3 -> 1.4 # drivers/char/agp/agp.h 1.38 -> 1.41 # drivers/acpi/utilities/utcopy.c 1.20 -> 1.21 # drivers/usb/input/hiddev.c 1.26 -> 1.27 # include/linux/pc_keyb.h 1.1 -> (deleted) # drivers/input/misc/Kconfig 1.3 -> 1.4 # arch/sparc64/kernel/systbls.S 1.29 -> 1.30 # arch/x86_64/ia32/sys_ia32.c 1.16 -> 1.17 # drivers/acpi/executer/exstore.c 1.21 -> 1.22 # arch/x86_64/kernel/irq.c 1.7 -> 1.8 # drivers/net/sis900.c 1.30 -> 1.31 # drivers/hotplug/cpci_hotplug_core.c 1.3 -> 1.4 # include/asm-i386/mach-summit/mach_mpparse.h 1.3 -> 1.4 # drivers/scsi/aacraid/aachba.c 1.9 -> 1.10 # arch/sparc/mm/init.c 1.16 -> 1.17 # mm/swap_state.c 1.55 -> 1.56 # arch/x86_64/ia32/ipc32.c 1.5 -> 1.6 # include/linux/input.h 1.25 -> 1.26 # arch/i386/kernel/cpu/cpufreq/Makefile 1.4 -> 1.5 # drivers/input/mouse/rpcmouse.c 1.12 -> 1.13 # include/linux/eventpoll.h 1.6 -> 1.7 # drivers/input/joystick/spaceorb.c 1.9 -> 1.10 # arch/x86_64/ia32/ia32entry.S 1.9 -> 1.11 # drivers/char/ec3104_keyb.c 1.2 -> 1.3 # drivers/acpi/pci_irq.c 1.14 -> 1.15 # include/net/sctp/sm.h 1.16 -> 1.19 # arch/i386/kernel/signal.c 1.27 -> 1.28 # include/asm-x86_64/mpspec.h 1.3 -> 1.4 # arch/s390x/kernel/signal32.c 1.13 -> 1.14 # drivers/scsi/aic7xxx/aic7xxx_core.c 1.20 -> 1.21 # arch/x86_64/kernel/nmi.c 1.6 -> 1.7 # drivers/char/riscom8.c 1.8 -> 1.9 # fs/afs/cmservice.c 1.3 -> 1.4 # drivers/usb/core/hub.c 1.54 -> 1.55 # drivers/usb/input/hid-ff.c 1.3 -> 1.4 # drivers/block/genhd.c 1.68 -> 1.70 # drivers/scsi/aic7xxx/aic79xx_pci.c 1.3 -> 1.4 # drivers/acpi/dispatcher/dsutils.c 1.17 -> 1.18 # arch/alpha/kernel/signal.c 1.15 -> 1.17 # drivers/char/watchdog/sc520_wdt.c 1.3 -> 1.4 # arch/i386/kernel/smpboot.c 1.47 -> 1.50 # drivers/media/video/bttv-cards.c 1.13 -> 1.14 # arch/i386/kernel/cpu/cpufreq/gx-suspmod.c 1.2 -> 1.3 # drivers/acpi/utilities/utdelete.c 1.15 -> 1.16 # drivers/input/serio/sa1111ps2.c 1.5 -> 1.6 # drivers/char/agp/intel-agp.c 1.21 -> 1.22 # drivers/acpi/dispatcher/dsmethod.c 1.14 -> 1.15 # scripts/fixdep.c 1.11 -> 1.12 # include/linux/hugetlb.h 1.10 -> 1.11 # fs/nfs/nfs3proc.c 1.24 -> 1.25 # drivers/net/tokenring/smctr.c 1.15 -> 1.16 # drivers/isdn/hardware/eicon/i4l_idi.c 1.1 -> 1.2 # include/linux/spinlock.h 1.21 -> 1.22 # drivers/input/joydev.c 1.13 -> 1.14 # net/econet/af_econet.c 1.12 -> 1.13 # fs/ufs/truncate.c 1.15 -> 1.16 # scripts/Makefile.lib 1.13 -> 1.15 # arch/parisc/oprofile/init.c 1.1 -> 1.2 # net/irda/ircomm/ircomm_param.c 1.8 -> 1.9 # drivers/usb/input/xpad.c 1.12 -> 1.13 # drivers/acpi/namespace/nsutils.c 1.19 -> 1.20 # drivers/oprofile/oprofile_files.c 1.2 -> 1.3 # include/acpi/acpi.h 1.7 -> 1.8 # include/asm-x86_64/i387.h 1.5 -> 1.6 # drivers/input/mouse/logibm.c 1.7 -> 1.8 # arch/i386/oprofile/op_counter.h 1.1 -> 1.2 # fs/jfs/jfs_logmgr.c 1.43 -> 1.44 # include/asm-alpha/signal.h 1.5 -> 1.6 # drivers/acpi/executer/exoparg2.c 1.19 -> 1.20 # arch/mips64/kernel/signal32.c 1.8 -> 1.9 # fs/ext2/ialloc.c 1.28 -> 1.29 # drivers/input/mouse/inport.c 1.6 -> 1.7 # drivers/char/watchdog/wdt.c 1.16 -> 1.17 # drivers/acpi/namespace/nsalloc.c 1.14 -> 1.15 # arch/ia64/mm/hugetlbpage.c 1.7 -> 1.8 # fs/minix/inode.c 1.32 -> 1.33 # drivers/acpi/power.c 1.14 -> 1.15 # arch/x86_64/mm/hugetlbpage.c 1.5 -> 1.8 # include/asm-x86_64/pgalloc.h 1.5 -> 1.6 # drivers/acpi/resources/rsaddr.c 1.10 -> 1.11 # drivers/input/keyboard/xtkbd.c 1.6 -> 1.7 # drivers/input/joystick/iforce/iforce-packets.c 1.3 -> 1.4 # drivers/acpi/resources/rscalc.c 1.14 -> 1.15 # include/net/irda/wrapper.h 1.2 -> 1.3 # include/asm-m68knommu/signal.h 1.2 -> 1.3 # net/sunrpc/sched.c 1.21 -> 1.22 # include/asm-x86_64/dma-mapping.h 1.1 -> 1.2 # arch/i386/kernel/nmi.c 1.14 -> 1.15 # arch/x86_64/kernel/init_task.c 1.3 -> 1.4 # drivers/acpi/ec.c 1.19 -> 1.20 # include/asm-sh/signal.h 1.3 -> 1.4 # drivers/net/tg3.c 1.58 -> 1.59 # sound/oss/vwsnd.c 1.7 -> 1.8 # drivers/char/rio/rioroute.c 1.3 -> 1.4 # net/ipv6/tcp_ipv6.c 1.36 -> 1.37 # drivers/acpi/resources/rsdump.c 1.12 -> 1.13 # arch/um/kernel/signal_kern.c 1.12 -> 1.13 # fs/ext3/xattr.c 1.4 -> 1.5 # arch/sparc64/kernel/signal.c 1.24 -> 1.25 # drivers/net/amd8111e.c 1.1 -> 1.2 # drivers/char/agp/Kconfig 1.8 -> 1.10 # arch/ia64/kernel/signal.c 1.19 -> 1.20 # drivers/block/loop.c 1.80 -> 1.81 # fs/buffer.c 1.182 -> 1.184 # arch/i386/oprofile/init.c 1.2 -> 1.3 # include/asm-x86_64/timex.h 1.5 -> 1.6 # fs/jffs/intrep.c 1.21 -> 1.22 # drivers/usb/input/hid-core.c 1.47 -> 1.49 # drivers/acpi/events/evxface.c 1.15 -> 1.16 # drivers/acpi/utilities/utinit.c 1.13 -> 1.14 # drivers/acpi/parser/psutils.c 1.14 -> 1.15 # fs/nfsd/export.c 1.68 -> 1.69 # arch/ppc64/oprofile/init.c 1.1 -> 1.2 # drivers/acpi/events/evmisc.c 1.16 -> 1.17 # include/linux/serio.h 1.11 -> 1.13 # fs/afs/kafstimod.c 1.3 -> 1.4 # drivers/acpi/events/evgpe.c 1.5 -> 1.6 # include/asm-sparc/signal.h 1.3 -> 1.4 # drivers/char/tty_io.c 1.56 -> 1.57 # drivers/char/agp/i460-agp.c 1.13 -> 1.14 # include/linux/sunrpc/clnt.h 1.12 -> 1.13 # drivers/acpi/executer/exconfig.c 1.14 -> 1.15 # drivers/acpi/system.c 1.26 -> 1.27 # drivers/usb/input/powermate.c 1.11 -> 1.13 # arch/sparc/kernel/init_task.c 1.6 -> 1.7 # fs/proc/array.c 1.41 -> 1.42 # fs/jfs/jfs_txnmgr.c 1.37 -> 1.38 # arch/parisc/kernel/sys32.h 1.2 -> 1.3 # MAINTAINERS 1.117 -> 1.119 # net/sctp/protocol.c 1.25 -> 1.30 # include/linux/oprofile.h 1.2 -> 1.5 # net/sctp/ipv6.c 1.15 -> 1.19 # fs/reiserfs/journal.c 1.60 -> 1.61 # drivers/acpi/bus.c 1.29 -> 1.30 # drivers/input/misc/Makefile 1.4 -> 1.5 # include/linux/cpufreq.h 1.12 -> 1.13 # drivers/ieee1394/nodemgr.c 1.17 -> 1.18 # arch/sparc64/oprofile/init.c 1.1 -> 1.2 # net/irda/irlap_event.c 1.15 -> 1.16 # include/asm-s390x/signal.h 1.5 -> 1.6 # sound/oss/ad1848.c 1.16 -> 1.17 # drivers/media/video/msp3400.c 1.12 -> 1.13 # drivers/usb/input/Makefile 1.12 -> 1.13 # mm/mmap.c 1.69 -> 1.71 # drivers/acpi/tables/tbrsdt.c 1.8 -> 1.9 # arch/i386/kernel/cpu/centaur.c 1.3 -> 1.5 # arch/s390x/kernel/signal.c 1.16 -> 1.17 # drivers/char/watchdog/w83877f_wdt.c 1.13 -> 1.14 # drivers/char/watchdog/acquirewdt.c 1.17 -> 1.18 # fs/ext2/xattr.c 1.4 -> 1.5 # fs/ufs/balloc.c 1.15 -> 1.16 # fs/lockd/svc.c 1.19 -> 1.20 # drivers/acpi/utilities/utdebug.c 1.14 -> 1.15 # drivers/message/i2o/i2o_core.c 1.13 -> 1.15 # drivers/net/arlan.c 1.12 -> 1.14 # arch/sparc64/kernel/sys_sparc32.c 1.61 -> 1.63 # include/asm-i386/mach-summit/mach_apic.h 1.17 -> 1.18 # net/sctp/command.c 1.5 -> 1.6 # arch/m68knommu/kernel/signal.c 1.4 -> 1.5 # drivers/scsi/st.c 1.53 -> 1.54 # arch/mips/baget/vacserial.c 1.6 -> 1.7 # drivers/acpi/tables/tbget.c 1.16 -> 1.17 # drivers/char/agp/ali-agp.c 1.13 -> 1.14 # fs/ext2/super.c 1.44 -> 1.45 # fs/smbfs/smbiod.c 1.6 -> 1.7 # drivers/acpi/utilities/utobject.c 1.15 -> 1.16 # arch/x86_64/kernel/sys_x86_64.c 1.6 -> 1.7 # drivers/input/joystick/amijoy.c 1.9 -> 1.10 # drivers/char/watchdog/Kconfig 1.6 -> 1.7 # arch/x86_64/kernel/head.S 1.8 -> 1.9 # drivers/i2c/i2c-algo-ibm_ocp.c 1.2 -> 1.3 # fs/jfs/resize.c 1.7 -> 1.8 # net/sctp/sm_sideeffect.c 1.18 -> 1.24 # drivers/input/serio/ambakmi.c 1.2 -> 1.3 # fs/ext3/inode.c 1.59 -> 1.60 # arch/sparc64/mm/hugetlbpage.c 1.5 -> 1.6 # drivers/acpi/events/evsci.c 1.10 -> 1.11 # arch/i386/mach-voyager/voyager_thread.c 1.1 -> 1.2 # include/asm-x86_64/acpi.h 1.1 -> 1.2 # drivers/char/agp/amd-k8-agp.c 1.21 -> 1.24 # net/ipv4/netfilter/ip_nat_ftp.c 1.6 -> 1.7 # arch/i386/kernel/timers/timer_tsc.c 1.9 -> 1.11 # arch/i386/oprofile/op_model_ppro.c 1.3 -> 1.4 # net/sunrpc/xprt.c 1.49 -> 1.50 # drivers/acpi/executer/exsystem.c 1.10 -> 1.11 # include/asm-x86_64/unistd.h 1.10 -> 1.11 # drivers/acpi/processor.c 1.32 -> 1.33 # arch/x86_64/kernel/time.c 1.10 -> 1.11 # net/ipv4/tcp_output.c 1.21 -> 1.23 # include/net/ip.h 1.14 -> 1.15 # arch/x86_64/defconfig 1.18 -> 1.19 # arch/i386/kernel/timers/timer_cyclone.c 1.3 -> 1.4 # drivers/char/mxser.c 1.17 -> 1.18 # net/bluetooth/bnep/core.c 1.9 -> 1.10 # drivers/input/joystick/warrior.c 1.9 -> 1.10 # drivers/char/watchdog/sbc60xxwdt.c 1.19 -> 1.20 # drivers/acpi/resources/rsxface.c 1.10 -> 1.11 # fs/ntfs/super.c 1.122 -> 1.123 # arch/x86_64/kernel/signal.c 1.12 -> 1.14 # drivers/char/agp/backend.c 1.66 -> 1.71 # drivers/input/mouse/sermouse.c 1.8 -> 1.9 # include/asm-x86_64/topology.h 1.1 -> 1.2 # drivers/acpi/debug.c 1.4 -> 1.5 # include/asm-x86_64/thread_info.h 1.6 -> 1.7 # arch/sparc/kernel/signal.c 1.19 -> 1.20 # include/asm-sparc/system.h 1.15 -> 1.16 # arch/x86_64/kernel/early_printk.c 1.5 -> 1.6 # arch/m68k/kernel/signal.c 1.10 -> 1.11 # arch/sparc64/oprofile/timer_int.c 1.1 -> 1.3 # drivers/message/i2o/i2o_block.c 1.48 -> 1.49 # drivers/scsi/aacraid/commsup.c 1.1 -> 1.2 # arch/i386/kernel/cpu/cpufreq/longrun.c 1.6 -> 1.8 # include/acpi/acpi_drivers.h 1.13 -> 1.14 # drivers/char/watchdog/Makefile 1.5 -> 1.6 # net/ipv6/ipv6_syms.c 1.4 -> 1.6 # arch/s390x/kernel/linux32.c 1.34 -> 1.35 # drivers/acpi/parser/pswalk.c 1.10 -> 1.11 # include/asm-x86_64/pgtable.h 1.11 -> 1.12 # net/ipv4/xfrm_state.c 1.8 -> 1.9 # include/asm-s390/signal.h 1.4 -> 1.5 # net/ipv4/sysctl_net_ipv4.c 1.7 -> 1.8 # include/net/af_unix.h 1.2 -> 1.3 # include/asm-mips64/signal.h 1.3 -> 1.4 # arch/x86_64/kernel/Makefile 1.15 -> 1.16 # drivers/acpi/executer/exoparg6.c 1.6 -> 1.7 # arch/i386/oprofile/op_model_athlon.c 1.3 -> 1.4 # net/irda/wrapper.c 1.4 -> 1.5 # drivers/net/hamradio/yam.c 1.12 -> 1.13 # arch/x86_64/mm/Makefile 1.7 -> 1.8 # drivers/char/watchdog/alim7101_wdt.c 1.4 -> 1.5 # drivers/acpi/tables/tbxfroot.c 1.15 -> 1.16 # sound/oss/nec_vrc5477.c 1.7 -> 1.8 # arch/x86_64/kernel/aperture.c 1.1 -> 1.2 # drivers/media/video/saa5249.c 1.11 -> 1.12 # drivers/acpi/tables/tbgetall.c 1.7 -> 1.8 # sound/oss/es1371.c 1.18 -> 1.19 # drivers/usb/input/Kconfig 1.3 -> 1.4 # drivers/acpi/battery.c 1.14 -> 1.15 # fs/reiserfs/hashes.c 1.5 -> 1.6 # drivers/usb/input/aiptek.c 1.13 -> 1.15 # drivers/usb/input/fixp-arith.h 1.2 -> 1.3 # net/ipv6/Makefile 1.7 -> 1.8 # arch/x86_64/boot/bootsect.S 1.1 -> 1.2 # drivers/block/DAC960.c 1.51 -> 1.52 # arch/arm/kernel/ecard.c 1.19 -> 1.20 # fs/jfs/namei.c 1.24 -> 1.25 # drivers/char/agp/via-kt400.c 1.6 -> (deleted) # arch/mips/kernel/signal.c 1.10 -> 1.11 # drivers/acpi/numa.c 1.3 -> 1.4 # include/acpi/platform/aclinux.h 1.17 -> 1.18 # arch/x86_64/kernel/vsyscall.c 1.7 -> 1.8 # fs/nfs/inode.c 1.71 -> 1.72 # drivers/scsi/cpqfcTSworker.c 1.13 -> 1.15 # drivers/isdn/hardware/eicon/diva.c 1.2 -> 1.3 # arch/s390/kernel/signal.c 1.17 -> 1.18 # drivers/acpi/pci_bind.c 1.5 -> 1.7 # drivers/acpi/tables/tbutils.c 1.15 -> 1.16 # arch/x86_64/Kconfig 1.13 -> 1.14 # include/linux/kbd_kern.h 1.6 -> 1.7 # kernel/sched.c 1.156 -> 1.158 # include/linux/agp_backend.h 1.23 -> 1.25 # drivers/acpi/executer/exmutex.c 1.9 -> 1.10 # drivers/net/irda/sir_kthread.c 1.3 -> 1.4 # fs/jbd/recovery.c 1.9 -> 1.10 # drivers/char/agp/hp-agp.c 1.13 -> 1.14 # drivers/acpi/parser/psxface.c 1.14 -> 1.15 # drivers/input/keyboard/atkbd.c 1.26 -> 1.28 # net/sctp/adler32.c 1.5 -> 1.6 # drivers/char/watchdog/wdt977.c 1.11 -> 1.12 # include/linux/jbd.h 1.15 -> 1.16 # drivers/acpi/osl.c 1.22 -> 1.24 # scripts/Makefile.build 1.27 -> 1.28 # net/sctp/crc32c.c 1.4 -> 1.5 # drivers/scsi/dpt_i2o.c 1.24 -> 1.25 # sound/pci/ens1370.c 1.24 -> 1.25 # include/asm-cris/signal.h 1.2 -> 1.3 # fs/ufs/dir.c 1.12 -> 1.13 # drivers/acpi/resources/rsmemory.c 1.9 -> 1.10 # drivers/input/gameport/ns558.c 1.14 -> 1.15 # drivers/acpi/dispatcher/dsopcode.c 1.17 -> 1.18 # include/asm-x86_64/system.h 1.10 -> 1.11 # include/net/xfrm.h 1.12 -> 1.13 # fs/sysfs/inode.c 1.80 -> 1.81 # drivers/char/agp/via-agp.c 1.20 -> 1.27 # drivers/acpi/events/evevent.c 1.20 -> 1.21 # drivers/acpi/executer/exmisc.c 1.18 -> 1.19 # drivers/input/joystick/iforce/iforce-usb.c 1.6 -> 1.7 # drivers/acpi/hardware/hwregs.c 1.16 -> 1.17 # drivers/input/touchscreen/h3600_ts_input.c 1.5 -> 1.6 # arch/mips/kernel/irixsig.c 1.4 -> 1.5 # drivers/net/hamradio/scc.c 1.19 -> 1.20 # drivers/char/hvc_console.c 1.11 -> 1.12 # drivers/media/dvb/av7110/av7110.h 1.2 -> 1.3 # drivers/net/Kconfig 1.12 -> 1.13 # drivers/scsi/eata.c 1.26 -> 1.27 # net/irda/qos.c 1.10 -> 1.11 # net/sched/sch_gred.c 1.8 -> 1.9 # arch/i386/kernel/acpi.c 1.19 -> 1.21 arch/i386/kernel/acpi/boot.c (moved) # drivers/acpi/dispatcher/dswstate.c 1.17 -> 1.18 # drivers/acpi/thermal.c 1.19 -> 1.21 # fs/qnx4/inode.c 1.28 -> 1.29 # net/ipv4/netfilter/iptable_mangle.c 1.7 -> 1.8 # kernel/exit.c 1.88 -> 1.92 # arch/i386/oprofile/Makefile 1.3 -> 1.4 # include/asm-x86_64/proto.h 1.6 -> 1.7 # arch/x86_64/Makefile 1.22 -> 1.23 # fs/jbd/commit.c 1.14 -> 1.15 # fs/ufs/ialloc.c 1.10 -> 1.11 # arch/sparc64/kernel/power.c 1.9 -> 1.10 # drivers/acpi/executer/exresop.c 1.18 -> 1.19 # lib/vsprintf.c 1.13 -> 1.14 # drivers/char/specialix.c 1.8 -> 1.9 # include/asm-x86_64/ia32.h 1.9 -> 1.10 # arch/x86_64/kernel/bluesmoke.c 1.5 -> 1.6 # fs/hugetlbfs/inode.c 1.18 -> 1.20 # arch/x86_64/kernel/module.c 1.6 -> 1.7 # arch/sparc64/kernel/ioctl32.c 1.49 -> 1.50 # drivers/input/serio/serport.c 1.9 -> 1.10 # drivers/acpi/tables/tbxface.c 1.14 -> 1.15 # fs/ext3/super.c 1.49 -> 1.51 # fs/cifs/connect.c 1.6 -> 1.7 # arch/ppc64/kernel/signal32.c 1.35 -> 1.36 # arch/i386/kernel/cpu/cpufreq/p4-clockmod.c 1.9 -> 1.10 # drivers/acpi/executer/exoparg1.c 1.19 -> 1.20 # drivers/acpi/namespace/nsdump.c 1.17 -> 1.18 # drivers/input/keyboard/amikbd.c 1.10 -> 1.11 # fs/partitions/check.c 1.94 -> 1.95 # drivers/input/mousedev.c 1.19 -> 1.20 # net/ax25/sysctl_net_ax25.c 1.5 -> 1.6 # arch/sparc/boot/Makefile 1.11 -> 1.12 # include/asm-x86_64/msr.h 1.3 -> 1.4 # arch/i386/mm/hugetlbpage.c 1.29 -> 1.31 # drivers/acpi/namespace/nsload.c 1.16 -> 1.17 # net/irda/irsyms.c 1.11 -> 1.12 # drivers/acpi/dispatcher/dsinit.c 1.6 -> 1.7 # include/asm-x86_64/segment.h 1.5 -> 1.6 # drivers/char/misc.c 1.13 -> 1.14 # arch/sparc64/kernel/irq.c 1.23 -> 1.24 # drivers/usb/input/usbmouse.c 1.21 -> 1.22 # drivers/char/moxa.c 1.13 -> 1.14 # fs/lockd/clntlock.c 1.6 -> 1.7 # drivers/char/watchdog/wafer5823wdt.c 1.3 -> 1.4 # drivers/acpi/executer/excreate.c 1.15 -> 1.16 # arch/i386/oprofile/nmi_int.c 1.5 -> 1.7 # arch/x86_64/mm/ioremap.c 1.6 -> 1.7 # net/sctp/ulpqueue.c 1.6 -> 1.8 # fs/ext3/xattr.h 1.2 -> 1.3 # drivers/oprofile/cpu_buffer.h 1.2 -> 1.3 # drivers/acpi/Makefile 1.29 -> 1.33 # drivers/acpi/executer/exstorob.c 1.16 -> 1.17 # drivers/acpi/utilities/utmath.c 1.6 -> 1.7 # fs/afs/kafsasyncd.c 1.3 -> 1.4 # arch/i386/kernel/timers/timer.c 1.4 -> 1.5 # drivers/usb/input/usbkbd.c 1.24 -> 1.25 # include/asm-x86_64/vsyscall.h 1.3 -> 1.4 # drivers/acpi/namespace/nsaccess.c 1.15 -> 1.16 # drivers/acpi/namespace/nssearch.c 1.16 -> 1.17 # include/asm-x86_64/spinlock.h 1.6 -> 1.7 # drivers/block/cciss.c 1.66 -> 1.67 # drivers/isdn/hardware/eicon/i4lididrv.c 1.4 -> 1.5 # drivers/net/wan/comx-hw-mixcom.c 1.7 -> 1.8 # arch/x86_64/ia32/ia32_signal.c 1.9 -> 1.10 # arch/parisc/kernel/signal.c 1.7 -> 1.8 # drivers/acpi/dispatcher/dswexec.c 1.16 -> 1.17 # include/asm-x86_64/processor.h 1.10 -> 1.11 # arch/ppc/kernel/signal.c 1.20 -> 1.21 # net/sctp/sm_statetable.c 1.11 -> 1.15 # net/ipv4/ip_output.c 1.26 -> 1.27 # drivers/acpi/namespace/nsxfeval.c 1.8 -> 1.9 # kernel/workqueue.c 1.5 -> 1.6 # drivers/serial/sunzilog.c 1.21 -> 1.24 # include/net/sctp/command.h 1.6 -> 1.8 # arch/sparc64/kernel/init_task.c 1.7 -> 1.8 # drivers/acpi/dispatcher/dswscope.c 1.11 -> 1.12 # drivers/scsi/imm.c 1.16 -> 1.17 # drivers/acpi/resources/rsirq.c 1.12 -> 1.13 # sound/oss/es1370.c 1.18 -> 1.19 # include/net/sctp/structs.h 1.24 -> 1.33 # drivers/acpi/utils.c 1.6 -> 1.7 # fs/nfs/nfs4xdr.c 1.13 -> 1.14 # drivers/acpi/Kconfig 1.4 -> 1.5 # net/sctp/Makefile 1.5 -> 1.6 # fs/proc/generic.c 1.19 -> 1.20 # drivers/ide/pci/amd74xx.c 1.11 -> 1.12 # drivers/acpi/namespace/nswalk.c 1.10 -> 1.11 # arch/v850/kernel/signal.c 1.6 -> 1.7 # drivers/acpi/resources/rslist.c 1.11 -> 1.12 # arch/i386/kernel/apic.c 1.30 -> 1.31 # drivers/macintosh/adb.c 1.15 -> 1.16 # drivers/char/nwflash.c 1.10 -> 1.11 # net/sctp/primitive.c 1.7 -> 1.8 # kernel/ptrace.c 1.25 -> 1.26 # arch/x86_64/kernel/smpboot.c 1.11 -> 1.12 # drivers/acpi/namespace/nsnames.c 1.15 -> 1.16 # fs/nfs/nfs3xdr.c 1.24 -> 1.25 # arch/ppc64/oprofile/timer_int.c 1.1 -> 1.3 # drivers/pcmcia/i82092.c 1.9 -> 1.10 # drivers/net/wireless/orinoco.c 1.18 -> 1.19 # drivers/char/agp/amd-k7-agp.c 1.17 -> 1.18 # drivers/macintosh/adbhid.c 1.12 -> 1.13 # mm/pdflush.c 1.15 -> 1.16 # net/core/rtnetlink.c 1.8 -> 1.9 # net/ipv4/netfilter/ip_queue.c 1.9 -> 1.10 # include/asm-x86_64/desc.h 1.6 -> 1.7 # fs/udf/inode.c 1.30 -> 1.31 # net/sctp/socket.c 1.29 -> 1.36 # include/net/irda/irda_device.h 1.3 -> 1.4 # arch/sh/kernel/signal.c 1.9 -> 1.10 # (new) -> 1.1 include/asm-x86_64/numa.h # (new) -> 1.2 arch/i386/kernel/cpu/cpufreq/powernow-k7.c # (new) -> 1.1 Documentation/sound/rme96xx # (new) -> 1.2 arch/i386/oprofile/op_model_p4.c # (new) -> 1.1 drivers/input/misc/98spkr.c # (new) -> 1.2 drivers/char/watchdog/cpu5wdt.c # (new) -> 1.1 include/asm-x86_64/numnodes.h # (new) -> 1.1 arch/i386/kernel/acpi/sleep.c # (new) -> 1.1 arch/i386/kernel/acpi/Makefile # (new) -> 1.1 include/asm-x86_64/mmsegment.h # (new) -> 1.1 drivers/usb/input/hid-tmff.c # (new) -> 1.2 drivers/char/agp/alpha-agp.c # (new) -> 1.3 drivers/acpi/sleep/proc.c # (new) -> 1.2 drivers/acpi/sleep/sleep.h # (new) -> 1.1 net/ipv6/xfrm_policy.c # (new) -> 1.4 drivers/acpi/sleep/Makefile # (new) -> 1.1 net/sctp/ssnmap.c # (new) -> 1.1 arch/x86_64/boot/mtools.conf.in # (new) -> 1.1 arch/x86_64/kernel/wakeup.S # (new) -> 1.1 arch/x86_64/mm/numa.c # (new) -> 1.1 include/asm-x86_64/mmzone.h # (new) -> 1.1 arch/i386/kernel/cpu/cpufreq/powernow-k7.h # (new) -> 1.1 drivers/acpi/sleep/poweroff.c # (new) -> 1.1 arch/x86_64/mm/k8topology.c # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/02/10 torvalds@home.transmeta.com 1.989.2.3 # Linux v2.5.60 # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.3.1 # [AGPGART] Fix up lots of 'comparison between signed and unsigned' warnings # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.3.2 # [AGPGART] Fix same logic bug in KT400 mode determination. # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.3.3 # [AGPGART] Don't oops when deregistering failed to init agp modules. # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.3.4 # [AGPGART] Handle the "KT400 in disguise as a KT266" case. # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.3.5 # [AGPGART] Handle failure during initialisation more gracefully. # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.3.6 # [AGPGART] Add ident for VIA KT400 in disguise as a KT266 # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.3.7 # [AGPGART] More failure path sanity checking. # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.3.8 # [AGPGART] VIA KT400 Aperture size is 12 bit in AGP3 mode. # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.3.9 # [AGPGART] kt400's enable routine can't be __init # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.3.10 # [AGPGART] alpha agp infrastructure # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.3.11 # [AGPGART] First step towards multiple AGP buses. # # The AGP3 spec allows for >1 AGP bus. This is the first of several patches # from Jeff Hartmann towards a context-using agp_bridge, by replacing # agp_bridge.foo accesses with agp_bridge->foo accesses. For now, there # should be no functional differences, as there is still only a single # agp_bridge_data struct defined. # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.3.12 # [AGPGART] Add extra VIA GART IDs. # # Based upon information from VIA, this also adds a bunch of placeholder # entries that will get filled in over time when they have been proven # to work with the code with no extra modification. # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.3.13 # [AGPGART] Additional VIA ids. # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.3.14 # [AGPGART] Fix missed agp_bridge conversion that caused oops. # -------------------------------------------- # 03/02/10 davej@codemonkey.org.uk 1.989.3.15 # [AGPGART] Merge VIA KT400 AGP3 support into main via-agp module. # # This removes lots of annoying problems trying to prevent both modules # from being loaded, and also shares quite a bit of code. # CONFIG_AGP3 will disable AGP3 mode operation of KT400s. # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.3.16 # [AGPGART] Remove pointless enums from VIA GART driver. # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.3.17 # [AGPGART] Enable support for VIA PLE133 chipset # -------------------------------------------- # 03/02/10 davej@tetrachloride.(none) 1.989.2.4 # Merge tetrachloride.(none):/mnt/stuff/kernel/2.5/bk-linus # into tetrachloride.(none):/mnt/stuff/kernel/2.5/agpgart-respin # -------------------------------------------- # 03/02/10 agrover@groveronline.com 1.989.4.1 # Merge groveronline.com:/root/bk/linux-2.5 # into groveronline.com:/root/bk/linux-acpi # -------------------------------------------- # 03/02/10 sri@us.ibm.com 1.989.5.1 # Merge us.ibm.com:/home/sridhar/BK/linux-2.5.60 # into us.ibm.com:/home/sridhar/BK/lksctp-2.5.60 # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.2.5 # [PATCH] Fix synchronous writers to wait properly for the result # # Mikulas Patocka points out a bug in # ll_rw_block() usage. # # Typical usage is: # # mark_buffer_dirty(bh); # ll_rw_block(WRITE, 1, &bh); # wait_on_buffer(bh); # # the problem is that if the buffer was locked on entry to this code sequence # (due to in-progress I/O), ll_rw_block() will not wait, and start new I/O. So # this code will wait on the _old_ I/O, and will then continue execution, # leaving the buffer dirty. # # It turns out that all callers were only writing one buffer, and they were all # waiting on that writeout. So I added a new sync_dirty_buffer() function: # # void sync_dirty_buffer(struct buffer_head *bh) # { # lock_buffer(bh); # if (test_clear_buffer_dirty(bh)) { # get_bh(bh); # bh->b_end_io = end_buffer_io_sync; # submit_bh(WRITE, bh); # } else { # unlock_buffer(bh); # } # } # # which allowed a fair amount of code to be removed, while adding the desired # data-integrity guarantees. # # UFS has its own wrappers around ll_rw_block() which got in the way, so this # operation was open-coded in that case. # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.2.6 # [PATCH] ncpfs compile fix # # Patch from Joel Becker # # The task_struct->sig -> task_struct->signal bits. # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.2.7 # [PATCH] de4x5 compile fix # # Move the definition of version[] down to where __initdata has been defined. # -------------------------------------------- # 03/02/10 rddunlap@osdl.org 1.989.2.8 # [PATCH] checker bounds/limits fixes # # Part of the bounds checking bugs found by the Stanford checker. # # The 4 fixes below have been acked by their maintainers. # -------------------------------------------- # 03/02/10 kai@tp1.ruhr-uni-bochum.de 1.989.2.9 # kbuild: sed compatibility fixes # # Some versions of sed seem to think \w, as in word, doesn't include # digits, which breaks the build with CONFIG_MODVERSIONS. So we # just use the more compatible []*. # -------------------------------------------- # 03/02/10 kai@tp1.ruhr-uni-bochum.de 1.989.2.10 # kbuild: Handle the "no modules" case # # When the user selects CONFIG_MODVERSIONS but doesn't build anything # modular, the post-processing step does nothing (right, as there is # nothing to be done), but it also gave an error, which it shouldn't. # -------------------------------------------- # 03/02/10 kai@tp1.ruhr-uni-bochum.de 1.989.2.11 # kbuild: cosmetics # # From ram : # # > Appended below is a small patch to the top-level makefile; it # > -- replaces a call to $(shell/echo/sed) with $(subst) and adds a # > comment # > -- fixes some typos. # -------------------------------------------- # 03/02/10 kai@tp1.ruhr-uni-bochum.de 1.989.2.12 # kbuild: Customflags for cmd_objcopy # # From Konrad Eisele: # # > like with cmd_ld in scripts/Makefile.lib having possibility to add # > customflags with cmd_objcopy would be nice. When building a # > ROMKernel I'd like to use: # > OBJCOPYFLAGS_rompiggydata := --remove-section=.text # > OBJCOPYFLAGS_$(MODEL)piggytext := --only-section=.text # -------------------------------------------- # 03/02/10 kai@tp1.ruhr-uni-bochum.de 1.989.2.13 # kbuild: Allow for ',$ in commands # # Quote ',$ before passing them to the shell - ' must be escaped for # echo, $$ will be converted to $ by make. # # This allows to use e.g. perl commands in the build with support # from the generic $(call if_changed,...). # # by Konrad Eisele # -------------------------------------------- # 03/02/11 davej@codemonkey.org.uk 1.989.6.1 # [WATCHDOG] PNP API conversion. # Done by Adam Belay. # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.7.1 # [PATCH] uninline get_jiffies_64() for 32-bit architectures # # uninline get_jiffies_64() for 32-bit architectures # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.7.2 # [PATCH] use per-cpu data for ia32 profiler # # Patch from Ravikiran G Thirumalai # # Converts the ia32 kernel profiler to use use the percpu area infrastructure. # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.7.3 # [PATCH] NUMAQ io_apic programming fix # # Patch from William Lee Irwin III # # Don't touch IO-APIC physid's on NUMA-Q. The BIOS pre-programs them. # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.7.4 # [PATCH] ext3: Remove journal_try_start() # # journal_try_start() is a function which nonblockingly attempts to open a JBD # transaction handle. It was added a long time ago when there were concerns # that ext3_writepage() could block kswapd for too long. # # It was never clearly necessary. # # So the patch throws it all away and just calls the blocking journal_start() # from ext3_writepage(). # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.7.5 # [PATCH] DAC960 Stanford Checker fix # # Patch from Dave Olien # # This was found by the Standford Checker. # The LogicalDeviceNumber bad range test was changed from > to >= # I also replaced a couple of panic() calls with error messages, # since panic-ing seemed a little extreme. # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.7.6 # [PATCH] Add David Olien MAINTAINERs for DAC960 # # (I asked Dave for this...) # # From: Dave Olien # # Add me as maintainer for DAC960 driver. # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.7.7 # [PATCH] nforce2 IDE support for the amd74xx driver # # Patch from James Curbo # # The amd74xx IDE driver in 2.5.59 has support for the nforce IDE controller, # but not explicitly for the nforce2 IDE controller (which has a different PCI # ID, which is in the kernel already). I'm not sure if the nforce and nforce2 # controllers are identical, but I made a small patch that made the amd74xx # driver recognize the nforce2 IDE, and it boots for me, seems to work fine, as # my drives were tuned to their highest transfer rate automatically (udma5). # # I don't know if this patch is proper or correct, but it Works for Me [tm]. # Patch is attached. # # Vojtech has acked this change. # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.7.8 # [PATCH] hugetlbpage MAP_FIXED fix # # We need to validate that the address and length of a MAP_FIXED request are # suitable for hugetlb pages. # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.7.9 # [PATCH] remove unneeded test from radix_tree_extend() # # Patch from: Szabolcs Berecz # # No need to check root->rnode in the loop. In the loop it remains nonzero. # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.7.10 # [PATCH] ext3 commenting cleanup # # Redo the (strange) layout of some of Roger's comments. # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.7.11 # [PATCH] Don't run unlock_super() in ext3_fill_super() # # A very long time ago ext3_fill_super() was beng called under the VFS's # lock_super(), and it had to drop that lock for deadlock avoidance reasons. # # But the VFS was later changed to not take lock_super() across ->fill_super(), # so we're upping a non-downed semaphore. # # Just take it out. # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.7.12 # [PATCH] remove the buffer_head mempool # # mempools have the wrong semantics for use by buffer_heads. The problem # scenario: # # - Process A calls mempool_alloc(), asking for a buffer_head. # # - While process A sleeps, process B frees up a ton of memory. # # That's it. There is no longer any memory pressure, so nobody frees any # buffer_heads, so process A does not get woken up. I managed to trigger this # in some testing recently. # # One approach would be to use a schedule_timeout(2) in mempool_alloc(). # # Anyway, the importance of buffer_head allocation was lessened when swapout # stopped using them, so let's just drop the mempool out of it for now. # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.7.13 # [PATCH] fix current->user->processes leak # # Patch from: Eric Lammerts # # Every time you do a loop mount, a kernel thread is started (those # processes are called "loop0", "loop1", etc.). The problem is that when # it starts, it's counted as one of your processes. Then, it's # changed to be a root-owned process without correcting that count. # # Patch below fixes the problem. It moves the bookkeeping of changing # current->user to a new function switch_uid() (which is now also used # by exec_usermodehelper() in kmod.c). The patch is tested. # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.7.14 # [PATCH] 3c509 compile fix # # Patch from Marc Zyngier # # Fix compilation of 3c509.c # -------------------------------------------- # 03/02/10 akpm@digeo.com 1.989.7.15 # [PATCH] Get 3c59x to compile on non-PCI systems # # Patch from Marc Zyngier # # My previous round of EISA hacking left the 3c59x driver unable to # compile on non-PCI systems (that is, EISA only...). # # This small patch fixes it. # -------------------------------------------- # 03/02/11 rusty@rustcorp.com.au 1.989.1.5 # [AF_UNIX] Cleanup forall_unix_sockets. # -------------------------------------------- # 03/02/11 rusty@rustcorp.com.au 1.989.1.6 # [X25]: Fix improper | precendence, pointed out by Joern Engel. # -------------------------------------------- # 03/02/11 rusty@rustcorp.com.au 1.989.1.7 # [ECONET]: Add comment to point out a bug spotted by Joern Engel. # -------------------------------------------- # 03/02/11 rob@osinvestor.com 1.993 # [SPARC]: HEAD --> HEAD_Y # -------------------------------------------- # 03/02/11 rob@osinvestor.com 1.994 # [SPARC]: ADd init_sighand. # -------------------------------------------- # 03/02/11 davem@nuts.ninka.net 1.995 # [TULIP DE4X5]: Cannot use initdata before including linux/init.h # -------------------------------------------- # 03/02/11 davem@nuts.ninka.net 1.989.1.8 # [TCP]: Do not bump backoff too high during 0-window probes. # -------------------------------------------- # 03/02/11 davem@nuts.ninka.net 1.996 # [SIGNAL]: Allow more platforms to use generic get_signal_to_deliver. # # The few platforms that cannot use the generic # get_signal_to_deliver implementation cannot do # so because they do special things for ptraced # children. This can be easily avoided and thus # all of the signal handling code duplication can # be eliminated. # # This is the first part, which adds a platform hook # right before the parent of the ptraced child is woken. # Data can be passed in via a cookie argument. # # The next part will be dealing with platforms # that need to muck with breakpoints in the child # in this same code block. # -------------------------------------------- # 03/02/11 davem@nuts.ninka.net 1.997 # Merge nuts.ninka.net:/home/davem/src/BK/sparcwork-2.5 # into nuts.ninka.net:/home/davem/src/BK/sparc-2.5 # -------------------------------------------- # 03/02/11 randy.dunlap@verizon.net 1.989.7.16 # [PATCH] ftape divide-by-zero found by Stanford Checker # # This fixes a potential divide-by-zero found by the Stanford Checker. # -------------------------------------------- # 03/02/11 randy.dunlap@verizon.net 1.989.7.17 # [PATCH] bounds/limits fixes (Stanford Checker) # # This fixes several trivial bounds/limits errors that were pointed out by # the Stanford Checker. # -------------------------------------------- # 03/02/11 akpm@digeo.com 1.989.7.18 # [PATCH] sched_init enables interrupts too early # # wake_up_forked_process() unconditionally enables interrupts. It is called # from sched_init(). Enabling interrupts that early makes Anton's ppc64 # machine lock up. # -------------------------------------------- # 03/02/11 Andries.Brouwer@cwi.nl 1.989.7.19 # [PATCH] signal error return fix # -------------------------------------------- # 03/02/11 Andries.Brouwer@cwi.nl 1.989.7.20 # [PATCH] genhd device unregistration fix # -------------------------------------------- # 03/02/11 torvalds@home.transmeta.com 1.989.7.21 # If we set TIF_SIGPENDING for SIGCONT, we have to wake up any sleeping # tasks (even if we don't otherwise need to wake anything up), since # otherwise later signals would see that signals are already pending and # wouldn't cause wakeups. # -------------------------------------------- # 03/02/11 torvalds@home.transmeta.com 1.989.6.2 # Merge bk://linux-dj.bkbits.net/watchdog # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/11 levon@movementarian.org 1.989.6.3 # [PATCH] oprofile: Pentium IV support # # The below patch implements a P4 driver for OProfile, mostly written # by Graydon Hoare. # -------------------------------------------- # 03/02/11 levon@movementarian.org 1.989.6.4 # [PATCH] oprofile: CPU type as string # # This patch updates the horrible enum for the logical CPU type with a # string instead. # -------------------------------------------- # 03/02/11 levon@movementarian.org 1.989.6.5 # [PATCH] oprofile: fix oprofilefs integer files base # # This patch allows the oprofilefs files to take entry in any base # instead of just base 10 # -------------------------------------------- # 03/02/11 levon@movementarian.org 1.989.6.6 # [PATCH] oprofile: kernel/user addresses fix # # This patch replaces the assumption that > PAGE_OFFSET == kernel address # with testing for user_mode(regs) and inserting switch codes instead. # -------------------------------------------- # 03/02/11 kai@tp1.ruhr-uni-bochum.de 1.989.2.14 # kbuild: scripts/fixdep.c doesn't close files when finished # # From Chris Wedgwood: # # > fixdep doesn't close files when finished with them... normally this # > doesn't matter unless you have strict ulimits in place. # > # > Trivial fix is: # -------------------------------------------- # 03/02/11 agrover@groveronline.com 1.989.8.1 # Merge groveronline.com:/root/bk/linux-2.5 # into groveronline.com:/root/bk/linux-acpi # -------------------------------------------- # 03/02/11 torvalds@penguin.transmeta.com 1.989.6.7 # Report shared pending signals in /proc//status # # Patch from Roland McGrath. # -------------------------------------------- # 03/02/11 torvalds@penguin.transmeta.com 1.989.6.8 # Sanitize kernel daemon signal handling and process naming. # # Add a name argument to daemonize() (va_arg) to avoid all the # kernel threads having to duplicate the name setting over and # over again. # # Make daemonize() disable all signals by default, and add a # "allow_signal()" function to let daemons say they explicitly # want to support a signal. # # Make flush_signal() take the signal lock, so that callers do # not need to. # -------------------------------------------- # 03/02/11 kai@tp1.ruhr-uni-bochum.de 1.989.2.15 # Merge tp1.ruhr-uni-bochum.de:/scratch/kai/kernel/v2.5/linux-2.5 # into tp1.ruhr-uni-bochum.de:/scratch/kai/kernel/v2.5/linux-2.5.make # -------------------------------------------- # 03/02/11 torvalds@penguin.transmeta.com 1.989.6.9 # Add macthing 'va_end()' to the 'va_start()' in daemonize(). # # Not that it makes any difference on x86, but there may be # architectures that actually need it. # -------------------------------------------- # 03/02/11 davem@kernel.bkbits.net 1.998 # Merge davem@nuts.ninka.net:/home/davem/src/BK/sparc-2.5 # into kernel.bkbits.net:/home/davem/sparc-2.5 # -------------------------------------------- # 03/02/11 davem@kernel.bkbits.net 1.989.1.9 # Merge davem@nuts.ninka.net:/home/davem/src/BK/net-2.5 # into kernel.bkbits.net:/home/davem/net-2.5 # -------------------------------------------- # 03/02/11 Andries.Brouwer@cwi.nl 1.989.6.10 # [PATCH] nfs fix # # nfs must not use MINORBITS - that fails with 32-bit dev_t # -------------------------------------------- # 03/02/11 torvalds@home.transmeta.com 1.989.2.16 # Merge http://linux-isdn.bkbits.net/linux-2.5.make # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/11 torvalds@home.transmeta.com 1.989.1.10 # Merge bk://kernel.bkbits.net/davem/net-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/11 torvalds@home.transmeta.com 1.999 # Merge bk://kernel.bkbits.net/davem/sparc-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/12 davej@codemonkey.org.uk 1.989.9.1 # [AGPGART] Remove unneeded AMD8151 shadowing in the K8 GART driver. # The 8151 GART registers aren't actually necessary to poke, and are # only there for 'legacy reasons' aparently. # -------------------------------------------- # 03/02/12 davej@codemonkey.org.uk 1.989.9.2 # [AGPGART] Cache K8 northbridges pci_devs instead of scanning whole PCI bus # -------------------------------------------- # 03/02/11 sfr@canb.auug.org.au 1.1000 # [PATCH] apm daemonize # # Since daemonize now blocks all signals, this simplification is trivially # correct. # -------------------------------------------- # 03/02/11 ak@muc.de 1.1001 # [PATCH] x86-64 merge # # This brings the x86-64 port uptodate in 2.5.60. Unfortunately I cannot # test too much because i constantly get deadlocks in exit/wait in initscripts # on SMP bootup. The kernel seems to still lose a lot of SIGCHLD. 2.5.59/SMP # had the same problem. Uniprocessor and SMP kernel on UP seems to work. # # This patch only touches x86-64 specific files. It requires a few simple # changes to arch independent files that I will send separately. # # - Fixed a lot of obsolete/misleading configure help texts. # - Remove old bootblock disk loader and support fdimage target for syslinux # instead (H. Peter Anvin) # - Fix potential fpu signal restore problem on 32bit emulation. # - Merge with 2.5.60 i386 (hugetlbfs, acpi etc.) # - Some fixes for local apic disabled modus. # - Beginngs of S3 ACPI wakeup from real-mode (not working yet, don't use) # - Beginnings of NUMA/CONFIG_DISCONTIGMEM support for AMD K8 (work in progress, # port from 2.4): clean up memory mapping at bootup, generalize bootmem etc. # - Fix 64bit GS base reload problem and reenable (Karsten Keil) # - Fix race with vmalloc accesses from interrupt handlers disturbing page fault/ # similar race for the debug handler (thanks to Andrew Morton) # - Merge cpu access primitives with i386 # - Revert to private module list for now because putting modules # nto vmlist triggered too many problems. # - Some cleanups, removal of unneeded code. # - Let early __get_free_pages see consistent pda # - Preempt disabled for now because it is too broken right now # - Signal handler fixes # - Fix do_gettimeofday to be completely lockless and reenable vsyscalls # - Optimize context switch path a bit (should be ported to i386) # - Get thread_info via stack for better code # - Don't leak pmd pages # - Clean up hardcoded task stack sizes. # -------------------------------------------- # 03/02/11 sfr@canb.auug.org.au 1.999.1.1 # [SPARC64]: sigprocmask/sigpending compat layer conversion. # -------------------------------------------- # 03/02/11 sfr@canb.auug.org.au 1.1002 # [PATCH] parisc compatibility layer update # # At Linux Conf AU, Willy asked me to send any further parisc compatibility # changes directly to you, so this is what I have outstanding. Basically, # it is just the uses of compat_sigset_t that seemed to have been missed in # the previous merges. # -------------------------------------------- # 03/02/11 sfr@canb.auug.org.au 1.1003 # [PATCH] x86_64 compatibility layer update # # Andi has asked that I send these straight forward compatibility patches # to you and he will fix up any merge problems later. These are the # outstanding patches for x86_64 against 2.5.60. # -------------------------------------------- # 03/02/11 ahaas@airmail.net 1.999.2.1 # [PATCH]: C99 initializers for net/ipv6/sysctl_net_ipv6.c # -------------------------------------------- # 03/02/11 ahaas@airmail.net 1.999.2.2 # [PATCH]: C99 initializers for net/core/sysctl_net_core.c # -------------------------------------------- # 03/02/11 ahaas@airmail.net 1.999.2.3 # [PATCH]: C99 initializers for net/ipv4/sysctl_net_ipv4.c # -------------------------------------------- # 03/02/11 davem@nuts.ninka.net 1.999.2.4 # Merge http://linux-lksctp.bkbits.net/lksctp-2.5 # into nuts.ninka.net:/home/davem/src/BK/net-2.5 # -------------------------------------------- # 03/02/12 vojtech@suse.cz 1.1004 # input: Update AT+PS/2 mouse and keyboard drivers: # - Fix a possible deadlock with 0xfe resend command (atkbd) # - Make ->ack variables volatile (they're updated from irq) # - Fix the GETID one/two byte command to avoid any races # - Fix Logitech PS2++ extended packet detection # - Use RESET_BAT on reboot to make notebooks happy # -------------------------------------------- # 03/02/12 jsimmons@maxwell.earthlink.net 1.1005 # input: Remove include/linux/pc_keyb.h and old PS/2 code # from drivers/char/misc.c # -------------------------------------------- # 03/02/12 vojtech@suse.cz 1.1006 # input: Only generate rawmode warnings if the event we cannot handle # is a real key and not just a button or something. # -------------------------------------------- # 03/02/12 zaitcev@redhat.com 1.1007 # input: Let newly connected keyboards pickup the LED state. # -------------------------------------------- # 03/02/12 vojtech@suse.cz 1.1008 # input: Get rid of the kbd_pt_regs variable, and instead pass the # value all the way from an interrupt handler to keyboard.c # that can display it. # -------------------------------------------- # 03/02/12 tomita@cinet.co.jp 1.1009 # input: Support for NEC PC-9800 beeper and support for Kana Lock LED. # -------------------------------------------- # 03/02/12 vojtech@suse.cz 1.1010 # input: HID update # - Fix a bad #define for HID_QUIRK_BADPAD # - Set absfuzz and absflat for joysticks/gamepads only # - Add TangTop quirk # -------------------------------------------- # 03/02/12 vojtech@suse.cz 1.1011 # input.c: joydev/mousedev update # - relax requirements on devices, joydev now allows joysticks # without buttons to work with throttles and pedals, mousedev # allows a separate mouse wheel # - remove a stray semicolon in joydev # -------------------------------------------- # 03/02/12 vojtech@suse.cz 1.1012 # input: Give preferential treatment to gameport at 0x201, and use # the odd addresses for access. # -------------------------------------------- # 03/02/12 zinx@epicsol.org 1.1013 # input: Add support for ThrustMaster ForceFeedback USB HID devices. # -------------------------------------------- # 03/02/12 will@sowerbutts.com 1.1014 # input: PowerMate driver update # - work around an undocumented firmware bug # - fix handling of LED brightness # -------------------------------------------- # 03/02/12 vojtech@suse.cz 1.1015 # input: Resurrect usb_set_report for Aiptek and Wacom tablets. # -------------------------------------------- # 03/02/12 vojtech@suse.cz 1.1016 # input: Add two new serio type #defines # -------------------------------------------- # 03/02/12 vojtech@suse.cz 1.1017 # input: sunkbd.c - fix reading beyond end of keycode array. # -------------------------------------------- # 03/02/12 szepe@pinerecords.com 1.1003.1.1 # [PATCH] export allow_signal() # # Export allow_signal(). It's needed by lockd, sunrpc and other modules. # -------------------------------------------- # 03/02/12 ink@jurassic.park.msu.ru 1.1003.1.2 # [PATCH] alpha: Add missing sighand bits # -------------------------------------------- # 03/02/12 torvalds@penguin.transmeta.com 1.1003.1.3 # Don't wake up processes unnecessarily for ignored signals # -------------------------------------------- # 03/02/12 pavel@ucw.cz 1.1003.1.4 # [PATCH] Fix stack handling in acpi_wakeup.S # # This fixes stack handling in acpi_wakeup.S, and makes stack smaller so # that wakeup code actually fits inside memory allocated for it. Plus # someone renamed .L1432 to something meaningful. # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.1 # sleep: fix /proc/acpi/sleep write handling. # # - Prevent users from screwing themselves by removing support for entering # S5 from the proc file. S5 is 'soft-off' and the state the system enters # when powering down. It needs to be preceded by a proper shutdown sequence # and should not be triggered manually. # - Fix a potential unchecked array reference using the written value as the # index. # -------------------------------------------- # 03/02/12 davej@codemonkey.org.uk 1.1003.3.1 # [CPUFREQ] Properly set memory allocated by x86 cpufreq drivers to zero. # From Dominik Brodowski # -------------------------------------------- # 03/02/12 davej@codemonkey.org.uk 1.1003.3.2 # [CPUFREQ] add support for cpufreq governors. # More bits from Dominik. # # Most cpufreq drivers (in fact, all except one, longrun) or even most # cpu frequency scaling algorithms only offer the CPU to be set to one # frequency. In order to offer dynamic frequency scaling, the cpufreq # core must be able to tell these drivers of a "target frequency". So # these specific drivers will be transformed to offer a "->target" # call instead of the existing "->setpolicy" call. For "longrun", all # stays the same, though. # # How to decide what frequency within the CPUfreq policy should be used? # That's done using "cpufreq governors". Two are already in this patch # -- they're the already existing "powersave" and "performance" which # set the frequency statically to the lowest or highest frequency, # respectively. At least two more such governors will be ready for # addition in the near future, but likely many more as there are various # different theories and models about dynamic frequency scaling # around. Using such a generic interface as cpufreq offers to scaling # governors, these can be tested extensively, and the best one can be # selected for each specific use. # # Basically, it's the following flow graph: # # CPU can be set to switch independetly | CPU can only be set # within specific "limits" | to specific frequencies # # "CPUfreq policy" # consists of frequency limits (policy->{min,max}) # and CPUfreq governor to be used # / \ # / \ # / the cpufreq governor decides # / (dynamically or statically) # / what target_freq to set within # / the limits of policy->{min,max} # / \ # / \ # Using the ->setpolicy call, Using the ->target call, # the limits and the the frequency closest # "policy" is set. to target_freq is set. # It is assured that it # is within policy->{min,max} # # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.2 # acpi sleep: move sleep support into own subdirectory. # -------------------------------------------- # 03/02/12 davej@codemonkey.org.uk 1.1003.3.3 # [CPUFREQ] fix longrun min/max confusion. # -------------------------------------------- # 03/02/12 torvalds@penguin.transmeta.com 1.1003.1.5 # Merge bk://linux-dj.bkbits.net/cpufreq # into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.6 # [PATCH] genhd warnings fix # # I have a whole bunch of silly compile warning fixes here, arising from # building the kernel for a 64-bit target. Some are trivial, some are genuine # printk bugs. # # assuming dev_t is unsigned generates a warning on ppc64. Cast it. # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.7 # [PATCH] kill warning in vmscan.c # # Make the "duplicate const" warning go away. Arguably a compiler bug... # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.8 # [PATCH] kill some ppc64 warnings in knfsd # # Don't assume that dev_t is an unsigned. Cast it. # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.9 # [PATCH] fix ppc64 wanings in fs/partitions/check.c # # cast dev_t when printing # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.10 # [PATCH] fix ppc64 nfs warning # # Don't assume that dev_t is unsigned. Cast it. # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.11 # [PATCH] fs/reiserfs/hashes.c warning fix # # printk needs kernel.h # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.12 # [PATCH] fix drivers/scsi/st.c warning # # kdev_t.value is not an int. Code looks fishy. # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.13 # [PATCH] provide uniproc write_trylock() # # Patch from Oleg Drokin , Nikita Danilov # # There is no uniprocessor definition of _raw_write_trylock(), so # write_trylock() doesn't work on UP. # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.14 # [PATCH] disassociate_ctty SMP fix # # Patch from Rik van Riel # # the following patch, against today's BK tree, fixes a small # SMP race in disassociate_ctty. This function gets called # from do_exit, without the BKL held. # # However, it sets the *tty variable before grabbing the bkl, # then makes decisions on what the variable was set to before # the lock was grabbed, despite the fact that another process # could modify its ->tty pointer in this same function. # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.15 # [PATCH] make the adaptec driver compile # # make the adaptec driver compile # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.16 # [PATCH] sunrpc dcache cleanup # # Patch from Dipankar Sarma # # All fs should be using dcache APIs to manipulate dcache hash lists. This is # in line with the dcache cleanup patch (dcache_rcu-1) from Maneesh that Linus # accepted. This seems like a reasonable cleanup. One change though, we don't # need to grab dcache_lock while deleting dentries from the private list and # __d_drop() should suffice here. # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.17 # [PATCH] jiffies wrap fixes # # Patch from Tim Schmielau # # Converts many open-coded jiffy comparisons to use time_after/before/etc. # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.18 # [PATCH] EATA driver fix # # This driver is calling down into scsi_register with local interrupts # disabled. scsi_register performs blocking allocations, starts kernel # threads, etc. slab debugging gets offended by someone performing blocking # operations with local interrupts disabled. # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.19 # [PATCH] make drivers/net/arlan.c compile again # # Someone typed `config' when they meant `conf'. # # Also fix a function-defined-but-not-used warning. # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.20 # [PATCH] Allow summit kernels to boot on normal systems # # Patch from: john stultz # # This patch simply fixes the summit subarch to allow summit kernels to # boot on normal systems. # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.21 # [PATCH] Make drivers/media/video/saa7110.c compile # # Patch from: Frank Davis # # The following patch addresses bugzilla bug # 341. # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.22 # [PATCH] drivers/media/video/saa5249.c compile fix # # Patch from: Frank Davis # # The following addresses bugzilla bug # 340. # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.23 # [PATCH] fix fadvise64() return type # # Patch from: David Mosberger # # Please remember to declare the return-type of syscall stubs as "long". # On 64-bit platforms, it's generally necessary to ensure that the # entire 64-bit return value is valid (and can be checked against # negative values). # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.24 # [PATCH] OSS CS4232 locking fixes # # Patch from: Peter Waechtler # # Addresses BUGME bug #331. "OSS CS4232 nasty spinlock printks on boot" # # The locking in some OSS modules is really lousy. # Because save_flags/cli/restore_flags could be used recursivly - the # programmers pushed the locking too far the lower level. # # Because on ISA cards the register sets are usually multiplexed # you had to write to an address latch and then access the data port # in an "atomic" manner. # # I suggest removing the locking from ad_read/ad_write + # ad_{enter|leave}_MCE and clamping the locks wherever the functions # are called. I hope the attached patch does that correctly. # # Yes, I don't like all the timeout loops while holding the locks: # high chances that a cpu is spinning in interrupt context :( # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.25 # [PATCH] epoll timeout and syscall return types # # Patch from Davide Libenzi # # Changes : # - Timeout overflow check # - Ceil()ing of ms->jif conversion # - Syscalls return type int->long # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.26 # [PATCH] MAP_FIXED|MAP_ANON crash fix # # An anonymous fixed mmap with CONFIG_HUGETLB_PAGE=y will dereference NULL. We # recur into the pagefault handler with mmap_sem held and lock up. # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.27 # [PATCH] u14-34f fix # # Need to reenable interrupts around the call to scsi_register(), which blocks. # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.28 # [PATCH] fix adaptec diagnostics for ppc64 # # The return type of sizeof() is size_t. On many architectrues size_t is # unsigned long, and may not be printed with %d. Use %Zu instead. # -------------------------------------------- # 03/02/12 akpm@digeo.com 1.1003.1.29 # [PATCH] printk size_t qualifier confusion # # My printf manpage says: # # z A following integer conversion corresponds to a # size_t or ssize_t argument. (Linux libc5 has Z with # this meaning. Don't use it.) # # And the opengroup spec says # # z Specifies that a following d , i , o , u , x , or X conversion specifier # applies to a size_t or the corresponding signed integer type argument; or # that a following n conversion specifier applies to a pointer to a signed # integer type corresponding to a size_t argument. # # # yet our vsnprintf implementation has # # /* 'z' support added 23/7/1999 S.H. */ # /* 'z' changed to 'Z' --davidm 1/25/99 */ # # # I guess the path of least surprise is to support both. gcc-3.2.1 doesn't # seem to care. # -------------------------------------------- # 03/02/12 agrover@groveronline.com 1.1003.4.1 # Merge groveronline.com:/root/bk/linux-2.5 # into groveronline.com:/root/bk/linux-acpi # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.3 # acpi: make source files look for headers in (event files) # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.6 # acpi: make source files look for headers in (executor files) # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.7 # acpi: make source files look for headers in (hardware files) # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.8 # acpi: make source files look in for headers (namespace files). # -------------------------------------------- # 03/02/12 acme@conectiva.com.br 1.1003.5.1 # [SUNZILOG]: fix DEVFS device name # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.9 # acpi: make source files look in for headers. (parser files). # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.10 # acpi: make source files look in for headers (resources files). # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.11 # acpi: make source files look in for headers (tables files). # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.12 # acpi: make source files look for headers in . # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.13 # acpi: make headers look in for other headers. # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.14 # acpi: make source files look in for headers. (other top-level files) # -------------------------------------------- # 03/02/12 davej@codemonkey.org.uk 1.1003.6.1 # [WATCHDOG] pcwd.c: if cpu has overheated, we want to shutdown, not panic. # Based on a patch from Tariq Shureih # -------------------------------------------- # 03/02/12 davej@codemonkey.org.uk 1.1003.6.2 # [WATCHDOG] printk levels for pcwd.c # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.15 # acpi: remove some acpi-specific compiler definitions in favor of standard ones. # # - Check if __linux__ is defined in include/acpi/platform/acenv.h, instead # of -D_LINUX (defined by drivers/acpi/Makefile). # - Remove -D_LINUX from custom CFLAGS. # - Remove include path of include/acpi, since all headers are looked for in # include/acpi. # -------------------------------------------- # 03/02/12 davej@codemonkey.org.uk 1.1003.6.3 # [WATCHDOG] More panic -> shutdown replacements in pcwd.c # -------------------------------------------- # 03/02/12 agrover@groveronline.com 1.1003.4.2 # ACPI: Lower errorlevel of a debug message (Matthew Wilcox) # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.16 # acpi: fix recently introduced proc-related bugs. # # Recently, the acpi proc files were changed to use the seq_file interface. # As a result of this, the write methods became top-level write() methods # (i.e. not called by the proc layer). # # Whoever made these changes, did not take into account that the parameters # passed to these changed. The fourth parameter previously was a void*, that # pointed to the private data for the owner of the file, and some of the # methods still expected this, even though the parameter is now an loff_t*, # and points to the offset into the file that is being written. Huge Bug. # # This fixes the broken methods to look in the same place as the other # methods (i.e. in the file's private data). # # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.17 # acpi: split sleep support into generic portion, and procfs-handlers. # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.18 # Consolidate ACPI and APM sysrq implementations. # # Each power management scheme was implmenting a sysrq callback for 'o' which # would call their respective power off routines. # # This moves the installation of the sysrq handler to kernel/pm.c, and calls # pm_power_off(), which will work for any platform that has that method # defined. # -------------------------------------------- # 03/02/12 mochel@osdl.org 1.1003.2.19 # acpi sleep: divorce sleep functionality from power off functionality. # # When ACPI turns the system off on shutdown, it actually enters S5, a sleep # state. This functionality is dependent on CONFIG_ACPI_SLEEP, which is # dependent on CONFIG_SOFTWARE_SUSPEND. # # This patch breaks the power off functionality into a separate file, and # removes the dependency on the above-mentioned crap. Finally, power off works # for me again. # # Thanks to Tobias Ringstrom for the original patch. # -------------------------------------------- # 03/02/12 davem@nuts.ninka.net 1.1003.1.30 # Merge nuts.ninka.net:/home/davem/src/BK/sparcwork-2.5 # into nuts.ninka.net:/home/davem/src/BK/sparc-2.5 # -------------------------------------------- # 03/02/12 davem@nuts.ninka.net 1.1003.1.31 # Merge bk://kernel.bkbits.net/acme/sparc-2.5 # into nuts.ninka.net:/home/davem/src/BK/sparc-2.5 # -------------------------------------------- # 03/02/12 zaitcev@redhat.com 1.1003.1.32 # [SUNZILOG]: Fix off-by-1 in spinlock initialization loop. # -------------------------------------------- # 03/02/12 davem@nuts.ninka.net 1.1003.7.1 # Merge nuts.ninka.net:/home/davem/src/BK/network-2.5 # into nuts.ninka.net:/home/davem/src/BK/net-2.5 # -------------------------------------------- # 03/02/12 ahaas@airmail.net 1.1003.7.2 # [PATCH] C99 initializers for net/sunrpc/sysctl.c # -------------------------------------------- # 03/02/12 ahaas@airmail.net 1.1003.7.3 # [PATCH] C99 initializers for net/unix/sysctl_net_unix.c # -------------------------------------------- # 03/02/12 ahaas@airmail.net 1.1003.7.4 # [PATCH] C99 initializers for net/ipv4/netfilter files # -------------------------------------------- # 03/02/12 ahaas@airmail.net 1.1003.7.5 # [PATCH] C99 initializers for net/sctp/sysctl.c # -------------------------------------------- # 03/02/12 ahaas@airmail.net 1.1003.7.6 # [PATCH] C99 initializers for net/ipv6/netfilter/ip6_queue.c # -------------------------------------------- # 03/02/12 ahaas@airmail.net 1.1003.7.7 # [PATCH] C99 initializers for net/ax25/sysctl_net_ax25.c # -------------------------------------------- # 03/02/12 ahaas@airmail.net 1.1003.7.8 # [PATCH] C99 initializers for net/irda/irsysctl.c # -------------------------------------------- # 03/02/13 jgarzik@redhat.com 1.1003.8.1 # [netdrvr fc/iphase] correct PCI probe loop-end test logic [#323] # # Fixes bugzilla bug #323. # -------------------------------------------- # 03/02/13 jgarzik@redhat.com 1.1003.8.2 # [tokenring smctr] remove stray ';' that prevented a loop from working [#312] # # Fixes broken node address check, and bugzilla bug #312. # -------------------------------------------- # 03/02/13 jgarzik@redhat.com 1.1003.8.3 # [netdrvr amd8111e] remove stray ';', fixing register dump [#311] # # Fixes bugzilla bug #311. # -------------------------------------------- # 03/02/12 latten@austin.ibm.com 1.1003.7.9 # [IPSEC]: Make AF_KEY allow NULL encryption. # -------------------------------------------- # 03/02/12 toml@us.ibm.com 1.1003.7.10 # [IPSEC]: Make sure to clear sin_zero in AF_KEY. # -------------------------------------------- # 03/02/12 davem@nuts.ninka.net 1.1003.7.11 # [IPSEC]: Add missed bit of sin_zero fix. # -------------------------------------------- # 03/02/13 jgarzik@redhat.com 1.1003.8.4 # [netdrvr tg3] DMA MRM bit only exists on 5700, 5701 # # Fixed by David Miller, spotted by Manish Lachwani. # -------------------------------------------- # 03/02/12 toml@us.ibm.com 1.1003.7.12 # [IPSEC] Make sure SADB_X_SPDADD messages have proper spid. # -------------------------------------------- # 03/02/13 jgarzik@redhat.com 1.1003.8.5 # [netdrvr arlan] fix the fixed fix. really. # # struct arlan_private clearly needs to be a pointer. # -------------------------------------------- # 03/02/13 jt@hpl.hp.com 1.1003.9.1 # [irda][CORRECT] Properly initialise IrCOMM status line (DCE settings) # # -------------------------------------------- # 03/02/13 jt@hpl.hp.com 1.1003.9.2 # [irda] better poll bit handling during times of packet loss # # o [CORRECT] fix the secondary function to send RR and frames without # the poll bit when it detect packet losses # -------------------------------------------- # 03/02/13 jt@hpl.hp.com 1.1003.9.3 # [irda] rx/tx wrapper path rewrites and cleanup: # o [FEATURE] Properly inline in wrapper Tx path # o [FEATURE] Rewrite/simplify/optimise wrapper Rx path # Lower CPU overhead *and* kernel image size # o [FEATURE] Add ZeroCopy in wrapper Rx path for drivers that support it # I'll update drivers later on... # -------------------------------------------- # 03/02/13 vojtech@kernel.bkbits.net 1.1018 # Merge kernel.bkbits.net:/home/repos/linux-2.5 # into kernel.bkbits.net:/home/vojtech/input # -------------------------------------------- # 03/02/13 davem@nuts.ninka.net 1.1003.7.13 # [IPSEC]: Fix mis-patch of previous changes. # -------------------------------------------- # 03/02/13 kunihiro@ipinfusion.com 1.1003.7.14 # [IPSEC]: Add ipv6 support infrastructure. # -------------------------------------------- # 03/02/13 davem@nuts.ninka.net 1.1003.7.15 # [IPSEC]: ipv6_syms needs net/xfrm.h # -------------------------------------------- # 03/02/13 davem@nuts.ninka.net 1.1003.7.16 # [IPSEC]: Fix af_key.c build. # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1003.6.4 # [WATCHDOG] missing printk level in acquirewdt # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1003.6.5 # [WATCHDOG] printk levels for alim7101_wdt.c # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1003.6.6 # [WATCHDOG] C99 struct initialisers for sc1200wdt # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1003.6.7 # [WATCHDOG] fix sc1200wdt for CONFIG_PNP=n # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1003.6.8 # [WATCHDOG] C99 struct intiialisers for remaining drivers. # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1003.6.9 # [WATCHDOG] Remove unneeded EXPORT_NO_SYMBOLS from sc1200wdt # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1003.10.1 # [CPUFREQ] Add powernow-k7 driver for AMD mobile Athlon/Duron CPUs. # -------------------------------------------- # 03/02/13 davem@nuts.ninka.net 1.1003.7.17 # [IPSEC]: Mark pfkey_sadb_addr2xfrm_addr static again. # -------------------------------------------- # 03/02/13 davej@tetrachloride.(none) 1.1003.11.1 # Merge tetrachloride.(none):/mnt/stuff/kernel/2.5/bk-linus # into tetrachloride.(none):/mnt/stuff/kernel/2.5/agpgart # -------------------------------------------- # 03/02/13 davej@tetrachloride.(none) 1.1003.12.1 # Merge tetrachloride.(none):/mnt/stuff/kernel/2.5/bk-linus # into tetrachloride.(none):/mnt/stuff/kernel/2.5/watchdog # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1003.12.2 # [WATCHDOG] Merge sma cpu5 watchdog driver. # By Heiko Ronsdorf, has been around linux-kernel a few days, and has # been through some rounds of cleanup. # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1003.12.3 # [WATCHDOG] Remove unneeded includes & EXPORT_NO_SYMBOLS from cpu5wdt # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1003.11.2 # [AGPGART] Export needed symbols for AMD K8 GART # -------------------------------------------- # 03/02/13 mochel@osdl.org 1.1003.13.1 # Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin # into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-power # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1003.10.2 # [CPUFREQ] powernow-k7.c: Zeropad the VID or we get 1.50V instead of 1.050V # -------------------------------------------- # 03/02/13 torvalds@home.transmeta.com 1.1019 # Missed initialization of "curr_target" in execve() dethreading case. # -------------------------------------------- # 03/02/13 torvalds@home.transmeta.com 1.1020 # Make dequeue_signal() take the process as an argument. # # This simplifies it and makes it more generic. # -------------------------------------------- # 03/02/13 akpm@digeo.com 1.1021 # [PATCH] set unplug_timer.function inside blk_queue_make_request # # Patch from Neil Brown # # Initialise the queue's unplug_timer inside blk_queue_make_request. This # makes the new auto-unplugging more accessable by other clients of # blk_queue_make_request - e.g. raid5, umem. # -------------------------------------------- # 03/02/13 akpm@digeo.com 1.1022 # [PATCH] make imm.c build # # Patch from: Ingo Oeser # # Cure imm.c of the recent scsi core damage. # -------------------------------------------- # 03/02/13 akpm@digeo.com 1.1023 # [PATCH] fix hugetlbfs_forget_inode() oddity # # - hugetlbfs_forget_inode() should be using || # -------------------------------------------- # 03/02/13 akpm@digeo.com 1.1024 # [PATCH] sysfs error handling fix # # Patch from: Rusty Lynch # # Attempting to cat a sysfs file that returns an error will result in an # endless dump of garbage to the screen because the result of the specific show # operation was being saved to a size_t (unsigned) and then later checked for a # negative value. # # Here is a trivial patch to fix the error. # -------------------------------------------- # 03/02/13 akpm@digeo.com 1.1025 # [PATCH] ia32 TSC timer cleanup # # Patch from: john stultz # # This cleanup patch makes fast_gettimeoffset_quotient (a timer_tsc specific # variable) static, and replaces its usage with cpu_khz, making it timer_opt # independent. # -------------------------------------------- # 03/02/13 akpm@digeo.com 1.1026 # [PATCH] Cyclone timer fixes # # Patch from: john stultz # # This patch "fixes" the timer_cyclone code by having it # initialize fast_gettimeoffset_quotient and cpu_khz in the same manner as # timer_tsc. This is required for enabling the timer_cyclone code on the # x440. # # Ideally fast_gettimeoffset_quotient would not be used outside timer_tsc # and cpu_khz would be initialized generically outside the timer # subsystem. I have patches to do this, but they touch quite a bit of # generic code, and I'd rather not make the timer_cyclone enablement # (patch to follow) depend on these larger changes. # -------------------------------------------- # 03/02/13 akpm@digeo.com 1.1027 # [PATCH] Enable timer_cyclone code # # Patch from john stultz # # This patch simply enables the existing timer_cyclone code for # Summit/x440 systems. # -------------------------------------------- # 03/02/13 akpm@digeo.com 1.1028 # [PATCH] hugetlbfs i_size fix # # Growing i_size in hugetlbfs_prefault() isn't right - if we run out of pages, # do_mmap_pgoff() will chop the partially-instantiated pages off again. # # So update i_size in hugetlbfs_file_mmap() if the whole mmap attempt was # successful. # -------------------------------------------- # 03/02/13 akpm@digeo.com 1.1029 # [PATCH] xattr: lock_kernel() balancing fix # # Patch from Andreas Gruenbacher # # This patch fixes an unbalanced lock_kernel()/unlock_kernel() path in the ext3 # extended attributes code. Instead of fixing this in fs/ext3/xattr_user.c, # the locking code is moved to fs/ext3/xattr.c, since most other types of # extended attributes will need the exact same functionality. # -------------------------------------------- # 03/02/13 mochel@osdl.org 1.1003.13.2 # acpi: Split i386 support up. # # - Created arch/i386/kernel/acpi/ # - Split file into boot.c and sleep.c. # - Moved acpi_wakeup.S into there. # -------------------------------------------- # 03/02/13 torvalds@home.transmeta.com 1.1030 # Merge bk://kernel.bkbits.net/jgarzik/net-drivers-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/13 torvalds@home.transmeta.com 1.1031 # Merge bk://kernel.bkbits.net/jgarzik/irda-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/13 mochel@osdl.org 1.1003.13.3 # acpi: Only build sleep directory if we have rest of bus support. # -------------------------------------------- # 03/02/13 torvalds@home.transmeta.com 1.1032 # Merge bk://kernel.bkbits.net/davem/sparc-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/13 torvalds@home.transmeta.com 1.1033 # Merge bk://kernel.bkbits.net/davem/net-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/13 torvalds@home.transmeta.com 1.1034 # Fix acl_set_handle() compile that got broken by the xattr # updates. # -------------------------------------------- # 03/02/13 mochel@osdl.org 1.1033.1.1 # Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin # into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-power # -------------------------------------------- # 03/02/13 torvalds@home.transmeta.com 1.1035 # Merge bk://linux-dj.bkbits.net/watchdog # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/13 torvalds@home.transmeta.com 1.1036 # Merge bk://linux-dj.bkbits.net/cpufreq # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1037 # [PATCH] ES1370 OSS fix # # from 2.4 # only register gameport if the port is active # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1038 # [PATCH] ES1371 OSS fix # # from 2.4 # only register gameport if the port is active # -------------------------------------------- # 03/02/13 mochel@osdl.org 1.1033.1.2 # acpi sleep: demote sleep proc file creation. # # - Make acpi_sleep_proc_init() a late_initcall(), and not called from # acpi_sleep_init(). This guarantees that the acpi proc hierarchy is at # least there when we create the dang file. # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1039 # [PATCH] improve K7 SMP tainting. # # If we have a non-SMP approved CPU, but its in a UP system, # we should allow SMP kernels. # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1040 # [PATCH] VIA C3 Nehemiah cachesize errata fix. # # Whoops, VIA goofed, and it reports L2 size as 65KB. # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1041 # [PATCH] fix sigio on tty drivers outgoing # # This went into 2.4.18 # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1042 # [PATCH] nvram driver uses incorrect types in llseek method # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1043 # [PATCH] i2c namespace pollution. # # adap_lock is a little generic for a global.. # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1044 # [PATCH] nwflash driver uses wrong types in llseek methods # # from 2.4 # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1045 # [PATCH] proc_file_read documentation/buffer overflow detection. # # This one has been around for ages, has Rusty's name # all over it, but wasn't from him. # 48 lines of comments, and no swearing? 8-) # # Mostly documentation, but also has some buffer overflow # detection in there. # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1046 # [PATCH] nec vrc5477 oss driver update # # Fixes from 2.4 + compile fixes from me. # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1047 # [PATCH] Missing maintainer. # # Forgot to bring this bit forward when I updated the watchdog drivers. # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1048 # [PATCH] VIA C3 Nehemiah support. # # The new C3s won't boot a C3 kernel as they dropped 3dnow support in # favour of SSE. It now also has cmov though and can be scheduled as a # 686 CPU. # # I've a patch for gcc pending inclusion that adds the -march=c3-2 option. # -------------------------------------------- # 03/02/13 davej@codemonkey.org.uk 1.1049 # [PATCH] OSS rme96xx update. # # Lingering around for a while. 2.4 forward port. # -------------------------------------------- # 03/02/13 David_Jeffery@adaptec.com 1.1050 # [PATCH] ips: missing reboot notifier and Mode Sense P8 # # This adds back the reboot_notifier hook that was accidentally removed in # the last set of patches. # # It also adds support handle a Mode Page 8 command so the scsi layer # won't complain anymore. And the movement to using ->device to get scsi # numbers resulted in 2 typos in debug code. These are also fixed. # -------------------------------------------- # 03/02/13 David_Jeffery@adaptec.com 1.1051 # [PATCH] ips: 2.4 compatability code # # This adds a few bits of code and couple #ifdefs that are needed to # enable this driver to work for 2.4 as well as 2.5. # -------------------------------------------- # 03/02/13 David_Jeffery@adaptec.com 1.1052 # [PATCH] ips: remove LinuxVersionCode # # This removes the old LinuxVersionCode() and replaces it with # KERNEL_VERSION(). Thanks go to Adrian Bunk for sending the initial # version. # -------------------------------------------- # 03/02/13 David_Jeffery@adaptec.com 1.1053 # [PATCH] ips: use scsi_add_host # # This converts the driver to use the new scsi_add_host() interface to add # scsi controllers. # -------------------------------------------- # 03/02/13 mochel@osdl.org 1.1033.1.3 # acpi sleep: demote acpi_sleep_init() to a late_initcall. # # - It depends on the rest of the subsys_initcalls in acpi to be done to get # the sleep info from the firmware. # - It doesn't need to be available any earlier... # -------------------------------------------- # 03/02/13 agrover@groveronline.com 1.1054 # Merge groveronline.com:/root/bk/linux-2.5 # into groveronline.com:/root/bk/linux-acpi # -------------------------------------------- # 03/02/13 torvalds@penguin.transmeta.com 1.1053.1.1 # Merge bk://ldm.bkbits.net/linux-2.5-power # into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux # -------------------------------------------- # 03/02/13 torvalds@penguin.transmeta.com 1.1053.1.2 # Merge bk://linux-dj.bkbits.net/agpgart # into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux # -------------------------------------------- # 03/02/13 agrover@groveronline.com 1.1053.2.1 # Merge http://ldm.bkbits.net/linux-2.5-power # into groveronline.com:/root/bk/linux-mochel # -------------------------------------------- # 03/02/13 agrover@groveronline.com 1.1055 # Merge groveronline.com:/root/bk/linux-mochel # into groveronline.com:/root/bk/linux-acpi # -------------------------------------------- # 03/02/13 agrover@groveronline.com 1.1056 # ACPI: Fix whitespace (Pavel Machek) # -------------------------------------------- # 03/02/13 ionut@badula.org 1.1053.1.3 # [PATCH] starfire driver update for 2.5.60 # # This is a rather large update for the starfire network driver, # implementing VLAN support, 64-bit dma_addr_t support, and NAPI support. It # also fixes a couple of show-stopper bugs in the old driver which were # biting real people out there. # # I've had a few positive test results with this version, including one from # Martin Bligh who tested it on his monster SMP boxes. So I'm pretty # confident that it's mostly all right, and certainly better than what's # currently in the tree. # -------------------------------------------- # 03/02/13 agrover@groveronline.com 1.1057 # Merge groveronline.com:/root/bk/linux-2.5 # into groveronline.com:/root/bk/linux-acpi # -------------------------------------------- # 03/02/13 roland@frob.com 1.1053.1.4 # [PATCH] Ctrl-C-ing strace # # This patch fix es the signals vs strace problem. The signal code # assumes that anybody who is TAK_STOPPED will check signals before # resuming, and the ptrace paths didn't do that. # -------------------------------------------- # 03/02/13 agrover@groveronline.com 1.1058 # ACPI: Fix some compilation issues # -------------------------------------------- # 03/02/13 trond.myklebust@fys.uio.no 1.1053.1.5 # [PATCH] further rpc_pipefs cleanups... # # - Only set up pipefs entries for those RPC services that actually # need them (for the moment NFS only). Portmap, lockd,... shouldn't # need to make upcalls. # # - Add in missing semaphore in rpc_populate(). # # - Make inode/dentry variable names in rpc_depopulate/rpc_populate # more consistent w.r.t other functions in rpc_pipe.c # # - Call shrink_dcache_parent() in order to clean up child entries # before we rmdir(). # -------------------------------------------- # 03/02/13 trond.myklebust@fys.uio.no 1.1053.1.6 # [PATCH] Clean up and fix SMP issue w.r.t. XID allocation # # This problem was identified by Olaf Kirch: # # In xprt_request_init(), the XID allocation needs to be protected by a # global spinlock. # -------------------------------------------- # 03/02/13 torvalds@home.transmeta.com 1.1059 # Merge http://linux-acpi.bkbits.net/linux-acpi # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/02/13 akpm@digeo.com 1.1060 # [PATCH] ACPI sleep build fix # # If you have !CONFIG_ACPI_SLEEP and CONFIG_PROC_FS, drivers/acpi/sleep/proc.o # is built, but drivers/acpi/sleep/main.o is not. # # But proc.o needs symbols from main.o # -------------------------------------------- # diff -Nru a/Documentation/sound/rme96xx b/Documentation/sound/rme96xx --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/Documentation/sound/rme96xx Fri Feb 14 00:27:30 2003 @@ -0,0 +1,767 @@ +Beta release of the rme96xx (driver for RME 96XX cards like the +"Hammerfall" and the "Hammerfall light") + +Important: The driver module has to be installed on a freshly rebooted system, +otherwise the driver might not be able to acquire its buffers. + +features: + + - OSS programming interface (i.e. runs with standard OSS soundsoftware) + - OSS/Multichannel interface (OSS multichannel is done by just aquiring + more than 2 channels). The driver does not use more than one device + ( yet .. this feature may be implemented later ) + - more than one RME card supported + +The driver uses a specific multichannel interface, which I will document +when the driver gets stable. (take a look at the defines in rme96xx.h, +which adds blocked multichannel formats i.e instead of +lrlrlrlr --> llllrrrr etc. + +Use the "rmectrl" programm to look at the status of the card .. +or use xrmectrl, a GUI interface for the ctrl program. + +What you can do with the rmectrl program is to set the stereo device for +OSS emulation (e.g. if you use SPDIF out). + +You do: + +./ctrl offset 24 24 + +which makes the stereo device use channels 25 and 26. + +Guenter Geiger + +copy the first part of the attached source code into rmectrl.c +and the second part into xrmectrl (or get the program from +http://gige.xdv.org/pages/soft/pages/rme) + +to compile: gcc -o rmectrl rmectrl.c +------------------------------ snip ------------------------------------ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "rme96xx.h" + +/* + remctrl.c + (C) 2000 Guenter Geiger + HP20020201 - Heiko Purnhagen +*/ + +/* # define DEVICE_NAME "/dev/mixer" */ +# define DEVICE_NAME "/dev/mixer1" + + +void usage(void) +{ + fprintf(stderr,"usage: rmectrl [/dev/mixer] [command [options]]\n\n"); + fprintf(stderr,"where command is one of:\n"); + fprintf(stderr," help show this help\n"); + fprintf(stderr," status show status bits\n"); + fprintf(stderr," control show control bits\n"); + fprintf(stderr," mix show mixer/offset status\n"); + fprintf(stderr," master set sync master\n"); + fprintf(stderr," pro set spdif out pro\n"); + fprintf(stderr," emphasis set spdif out emphasis\n"); + fprintf(stderr," dolby set spdif out no audio\n"); + fprintf(stderr," optout set spdif out optical\n"); + fprintf(stderr," wordclock set sync wordclock\n"); + fprintf(stderr," spdifin set spdif in (0=optical,1=coax,2=intern)\n"); + fprintf(stderr," syncref set sync source (0=ADAT1,1=ADAT2,2=ADAT3,3=SPDIF)\n"); + fprintf(stderr," adat1cd set ADAT1 on internal CD\n"); + fprintf(stderr," offset set dev (0..3) offset (0..25)\n"); + exit(-1); +} + + +int main(int argc, char* argv[]) +{ + int cards; + int ret; + int i; + double ft; + int fd, fdwr; + int param,orig; + rme_status_t stat; + rme_ctrl_t ctrl; + char *device; + int argidx; + + if (argc < 2) + usage(); + + if (*argv[1]=='/') { + device = argv[1]; + argidx = 2; + } + else { + device = DEVICE_NAME; + argidx = 1; + } + + fprintf(stdout,"mixer device %s\n",device); + if ((fd = open(device,O_RDONLY)) < 0) { + fprintf(stdout,"opening device failed\n"); + exit(-1); + } + + if ((fdwr = open(device,O_WRONLY)) < 0) { + fprintf(stdout,"opening device failed\n"); + exit(-1); + } + + if (argc < argidx+1) + usage(); + + if (!strcmp(argv[argidx],"help")) + usage(); + if (!strcmp(argv[argidx],"-h")) + usage(); + if (!strcmp(argv[argidx],"--help")) + usage(); + + if (!strcmp(argv[argidx],"status")) { + ioctl(fd,SOUND_MIXER_PRIVATE2,&stat); + fprintf(stdout,"stat.irq %d\n",stat.irq); + fprintf(stdout,"stat.lockmask %d\n",stat.lockmask); + fprintf(stdout,"stat.sr48 %d\n",stat.sr48); + fprintf(stdout,"stat.wclock %d\n",stat.wclock); + fprintf(stdout,"stat.bufpoint %d\n",stat.bufpoint); + fprintf(stdout,"stat.syncmask %d\n",stat.syncmask); + fprintf(stdout,"stat.doublespeed %d\n",stat.doublespeed); + fprintf(stdout,"stat.tc_busy %d\n",stat.tc_busy); + fprintf(stdout,"stat.tc_out %d\n",stat.tc_out); + fprintf(stdout,"stat.crystalrate %d (0=64k 3=96k 4=88.2k 5=48k 6=44.1k 7=32k)\n",stat.crystalrate); + fprintf(stdout,"stat.spdif_error %d\n",stat.spdif_error); + fprintf(stdout,"stat.bufid %d\n",stat.bufid); + fprintf(stdout,"stat.tc_valid %d\n",stat.tc_valid); + exit (0); + } + + if (!strcmp(argv[argidx],"control")) { + ioctl(fd,SOUND_MIXER_PRIVATE3,&ctrl); + fprintf(stdout,"ctrl.start %d\n",ctrl.start); + fprintf(stdout,"ctrl.latency %d (0=64 .. 7=8192)\n",ctrl.latency); + fprintf(stdout,"ctrl.master %d\n",ctrl.master); + fprintf(stdout,"ctrl.ie %d\n",ctrl.ie); + fprintf(stdout,"ctrl.sr48 %d\n",ctrl.sr48); + fprintf(stdout,"ctrl.spare %d\n",ctrl.spare); + fprintf(stdout,"ctrl.doublespeed %d\n",ctrl.doublespeed); + fprintf(stdout,"ctrl.pro %d\n",ctrl.pro); + fprintf(stdout,"ctrl.emphasis %d\n",ctrl.emphasis); + fprintf(stdout,"ctrl.dolby %d\n",ctrl.dolby); + fprintf(stdout,"ctrl.opt_out %d\n",ctrl.opt_out); + fprintf(stdout,"ctrl.wordclock %d\n",ctrl.wordclock); + fprintf(stdout,"ctrl.spdif_in %d (0=optical,1=coax,2=intern)\n",ctrl.spdif_in); + fprintf(stdout,"ctrl.sync_ref %d (0=ADAT1,1=ADAT2,2=ADAT3,3=SPDIF)\n",ctrl.sync_ref); + fprintf(stdout,"ctrl.spdif_reset %d\n",ctrl.spdif_reset); + fprintf(stdout,"ctrl.spdif_select %d\n",ctrl.spdif_select); + fprintf(stdout,"ctrl.spdif_clock %d\n",ctrl.spdif_clock); + fprintf(stdout,"ctrl.spdif_write %d\n",ctrl.spdif_write); + fprintf(stdout,"ctrl.adat1_cd %d\n",ctrl.adat1_cd); + exit (0); + } + + if (!strcmp(argv[argidx],"mix")) { + rme_mixer mix; + int i; + + for (i=0; i<4; i++) { + mix.devnr = i; + ioctl(fd,SOUND_MIXER_PRIVATE1,&mix); + if (mix.devnr == i) { + fprintf(stdout,"devnr %d\n",mix.devnr); + fprintf(stdout,"mix.i_offset %2d (0-25)\n",mix.i_offset); + fprintf(stdout,"mix.o_offset %2d (0-25)\n",mix.o_offset); + } + } + exit (0); + } + +/* the control flags */ + + if (argc < argidx+2) + usage(); + + if (!strcmp(argv[argidx],"master")) { + int val = atoi(argv[argidx+1]); + ioctl(fd,SOUND_MIXER_PRIVATE3,&ctrl); + printf("master = %d\n",val); + ctrl.master = val; + ioctl(fdwr,SOUND_MIXER_PRIVATE3,&ctrl); + exit (0); + } + + if (!strcmp(argv[argidx],"pro")) { + int val = atoi(argv[argidx+1]); + ioctl(fd,SOUND_MIXER_PRIVATE3,&ctrl); + printf("pro = %d\n",val); + ctrl.pro = val; + ioctl(fdwr,SOUND_MIXER_PRIVATE3,&ctrl); + exit (0); + } + + if (!strcmp(argv[argidx],"emphasis")) { + int val = atoi(argv[argidx+1]); + ioctl(fd,SOUND_MIXER_PRIVATE3,&ctrl); + printf("emphasis = %d\n",val); + ctrl.emphasis = val; + ioctl(fdwr,SOUND_MIXER_PRIVATE3,&ctrl); + exit (0); + } + + if (!strcmp(argv[argidx],"dolby")) { + int val = atoi(argv[argidx+1]); + ioctl(fd,SOUND_MIXER_PRIVATE3,&ctrl); + printf("dolby = %d\n",val); + ctrl.dolby = val; + ioctl(fdwr,SOUND_MIXER_PRIVATE3,&ctrl); + exit (0); + } + + if (!strcmp(argv[argidx],"optout")) { + int val = atoi(argv[argidx+1]); + ioctl(fd,SOUND_MIXER_PRIVATE3,&ctrl); + printf("optout = %d\n",val); + ctrl.opt_out = val; + ioctl(fdwr,SOUND_MIXER_PRIVATE3,&ctrl); + exit (0); + } + + if (!strcmp(argv[argidx],"wordclock")) { + int val = atoi(argv[argidx+1]); + ioctl(fd,SOUND_MIXER_PRIVATE3,&ctrl); + printf("wordclock = %d\n",val); + ctrl.wordclock = val; + ioctl(fdwr,SOUND_MIXER_PRIVATE3,&ctrl); + exit (0); + } + + if (!strcmp(argv[argidx],"spdifin")) { + int val = atoi(argv[argidx+1]); + ioctl(fd,SOUND_MIXER_PRIVATE3,&ctrl); + printf("spdifin = %d\n",val); + ctrl.spdif_in = val; + ioctl(fdwr,SOUND_MIXER_PRIVATE3,&ctrl); + exit (0); + } + + if (!strcmp(argv[argidx],"syncref")) { + int val = atoi(argv[argidx+1]); + ioctl(fd,SOUND_MIXER_PRIVATE3,&ctrl); + printf("syncref = %d\n",val); + ctrl.sync_ref = val; + ioctl(fdwr,SOUND_MIXER_PRIVATE3,&ctrl); + exit (0); + } + + if (!strcmp(argv[argidx],"adat1cd")) { + int val = atoi(argv[argidx+1]); + ioctl(fd,SOUND_MIXER_PRIVATE3,&ctrl); + printf("adat1cd = %d\n",val); + ctrl.adat1_cd = val; + ioctl(fdwr,SOUND_MIXER_PRIVATE3,&ctrl); + exit (0); + } + +/* setting offset */ + + if (argc < argidx+4) + usage(); + + if (!strcmp(argv[argidx],"offset")) { + rme_mixer mix; + + mix.devnr = atoi(argv[argidx+1]); + + mix.i_offset = atoi(argv[argidx+2]); + mix.o_offset = atoi(argv[argidx+3]); + ioctl(fdwr,SOUND_MIXER_PRIVATE1,&mix); + fprintf(stdout,"devnr %d\n",mix.devnr); + fprintf(stdout,"mix.i_offset to %d\n",mix.i_offset); + fprintf(stdout,"mix.o_offset to %d\n",mix.o_offset); + exit (0); + } + + usage(); + exit (0); /* to avoid warning */ +} + + +---------------------------- -------------------------------- +#!/usr/bin/wish + +# xrmectrl +# (C) 2000 Guenter Geiger +# HP20020201 - Heiko Purnhagen + +#set defaults "-relief ridged" +set CTRLPROG "./rmectrl" +if {$argc} { + set CTRLPROG "$CTRLPROG $argv" +} +puts "CTRLPROG $CTRLPROG" + +frame .butts +button .butts.exit -text "Exit" -command "exit" -relief ridge +#button .butts.state -text "State" -command "get_all" + +pack .butts.exit -side left +pack .butts -side bottom + + +# +# STATUS +# + +frame .status + +# Sampling Rate + +frame .status.sr +label .status.sr.text -text "Sampling Rate" -justify left +radiobutton .status.sr.441 -selectcolor red -text "44.1 kHz" -width 10 -anchor nw -variable srate -value 44100 -font times +radiobutton .status.sr.480 -selectcolor red -text "48 kHz" -width 10 -anchor nw -variable srate -value 48000 -font times +radiobutton .status.sr.882 -selectcolor red -text "88.2 kHz" -width 10 -anchor nw -variable srate -value 88200 -font times +radiobutton .status.sr.960 -selectcolor red -text "96 kHz" -width 10 -anchor nw -variable srate -value 96000 -font times + +pack .status.sr.text .status.sr.441 .status.sr.480 .status.sr.882 .status.sr.960 -side top -padx 3 + +# Lock + +frame .status.lock +label .status.lock.text -text "Lock" -justify left +checkbutton .status.lock.adat1 -selectcolor red -text "ADAT1" -anchor nw -width 10 -variable adatlock1 -font times +checkbutton .status.lock.adat2 -selectcolor red -text "ADAT2" -anchor nw -width 10 -variable adatlock2 -font times +checkbutton .status.lock.adat3 -selectcolor red -text "ADAT3" -anchor nw -width 10 -variable adatlock3 -font times + +pack .status.lock.text .status.lock.adat1 .status.lock.adat2 .status.lock.adat3 -side top -padx 3 + +# Sync + +frame .status.sync +label .status.sync.text -text "Sync" -justify left +checkbutton .status.sync.adat1 -selectcolor red -text "ADAT1" -anchor nw -width 10 -variable adatsync1 -font times +checkbutton .status.sync.adat2 -selectcolor red -text "ADAT2" -anchor nw -width 10 -variable adatsync2 -font times +checkbutton .status.sync.adat3 -selectcolor red -text "ADAT3" -anchor nw -width 10 -variable adatsync3 -font times + +pack .status.sync.text .status.sync.adat1 .status.sync.adat2 .status.sync.adat3 -side top -padx 3 + +# Timecode + +frame .status.tc +label .status.tc.text -text "Timecode" -justify left +checkbutton .status.tc.busy -selectcolor red -text "busy" -anchor nw -width 10 -variable tcbusy -font times +checkbutton .status.tc.out -selectcolor red -text "out" -anchor nw -width 10 -variable tcout -font times +checkbutton .status.tc.valid -selectcolor red -text "valid" -anchor nw -width 10 -variable tcvalid -font times + +pack .status.tc.text .status.tc.busy .status.tc.out .status.tc.valid -side top -padx 3 + +# SPDIF In + +frame .status.spdif +label .status.spdif.text -text "SPDIF In" -justify left +label .status.spdif.sr -text "--.- kHz" -anchor n -width 10 -font times +checkbutton .status.spdif.error -selectcolor red -text "Input Lock" -anchor nw -width 10 -variable spdiferr -font times + +pack .status.spdif.text .status.spdif.sr .status.spdif.error -side top -padx 3 + +pack .status.sr .status.lock .status.sync .status.tc .status.spdif -side left -fill x -anchor n -expand 1 + + +# +# CONTROL +# + +proc setprof {} { + global CTRLPROG + global spprof + exec $CTRLPROG pro $spprof +} + +proc setemph {} { + global CTRLPROG + global spemph + exec $CTRLPROG emphasis $spemph +} + +proc setnoaud {} { + global CTRLPROG + global spnoaud + exec $CTRLPROG dolby $spnoaud +} + +proc setoptical {} { + global CTRLPROG + global spoptical + exec $CTRLPROG optout $spoptical +} + +proc setspdifin {} { + global CTRLPROG + global spdifin + exec $CTRLPROG spdifin [expr $spdifin - 1] +} + +proc setsyncsource {} { + global CTRLPROG + global syncsource + exec $CTRLPROG syncref [expr $syncsource -1] +} + + +proc setmaster {} { + global CTRLPROG + global master + exec $CTRLPROG master $master +} + +proc setwordclock {} { + global CTRLPROG + global wordclock + exec $CTRLPROG wordclock $wordclock +} + +proc setadat1cd {} { + global CTRLPROG + global adat1cd + exec $CTRLPROG adat1cd $adat1cd +} + + +frame .control + +# SPDIF In & SPDIF Out + + +frame .control.spdif + +frame .control.spdif.in +label .control.spdif.in.text -text "SPDIF In" -justify left +radiobutton .control.spdif.in.input1 -text "Optical" -anchor nw -width 13 -variable spdifin -value 1 -command setspdifin -selectcolor blue -font times +radiobutton .control.spdif.in.input2 -text "Coaxial" -anchor nw -width 13 -variable spdifin -value 2 -command setspdifin -selectcolor blue -font times +radiobutton .control.spdif.in.input3 -text "Intern " -anchor nw -width 13 -variable spdifin -command setspdifin -value 3 -selectcolor blue -font times + +checkbutton .control.spdif.in.adat1cd -text "ADAT1 Intern" -anchor nw -width 13 -variable adat1cd -command setadat1cd -selectcolor blue -font times + +pack .control.spdif.in.text .control.spdif.in.input1 .control.spdif.in.input2 .control.spdif.in.input3 .control.spdif.in.adat1cd + +label .control.spdif.space + +frame .control.spdif.out +label .control.spdif.out.text -text "SPDIF Out" -justify left +checkbutton .control.spdif.out.pro -text "Professional" -anchor nw -width 13 -variable spprof -command setprof -selectcolor blue -font times +checkbutton .control.spdif.out.emphasis -text "Emphasis" -anchor nw -width 13 -variable spemph -command setemph -selectcolor blue -font times +checkbutton .control.spdif.out.dolby -text "NoAudio" -anchor nw -width 13 -variable spnoaud -command setnoaud -selectcolor blue -font times +checkbutton .control.spdif.out.optout -text "Optical Out" -anchor nw -width 13 -variable spoptical -command setoptical -selectcolor blue -font times + +pack .control.spdif.out.optout .control.spdif.out.dolby .control.spdif.out.emphasis .control.spdif.out.pro .control.spdif.out.text -side bottom + +pack .control.spdif.in .control.spdif.space .control.spdif.out -side top -fill y -padx 3 -expand 1 + +# Sync Mode & Sync Source + +frame .control.sync +frame .control.sync.mode +label .control.sync.mode.text -text "Sync Mode" -justify left +checkbutton .control.sync.mode.master -text "Master" -anchor nw -width 13 -variable master -command setmaster -selectcolor blue -font times +checkbutton .control.sync.mode.wc -text "Wordclock" -anchor nw -width 13 -variable wordclock -command setwordclock -selectcolor blue -font times + +pack .control.sync.mode.text .control.sync.mode.master .control.sync.mode.wc + +label .control.sync.space + +frame .control.sync.src +label .control.sync.src.text -text "Sync Source" -justify left +radiobutton .control.sync.src.input1 -text "ADAT1" -anchor nw -width 13 -variable syncsource -value 1 -command setsyncsource -selectcolor blue -font times +radiobutton .control.sync.src.input2 -text "ADAT2" -anchor nw -width 13 -variable syncsource -value 2 -command setsyncsource -selectcolor blue -font times +radiobutton .control.sync.src.input3 -text "ADAT3" -anchor nw -width 13 -variable syncsource -command setsyncsource -value 3 -selectcolor blue -font times +radiobutton .control.sync.src.input4 -text "SPDIF" -anchor nw -width 13 -variable syncsource -command setsyncsource -value 4 -selectcolor blue -font times + +pack .control.sync.src.input4 .control.sync.src.input3 .control.sync.src.input2 .control.sync.src.input1 .control.sync.src.text -side bottom + +pack .control.sync.mode .control.sync.space .control.sync.src -side top -fill y -padx 3 -expand 1 + +label .control.space -text "" -width 10 + +# Buffer Size + +frame .control.buf +label .control.buf.text -text "Buffer Size (Latency)" -justify left +radiobutton .control.buf.b1 -selectcolor red -text "64 (1.5 ms)" -width 13 -anchor nw -variable ssrate -value 1 -font times +radiobutton .control.buf.b2 -selectcolor red -text "128 (3 ms)" -width 13 -anchor nw -variable ssrate -value 2 -font times +radiobutton .control.buf.b3 -selectcolor red -text "256 (6 ms)" -width 13 -anchor nw -variable ssrate -value 3 -font times +radiobutton .control.buf.b4 -selectcolor red -text "512 (12 ms)" -width 13 -anchor nw -variable ssrate -value 4 -font times +radiobutton .control.buf.b5 -selectcolor red -text "1024 (23 ms)" -width 13 -anchor nw -variable ssrate -value 5 -font times +radiobutton .control.buf.b6 -selectcolor red -text "2048 (46 ms)" -width 13 -anchor nw -variable ssrate -value 6 -font times +radiobutton .control.buf.b7 -selectcolor red -text "4096 (93 ms)" -width 13 -anchor nw -variable ssrate -value 7 -font times +radiobutton .control.buf.b8 -selectcolor red -text "8192 (186 ms)" -width 13 -anchor nw -variable ssrate -value 8 -font times + +pack .control.buf.text .control.buf.b1 .control.buf.b2 .control.buf.b3 .control.buf.b4 .control.buf.b5 .control.buf.b6 .control.buf.b7 .control.buf.b8 -side top -padx 3 + +# Offset + +frame .control.offset + +frame .control.offset.in +label .control.offset.in.text -text "Offset In" -justify left +label .control.offset.in.off0 -text "dev\#0: -" -anchor nw -width 10 -font times +label .control.offset.in.off1 -text "dev\#1: -" -anchor nw -width 10 -font times +label .control.offset.in.off2 -text "dev\#2: -" -anchor nw -width 10 -font times +label .control.offset.in.off3 -text "dev\#3: -" -anchor nw -width 10 -font times + +pack .control.offset.in.text .control.offset.in.off0 .control.offset.in.off1 .control.offset.in.off2 .control.offset.in.off3 + +label .control.offset.space + +frame .control.offset.out +label .control.offset.out.text -text "Offset Out" -justify left +label .control.offset.out.off0 -text "dev\#0: -" -anchor nw -width 10 -font times +label .control.offset.out.off1 -text "dev\#1: -" -anchor nw -width 10 -font times +label .control.offset.out.off2 -text "dev\#2: -" -anchor nw -width 10 -font times +label .control.offset.out.off3 -text "dev\#3: -" -anchor nw -width 10 -font times + +pack .control.offset.out.off3 .control.offset.out.off2 .control.offset.out.off1 .control.offset.out.off0 .control.offset.out.text -side bottom + +pack .control.offset.in .control.offset.space .control.offset.out -side top -fill y -padx 3 -expand 1 + + +pack .control.spdif .control.sync .control.space .control.buf .control.offset -side left -fill both -anchor n -expand 1 + + +label .statustext -text Status -justify center -relief ridge +label .controltext -text Control -justify center -relief ridge + +label .statusspace +label .controlspace + +pack .statustext .status .statusspace .controltext .control .controlspace -side top -anchor nw -fill both -expand 1 + + +proc get_bit {output sstr} { + set idx1 [string last [concat $sstr 1] $output] + set idx1 [expr $idx1 != -1] + return $idx1 +} + +proc get_val {output sstr} { + set val [string wordend $output [string last $sstr $output]] + set val [string range $output $val [expr $val+1]] + return $val +} + +proc get_val2 {output sstr} { + set val [string wordend $output [string first $sstr $output]] + set val [string range $output $val [expr $val+2]] + return $val +} + +proc get_control {} { + global spprof + global spemph + global spnoaud + global spoptical + global spdifin + global ssrate + global master + global wordclock + global syncsource + global CTRLPROG + + set f [open "| $CTRLPROG control" r+] + set ooo [read $f 1000] + close $f +# puts $ooo + + set spprof [ get_bit $ooo "pro"] + set spemph [ get_bit $ooo "emphasis"] + set spnoaud [ get_bit $ooo "dolby"] + set spoptical [ get_bit $ooo "opt_out"] + set spdifin [ expr [ get_val $ooo "spdif_in"] + 1] + set ssrate [ expr [ get_val $ooo "latency"] + 1] + set master [ expr [ get_val $ooo "master"]] + set wordclock [ expr [ get_val $ooo "wordclock"]] + set syncsource [ expr [ get_val $ooo "sync_ref"] + 1] +} + +proc get_status {} { + global srate + global ctrlcom + + global adatlock1 + global adatlock2 + global adatlock3 + + global adatsync1 + global adatsync2 + global adatsync3 + + global tcbusy + global tcout + global tcvalid + + global spdiferr + global crystal + global .status.spdif.text + global CTRLPROG + + + set f [open "| $CTRLPROG status" r+] + set ooo [read $f 1000] + close $f +# puts $ooo + +# samplerate + + set idx1 [string last "sr48 1" $ooo] + set idx2 [string last "doublespeed 1" $ooo] + if {$idx1 >= 0} { + set fact1 48000 + } else { + set fact1 44100 + } + + if {$idx2 >= 0} { + set fact2 2 + } else { + set fact2 1 + } + set srate [expr $fact1 * $fact2] +# ADAT lock + + set val [get_val $ooo lockmask] + set adatlock1 0 + set adatlock2 0 + set adatlock3 0 + if {[expr $val & 1]} { + set adatlock3 1 + } + if {[expr $val & 2]} { + set adatlock2 1 + } + if {[expr $val & 4]} { + set adatlock1 1 + } + +# ADAT sync + set val [get_val $ooo syncmask] + set adatsync1 0 + set adatsync2 0 + set adatsync3 0 + + if {[expr $val & 1]} { + set adatsync3 1 + } + if {[expr $val & 2]} { + set adatsync2 1 + } + if {[expr $val & 4]} { + set adatsync1 1 + } + +# TC busy + + set tcbusy [get_bit $ooo "busy"] + set tcout [get_bit $ooo "out"] + set tcvalid [get_bit $ooo "valid"] + set spdiferr [expr [get_bit $ooo "spdif_error"] == 0] + +# 000=64kHz, 100=88.2kHz, 011=96kHz +# 111=32kHz, 110=44.1kHz, 101=48kHz + + set val [get_val $ooo crystalrate] + + set crystal "--.- kHz" + if {$val == 0} { + set crystal "64 kHz" + } + if {$val == 4} { + set crystal "88.2 kHz" + } + if {$val == 3} { + set crystal "96 kHz" + } + if {$val == 7} { + set crystal "32 kHz" + } + if {$val == 6} { + set crystal "44.1 kHz" + } + if {$val == 5} { + set crystal "48 kHz" + } + .status.spdif.sr configure -text $crystal +} + +proc get_offset {} { + global inoffset + global outoffset + global CTRLPROG + + set f [open "| $CTRLPROG mix" r+] + set ooo [read $f 1000] + close $f +# puts $ooo + + if { [string match "*devnr*" $ooo] } { + set ooo [string range $ooo [string wordend $ooo [string first devnr $ooo]] end] + set val [get_val2 $ooo i_offset] + .control.offset.in.off0 configure -text "dev\#0: $val" + set val [get_val2 $ooo o_offset] + .control.offset.out.off0 configure -text "dev\#0: $val" + } else { + .control.offset.in.off0 configure -text "dev\#0: -" + .control.offset.out.off0 configure -text "dev\#0: -" + } + if { [string match "*devnr*" $ooo] } { + set ooo [string range $ooo [string wordend $ooo [string first devnr $ooo]] end] + set val [get_val2 $ooo i_offset] + .control.offset.in.off1 configure -text "dev\#1: $val" + set val [get_val2 $ooo o_offset] + .control.offset.out.off1 configure -text "dev\#1: $val" + } else { + .control.offset.in.off1 configure -text "dev\#1: -" + .control.offset.out.off1 configure -text "dev\#1: -" + } + if { [string match "*devnr*" $ooo] } { + set ooo [string range $ooo [string wordend $ooo [string first devnr $ooo]] end] + set val [get_val2 $ooo i_offset] + .control.offset.in.off2 configure -text "dev\#2: $val" + set val [get_val2 $ooo o_offset] + .control.offset.out.off2 configure -text "dev\#2: $val" + } else { + .control.offset.in.off2 configure -text "dev\#2: -" + .control.offset.out.off2 configure -text "dev\#2: -" + } + if { [string match "*devnr*" $ooo] } { + set ooo [string range $ooo [string wordend $ooo [string first devnr $ooo]] end] + set val [get_val2 $ooo i_offset] + .control.offset.in.off3 configure -text "dev\#3: $val" + set val [get_val2 $ooo o_offset] + .control.offset.out.off3 configure -text "dev\#3: $val" + } else { + .control.offset.in.off3 configure -text "dev\#3: -" + .control.offset.out.off3 configure -text "dev\#3: -" + } +} + + +proc get_all {} { +get_status +get_control +get_offset +} + +# main +while {1} { + after 200 + get_all + update +} diff -Nru a/MAINTAINERS b/MAINTAINERS --- a/MAINTAINERS Fri Feb 14 00:27:28 2003 +++ b/MAINTAINERS Fri Feb 14 00:27:28 2003 @@ -460,6 +460,13 @@ W: http://www.cyclades.com/ S: Supported +DAC960 RAID CONTROLLER DRIVER +P: Dave Olien +M dmo@osdl.org +W: http://www.osdl.org/archive/dmo/DAC960 +L: linux-kernel@vger.kernel.org +S: Maintained + DAMA SLAVE for AX.25 P: Joerg Reuter M: jreuter@yaina.de @@ -1498,6 +1505,11 @@ P: Eberhard Moenkeberg M: emoenke@gwdg.de L: linux-kernel@vger.kernel.org +S: Maintained + +SC1200 WDT DRIVER +P: Zwane Mwaikambo +M: zwane@commfireservices.com S: Maintained SCHEDULER diff -Nru a/Makefile b/Makefile --- a/Makefile Fri Feb 14 00:27:27 2003 +++ b/Makefile Fri Feb 14 00:27:27 2003 @@ -36,7 +36,8 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) ARCH := $(SUBARCH) -KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g") +# Remove hyphens since they have special meaning in RPM filenames +KERNELPATH=kernel-$(subst -,,$(KERNELRELEASE)) UTS_MACHINE := $(ARCH) @@ -355,7 +356,7 @@ # It's a three stage process: # o .tmp_vmlinux1 has all symbols and sections, but __kallsyms is # empty -# Running kallsyms on that gives as .tmp_kallsyms1.o with +# Running kallsyms on that gives us .tmp_kallsyms1.o with # the right size # o .tmp_vmlinux2 now has a __kallsyms section of the right size, # but due to the added section, some addresses have shifted @@ -689,7 +690,7 @@ # make clean Delete all automatically generated files, including # tools and firmware. # make mrproper Delete the current configuration, and related files -# Any core files spread around is deleted as well +# Any core files spread around are deleted as well # make distclean Remove editor backup files, patch leftover files and the like # Files removed with 'make clean' @@ -884,9 +885,9 @@ $(filter-out $(cmd_$(1)),$(cmd_$@))\ $(filter-out $(cmd_$@),$(cmd_$(1)))),\ @set -e; \ - $(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))';) \ + $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \ $(cmd_$(1)); \ - scripts/fixdep $(depfile) $@ '$(cmd_$(1))' > $(@D)/.$(@F).tmp; \ + scripts/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \ rm -f $(depfile); \ mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd) @@ -913,19 +914,19 @@ fi endef -# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj= +# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=dir # Usage: # $(Q)$(MAKE) $(build)=dir build := -f scripts/Makefile.build obj -# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir +# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir # Usage: # $(Q)$(MAKE) $(clean)=dir clean := -f scripts/Makefile.clean obj # $(call descend,,) # Recursively call a sub-make in with target -# Usage is deprecated, because make do not see this as an invocation of make. +# Usage is deprecated, because make does not see this as an invocation of make. descend =$(Q)$(MAKE) -f scripts/Makefile.build obj=$(1) $(2) FORCE: diff -Nru a/arch/alpha/kernel/init_task.c b/arch/alpha/kernel/init_task.c --- a/arch/alpha/kernel/init_task.c Fri Feb 14 00:27:27 2003 +++ b/arch/alpha/kernel/init_task.c Fri Feb 14 00:27:27 2003 @@ -9,6 +9,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); struct task_struct init_task = INIT_TASK(init_task); diff -Nru a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c --- a/arch/alpha/kernel/signal.c Fri Feb 14 00:27:28 2003 +++ b/arch/alpha/kernel/signal.c Fri Feb 14 00:27:28 2003 @@ -619,11 +619,11 @@ if (!oldset) oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, regs); + signr = get_signal_to_deliver(&info, regs, NULL); if (signr > 0) { /* Whee! Actually deliver the signal. */ - struct k_sigaction *ka = ¤t->sig->action[signr-1]; + struct k_sigaction *ka = ¤t->sighand->action[signr-1]; if (r0) syscall_restart(r0, r19, regs, ka); handle_signal(signr, ka, &info, oldset, regs, sw); diff -Nru a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c --- a/arch/arm/kernel/ecard.c Fri Feb 14 00:27:29 2003 +++ b/arch/arm/kernel/ecard.c Fri Feb 14 00:27:29 2003 @@ -290,14 +290,7 @@ { struct task_struct *tsk = current; - /* - * We don't want /any/ signals, not even SIGKILL - */ - sigfillset(&tsk->blocked); - sigemptyset(&tsk->pending.signal); - recalc_sigpending(); - strcpy(tsk->comm, "kecardd"); - daemonize(); + daemonize("kecardd"); /* * Allocate a mm. We're not a lazy-TLB kernel task since we need diff -Nru a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c --- a/arch/arm/kernel/signal.c Fri Feb 14 00:27:26 2003 +++ b/arch/arm/kernel/signal.c Fri Feb 14 00:27:26 2003 @@ -522,7 +522,7 @@ struct k_sigaction *ka; spin_lock_irq(¤t->sighand->siglock); - signr = dequeue_signal(¤t->blocked, &info); + signr = dequeue_signal(current, ¤t->blocked, &info); spin_unlock_irq(¤t->sighand->siglock); if (!signr) diff -Nru a/arch/cris/drivers/usb-host.c b/arch/cris/drivers/usb-host.c --- a/arch/cris/drivers/usb-host.c Fri Feb 14 00:27:27 2003 +++ b/arch/cris/drivers/usb-host.c Fri Feb 14 00:27:27 2003 @@ -459,7 +459,8 @@ *R_DMA_CH8_SUB2_CMD = IO_STATE(R_DMA_CH8_SUB2_CMD, cmd, stop); /* Somehow wait for the DMA to finish current activities */ i = jiffies + 100; - while (jiffies < i); + while (time_before(jiffies, i)) + ; first_ep = &TxIntrEPList[0]; tmp_ep = first_ep; diff -Nru a/arch/cris/kernel/signal.c b/arch/cris/kernel/signal.c --- a/arch/cris/kernel/signal.c Fri Feb 14 00:27:26 2003 +++ b/arch/cris/kernel/signal.c Fri Feb 14 00:27:26 2003 @@ -560,7 +560,7 @@ if (!oldset) oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, regs); + signr = get_signal_to_deliver(&info, regs, NULL); if (signr > 0) { /* Whee! Actually deliver the signal. */ handle_signal(canrestart, signr, &info, oldset, regs); diff -Nru a/arch/i386/Kconfig b/arch/i386/Kconfig --- a/arch/i386/Kconfig Fri Feb 14 00:27:27 2003 +++ b/arch/i386/Kconfig Fri Feb 14 00:27:27 2003 @@ -136,6 +136,7 @@ - "Winchip-2" for IDT Winchip 2. - "Winchip-2A" for IDT Winchips with 3dNow! capabilities. - "CyrixIII/VIA C3" for VIA Cyrix III or VIA C3. + - "VIA C3-2 for VIA C3-2 "Nehemiah" (model 9 and above). If you don't know what to do, choose "386". @@ -174,7 +175,7 @@ against the f00f bug found in earlier Pentiums. config MPENTIUMII - bool "Pentium-II/Celeron(pre-Coppermine)" + bool "Pentium-II/Celeron(pre-Coppermine)" help Select this for Intel chips based on the Pentium-II and pre-Coppermine Celeron core. This option enables an unaligned @@ -260,6 +261,16 @@ treat this chip as a generic 586. Whilst the CPU is 686 class, it lacks the cmov extension which gcc assumes is present when generating 686 code. + Note, that Nehemiah (Model 9) and above will not boot with this + kernel due to them lacking the 3dnow instructions used in earlier + incarnations of the CPU. + +config MVIAC3_2 + bool "VIA C3-2 (Nehemiah)" + help + Select this for a VIA C3 "Nehemiah". Selecting this enables usage of SSE + and tells gcc to treat the CPU as a 686. + Note, this kernel will not boot on older (pre model 9) C3s. endchoice @@ -278,8 +289,8 @@ config X86_L1_CACHE_SHIFT int - default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 default "4" if MELAN || M486 || M386 + default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 default "6" if MK7 || MK8 default "7" if MPENTIUM4 @@ -325,12 +336,12 @@ config X86_ALIGNMENT_16 bool - depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MELAN || MK6 || M586MMX || M586TSC || M586 || M486 + depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 default y config X86_TSC bool - depends on MWINCHIP3D || MWINCHIP2 || MCRUSOE || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 + depends on MWINCHIP3D || MWINCHIP2 || MCRUSOE || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 default y config X86_GOOD_APIC @@ -345,7 +356,7 @@ config X86_USE_PPRO_CHECKSUM bool - depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || MK8 + depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 default y config X86_USE_3DNOW @@ -360,7 +371,7 @@ config X86_PREFETCH bool - depends on MPENTIUMIII || MPENTIUM4 + depends on MPENTIUMIII || MPENTIUM4 || MVIAC3_2 default y config X86_SSE2 @@ -1000,6 +1011,16 @@ help This adds the CPUFreq driver for mobile AMD K6-2+ and mobile AMD K6-3+ processors. + + For details, take a look at linux/Documentation/cpufreq. + + If in doubt, say N. + +config X86_POWERNOW_K7 + tristate "AMD Mobile Athlon/Duron PowerNow!" + depends on CPU_FREQ + help + This adds the CPUFreq driver for mobile AMD K7 mobile processors. For details, take a look at linux/Documentation/cpufreq. diff -Nru a/arch/i386/Makefile b/arch/i386/Makefile --- a/arch/i386/Makefile Fri Feb 14 00:27:27 2003 +++ b/arch/i386/Makefile Fri Feb 14 00:27:27 2003 @@ -46,6 +46,7 @@ cflags-$(CONFIG_MCYRIXIII) += $(call check_gcc,-march=c3,-march=i486) # The alignment flags change with gcc 3.2 cflags-$(CONFIG_MCYRIXIII) += $(call check_gcc,-falign-functions=0 -falign-jumps=0 -falign-loops=0,-malign-functions=0 -malign-jumps=0 -malign-loops=0) +cflags-$(CONFIG_MVIAC3_2) += $(call check_gcc,-march=c3-2,-march=i686) CFLAGS += $(cflags-y) diff -Nru a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile --- a/arch/i386/kernel/Makefile Fri Feb 14 00:27:27 2003 +++ b/arch/i386/kernel/Makefile Fri Feb 14 00:27:27 2003 @@ -10,14 +10,13 @@ obj-y += cpu/ obj-y += timers/ +obj-$(CONFIG_ACPI) += acpi/ obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o obj-$(CONFIG_MCA) += mca.o obj-$(CONFIG_X86_MSR) += msr.o obj-$(CONFIG_X86_CPUID) += cpuid.o obj-$(CONFIG_MICROCODE) += microcode.o obj-$(CONFIG_APM) += apm.o -obj-$(CONFIG_ACPI) += acpi.o -obj-$(CONFIG_ACPI_SLEEP) += acpi_wakeup.o obj-$(CONFIG_X86_SMP) += smp.o smpboot.o obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o obj-$(CONFIG_X86_MPPARSE) += mpparse.o diff -Nru a/arch/i386/kernel/acpi/Makefile b/arch/i386/kernel/acpi/Makefile --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/i386/kernel/acpi/Makefile Fri Feb 14 00:27:30 2003 @@ -0,0 +1,3 @@ +obj-$(CONFIG_ACPI_BOOT) := boot.o +obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o + diff -Nru a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/i386/kernel/acpi/boot.c Fri Feb 14 00:27:29 2003 @@ -0,0 +1,425 @@ +/* + * boot.c - Architecture-Specific Low-Level ACPI Boot Support + * + * Copyright (C) 2001, 2002 Paul Diefenbaugh + * Copyright (C) 2001 Jun Nakajima + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * 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 + +#define PREFIX "ACPI: " + +extern int acpi_disabled; + +/* -------------------------------------------------------------------------- + Boot-time Configuration + -------------------------------------------------------------------------- */ + +enum acpi_irq_model_id acpi_irq_model; + +/* + * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END, + * to map the target physical address. The problem is that set_fixmap() + * provides a single page, and it is possible that the page is not + * sufficient. + * By using this area, we can map up to MAX_IO_APICS pages temporarily, + * i.e. until the next __va_range() call. + * + * Important Safety Note: The fixed I/O APIC page numbers are *subtracted* + * from the fixed base. That's why we start at FIX_IO_APIC_BASE_END and + * count idx down while incrementing the phys address. + */ +char *__acpi_map_table(unsigned long phys, unsigned long size) +{ + unsigned long base, offset, mapped_size; + int idx; + + if (phys + size < 8*1024*1024) + return __va(phys); + + offset = phys & (PAGE_SIZE - 1); + mapped_size = PAGE_SIZE - offset; + set_fixmap(FIX_ACPI_END, phys); + base = fix_to_virt(FIX_ACPI_END); + + /* + * Most cases can be covered by the below. + */ + idx = FIX_ACPI_END; + while (mapped_size < size) { + if (--idx < FIX_ACPI_BEGIN) + return 0; /* cannot handle this */ + phys += PAGE_SIZE; + set_fixmap(idx, phys); + mapped_size += PAGE_SIZE; + } + + return ((unsigned char *) base + offset); +} + + +#ifdef CONFIG_X86_LOCAL_APIC + +int acpi_lapic; + +static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; + + +static int __init +acpi_parse_madt ( + unsigned long phys_addr, + unsigned long size) +{ + struct acpi_table_madt *madt = NULL; + + if (!phys_addr || !size) + return -EINVAL; + + madt = (struct acpi_table_madt *) __acpi_map_table(phys_addr, size); + if (!madt) { + printk(KERN_WARNING PREFIX "Unable to map MADT\n"); + return -ENODEV; + } + + if (madt->lapic_address) + acpi_lapic_addr = (u64) madt->lapic_address; + + printk(KERN_INFO PREFIX "Local APIC address 0x%08x\n", + madt->lapic_address); + + acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id); + + return 0; +} + + +static int __init +acpi_parse_lapic ( + acpi_table_entry_header *header) +{ + struct acpi_table_lapic *processor = NULL; + + processor = (struct acpi_table_lapic*) header; + if (!processor) + return -EINVAL; + + acpi_table_print_madt_entry(header); + + mp_register_lapic ( + processor->id, /* APIC ID */ + processor->flags.enabled); /* Enabled? */ + + return 0; +} + + +static int __init +acpi_parse_lapic_addr_ovr ( + acpi_table_entry_header *header) +{ + struct acpi_table_lapic_addr_ovr *lapic_addr_ovr = NULL; + + lapic_addr_ovr = (struct acpi_table_lapic_addr_ovr*) header; + if (!lapic_addr_ovr) + return -EINVAL; + + acpi_lapic_addr = lapic_addr_ovr->address; + + return 0; +} + +#ifndef CONFIG_ACPI_HT_ONLY + +static int __init +acpi_parse_lapic_nmi ( + acpi_table_entry_header *header) +{ + struct acpi_table_lapic_nmi *lapic_nmi = NULL; + + lapic_nmi = (struct acpi_table_lapic_nmi*) header; + if (!lapic_nmi) + return -EINVAL; + + acpi_table_print_madt_entry(header); + + if (lapic_nmi->lint != 1) + printk(KERN_WARNING PREFIX "NMI not connected to LINT 1!\n"); + + return 0; +} + +#endif /*CONFIG_ACPI_HT_ONLY*/ + +#endif /*CONFIG_X86_LOCAL_APIC*/ + +#ifdef CONFIG_X86_IO_APIC + +int acpi_ioapic; + +#ifndef CONFIG_ACPI_HT_ONLY + +static int __init +acpi_parse_ioapic ( + acpi_table_entry_header *header) +{ + struct acpi_table_ioapic *ioapic = NULL; + + ioapic = (struct acpi_table_ioapic*) header; + if (!ioapic) + return -EINVAL; + + acpi_table_print_madt_entry(header); + + mp_register_ioapic ( + ioapic->id, + ioapic->address, + ioapic->global_irq_base); + + return 0; +} + + +static int __init +acpi_parse_int_src_ovr ( + acpi_table_entry_header *header) +{ + struct acpi_table_int_src_ovr *intsrc = NULL; + + intsrc = (struct acpi_table_int_src_ovr*) header; + if (!intsrc) + return -EINVAL; + + acpi_table_print_madt_entry(header); + + mp_override_legacy_irq ( + intsrc->bus_irq, + intsrc->flags.polarity, + intsrc->flags.trigger, + intsrc->global_irq); + + return 0; +} + + +static int __init +acpi_parse_nmi_src ( + acpi_table_entry_header *header) +{ + struct acpi_table_nmi_src *nmi_src = NULL; + + nmi_src = (struct acpi_table_nmi_src*) header; + if (!nmi_src) + return -EINVAL; + + acpi_table_print_madt_entry(header); + + /* TBD: Support nimsrc entries? */ + + return 0; +} + +#endif /*!CONFIG_ACPI_HT_ONLY*/ +#endif /*CONFIG_X86_IO_APIC*/ + + +static unsigned long __init +acpi_scan_rsdp ( + unsigned long start, + unsigned long length) +{ + unsigned long offset = 0; + unsigned long sig_len = sizeof("RSD PTR ") - 1; + + /* + * Scan all 16-byte boundaries of the physical memory region for the + * RSDP signature. + */ + for (offset = 0; offset < length; offset += 16) { + if (strncmp((char *) (start + offset), "RSD PTR ", sig_len)) + continue; + return (start + offset); + } + + return 0; +} + + +unsigned long __init +acpi_find_rsdp (void) +{ + unsigned long rsdp_phys = 0; + + /* + * Scan memory looking for the RSDP signature. First search EBDA (low + * memory) paragraphs and then search upper memory (E0000-FFFFF). + */ + rsdp_phys = acpi_scan_rsdp (0, 0x400); + if (!rsdp_phys) + rsdp_phys = acpi_scan_rsdp (0xE0000, 0xFFFFF); + + return rsdp_phys; +} + + +int __init +acpi_boot_init (void) +{ + int result = 0; + + /* + * The default interrupt routing model is PIC (8259). This gets + * overriden if IOAPICs are enumerated (below). + */ + acpi_irq_model = ACPI_IRQ_MODEL_PIC; + + /* + * Initialize the ACPI boot-time table parser. + */ + result = acpi_table_init(); + if (result) + return result; + + result = acpi_blacklisted(); + if (result) { + acpi_disabled = 1; + return result; + } + else + printk(KERN_NOTICE PREFIX "BIOS passes blacklist\n"); + +#ifdef CONFIG_X86_LOCAL_APIC + + /* + * MADT + * ---- + * Parse the Multiple APIC Description Table (MADT), if exists. + * Note that this table provides platform SMP configuration + * information -- the successor to MPS tables. + */ + + result = acpi_table_parse(ACPI_APIC, acpi_parse_madt); + if (!result) { + printk(KERN_WARNING PREFIX "MADT not present\n"); + return 0; + } + else if (result < 0) { + printk(KERN_ERR PREFIX "Error parsing MADT\n"); + return result; + } + else if (result > 1) + printk(KERN_WARNING PREFIX "Multiple MADT tables exist\n"); + + /* + * Local APIC + * ---------- + * Note that the LAPIC address is obtained from the MADT (32-bit value) + * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value). + */ + + result = acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr); + if (result < 0) { + printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n"); + return result; + } + + mp_register_lapic_address(acpi_lapic_addr); + + result = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic); + if (!result) { + printk(KERN_ERR PREFIX "No LAPIC entries present\n"); + /* TBD: Cleanup to allow fallback to MPS */ + return -ENODEV; + } + else if (result < 0) { + printk(KERN_ERR PREFIX "Error parsing LAPIC entry\n"); + /* TBD: Cleanup to allow fallback to MPS */ + return result; + } + +#ifndef CONFIG_ACPI_HT_ONLY + result = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi); + if (result < 0) { + printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); + /* TBD: Cleanup to allow fallback to MPS */ + return result; + } +#endif /*!CONFIG_ACPI_HT_ONLY*/ + + acpi_lapic = 1; + +#endif /*CONFIG_X86_LOCAL_APIC*/ + +#ifdef CONFIG_X86_IO_APIC +#ifndef CONFIG_ACPI_HT_ONLY + + /* + * I/O APIC + * -------- + */ + + result = acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic); + if (!result) { + printk(KERN_ERR PREFIX "No IOAPIC entries present\n"); + return -ENODEV; + } + else if (result < 0) { + printk(KERN_ERR PREFIX "Error parsing IOAPIC entry\n"); + return result; + } + + /* Build a default routing table for legacy (ISA) interrupts. */ + mp_config_acpi_legacy_irqs(); + + result = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr); + if (result < 0) { + printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n"); + /* TBD: Cleanup to allow fallback to MPS */ + return result; + } + + result = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src); + if (result < 0) { + printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); + /* TBD: Cleanup to allow fallback to MPS */ + return result; + } + + acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC; + + acpi_ioapic = 1; + +#endif /*!CONFIG_ACPI_HT_ONLY*/ +#endif /*CONFIG_X86_IO_APIC*/ + +#ifdef CONFIG_X86_LOCAL_APIC + if (acpi_lapic && acpi_ioapic) { + smp_found_config = 1; + clustered_apic_check(); + } +#endif + + return 0; +} diff -Nru a/arch/i386/kernel/acpi/sleep.c b/arch/i386/kernel/acpi/sleep.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/i386/kernel/acpi/sleep.c Fri Feb 14 00:27:30 2003 @@ -0,0 +1,96 @@ +/* + * sleep.c - x86-specific ACPI sleep support. + * + * Copyright (C) 2001-2003 Patrick Mochel + */ + +#include +#include +#include + + +/* 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)); + +static void init_low_mapping(pgd_t *pgd, int pgd_limit) +{ + int pgd_ofs = 0; + + while ((pgd_ofs < pgd_limit) && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) { + set_pgd(pgd, *(pgd+USER_PTRS_PER_PGD)); + pgd_ofs++, pgd++; + } +} + +/** + * acpi_save_state_mem - save kernel state + * + * Create an identity mapped page table and copy the wakeup routine to + * low memory. + */ +int acpi_save_state_mem (void) +{ +#if CONFIG_X86_PAE + panic("S3 and PAE do not like each other for now."); + return 1; +#endif + init_low_mapping(swapper_pg_dir, USER_PTRS_PER_PGD); + memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start); + acpi_copy_wakeup_routine(acpi_wakeup_address); + + return 0; +} + +/** + * acpi_save_state_disk - save kernel state to disk + * + */ +int acpi_save_state_disk (void) +{ + return 1; +} + +/* + * acpi_restore_state + */ +void acpi_restore_state_mem (void) +{ + zap_low_mappings(); +} + +/** + * acpi_reserve_bootmem - do _very_ early ACPI initialisation + * + * We allocate a page in low memory for the wakeup + * routine for when we come back from a sleep state. The + * runtime allocator allows specification of <16M pages, but not + * <1M pages. + */ +void __init acpi_reserve_bootmem(void) +{ + acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE); + if ((&wakeup_end - &wakeup_start) > PAGE_SIZE) + printk(KERN_CRIT "ACPI: Wakeup code way too big, will crash on attempt to suspend\n"); + 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); diff -Nru a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/i386/kernel/acpi/wakeup.S Fri Feb 14 00:27:27 2003 @@ -0,0 +1,325 @@ +.text +#include +#include +#include + +# +# wakeup_code runs in real mode, and at unknown address (determined at run-time). +# Therefore it must only use relative jumps/calls. +# +# Do we need to deal with A20? It is okay: ACPI specs says A20 must be enabled +# +# If physical address of wakeup_code is 0x12345, BIOS should call us with +# cs = 0x1234, eip = 0x05 +# + +ALIGN + .align 4096 +ENTRY(wakeup_start) +wakeup_code: + wakeup_code_start = . + .code16 + + movw $0xb800, %ax + movw %ax,%fs + movw $0x0e00 + 'L', %fs:(0x10) + + cli + cld + + # setup data segment + movw %cs, %ax + movw %ax, %ds # Make ds:0 point to wakeup_start + movw %ax, %ss + mov $(wakeup_stack - wakeup_code), %sp # Private stack is needed for ASUS board + movw $0x0e00 + 'S', %fs:(0x12) + + pushl $0 # Kill any dangerous flags + popfl + + movl real_magic - wakeup_code, %eax + cmpl $0x12345678, %eax + jne bogus_real_magic + + testl $1, video_flags - wakeup_code + jz 1f + lcall $0xc000,$3 +1: + + testl $2, video_flags - wakeup_code + jz 1f + mov video_mode - wakeup_code, %ax + call mode_set +1: + + # set up page table + movl $swapper_pg_dir-__PAGE_OFFSET, %eax + movl %eax, %cr3 + + # make sure %cr4 is set correctly (features, etc) + movl real_save_cr4 - wakeup_code, %eax + movl %eax, %cr4 + movw $0xb800, %ax + movw %ax,%fs + movw $0x0e00 + 'i', %fs:(0x12) + + # need a gdt + lgdt real_save_gdt - wakeup_code + + movl real_save_cr0 - wakeup_code, %eax + movl %eax, %cr0 + jmp 1f +1: + movw $0x0e00 + 'n', %fs:(0x14) + + movl real_magic - wakeup_code, %eax + cmpl $0x12345678, %eax + jne bogus_real_magic + + ljmpl $__KERNEL_CS,$wakeup_pmode_return + +real_save_gdt: .word 0 + .long 0 +real_save_cr0: .long 0 +real_save_cr3: .long 0 +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) + jmp bogus_real_magic + +/* This code uses an extended set of video mode numbers. These include: + * Aliases for standard modes + * NORMAL_VGA (-1) + * EXTENDED_VGA (-2) + * ASK_VGA (-3) + * Video modes numbered by menu position -- NOT RECOMMENDED because of lack + * of compatibility when extending the table. These are between 0x00 and 0xff. + */ +#define VIDEO_FIRST_MENU 0x0000 + +/* Standard BIOS video modes (BIOS number + 0x0100) */ +#define VIDEO_FIRST_BIOS 0x0100 + +/* VESA BIOS video modes (VESA number + 0x0200) */ +#define VIDEO_FIRST_VESA 0x0200 + +/* Video7 special modes (BIOS number + 0x0900) */ +#define VIDEO_FIRST_V7 0x0900 + +# Setting of user mode (AX=mode ID) => CF=success +mode_set: + movw %ax, %bx +#if 0 + cmpb $0xff, %ah + jz setalias + + testb $VIDEO_RECALC>>8, %ah + jnz _setrec + + cmpb $VIDEO_FIRST_RESOLUTION>>8, %ah + jnc setres + + cmpb $VIDEO_FIRST_SPECIAL>>8, %ah + jz setspc + + cmpb $VIDEO_FIRST_V7>>8, %ah + jz setv7 +#endif + + cmpb $VIDEO_FIRST_VESA>>8, %ah + jnc check_vesa +#if 0 + orb %ah, %ah + jz setmenu +#endif + + decb %ah +# jz setbios Add bios modes later + +setbad: clc + ret + +check_vesa: + subb $VIDEO_FIRST_VESA>>8, %bh + orw $0x4000, %bx # Use linear frame buffer + movw $0x4f02, %ax # VESA BIOS mode set call + int $0x10 + cmpw $0x004f, %ax # AL=4f if implemented + jnz _setbad # AH=0 if OK + + stc + ret + +_setbad: jmp setbad + + .code32 + ALIGN + +.org 0x800 +wakeup_stack_begin: # Stack grows down + +.org 0xff0 # Just below end of page +wakeup_stack: +ENTRY(wakeup_end) + +.org 0x1000 + +wakeup_pmode_return: + movl $__KERNEL_DS, %eax + movl %eax, %ds + movw $0x0e00 + 'u', %ds:(0xb8016) + + # restore other segment registers + xorl %eax, %eax + movw %ax, %fs + movw %ax, %gs + + # reload the gdt, as we need the full 32 bit address + lgdt saved_gdt + lidt saved_idt + lldt saved_ldt + ljmp $(__KERNEL_CS),$1f +1: + movl %cr3, %eax + movl %eax, %cr3 + wbinvd + + # and restore the stack ... but you need gdt for this to work + movl $__KERNEL_DS, %eax + movw %ax, %ss + movw %ax, %ds + movw %ax, %es + movw %ax, %fs + movw %ax, %gs + movl saved_esp, %esp + + movw $0x0e00 + 'W', %ds:(0xb8018) + movl $(1024*1024*3), %ecx + movl $0, %esi + rep lodsb + movw $0x0e00 + 'O', %ds:(0xb8018) + + movl %cs:saved_magic, %eax + cmpl $0x12345678, %eax + jne bogus_magic + + # restore the other general registers + movl saved_ebx, %ebx + movl saved_edi, %edi + movl saved_esi, %esi + movl saved_ebp, %ebp + + # jump to place where we left off + movl saved_eip,%eax + movw $0x0e00 + 'x', %ds:(0xb8018) + pushl %eax + popl %eax + movw $0x0e00 + '!', %ds:(0xb801a) + jmp *%eax + +bogus_magic: + movw $0x0e00 + 'B', %ds:(0xb8018) + jmp bogus_magic + +bogus_magic2: + movw $0x0e00 + '2', %ds:(0xb8018) + jmp bogus_magic2 + +## +# acpi_copy_wakeup_routine +# +# Copy the above routine to low memory. +# +# Parameters: +# %eax: place to copy wakeup routine to +# +# Returned address is location of code in low memory (past data and stack) +# +ENTRY(acpi_copy_wakeup_routine) + + sgdt saved_gdt + sidt saved_idt + sldt saved_ldt + str saved_tss + + movl %cr3, %edx + movl %edx, real_save_cr3 - wakeup_start (%eax) + movl %cr4, %edx + movl %edx, real_save_cr4 - wakeup_start (%eax) + movl %cr0, %edx + movl %edx, real_save_cr0 - wakeup_start (%eax) + sgdt real_save_gdt - wakeup_start (%eax) + + 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 + +.data +ALIGN +ENTRY(saved_ebp) .long 0 +ENTRY(saved_esi) .long 0 +ENTRY(saved_edi) .long 0 +ENTRY(saved_ebx) .long 0 + +ENTRY(saved_eip) .long 0 +ENTRY(saved_esp) .long 0 + +ENTRY(saved_magic) .long 0 + +ENTRY(do_suspend_lowlevel) + cmpl $0,4(%esp) + jne ret_point + call save_processor_state + + movl %esp, saved_context_esp + movl %eax, saved_context_eax + movl %ebx, saved_context_ebx + movl %ecx, saved_context_ecx + movl %edx, saved_context_edx + movl %ebp, saved_context_ebp + movl %esi, saved_context_esi + movl %edi, saved_context_edi + pushfl ; popl saved_context_eflags + + movl $ret_point,saved_eip + movl %esp,saved_esp + movl %ebp,saved_ebp + movl %ebx,saved_ebx + movl %edi,saved_edi + movl %esi,saved_esi + + pushl $3 + call acpi_enter_sleep_state + addl $4,%esp + ret + .p2align 4,,7 +ret_point: + movl $__KERNEL_DS,%eax + movw %ax, %ds + movl saved_context_esp, %esp + movl saved_context_ebp, %ebp + movl saved_context_eax, %eax + movl saved_context_ebx, %ebx + movl saved_context_ecx, %ecx + movl saved_context_edx, %edx + movl saved_context_esi, %esi + movl saved_context_edi, %edi + call restore_processor_state + pushl saved_context_eflags ; popfl + ret + +ALIGN +# saved registers +saved_gdt: .long 0,0 +saved_idt: .long 0,0 +saved_ldt: .long 0 +saved_tss: .long 0 + diff -Nru a/arch/i386/kernel/acpi.c b/arch/i386/kernel/acpi.c --- a/arch/i386/kernel/acpi.c Fri Feb 14 00:27:29 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,539 +0,0 @@ -/* - * acpi.c - Architecture-Specific Low-Level ACPI Support - * - * Copyright (C) 2001, 2002 Paul Diefenbaugh - * Copyright (C) 2001 Jun Nakajima - * Copyright (C) 2001 Patrick Mochel - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#define PREFIX "ACPI: " - -extern int acpi_disabled; - -/* -------------------------------------------------------------------------- - Boot-time Configuration - -------------------------------------------------------------------------- */ - -enum acpi_irq_model_id acpi_irq_model; - -#ifdef CONFIG_ACPI_BOOT -/* - * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END, - * to map the target physical address. The problem is that set_fixmap() - * provides a single page, and it is possible that the page is not - * sufficient. - * By using this area, we can map up to MAX_IO_APICS pages temporarily, - * i.e. until the next __va_range() call. - * - * Important Safety Note: The fixed I/O APIC page numbers are *subtracted* - * from the fixed base. That's why we start at FIX_IO_APIC_BASE_END and - * count idx down while incrementing the phys address. - */ -char *__acpi_map_table(unsigned long phys, unsigned long size) -{ - unsigned long base, offset, mapped_size; - int idx; - - if (phys + size < 8*1024*1024) - return __va(phys); - - offset = phys & (PAGE_SIZE - 1); - mapped_size = PAGE_SIZE - offset; - set_fixmap(FIX_ACPI_END, phys); - base = fix_to_virt(FIX_ACPI_END); - - /* - * Most cases can be covered by the below. - */ - idx = FIX_ACPI_END; - while (mapped_size < size) { - if (--idx < FIX_ACPI_BEGIN) - return 0; /* cannot handle this */ - phys += PAGE_SIZE; - set_fixmap(idx, phys); - mapped_size += PAGE_SIZE; - } - - return ((unsigned char *) base + offset); -} - - -#ifdef CONFIG_X86_LOCAL_APIC - -int acpi_lapic; - -static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; - - -static int __init -acpi_parse_madt ( - unsigned long phys_addr, - unsigned long size) -{ - struct acpi_table_madt *madt = NULL; - - if (!phys_addr || !size) - return -EINVAL; - - madt = (struct acpi_table_madt *) __acpi_map_table(phys_addr, size); - if (!madt) { - printk(KERN_WARNING PREFIX "Unable to map MADT\n"); - return -ENODEV; - } - - if (madt->lapic_address) - acpi_lapic_addr = (u64) madt->lapic_address; - - printk(KERN_INFO PREFIX "Local APIC address 0x%08x\n", - madt->lapic_address); - - acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id); - - return 0; -} - - -static int __init -acpi_parse_lapic ( - acpi_table_entry_header *header) -{ - struct acpi_table_lapic *processor = NULL; - - processor = (struct acpi_table_lapic*) header; - if (!processor) - return -EINVAL; - - acpi_table_print_madt_entry(header); - - mp_register_lapic ( - processor->id, /* APIC ID */ - processor->flags.enabled); /* Enabled? */ - - return 0; -} - - -static int __init -acpi_parse_lapic_addr_ovr ( - acpi_table_entry_header *header) -{ - struct acpi_table_lapic_addr_ovr *lapic_addr_ovr = NULL; - - lapic_addr_ovr = (struct acpi_table_lapic_addr_ovr*) header; - if (!lapic_addr_ovr) - return -EINVAL; - - acpi_lapic_addr = lapic_addr_ovr->address; - - return 0; -} - -#ifndef CONFIG_ACPI_HT_ONLY - -static int __init -acpi_parse_lapic_nmi ( - acpi_table_entry_header *header) -{ - struct acpi_table_lapic_nmi *lapic_nmi = NULL; - - lapic_nmi = (struct acpi_table_lapic_nmi*) header; - if (!lapic_nmi) - return -EINVAL; - - acpi_table_print_madt_entry(header); - - if (lapic_nmi->lint != 1) - printk(KERN_WARNING PREFIX "NMI not connected to LINT 1!\n"); - - return 0; -} - -#endif /*CONFIG_ACPI_HT_ONLY*/ - -#endif /*CONFIG_X86_LOCAL_APIC*/ - -#ifdef CONFIG_X86_IO_APIC - -int acpi_ioapic; - -#ifndef CONFIG_ACPI_HT_ONLY - -static int __init -acpi_parse_ioapic ( - acpi_table_entry_header *header) -{ - struct acpi_table_ioapic *ioapic = NULL; - - ioapic = (struct acpi_table_ioapic*) header; - if (!ioapic) - return -EINVAL; - - acpi_table_print_madt_entry(header); - - mp_register_ioapic ( - ioapic->id, - ioapic->address, - ioapic->global_irq_base); - - return 0; -} - - -static int __init -acpi_parse_int_src_ovr ( - acpi_table_entry_header *header) -{ - struct acpi_table_int_src_ovr *intsrc = NULL; - - intsrc = (struct acpi_table_int_src_ovr*) header; - if (!intsrc) - return -EINVAL; - - acpi_table_print_madt_entry(header); - - mp_override_legacy_irq ( - intsrc->bus_irq, - intsrc->flags.polarity, - intsrc->flags.trigger, - intsrc->global_irq); - - return 0; -} - - -static int __init -acpi_parse_nmi_src ( - acpi_table_entry_header *header) -{ - struct acpi_table_nmi_src *nmi_src = NULL; - - nmi_src = (struct acpi_table_nmi_src*) header; - if (!nmi_src) - return -EINVAL; - - acpi_table_print_madt_entry(header); - - /* TBD: Support nimsrc entries? */ - - return 0; -} - -#endif /*!CONFIG_ACPI_HT_ONLY*/ -#endif /*CONFIG_X86_IO_APIC*/ - - -static unsigned long __init -acpi_scan_rsdp ( - unsigned long start, - unsigned long length) -{ - unsigned long offset = 0; - unsigned long sig_len = sizeof("RSD PTR ") - 1; - - /* - * Scan all 16-byte boundaries of the physical memory region for the - * RSDP signature. - */ - for (offset = 0; offset < length; offset += 16) { - if (strncmp((char *) (start + offset), "RSD PTR ", sig_len)) - continue; - return (start + offset); - } - - return 0; -} - - -unsigned long __init -acpi_find_rsdp (void) -{ - unsigned long rsdp_phys = 0; - - /* - * Scan memory looking for the RSDP signature. First search EBDA (low - * memory) paragraphs and then search upper memory (E0000-FFFFF). - */ - rsdp_phys = acpi_scan_rsdp (0, 0x400); - if (!rsdp_phys) - rsdp_phys = acpi_scan_rsdp (0xE0000, 0xFFFFF); - - return rsdp_phys; -} - - -int __init -acpi_boot_init (void) -{ - int result = 0; - - /* - * The default interrupt routing model is PIC (8259). This gets - * overriden if IOAPICs are enumerated (below). - */ - acpi_irq_model = ACPI_IRQ_MODEL_PIC; - - /* - * Initialize the ACPI boot-time table parser. - */ - result = acpi_table_init(); - if (result) - return result; - - result = acpi_blacklisted(); - if (result) { - acpi_disabled = 1; - return result; - } - else - printk(KERN_NOTICE PREFIX "BIOS passes blacklist\n"); - -#ifdef CONFIG_X86_LOCAL_APIC - - /* - * MADT - * ---- - * Parse the Multiple APIC Description Table (MADT), if exists. - * Note that this table provides platform SMP configuration - * information -- the successor to MPS tables. - */ - - result = acpi_table_parse(ACPI_APIC, acpi_parse_madt); - if (!result) { - printk(KERN_WARNING PREFIX "MADT not present\n"); - return 0; - } - else if (result < 0) { - printk(KERN_ERR PREFIX "Error parsing MADT\n"); - return result; - } - else if (result > 1) - printk(KERN_WARNING PREFIX "Multiple MADT tables exist\n"); - - /* - * Local APIC - * ---------- - * Note that the LAPIC address is obtained from the MADT (32-bit value) - * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value). - */ - - result = acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr); - if (result < 0) { - printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n"); - return result; - } - - mp_register_lapic_address(acpi_lapic_addr); - - result = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic); - if (!result) { - printk(KERN_ERR PREFIX "No LAPIC entries present\n"); - /* TBD: Cleanup to allow fallback to MPS */ - return -ENODEV; - } - else if (result < 0) { - printk(KERN_ERR PREFIX "Error parsing LAPIC entry\n"); - /* TBD: Cleanup to allow fallback to MPS */ - return result; - } - -#ifndef CONFIG_ACPI_HT_ONLY - result = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi); - if (result < 0) { - printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); - /* TBD: Cleanup to allow fallback to MPS */ - return result; - } -#endif /*!CONFIG_ACPI_HT_ONLY*/ - - acpi_lapic = 1; - -#endif /*CONFIG_X86_LOCAL_APIC*/ - -#ifdef CONFIG_X86_IO_APIC -#ifndef CONFIG_ACPI_HT_ONLY - - /* - * I/O APIC - * -------- - */ - - result = acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic); - if (!result) { - printk(KERN_ERR PREFIX "No IOAPIC entries present\n"); - return -ENODEV; - } - else if (result < 0) { - printk(KERN_ERR PREFIX "Error parsing IOAPIC entry\n"); - return result; - } - - /* Build a default routing table for legacy (ISA) interrupts. */ - mp_config_acpi_legacy_irqs(); - - result = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr); - if (result < 0) { - printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n"); - /* TBD: Cleanup to allow fallback to MPS */ - return result; - } - - result = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src); - if (result < 0) { - printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); - /* TBD: Cleanup to allow fallback to MPS */ - return result; - } - - acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC; - - acpi_ioapic = 1; - -#endif /*!CONFIG_ACPI_HT_ONLY*/ -#endif /*CONFIG_X86_IO_APIC*/ - -#ifdef CONFIG_X86_LOCAL_APIC - if (acpi_lapic && acpi_ioapic) { - smp_found_config = 1; - clustered_apic_check(); - } -#endif - - return 0; -} - -#endif /*CONFIG_ACPI_BOOT*/ - - -/* -------------------------------------------------------------------------- - Low-Level Sleep Support - -------------------------------------------------------------------------- */ - -#ifdef CONFIG_ACPI_SLEEP - -/* 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)); - -static void init_low_mapping(pgd_t *pgd, int pgd_limit) -{ - int pgd_ofs = 0; - - while ((pgd_ofs < pgd_limit) && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) { - set_pgd(pgd, *(pgd+USER_PTRS_PER_PGD)); - pgd_ofs++, pgd++; - } -} - -/** - * acpi_save_state_mem - save kernel state - * - * Create an identity mapped page table and copy the wakeup routine to - * low memory. - */ -int acpi_save_state_mem (void) -{ -#if CONFIG_X86_PAE - panic("S3 and PAE do not like each other for now."); - return 1; -#endif - init_low_mapping(swapper_pg_dir, USER_PTRS_PER_PGD); - memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start); - acpi_copy_wakeup_routine(acpi_wakeup_address); - - return 0; -} - -/** - * acpi_save_state_disk - save kernel state to disk - * - */ -int acpi_save_state_disk (void) -{ - return 1; -} - -/* - * acpi_restore_state - */ -void acpi_restore_state_mem (void) -{ - zap_low_mappings(); -} - -/** - * acpi_reserve_bootmem - do _very_ early ACPI initialisation - * - * We allocate a page in low memory for the wakeup - * routine for when we come back from a sleep state. The - * runtime allocator allows specification of <16M pages, but not - * <1M pages. - */ -void __init acpi_reserve_bootmem(void) -{ - acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE); - if ((&wakeup_end - &wakeup_start) > PAGE_SIZE) - printk(KERN_CRIT "ACPI: Wakeup code way too big, will crash on attempt to suspend\n"); - 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 Fri Feb 14 00:27:27 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,323 +0,0 @@ -.text -#include -#include -#include - -# -# wakeup_code runs in real mode, and at unknown address (determined at run-time). -# Therefore it must only use relative jumps/calls. -# -# Do we need to deal with A20? It is okay: ACPI specs says A20 must be enabled -# -# If physical address of wakeup_code is 0x12345, BIOS should call us with -# cs = 0x1234, eip = 0x05 -# - -ALIGN - .align 4096 -ENTRY(wakeup_start) -wakeup_code: - wakeup_code_start = . - .code16 - - movw $0xb800, %ax - movw %ax,%fs - movw $0x0e00 + 'L', %fs:(0x10) - - cli - cld - - # setup data segment - movw %cs, %ax - movw %ax, %ds # Make ds:0 point to wakeup_start - movw %ax, %ss - mov wakeup_stack - wakeup_code, %sp # Private stack is needed for ASUS board - movw $0x0e00 + 'S', %fs:(0x12) - - pushl $0 # Kill any dangerous flags - popfl - - movl real_magic - wakeup_code, %eax - cmpl $0x12345678, %eax - jne bogus_real_magic - - testl $1, video_flags - wakeup_code - jz 1f - lcall $0xc000,$3 -1: - - testl $2, video_flags - wakeup_code - jz 1f - mov video_mode - wakeup_code, %ax - call mode_set -1: - - # set up page table - movl $swapper_pg_dir-__PAGE_OFFSET, %eax - movl %eax, %cr3 - - # make sure %cr4 is set correctly (features, etc) - movl real_save_cr4 - wakeup_code, %eax - movl %eax, %cr4 - movw $0xb800, %ax - movw %ax,%fs - movw $0x0e00 + 'i', %fs:(0x12) - - # need a gdt - lgdt real_save_gdt - wakeup_code - - movl real_save_cr0 - wakeup_code, %eax - movl %eax, %cr0 - jmp 1f -1: - movw $0x0e00 + 'n', %fs:(0x14) - - movl real_magic - wakeup_code, %eax - cmpl $0x12345678, %eax - jne bogus_real_magic - - ljmpl $__KERNEL_CS,$wakeup_pmode_return - -real_save_gdt: .word 0 - .long 0 -real_save_cr0: .long 0 -real_save_cr3: .long 0 -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) - jmp bogus_real_magic - -/* This code uses an extended set of video mode numbers. These include: - * Aliases for standard modes - * NORMAL_VGA (-1) - * EXTENDED_VGA (-2) - * ASK_VGA (-3) - * Video modes numbered by menu position -- NOT RECOMMENDED because of lack - * of compatibility when extending the table. These are between 0x00 and 0xff. - */ -#define VIDEO_FIRST_MENU 0x0000 - -/* Standard BIOS video modes (BIOS number + 0x0100) */ -#define VIDEO_FIRST_BIOS 0x0100 - -/* VESA BIOS video modes (VESA number + 0x0200) */ -#define VIDEO_FIRST_VESA 0x0200 - -/* Video7 special modes (BIOS number + 0x0900) */ -#define VIDEO_FIRST_V7 0x0900 - -# Setting of user mode (AX=mode ID) => CF=success -mode_set: - movw %ax, %bx -#if 0 - cmpb $0xff, %ah - jz setalias - - testb $VIDEO_RECALC>>8, %ah - jnz _setrec - - cmpb $VIDEO_FIRST_RESOLUTION>>8, %ah - jnc setres - - cmpb $VIDEO_FIRST_SPECIAL>>8, %ah - jz setspc - - cmpb $VIDEO_FIRST_V7>>8, %ah - jz setv7 -#endif - - cmpb $VIDEO_FIRST_VESA>>8, %ah - jnc check_vesa -#if 0 - orb %ah, %ah - jz setmenu -#endif - - decb %ah -# jz setbios Add bios modes later - -setbad: clc - ret - -check_vesa: - subb $VIDEO_FIRST_VESA>>8, %bh - orw $0x4000, %bx # Use linear frame buffer - movw $0x4f02, %ax # VESA BIOS mode set call - int $0x10 - cmpw $0x004f, %ax # AL=4f if implemented - jnz _setbad # AH=0 if OK - - stc - ret - -_setbad: jmp setbad - - .code32 - ALIGN - - -.org 0x2000 -wakeup_stack: -.org 0x3000 -ENTRY(wakeup_end) -.org 0x4000 - -wakeup_pmode_return: - movl $__KERNEL_DS, %eax - movl %eax, %ds - movw $0x0e00 + 'u', %ds:(0xb8016) - - # restore other segment registers - xorl %eax, %eax - movw %ax, %fs - movw %ax, %gs - - # reload the gdt, as we need the full 32 bit address - lgdt saved_gdt - lidt saved_idt - lldt saved_ldt - ljmp $(__KERNEL_CS),$1f -1: - movl %cr3, %eax - movl %eax, %cr3 - wbinvd - - # and restore the stack ... but you need gdt for this to work - movl $__KERNEL_DS, %eax - movw %ax, %ss - movw %ax, %ds - movw %ax, %es - movw %ax, %fs - movw %ax, %gs - movl saved_esp, %esp - - movw $0x0e00 + 'W', %ds:(0xb8018) - movl $(1024*1024*3), %ecx - movl $0, %esi - rep lodsb - movw $0x0e00 + 'O', %ds:(0xb8018) - - movl %cs:saved_magic, %eax - cmpl $0x12345678, %eax - jne bogus_magic - - # restore the other general registers - movl saved_ebx, %ebx - movl saved_edi, %edi - movl saved_esi, %esi - movl saved_ebp, %ebp - - # jump to place where we left off - movl saved_eip,%eax - movw $0x0e00 + 'x', %ds:(0xb8018) - pushl %eax - popl %eax - movw $0x0e00 + '!', %ds:(0xb801a) - jmp *%eax - -bogus_magic: - movw $0x0e00 + 'B', %ds:(0xb8018) - jmp bogus_magic - -bogus_magic2: - movw $0x0e00 + '2', %ds:(0xb8018) - jmp bogus_magic2 - -## -# acpi_copy_wakeup_routine -# -# Copy the above routine to low memory. -# -# Parameters: -# %eax: place to copy wakeup routine to -# -# Returned address is location of code in low memory (past data and stack) -# -ENTRY(acpi_copy_wakeup_routine) - - sgdt saved_gdt - sidt saved_idt - sldt saved_ldt - str saved_tss - - movl %cr3, %edx - movl %edx, real_save_cr3 - wakeup_start (%eax) - movl %cr4, %edx - movl %edx, real_save_cr4 - wakeup_start (%eax) - movl %cr0, %edx - movl %edx, real_save_cr0 - wakeup_start (%eax) - sgdt real_save_gdt - wakeup_start (%eax) - - 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 - -.data -ALIGN -ENTRY(saved_ebp) .long 0 -ENTRY(saved_esi) .long 0 -ENTRY(saved_edi) .long 0 -ENTRY(saved_ebx) .long 0 - -ENTRY(saved_eip) .long 0 -ENTRY(saved_esp) .long 0 - -ENTRY(saved_magic) .long 0 - -ENTRY(do_suspend_lowlevel) - cmpl $0,4(%esp) - jne .L1432 - call save_processor_state - - movl %esp, saved_context_esp - movl %eax, saved_context_eax - movl %ebx, saved_context_ebx - movl %ecx, saved_context_ecx - movl %edx, saved_context_edx - movl %ebp, saved_context_ebp - movl %esi, saved_context_esi - movl %edi, saved_context_edi - pushfl ; popl saved_context_eflags - - movl $.L1432,saved_eip - movl %esp,saved_esp - movl %ebp,saved_ebp - movl %ebx,saved_ebx - movl %edi,saved_edi - movl %esi,saved_esi - - pushl $3 - call acpi_enter_sleep_state - addl $4,%esp - ret - .p2align 4,,7 -.L1432: - movl $__KERNEL_DS,%eax - movw %ax, %ds - movl saved_context_esp, %esp - movl saved_context_ebp, %ebp - movl saved_context_eax, %eax - movl saved_context_ebx, %ebx - movl saved_context_ecx, %ecx - movl saved_context_edx, %edx - movl saved_context_esi, %esi - movl saved_context_edi, %edi - call restore_processor_state - pushl saved_context_eflags ; popfl - ret - -ALIGN -# saved registers -saved_gdt: .long 0,0 -saved_idt: .long 0,0 -saved_ldt: .long 0 -saved_tss: .long 0 - diff -Nru a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c --- a/arch/i386/kernel/apic.c Fri Feb 14 00:27:30 2003 +++ b/arch/i386/kernel/apic.c Fri Feb 14 00:27:30 2003 @@ -52,7 +52,7 @@ int prof_multiplier[NR_CPUS] = { 1, }; int prof_old_multiplier[NR_CPUS] = { 1, }; -int prof_counter[NR_CPUS] = { 1, }; +DEFINE_PER_CPU(int, prof_counter) = 1; int get_maxlvt(void) { @@ -997,7 +997,7 @@ x86_do_profile(regs); - if (--prof_counter[cpu] <= 0) { + if (--per_cpu(prof_counter, cpu) <= 0) { /* * The multiplier may have changed since the last time we got * to this point as a result of the user writing to @@ -1006,10 +1006,12 @@ * * Interrupts are already masked off at this point. */ - prof_counter[cpu] = prof_multiplier[cpu]; - if (prof_counter[cpu] != prof_old_multiplier[cpu]) { - __setup_APIC_LVTT(calibration_result/prof_counter[cpu]); - prof_old_multiplier[cpu] = prof_counter[cpu]; + per_cpu(prof_counter, cpu) = prof_multiplier[cpu]; + if (per_cpu(prof_counter, cpu) != prof_old_multiplier[cpu]) { + __setup_APIC_LVTT( + calibration_result/ + per_cpu(prof_counter, cpu)); + prof_old_multiplier[cpu] = per_cpu(prof_counter, cpu); } #ifdef CONFIG_SMP diff -Nru a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c --- a/arch/i386/kernel/apm.c Fri Feb 14 00:27:26 2003 +++ b/arch/i386/kernel/apm.c Fri Feb 14 00:27:26 2003 @@ -226,8 +226,6 @@ #include #include -#include - extern spinlock_t i8253_lock; extern unsigned long get_cmos_time(void); extern void machine_real_restart(unsigned char *, int); @@ -972,30 +970,6 @@ (void) set_system_power_state(APM_STATE_OFF); } -/** - * handle_poweroff - sysrq callback for power down - * @key: key pressed (unused) - * @pt_regs: register state (unused) - * @kbd: keyboard state (unused) - * @tty: tty involved (unused) - * - * When the user hits Sys-Rq o to power down the machine this is the - * callback we use. - */ - -static void handle_poweroff (int key, struct pt_regs *pt_regs, - struct tty_struct *tty) -{ - apm_power_off(); -} - -static struct sysrq_key_op sysrq_poweroff_op = { - .handler = handle_poweroff, - .help_msg = "Off", - .action_msg = "Power Off\n" -}; - - #ifdef CONFIG_APM_DO_ENABLE /** @@ -1742,11 +1716,9 @@ kapmd_running = 1; - daemonize(); + daemonize("kapmd"); - strcpy(current->comm, "kapmd"); current->flags |= PF_IOTHREAD; - sigfillset(¤t->blocked); #ifdef CONFIG_SMP /* 2002/08/01 - WT @@ -1850,7 +1822,6 @@ /* Install our power off handler.. */ if (power_off) pm_power_off = apm_power_off; - register_sysrq_key('o', &sysrq_poweroff_op); if (num_online_cpus() == 1 || smp) { #if defined(CONFIG_APM_DISPLAY_BLANK) && defined(CONFIG_VT) @@ -2098,7 +2069,6 @@ } misc_deregister(&apm_device); remove_proc_entry("apm", NULL); - unregister_sysrq_key('o',&sysrq_poweroff_op); if (power_off) pm_power_off = NULL; exit_kapmd = 1; diff -Nru a/arch/i386/kernel/cpu/centaur.c b/arch/i386/kernel/cpu/centaur.c --- a/arch/i386/kernel/cpu/centaur.c Fri Feb 14 00:27:29 2003 +++ b/arch/i386/kernel/cpu/centaur.c Fri Feb 14 00:27:29 2003 @@ -395,6 +395,8 @@ set_bit(X86_FEATURE_CX8, c->x86_capability); set_bit(X86_FEATURE_3DNOW, c->x86_capability); + case 9: /* Nehemiah */ + default: get_model_name(c); display_cacheinfo(c); break; @@ -408,6 +410,12 @@ /* VIA C3 CPUs (670-68F) need further shifting. */ if ((c->x86 == 6) && ((c->x86_model == 7) || (c->x86_model == 8))) size >>= 8; + + /* VIA also screwed up Nehemiah stepping 1, and made + it return '65KB' instead of '64KB' */ + if ((c->x86==6) && (c->x86_model==9) && (c->x86_mask==1)) + size -=1; + return size; } diff -Nru a/arch/i386/kernel/cpu/cpufreq/Makefile b/arch/i386/kernel/cpu/cpufreq/Makefile --- a/arch/i386/kernel/cpu/cpufreq/Makefile Fri Feb 14 00:27:28 2003 +++ b/arch/i386/kernel/cpu/cpufreq/Makefile Fri Feb 14 00:27:28 2003 @@ -1,4 +1,5 @@ obj-$(CONFIG_X86_POWERNOW_K6) += powernow-k6.o +obj-$(CONFIG_X86_POWERNOW_K7) += powernow-k7.o obj-$(CONFIG_X86_LONGHAUL) += longhaul.o obj-$(CONFIG_X86_SPEEDSTEP) += speedstep.o obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o diff -Nru a/arch/i386/kernel/cpu/cpufreq/elanfreq.c b/arch/i386/kernel/cpu/cpufreq/elanfreq.c --- a/arch/i386/kernel/cpu/cpufreq/elanfreq.c Fri Feb 14 00:27:28 2003 +++ b/arch/i386/kernel/cpu/cpufreq/elanfreq.c Fri Feb 14 00:27:28 2003 @@ -242,6 +242,8 @@ NR_CPUS * sizeof(struct cpufreq_policy), GFP_KERNEL); if (!driver) return -ENOMEM; + memset(driver, 0, sizeof(struct cpufreq_driver) + + NR_CPUS * sizeof(struct cpufreq_policy)); driver->policy = (struct cpufreq_policy *) (driver + 1); @@ -260,8 +262,6 @@ driver->verify = &elanfreq_verify; driver->setpolicy = &elanfreq_setpolicy; - driver->init = NULL; - driver->exit = NULL; strncpy(driver->name, "elanfreq", CPUFREQ_NAME_LEN); driver->policy[0].cpu = 0; diff -Nru a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c --- a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c Fri Feb 14 00:27:28 2003 +++ b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c Fri Feb 14 00:27:28 2003 @@ -431,11 +431,15 @@ driver = kmalloc(sizeof(struct cpufreq_driver) + NR_CPUS * sizeof(struct cpufreq_policy), GFP_KERNEL); if (driver == NULL) return -ENOMEM; + memset(driver, 0, sizeof(struct cpufreq_driver) + + NR_CPUS * sizeof(struct cpufreq_policy)); + params = kmalloc(sizeof(struct gxfreq_params), GFP_KERNEL); if (params == NULL) { kfree(driver); return -ENOMEM; } + memset(params, 0, sizeof(struct gxfreq_params)); driver->policy = (struct cpufreq_policy *)(driver + 1); params->cs55x0 = gx_pci; diff -Nru a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c --- a/arch/i386/kernel/cpu/cpufreq/longhaul.c Fri Feb 14 00:27:26 2003 +++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c Fri Feb 14 00:27:26 2003 @@ -762,6 +762,8 @@ NR_CPUS * sizeof(struct cpufreq_policy), GFP_KERNEL); if (!driver) return -ENOMEM; + memset(driver, 0, sizeof(struct cpufreq_driver) + + NR_CPUS * sizeof(struct cpufreq_policy)); driver->policy = (struct cpufreq_policy *) (driver + 1); @@ -771,8 +773,7 @@ driver->verify = &longhaul_verify; driver->setpolicy = &longhaul_setpolicy; - driver->init = NULL; - driver->exit = NULL; + strncpy(driver->name, "longhaul", CPUFREQ_NAME_LEN); driver->policy[0].cpu = 0; diff -Nru a/arch/i386/kernel/cpu/cpufreq/longrun.c b/arch/i386/kernel/cpu/cpufreq/longrun.c --- a/arch/i386/kernel/cpu/cpufreq/longrun.c Fri Feb 14 00:27:29 2003 +++ b/arch/i386/kernel/cpu/cpufreq/longrun.c Fri Feb 14 00:27:29 2003 @@ -54,7 +54,7 @@ policy->min = longrun_low_freq + msr_lo * ((longrun_high_freq - longrun_low_freq) / 100); - policy->min = longrun_low_freq + msr_hi * + policy->max = longrun_low_freq + msr_hi * ((longrun_high_freq - longrun_low_freq) / 100); policy->cpu = 0; } @@ -241,6 +241,8 @@ NR_CPUS * sizeof(struct cpufreq_policy), GFP_KERNEL); if (!driver) return -ENOMEM; + memset(driver, 0, sizeof(struct cpufreq_driver) + + NR_CPUS * sizeof(struct cpufreq_policy)); driver->policy = (struct cpufreq_policy *) (driver + 1); @@ -251,8 +253,7 @@ driver->policy[0].cpuinfo.min_freq = longrun_low_freq; driver->policy[0].cpuinfo.max_freq = longrun_high_freq; driver->policy[0].cpuinfo.transition_latency = CPUFREQ_ETERNAL; - driver->init = NULL; - driver->exit = NULL; + strncpy(driver->name, "longrun", CPUFREQ_NAME_LEN); longrun_get_policy(&driver->policy[0]); diff -Nru a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c --- a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c Fri Feb 14 00:27:30 2003 +++ b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c Fri Feb 14 00:27:30 2003 @@ -220,6 +220,8 @@ NR_CPUS * sizeof(struct cpufreq_policy), GFP_KERNEL); if (!driver) return -ENOMEM; + memset(driver, 0, sizeof(struct cpufreq_driver) + + NR_CPUS * sizeof(struct cpufreq_policy)); driver->policy = (struct cpufreq_policy *) (driver + 1); @@ -240,8 +242,6 @@ driver->verify = &cpufreq_p4_verify; driver->setpolicy = &cpufreq_p4_setpolicy; - driver->init = NULL; - driver->exit = NULL; strncpy(driver->name, "p4-clockmod", CPUFREQ_NAME_LEN); for (i=0;ipolicy = (struct cpufreq_policy *) (driver + 1); /* table init */ @@ -184,8 +186,6 @@ driver->verify = &powernow_k6_verify; driver->setpolicy = &powernow_k6_setpolicy; - driver->init = NULL; - driver->exit = NULL; strncpy(driver->name, "powernow-k6", CPUFREQ_NAME_LEN); /* cpuinfo and default policy values */ diff -Nru a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c Fri Feb 14 00:27:30 2003 @@ -0,0 +1,408 @@ +/* + * $Id: powernow-k7.c,v 1.31 2003/02/12 21:16:35 davej Exp $ + * + * (C) 2003 Dave Jones + * + * Licensed under the terms of the GNU GPL License version 2. + * Based upon datasheets & sample CPUs kindly provided by AMD. + * + * BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous* + * + * Errata 5: Processor may fail to execute a FID/VID change in presence of interrupt. + * - We cli/sti on stepping A0 CPUs around the FID/VID transition. + * Errata 15: Processors with half frequency multipliers may hang upon wakeup from disconnect. + * - We disable half multipliers if ACPI is used on A0 stepping CPUs. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "powernow-k7.h" + +#define DEBUG + +#ifdef DEBUG +#define dprintk(msg...) printk(msg) +#else +#define dprintk(msg...) do { } while(0); +#endif + +#define PFX "powernow: " + + +struct psb_s { + u8 signature[10]; + u8 tableversion; + u8 flags; + u16 settlingtime; + u8 reserved1; + u8 numpst; +}; + +struct pst_s { + u32 cpuid; + u8 fsbspeed; + u8 maxfid; + u8 startvid; + u8 numpstates; +}; + + +/* divide by 1000 to get VID. */ +static int mobile_vid_table[32] = { + 2000, 1950, 1900, 1850, 1800, 1750, 1700, 1650, + 1600, 1550, 1500, 1450, 1400, 1350, 1300, 0, + 1275, 1250, 1225, 1200, 1175, 1150, 1125, 1100, + 1075, 1050, 1024, 1000, 975, 950, 925, 0, +}; + +/* divide by 10 to get FID. */ +static int fid_codes[32] = { + 110, 115, 120, 125, 50, 55, 60, 65, + 70, 75, 80, 85, 90, 95, 10, 105, + 30, 190, 40, 200, 130, 135, 140, 210, + 150, 225, 160, 165, 170, 180, -1, -1, +}; + +static struct cpufreq_driver powernow_driver; + +static struct cpufreq_frequency_table *powernow_table; + +static unsigned int can_scale_bus; +static unsigned int can_scale_vid; +static unsigned int minimum_speed=-1; +static unsigned int maximum_speed; +static unsigned int number_scales; +static unsigned int fsb; +static unsigned int latency; +static char have_a0; + + +#ifndef rdmsrl +#define rdmsrl(msr,val) do {unsigned long l__,h__; \ + rdmsr (msr, l__, h__); \ + val = l__; \ + val |= ((u64)h__<<32); \ +} while(0); +#endif + +#ifndef wrmsrl +static void wrmsrl (u32 msr, u64 val) +{ + u32 lo, hi; + + lo = (u32) val; + hi = val >> 32; + wrmsr (msr, lo, hi); +} +#endif + + + +static int check_powernow(void) +{ + struct cpuinfo_x86 *c = cpu_data; + unsigned int maxei, eax, ebx, ecx, edx; + + if (c->x86_vendor != X86_VENDOR_AMD) { + printk (KERN_INFO PFX "AMD processor not detected.\n"); + return 0; + } + + if (c->x86 !=6) { + printk (KERN_INFO PFX "This module only works with AMD K7 CPUs\n"); + return 0; + } + + printk (KERN_INFO PFX "AMD K7 CPU detected.\n"); + + if ((c->x86_model == 6) && (c->x86_mask == 0)) { + printk (KERN_INFO PFX "K7 660[A0] core detected, enabling errata workarounds\n"); + have_a0 = 1; + } + + /* Get maximum capabilities */ + maxei = cpuid_eax (0x80000000); + if (maxei < 0x80000007) { /* Any powernow info ? */ + printk (KERN_INFO PFX "No powernow capabilities detected\n"); + return 0; + } + + cpuid(0x80000007, &eax, &ebx, &ecx, &edx); + printk (KERN_INFO PFX "PowerNOW! Technology present. Can scale: "); + + if (edx & 1 << 1) { + printk ("frequency"); + can_scale_bus=1; + } + + if ((edx & (1 << 1 | 1 << 2)) == 0x6) + printk (" and "); + + if (edx & 1 << 2) { + printk ("voltage"); + can_scale_vid=1; + } + + if (!(edx & (1 << 1 | 1 << 2))) { + printk (" nothing.\n"); + return 0; + } + + printk (".\n"); + return 1; +} + + +static int get_ranges (unsigned char *pst) +{ + int j; + u8 fid, vid; + unsigned int speed; + + powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table) * (number_scales + 1)), GFP_KERNEL); + if (!powernow_table) + return -ENOMEM; + memset(powernow_table, 0, (sizeof(struct cpufreq_frequency_table) * (number_scales + 1))); + + for (j=0 ; j < number_scales; j++) { + fid = *pst++; + + powernow_table[j].frequency = fsb * fid_codes[fid] * 100; + powernow_table[j].index = fid; /* lower 8 bits */ + + speed = fsb * (fid_codes[fid]/10); + if ((fid_codes[fid] % 10)==5) { + speed += fsb/2; +#if defined(CONFIG_ACPI_PROCESSOR) || defined(CONFIG_ACPI_PROCESSOR_MODULE) + if (have_a0 == 1) + powernow_table[j].frequency = CPUFREQ_ENTRY_INVALID; +#endif + } + + dprintk (KERN_INFO PFX " FID: 0x%x (%d.%dx [%dMHz])\t", fid, + fid_codes[fid] / 10, fid_codes[fid] % 10, speed); + + if (speed < minimum_speed) + minimum_speed = speed; + if (speed > maximum_speed) + maximum_speed = speed; + + vid = *pst++; + powernow_table[j].index |= (vid << 8); /* upper 8 bits */ + dprintk ("VID: 0x%x (%d.%03dV)\n", vid, mobile_vid_table[vid]/1000, + mobile_vid_table[vid]%1000); + } + dprintk ("\n"); + + powernow_table[number_scales].frequency = CPUFREQ_TABLE_END; + powernow_table[number_scales].index = 0; + + return 0; +} + + +static void change_speed (unsigned int index) +{ + u8 fid, vid; + struct cpufreq_freqs freqs; + union msr_fidvidstatus fidvidstatus; + union msr_fidvidctl fidvidctl; + + + /* fid are the lower 8 bits of the index we stored into + * the cpufreq frequency table in powernow_decode_bios, + * vid are the upper 8 bits. + */ + + fid = powernow_table[index].index & 0xFF; + vid = (powernow_table[index].index & 0xFF00) >> 8; + + freqs.cpu = 0; + + rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val); + freqs.old = fsb * fid_codes[fidvidstatus.bits.CFID] * 100; + + freqs.new = powernow_table[index].frequency; + + cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); + + /* Now do the magic poking into the MSRs. */ + + if (have_a0 == 1) /* A0 errata 5 */ + __asm__("\tcli\n"); + rdmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val); + fidvidctl.bits.SGTC = latency; /* Stop grant timeout counter */ + fidvidctl.bits.FID = fid; + fidvidctl.bits.VID = vid; + /* Note, we could set these lazily. Ie, only do voltage transition + if its changed since last time (Some speeds have the same voltage) */ + fidvidctl.bits.FIDC = 1; + fidvidctl.bits.VIDC = 1; + wrmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val); + if (have_a0 == 1) + __asm__("\tsti\n"); + + cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); +} + + +int powernow_decode_bios (int maxfid, int startvid) +{ + struct psb_s *psb; + struct pst_s *pst; + struct cpuinfo_x86 *c = cpu_data; + unsigned int i, j; + unsigned char *p; + unsigned int etuple; + unsigned int ret; + + etuple = cpuid_eax(0x80000001); + etuple &= 0xf00; + etuple |= (c->x86_model<<4)|(c->x86_mask); + + for (i=0xC0000; i < 0xffff0 ; i+=16) { + + p = phys_to_virt(i); + + if (memcmp(p, "AMDK7PNOW!", 10) == 0){ + dprintk (KERN_INFO PFX "Found PSB header at %p\n", p); + psb = (struct psb_s *) p; + dprintk (KERN_INFO PFX "Table version: 0x%x\n", psb->tableversion); + if (psb->tableversion != 0x12) { + printk (KERN_INFO PFX "Sorry, only v1.2 tables supported right now\n"); + return -ENODEV; + } + + dprintk (KERN_INFO PFX "Flags: 0x%x (", psb->flags); + if ((psb->flags & 1)==0) { + dprintk ("Mobile"); + } else { + dprintk ("Desktop"); + } + dprintk (" voltage regulator)\n"); + + latency = psb->settlingtime; + dprintk (KERN_INFO PFX "Settling Time: %d microseconds.\n", psb->settlingtime); + dprintk (KERN_INFO PFX "Has %d PST tables. (Only dumping ones relevant to this CPU).\n", psb->numpst); + + p += sizeof (struct psb_s); + + pst = (struct pst_s *) p; + + for (i = 0 ; i numpst; i++) { + pst = (struct pst_s *) p; + number_scales = pst->numpstates; + + if ((etuple == pst->cpuid) && (maxfid==pst->maxfid) && (startvid==pst->startvid)) + { + dprintk (KERN_INFO PFX "PST:%d (@%p)\n", i, pst); + dprintk (KERN_INFO PFX " cpuid: 0x%x\t", pst->cpuid); + dprintk ("fsb: %d\t", pst->fsbspeed); + dprintk ("maxFID: 0x%x\t", pst->maxfid); + dprintk ("startvid: 0x%x\n", pst->startvid); + + fsb = pst->fsbspeed; + ret = get_ranges ((char *) pst + sizeof (struct pst_s)); + return ret; + + } else { + p = (char *) pst + sizeof (struct pst_s); + for (j=0 ; j < number_scales; j++) + p+=2; + } + } + return -EINVAL; + } + p++; + } + + return -ENODEV; +} + + +static int powernow_target (struct cpufreq_policy *policy, + unsigned int target_freq, + unsigned int relation) +{ + unsigned int newstate; + + if (cpufreq_frequency_table_target(policy, powernow_table, target_freq, relation, &newstate)) + return -EINVAL; + + change_speed(newstate); + + return 0; +} + + +static int powernow_verify (struct cpufreq_policy *policy) +{ + return cpufreq_frequency_table_verify(policy, powernow_table); +} + + +static int __init powernow_cpu_init (struct cpufreq_policy *policy) +{ + union msr_fidvidstatus fidvidstatus; + int result; + + if (policy->cpu != 0) + return -ENODEV; + + rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val); + + result = powernow_decode_bios(fidvidstatus.bits.MFID, fidvidstatus.bits.SVID); + if (result) + return result; + + printk (KERN_INFO PFX "Minimum speed %d MHz. Maximum speed %d MHz.\n", + minimum_speed, maximum_speed); + + policy->policy = CPUFREQ_POLICY_PERFORMANCE; + policy->cpuinfo.transition_latency = latency; +#ifdef CONFIG_CPU_FREQ_24_API + powernow_driver.cpu_cur_freq[policy->cpu] = maximum_speed; +#endif + + return cpufreq_frequency_table_cpuinfo(policy, powernow_table); +} + +static int __init powernow_init (void) +{ + if (check_powernow()==0) + return -ENODEV; + return cpufreq_register_driver(&powernow_driver); +} + + +static void __exit powernow_exit (void) +{ + cpufreq_unregister_driver(&powernow_driver); + if (powernow_table) + kfree(powernow_table); +} + +static struct cpufreq_driver powernow_driver = { + .verify = powernow_verify, + .target = powernow_target, + .init = powernow_cpu_init, + .name = "powernow-k7", +}; + + +MODULE_AUTHOR ("Dave Jones "); +MODULE_DESCRIPTION ("Powernow driver for AMD K7 processors."); +MODULE_LICENSE ("GPL"); + +module_init(powernow_init); +module_exit(powernow_exit); + diff -Nru a/arch/i386/kernel/cpu/cpufreq/powernow-k7.h b/arch/i386/kernel/cpu/cpufreq/powernow-k7.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.h Fri Feb 14 00:27:30 2003 @@ -0,0 +1,52 @@ +/* + * $Id: powernow-k7.h,v 1.2 2003/02/10 18:26:01 davej Exp $ + * (C) 2003 Dave Jones. + * + * Licensed under the terms of the GNU GPL License version 2. + * + * AMD-specific information + * + */ + +#ifndef MSR_K7_FID_VID_CTL +#define MSR_K7_FID_VID_CTL 0xc0010041 +#endif +#ifndef MSR_K7_FID_VID_STATUS +#define MSR_K7_FID_VID_STATUS 0xc0010042 +#endif + + +union msr_fidvidctl { + struct { + unsigned FID:5, // 4:0 + reserved1:3, // 7:5 + VID:5, // 12:8 + reserved2:3, // 15:13 + FIDC:1, // 16 + VIDC:1, // 17 + reserved3:2, // 19:18 + FIDCHGRATIO:1, // 20 + reserved4:11, // 31-21 + SGTC:20, // 32:51 + reserved5:12; // 63:52 + } bits; + unsigned long long val; +}; + +union msr_fidvidstatus { + struct { + unsigned CFID:5, // 4:0 + reserved1:3, // 7:5 + SFID:5, // 12:8 + reserved2:3, // 15:13 + MFID:5, // 20:16 + reserved3:11, // 31:21 + CVID:5, // 36:32 + reserved4:3, // 39:37 + SVID:5, // 44:40 + reserved5:3, // 47:45 + MVID:5, // 52:48 + reserved6:11; // 63:53 + } bits; + unsigned long long val; +}; diff -Nru a/arch/i386/kernel/cpu/cpufreq/speedstep.c b/arch/i386/kernel/cpu/cpufreq/speedstep.c --- a/arch/i386/kernel/cpu/cpufreq/speedstep.c Fri Feb 14 00:27:26 2003 +++ b/arch/i386/kernel/cpu/cpufreq/speedstep.c Fri Feb 14 00:27:26 2003 @@ -674,6 +674,8 @@ NR_CPUS * sizeof(struct cpufreq_policy), GFP_KERNEL); if (!driver) return -ENOMEM; + memset(driver, 0, sizeof(struct cpufreq_driver) + + NR_CPUS * sizeof(struct cpufreq_policy)); driver->policy = (struct cpufreq_policy *) (driver + 1); @@ -690,8 +692,6 @@ driver->verify = &speedstep_verify; driver->setpolicy = &speedstep_setpolicy; - driver->init = NULL; - driver->exit = NULL; strncpy(driver->name, "speedstep", CPUFREQ_NAME_LEN); driver->policy[0].cpuinfo.transition_latency = CPUFREQ_ETERNAL; diff -Nru a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c --- a/arch/i386/kernel/io_apic.c Fri Feb 14 00:27:27 2003 +++ b/arch/i386/kernel/io_apic.c Fri Feb 14 00:27:27 2003 @@ -510,9 +510,8 @@ int i; unsigned long prev_balance_time = jiffies; long time_remaining = balanced_irq_interval; - daemonize(); - sigfillset(¤t->blocked); - sprintf(current->comm, "kirqd"); + + daemonize("kirqd"); /* push everything to CPU 0 to give us a starting point. */ for (i = 0 ; i < NR_IRQS ; i++) @@ -1440,7 +1439,8 @@ * by Matt Domsch Tue Dec 21 12:25:05 CST 1999 */ -static void __init setup_ioapic_ids_from_mpc (void) +#ifndef CONFIG_X86_NUMAQ +static void __init setup_ioapic_ids_from_mpc(void) { struct IO_APIC_reg_00 reg_00; unsigned long phys_id_present_map; @@ -1533,6 +1533,9 @@ printk(" ok.\n"); } } +#else +static void __init setup_ioapic_ids_from_mpc(void) { } +#endif /* * There is a nasty bug in some older SMP boards, their mptable lies diff -Nru a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c --- a/arch/i386/kernel/nmi.c Fri Feb 14 00:27:28 2003 +++ b/arch/i386/kernel/nmi.c Fri Feb 14 00:27:28 2003 @@ -63,8 +63,6 @@ CRU_ESCR0 (with any non-null event selector) through a complemented max threshold. [IA32-Vol3, Section 14.9.9] */ #define MSR_P4_IQ_COUNTER0 0x30C -#define MSR_P4_IQ_CCCR0 0x36C -#define MSR_P4_CRU_ESCR0 0x3B8 #define P4_NMI_CRU_ESCR0 (P4_ESCR_EVENT_SELECT(0x3F)|P4_ESCR_OS|P4_ESCR_USR) #define P4_NMI_IQ_CCCR0 \ (P4_CCCR_OVF_PMI|P4_CCCR_THRESHOLD(15)|P4_CCCR_COMPLEMENT| \ diff -Nru a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c --- a/arch/i386/kernel/ptrace.c Fri Feb 14 00:27:27 2003 +++ b/arch/i386/kernel/ptrace.c Fri Feb 14 00:27:27 2003 @@ -530,11 +530,9 @@ return; /* the 0x80 provides a way for the tracing parent to distinguish between a syscall stop and SIGTRAP delivery */ - current->exit_code = SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) - ? 0x80 : 0); - current->state = TASK_STOPPED; - notify_parent(current, SIGCHLD); - schedule(); + ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) + ? 0x80 : 0)); + /* * this isn't the same as continuing with a signal, but it will do * for normal use. strace only continues with a signal if the diff -Nru a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c --- a/arch/i386/kernel/signal.c Fri Feb 14 00:27:28 2003 +++ b/arch/i386/kernel/signal.c Fri Feb 14 00:27:28 2003 @@ -582,7 +582,7 @@ if (!oldset) oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, regs); + signr = get_signal_to_deliver(&info, regs, NULL); if (signr > 0) { /* Reenable any watchpoints before delivering the * signal to user space. The processor register will diff -Nru a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c --- a/arch/i386/kernel/smpboot.c Fri Feb 14 00:27:28 2003 +++ b/arch/i386/kernel/smpboot.c Fri Feb 14 00:27:28 2003 @@ -160,7 +160,6 @@ goto valid_k7; /* If we get here, it's not a certified SMP capable AMD system. */ - printk (KERN_INFO "WARNING: This combination of AMD processors is not suitable for SMP.\n"); tainted |= TAINT_UNSAFE_SMP; } @@ -182,8 +181,6 @@ #define NR_LOOPS 5 -extern unsigned long fast_gettimeoffset_quotient; - /* * accurate 64-bit/32-bit division, expanded to 32-bit divisions and 64-bit * multiplication. Not terribly optimized but we need it at boot time only @@ -223,7 +220,8 @@ printk("checking TSC synchronization across %u CPUs: ", num_booting_cpus()); - one_usec = ((1<<30)/fast_gettimeoffset_quotient)*(1<<2); + /* convert from kcyc/sec to cyc/usec */ + one_usec = cpu_khz / 1000; atomic_set(&tsc_start_flag, 1); wmb(); @@ -935,10 +933,6 @@ * Cycle through the processors sending APIC IPIs to boot each. */ -extern int prof_multiplier[NR_CPUS]; -extern int prof_old_multiplier[NR_CPUS]; -extern int prof_counter[NR_CPUS]; - static int boot_cpu_logical_apicid; /* Where the IO area was mapped on multiquad, always 0 otherwise */ void *xquad_portio; @@ -950,17 +944,6 @@ int apicid, cpu, bit; /* - * Initialize the logical to physical CPU number mapping - * and the per-CPU profiling counter/multiplier - */ - - for (cpu = 0; cpu < NR_CPUS; cpu++) { - prof_counter[cpu] = 1; - prof_old_multiplier[cpu] = 1; - prof_multiplier[cpu] = 1; - } - - /* * Setup boot CPU information */ smp_store_cpu_info(0); /* Final full version of the data */ @@ -1084,6 +1067,15 @@ if (smp_b_stepping) printk(KERN_WARNING "WARNING: SMP operation may be unreliable with B stepping processors.\n"); + + /* Don't taint if we are running SMP kernel on a single non-MP approved Athlon */ + if (tainted & TAINT_UNSAFE_SMP) { + if (cpucount) + printk (KERN_INFO "WARNING: This combination of AMD processors is not suitable for SMP.\n"); + else + tainted &= ~TAINT_UNSAFE_SMP; + } + Dprintk("Boot done.\n"); /* diff -Nru a/arch/i386/kernel/timers/Makefile b/arch/i386/kernel/timers/Makefile --- a/arch/i386/kernel/timers/Makefile Fri Feb 14 00:27:26 2003 +++ b/arch/i386/kernel/timers/Makefile Fri Feb 14 00:27:26 2003 @@ -4,4 +4,4 @@ obj-y := timer.o timer_none.o timer_tsc.o timer_pit.o -obj-$(CONFIG_X86_CYCLONE) += timer_cyclone.o +obj-$(CONFIG_X86_SUMMIT) += timer_cyclone.o diff -Nru a/arch/i386/kernel/timers/timer.c b/arch/i386/kernel/timers/timer.c --- a/arch/i386/kernel/timers/timer.c Fri Feb 14 00:27:30 2003 +++ b/arch/i386/kernel/timers/timer.c Fri Feb 14 00:27:30 2003 @@ -4,9 +4,14 @@ /* list of externed timers */ extern struct timer_opts timer_pit; extern struct timer_opts timer_tsc; - +#ifdef CONFIG_X86_SUMMIT +extern struct timer_opts timer_cyclone; +#endif /* list of timers, ordered by preference, NULL terminated */ static struct timer_opts* timers[] = { +#ifdef CONFIG_X86_SUMMIT + &timer_cyclone, +#endif &timer_tsc, &timer_pit, NULL, diff -Nru a/arch/i386/kernel/timers/timer_cyclone.c b/arch/i386/kernel/timers/timer_cyclone.c --- a/arch/i386/kernel/timers/timer_cyclone.c Fri Feb 14 00:27:29 2003 +++ b/arch/i386/kernel/timers/timer_cyclone.c Fri Feb 14 00:27:29 2003 @@ -17,6 +17,7 @@ #include extern spinlock_t i8253_lock; +extern unsigned long calibrate_tsc(void); /* Number of usecs that the last interrupt was delayed */ static int delay_at_last_interrupt; @@ -142,6 +143,27 @@ printk(KERN_ERR "Summit chipset: Counter not counting! DISABLED\n"); cyclone_timer = 0; return -ENODEV; + } + } + + /* init cpu_khz. + * XXX - This should really be done elsewhere, + * and in a more generic fashion. -johnstul@us.ibm.com + */ + if (cpu_has_tsc) { + unsigned long tsc_quotient = calibrate_tsc(); + if (tsc_quotient) { + /* report CPU clock rate in Hz. + * The formula is (10^6 * 2^32) / (2^32 * 1 / (clocks/us)) = + * clock/second. Our precision is about 100 ppm. + */ + { unsigned long eax=0, edx=1000; + __asm__("divl %2" + :"=a" (cpu_khz), "=d" (edx) + :"r" (tsc_quotient), + "0" (eax), "1" (edx)); + printk("Detected %lu.%03lu MHz processor.\n", cpu_khz / 1000, cpu_khz % 1000); + } } } diff -Nru a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c --- a/arch/i386/kernel/timers/timer_tsc.c Fri Feb 14 00:27:29 2003 +++ b/arch/i386/kernel/timers/timer_tsc.c Fri Feb 14 00:27:29 2003 @@ -29,7 +29,7 @@ * Equal to 2^32 * (1 / (clocks per usec) ). * Initialized in time_init. */ -unsigned long fast_gettimeoffset_quotient; +static unsigned long fast_gettimeoffset_quotient; static unsigned long get_offset_tsc(void) { @@ -130,7 +130,7 @@ #define CALIBRATE_LATCH (5 * LATCH) #define CALIBRATE_TIME (5 * 1000020/HZ) -static unsigned long __init calibrate_tsc(void) +unsigned long __init calibrate_tsc(void) { /* Set the Gate high, disable speaker */ outb((inb(0x61) & ~0x02) | 0x01, 0x61); diff -Nru a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c --- a/arch/i386/mach-voyager/voyager_smp.c Fri Feb 14 00:27:28 2003 +++ b/arch/i386/mach-voyager/voyager_smp.c Fri Feb 14 00:27:28 2003 @@ -236,7 +236,7 @@ /* The per cpu profile stuff - used in smp_local_timer_interrupt */ static unsigned int prof_multiplier[NR_CPUS] __cacheline_aligned = { 1, }; static unsigned int prof_old_multiplier[NR_CPUS] __cacheline_aligned = { 1, }; -static unsigned int prof_counter[NR_CPUS] __cacheline_aligned = { 1, }; +static DEFINE_PER_CPU(unsigned int, prof_counter) = 1; /* the map used to check if a CPU has booted */ static __u32 cpu_booted_map; @@ -393,9 +393,6 @@ /* initialize the CPU structures (moved from smp_boot_cpus) */ for(i=0; icomm, THREAD_NAME); sigfillset(¤t->blocked); current->tty = NULL; /* get rid of controlling tty */ diff -Nru a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c --- a/arch/i386/mm/hugetlbpage.c Fri Feb 14 00:27:30 2003 +++ b/arch/i386/mm/hugetlbpage.c Fri Feb 14 00:27:30 2003 @@ -88,6 +88,18 @@ set_pte(page_table, entry); } +/* + * This function checks for proper alignment of input addr and len parameters. + */ +int is_aligned_hugepage_range(unsigned long addr, unsigned long len) +{ + if (len & ~HPAGE_MASK) + return -EINVAL; + if (addr & ~HPAGE_MASK) + return -EINVAL; + return 0; +} + int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma) { @@ -284,7 +296,6 @@ 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; @@ -308,7 +319,6 @@ + (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; @@ -320,9 +330,6 @@ 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); } diff -Nru a/arch/i386/oprofile/Makefile b/arch/i386/oprofile/Makefile --- a/arch/i386/oprofile/Makefile Fri Feb 14 00:27:30 2003 +++ b/arch/i386/oprofile/Makefile Fri Feb 14 00:27:30 2003 @@ -7,4 +7,4 @@ oprofile-y := $(DRIVER_OBJS) init.o timer_int.o oprofile-$(CONFIG_X86_LOCAL_APIC) += nmi_int.o op_model_athlon.o \ - op_model_ppro.o + op_model_ppro.o op_model_p4.o diff -Nru a/arch/i386/oprofile/init.c b/arch/i386/oprofile/init.c --- a/arch/i386/oprofile/init.c Fri Feb 14 00:27:28 2003 +++ b/arch/i386/oprofile/init.c Fri Feb 14 00:27:28 2003 @@ -16,14 +16,14 @@ * code unlike the NMI-based code. */ -extern int nmi_init(struct oprofile_operations ** ops, enum oprofile_cpu * cpu); -extern void timer_init(struct oprofile_operations ** ops, enum oprofile_cpu * cpu); +extern int nmi_init(struct oprofile_operations ** ops); +extern void timer_init(struct oprofile_operations ** ops); -int __init oprofile_arch_init(struct oprofile_operations ** ops, enum oprofile_cpu * cpu) +int __init oprofile_arch_init(struct oprofile_operations ** ops) { #ifdef CONFIG_X86_LOCAL_APIC - if (!nmi_init(ops, cpu)) + if (!nmi_init(ops)) #endif - timer_init(ops, cpu); + timer_init(ops); return 0; } diff -Nru a/arch/i386/oprofile/nmi_int.c b/arch/i386/oprofile/nmi_int.c --- a/arch/i386/oprofile/nmi_int.c Fri Feb 14 00:27:30 2003 +++ b/arch/i386/oprofile/nmi_int.c Fri Feb 14 00:27:30 2003 @@ -214,12 +214,62 @@ .stop = nmi_stop }; + +#if !defined(CONFIG_X86_64) + +static int __init p4_init(void) +{ + __u8 cpu_model = current_cpu_data.x86_model; + + if (cpu_model > 3) + return 0; + +#ifndef CONFIG_SMP + nmi_ops.cpu_type = "i386/p4"; + model = &op_p4_spec; + return 1; +#else + switch (smp_num_siblings) { + case 1: + nmi_ops.cpu_type = "i386/p4"; + model = &op_p4_spec; + return 1; + + case 2: + nmi_ops.cpu_type = "i386/p4-ht"; + model = &op_p4_ht2_spec; + return 1; + } +#endif + + printk(KERN_INFO "oprofile: P4 HyperThreading detected with > 2 threads\n"); + printk(KERN_INFO "oprofile: Reverting to timer mode.\n"); + return 0; +} + + +static int __init ppro_init(void) +{ + __u8 cpu_model = current_cpu_data.x86_model; + + if (cpu_model > 5) { + nmi_ops.cpu_type = "i386/piii"; + } else if (cpu_model > 2) { + nmi_ops.cpu_type = "i386/pii"; + } else { + nmi_ops.cpu_type = "i386/ppro"; + } + + model = &op_ppro_spec; + return 1; +} + +#endif /* !CONFIG_X86_64 */ -int __init nmi_init(struct oprofile_operations ** ops, enum oprofile_cpu * cpu) +int __init nmi_init(struct oprofile_operations ** ops) { __u8 vendor = current_cpu_data.x86_vendor; __u8 family = current_cpu_data.x86; - __u8 cpu_model = current_cpu_data.x86_model; if (!cpu_has_apic) return 0; @@ -230,26 +280,29 @@ if (family < 6) return 0; model = &op_athlon_spec; - *cpu = OPROFILE_CPU_ATHLON; + nmi_ops.cpu_type = "i386/athlon"; break; -#ifndef CONFIG_X86_64 +#if !defined(CONFIG_X86_64) case X86_VENDOR_INTEL: - /* Less than a P6-class processor */ - if (family != 6) - return 0; - - if (cpu_model > 5) { - *cpu = OPROFILE_CPU_PIII; - } else if (cpu_model > 2) { - *cpu = OPROFILE_CPU_PII; - } else { - *cpu = OPROFILE_CPU_PPRO; + switch (family) { + /* Pentium IV */ + case 0xf: + if (!p4_init()) + return 0; + break; + + /* A P6-class processor */ + case 6: + if (!ppro_init()) + return 0; + break; + + default: + return 0; } - - model = &op_ppro_spec; break; -#endif +#endif /* !CONFIG_X86_64 */ default: return 0; diff -Nru a/arch/i386/oprofile/op_counter.h b/arch/i386/oprofile/op_counter.h --- a/arch/i386/oprofile/op_counter.h Fri Feb 14 00:27:28 2003 +++ b/arch/i386/oprofile/op_counter.h Fri Feb 14 00:27:28 2003 @@ -10,7 +10,7 @@ #ifndef OP_COUNTER_H #define OP_COUNTER_H -#define OP_MAX_COUNTER 4 +#define OP_MAX_COUNTER 8 /* Per-perfctr configuration as set via * oprofilefs. diff -Nru a/arch/i386/oprofile/op_model_athlon.c b/arch/i386/oprofile/op_model_athlon.c --- a/arch/i386/oprofile/op_model_athlon.c Fri Feb 14 00:27:29 2003 +++ b/arch/i386/oprofile/op_model_athlon.c Fri Feb 14 00:27:29 2003 @@ -96,10 +96,13 @@ { unsigned int low, high; int i; + unsigned long eip = instruction_pointer(regs); + int is_kernel = !user_mode(regs); + for (i = 0 ; i < NUM_COUNTERS; ++i) { CTR_READ(low, high, msrs, i); if (CTR_OVERFLOWED(low)) { - oprofile_add_sample(instruction_pointer(regs), i, cpu); + oprofile_add_sample(eip, is_kernel, i, cpu); CTR_WRITE(reset_value[i], msrs, i); return 1; } diff -Nru a/arch/i386/oprofile/op_model_p4.c b/arch/i386/oprofile/op_model_p4.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/i386/oprofile/op_model_p4.c Fri Feb 14 00:27:30 2003 @@ -0,0 +1,673 @@ +/** + * @file op_model_p4.c + * P4 model-specific MSR operations + * + * @remark Copyright 2002 OProfile authors + * @remark Read the file COPYING + * + * @author Graydon Hoare + */ + +#include +#include +#include +#include +#include +#include + +#include "op_x86_model.h" +#include "op_counter.h" + +#define NUM_EVENTS 39 + +#define NUM_COUNTERS_NON_HT 8 +#define NUM_ESCRS_NON_HT 45 +#define NUM_CCCRS_NON_HT 18 +#define NUM_CONTROLS_NON_HT (NUM_ESCRS_NON_HT + NUM_CCCRS_NON_HT) + +#define NUM_COUNTERS_HT2 4 +#define NUM_ESCRS_HT2 23 +#define NUM_CCCRS_HT2 9 +#define NUM_CONTROLS_HT2 (NUM_ESCRS_HT2 + NUM_CCCRS_HT2) + +static unsigned int num_counters = NUM_COUNTERS_NON_HT; +static unsigned int num_cccrs = NUM_CCCRS_NON_HT; + + +/* this has to be checked dynamically since the + hyper-threadedness of a chip is discovered at + kernel boot-time. */ +static inline void setup_num_counters(void) +{ +#ifdef CONFIG_SMP + if (smp_num_siblings == 2) { + num_counters = NUM_COUNTERS_HT2; + num_cccrs = NUM_CCCRS_HT2; + } +#endif +} + + +/* tables to simulate simplified hardware view of p4 registers */ +struct p4_counter_binding { + int virt_counter; + int counter_address; + int cccr_address; +}; + +struct p4_event_binding { + int escr_select; /* value to put in CCCR */ + int event_select; /* value to put in ESCR */ + struct { + int virt_counter; /* for this counter... */ + int escr_address; /* use this ESCR */ + } bindings[2]; +}; + +/* nb: these CTR_* defines are a duplicate of defines in + libop/op_events.c. */ + + +#define CTR_BPU_0 (1 << 0) +#define CTR_MS_0 (1 << 1) +#define CTR_FLAME_0 (1 << 2) +#define CTR_IQ_4 (1 << 3) +#define CTR_BPU_2 (1 << 4) +#define CTR_MS_2 (1 << 5) +#define CTR_FLAME_2 (1 << 6) +#define CTR_IQ_5 (1 << 7) + +static struct p4_counter_binding p4_counters [NUM_COUNTERS_NON_HT] = { + { CTR_BPU_0, MSR_P4_BPU_PERFCTR0, MSR_P4_BPU_CCCR0 }, + { CTR_MS_0, MSR_P4_MS_PERFCTR0, MSR_P4_MS_CCCR0 }, + { CTR_FLAME_0, MSR_P4_FLAME_PERFCTR0, MSR_P4_FLAME_CCCR0 }, + { CTR_IQ_4, MSR_P4_IQ_PERFCTR4, MSR_P4_IQ_CCCR4 }, + { CTR_BPU_2, MSR_P4_BPU_PERFCTR2, MSR_P4_BPU_CCCR2 }, + { CTR_MS_2, MSR_P4_MS_PERFCTR2, MSR_P4_MS_CCCR2 }, + { CTR_FLAME_2, MSR_P4_FLAME_PERFCTR2, MSR_P4_FLAME_CCCR2 }, + { CTR_IQ_5, MSR_P4_IQ_PERFCTR5, MSR_P4_IQ_CCCR5 } +}; + +/* p4 event codes in libop/op_event.h are indices into this table. */ + +static struct p4_event_binding p4_events[NUM_EVENTS] = { + + { /* BRANCH_RETIRED */ + 0x05, 0x06, + { {CTR_IQ_4, MSR_P4_CRU_ESCR2}, + {CTR_IQ_5, MSR_P4_CRU_ESCR3} } + }, + + { /* MISPRED_BRANCH_RETIRED */ + 0x04, 0x03, + { { CTR_IQ_4, MSR_P4_CRU_ESCR0}, + { CTR_IQ_5, MSR_P4_CRU_ESCR1} } + }, + + { /* TC_DELIVER_MODE */ + 0x01, 0x01, + { { CTR_MS_0, MSR_P4_TC_ESCR0}, + { CTR_MS_2, MSR_P4_TC_ESCR1} } + }, + + { /* BPU_FETCH_REQUEST */ + 0x00, 0x03, + { { CTR_BPU_0, MSR_P4_BPU_ESCR0}, + { CTR_BPU_2, MSR_P4_BPU_ESCR1} } + }, + + { /* ITLB_REFERENCE */ + 0x03, 0x18, + { { CTR_BPU_0, MSR_P4_ITLB_ESCR0}, + { CTR_BPU_2, MSR_P4_ITLB_ESCR1} } + }, + + { /* MEMORY_CANCEL */ + 0x05, 0x02, + { { CTR_FLAME_0, MSR_P4_DAC_ESCR0}, + { CTR_FLAME_2, MSR_P4_DAC_ESCR1} } + }, + + { /* MEMORY_COMPLETE */ + 0x02, 0x08, + { { CTR_FLAME_0, MSR_P4_SAAT_ESCR0}, + { CTR_FLAME_2, MSR_P4_SAAT_ESCR1} } + }, + + { /* LOAD_PORT_REPLAY */ + 0x02, 0x04, + { { CTR_FLAME_0, MSR_P4_SAAT_ESCR0}, + { CTR_FLAME_2, MSR_P4_SAAT_ESCR1} } + }, + + { /* STORE_PORT_REPLAY */ + 0x02, 0x05, + { { CTR_FLAME_0, MSR_P4_SAAT_ESCR0}, + { CTR_FLAME_2, MSR_P4_SAAT_ESCR1} } + }, + + { /* MOB_LOAD_REPLAY */ + 0x02, 0x03, + { { CTR_BPU_0, MSR_P4_MOB_ESCR0}, + { CTR_BPU_2, MSR_P4_MOB_ESCR1} } + }, + + { /* PAGE_WALK_TYPE */ + 0x04, 0x01, + { { CTR_BPU_0, MSR_P4_PMH_ESCR0}, + { CTR_BPU_2, MSR_P4_PMH_ESCR1} } + }, + + { /* BSQ_CACHE_REFERENCE */ + 0x07, 0x0c, + { { CTR_BPU_0, MSR_P4_BSU_ESCR0}, + { CTR_BPU_2, MSR_P4_BSU_ESCR1} } + }, + + { /* IOQ_ALLOCATION */ + 0x06, 0x03, + { { CTR_BPU_0, MSR_P4_FSB_ESCR0}, + {-1,-1} } + }, + + { /* IOQ_ACTIVE_ENTRIES */ + 0x06, 0x1a, + { { CTR_BPU_2, MSR_P4_FSB_ESCR1}, + {-1,-1} } + }, + + { /* FSB_DATA_ACTIVITY */ + 0x06, 0x17, + { { CTR_BPU_0, MSR_P4_FSB_ESCR0}, + { CTR_BPU_2, MSR_P4_FSB_ESCR1} } + }, + + { /* BSQ_ALLOCATION */ + 0x07, 0x05, + { { CTR_BPU_0, MSR_P4_BSU_ESCR0}, + {-1,-1} } + }, + + { /* BSQ_ACTIVE_ENTRIES */ + 0x07, 0x06, + { { CTR_BPU_2, MSR_P4_BSU_ESCR1 /* guess */}, + {-1,-1} } + }, + + { /* X87_ASSIST */ + 0x05, 0x03, + { { CTR_IQ_4, MSR_P4_CRU_ESCR2}, + { CTR_IQ_5, MSR_P4_CRU_ESCR3} } + }, + + { /* SSE_INPUT_ASSIST */ + 0x01, 0x34, + { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0}, + { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} } + }, + + { /* PACKED_SP_UOP */ + 0x01, 0x08, + { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0}, + { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} } + }, + + { /* PACKED_DP_UOP */ + 0x01, 0x0c, + { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0}, + { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} } + }, + + { /* SCALAR_SP_UOP */ + 0x01, 0x0a, + { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0}, + { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} } + }, + + { /* SCALAR_DP_UOP */ + 0x01, 0x0e, + { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0}, + { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} } + }, + + { /* 64BIT_MMX_UOP */ + 0x01, 0x02, + { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0}, + { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} } + }, + + { /* 128BIT_MMX_UOP */ + 0x01, 0x1a, + { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0}, + { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} } + }, + + { /* X87_FP_UOP */ + 0x01, 0x04, + { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0}, + { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} } + }, + + { /* X87_SIMD_MOVES_UOP */ + 0x01, 0x2e, + { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0}, + { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} } + }, + + { /* MACHINE_CLEAR */ + 0x05, 0x02, + { { CTR_IQ_4, MSR_P4_CRU_ESCR2}, + { CTR_IQ_5, MSR_P4_CRU_ESCR3} } + }, + + { /* GLOBAL_POWER_EVENTS */ + 0x06, 0x13 /* manual says 0x05 */, + { { CTR_BPU_0, MSR_P4_FSB_ESCR0}, + { CTR_BPU_2, MSR_P4_FSB_ESCR1} } + }, + + { /* TC_MS_XFER */ + 0x00, 0x05, + { { CTR_MS_0, MSR_P4_MS_ESCR0}, + { CTR_MS_2, MSR_P4_MS_ESCR1} } + }, + + { /* UOP_QUEUE_WRITES */ + 0x00, 0x09, + { { CTR_MS_0, MSR_P4_MS_ESCR0}, + { CTR_MS_2, MSR_P4_MS_ESCR1} } + }, + + { /* FRONT_END_EVENT */ + 0x05, 0x08, + { { CTR_IQ_4, MSR_P4_CRU_ESCR2}, + { CTR_IQ_5, MSR_P4_CRU_ESCR3} } + }, + + { /* EXECUTION_EVENT */ + 0x05, 0x0c, + { { CTR_IQ_4, MSR_P4_CRU_ESCR2}, + { CTR_IQ_5, MSR_P4_CRU_ESCR3} } + }, + + { /* REPLAY_EVENT */ + 0x05, 0x09, + { { CTR_IQ_4, MSR_P4_CRU_ESCR2}, + { CTR_IQ_5, MSR_P4_CRU_ESCR3} } + }, + + { /* INSTR_RETIRED */ + 0x04, 0x02, + { { CTR_IQ_4, MSR_P4_CRU_ESCR0}, + { CTR_IQ_5, MSR_P4_CRU_ESCR1} } + }, + + { /* UOPS_RETIRED */ + 0x04, 0x01, + { { CTR_IQ_4, MSR_P4_CRU_ESCR0}, + { CTR_IQ_5, MSR_P4_CRU_ESCR1} } + }, + + { /* UOP_TYPE */ + 0x02, 0x02, + { { CTR_IQ_4, MSR_P4_RAT_ESCR0}, + { CTR_IQ_5, MSR_P4_RAT_ESCR1} } + }, + + { /* RETIRED_MISPRED_BRANCH_TYPE */ + 0x02, 0x05, + { { CTR_MS_0, MSR_P4_TBPU_ESCR0}, + { CTR_MS_2, MSR_P4_TBPU_ESCR1} } + }, + + { /* RETIRED_BRANCH_TYPE */ + 0x02, 0x04, + { { CTR_MS_0, MSR_P4_TBPU_ESCR0}, + { CTR_MS_2, MSR_P4_TBPU_ESCR1} } + } +}; + + +#define MISC_PMC_ENABLED_P(x) ((x) & 1 << 7) + +#define ESCR_RESERVED_BITS 0x80000003 +#define ESCR_CLEAR(escr) ((escr) &= ESCR_RESERVED_BITS) +#define ESCR_SET_USR_0(escr, usr) ((escr) |= (((usr) & 1) << 2)) +#define ESCR_SET_OS_0(escr, os) ((escr) |= (((os) & 1) << 3)) +#define ESCR_SET_USR_1(escr, usr) ((escr) |= (((usr) & 1))) +#define ESCR_SET_OS_1(escr, os) ((escr) |= (((os) & 1) << 1)) +#define ESCR_SET_EVENT_SELECT(escr, sel) ((escr) |= (((sel) & 0x1f) << 25)) +#define ESCR_SET_EVENT_MASK(escr, mask) ((escr) |= (((mask) & 0xffff) << 9)) +#define ESCR_READ(escr,high,ev,i) do {rdmsr(ev->bindings[(i)].escr_address, (escr), (high));} while (0); +#define ESCR_WRITE(escr,high,ev,i) do {wrmsr(ev->bindings[(i)].escr_address, (escr), (high));} while (0); + +#define CCCR_RESERVED_BITS 0x38030FFF +#define CCCR_CLEAR(cccr) ((cccr) &= CCCR_RESERVED_BITS) +#define CCCR_SET_REQUIRED_BITS(cccr) ((cccr) |= 0x00030000) +#define CCCR_SET_ESCR_SELECT(cccr, sel) ((cccr) |= (((sel) & 0x07) << 13)) +#define CCCR_SET_PMI_OVF_0(cccr) ((cccr) |= (1<<26)) +#define CCCR_SET_PMI_OVF_1(cccr) ((cccr) |= (1<<27)) +#define CCCR_SET_ENABLE(cccr) ((cccr) |= (1<<12)) +#define CCCR_SET_DISABLE(cccr) ((cccr) &= ~(1<<12)) +#define CCCR_READ(low, high, i) do {rdmsr (p4_counters[(i)].cccr_address, (low), (high));} while (0); +#define CCCR_WRITE(low, high, i) do {wrmsr (p4_counters[(i)].cccr_address, (low), (high));} while (0); +#define CCCR_OVF_P(cccr) ((cccr) & (1U<<31)) +#define CCCR_CLEAR_OVF(cccr) ((cccr) &= (~(1U<<31))) + +#define CTR_READ(l,h,i) do {rdmsr(p4_counters[(i)].counter_address, (l), (h));} while (0); +#define CTR_WRITE(l,i) do {wrmsr(p4_counters[(i)].counter_address, -(u32)(l), -1);} while (0); +#define CTR_OVERFLOW_P(ctr) (!((ctr) & 0x80000000)) + +/* these access the underlying cccrs 1-18, not the subset of 8 bound to "virtual counters" */ +#define RAW_CCCR_READ(low, high, i) do {rdmsr (MSR_P4_BPU_CCCR0 + (i), (low), (high));} while (0); +#define RAW_CCCR_WRITE(low, high, i) do {wrmsr (MSR_P4_BPU_CCCR0 + (i), (low), (high));} while (0); + + +/* this assigns a "stagger" to the current CPU, which is used throughout + the code in this module as an extra array offset, to select the "even" + or "odd" part of all the divided resources. */ +static inline unsigned int get_stagger(void) +{ +#ifdef CONFIG_SMP + int cpu; + if (smp_num_siblings > 1) { + cpu = smp_processor_id(); + return (cpu_sibling_map[cpu] > cpu) ? 0 : 1; + } +#endif + return 0; +} + + +/* finally, mediate access to a real hardware counter + by passing a "virtual" counter numer to this macro, + along with your stagger setting. */ +#define VIRT_CTR(stagger, i) ((i) + ((num_counters) * (stagger))) + +static unsigned long reset_value[NUM_COUNTERS_NON_HT]; + + +static void p4_fill_in_addresses(struct op_msrs * const msrs) +{ + int i; + unsigned int addr, stag; + + setup_num_counters(); + stag = get_stagger(); + + /* the 8 counter registers we pay attention to */ + for (i = 0; i < num_counters; ++i) + msrs->counters.addrs[i] = + p4_counters[VIRT_CTR(stag, i)].counter_address; + + /* 18 CCCR registers */ + for (i=stag, addr = MSR_P4_BPU_CCCR0; + addr <= MSR_P4_IQ_CCCR5; ++i, addr += (1 + stag)) + msrs->controls.addrs[i] = addr; + + /* 43 ESCR registers */ + for (addr = MSR_P4_BSU_ESCR0; + addr <= MSR_P4_SSU_ESCR0; ++i, addr += (1 + stag)){ + msrs->controls.addrs[i] = addr; + } + + for (addr = MSR_P4_MS_ESCR0; + addr <= MSR_P4_TC_ESCR1; ++i, addr += (1 + stag)){ + msrs->controls.addrs[i] = addr; + } + + for (addr = MSR_P4_IX_ESCR0; + addr <= MSR_P4_CRU_ESCR3; ++i, addr += (1 + stag)){ + msrs->controls.addrs[i] = addr; + } + + /* there are 2 remaining non-contiguously located ESCRs */ + + if (num_counters == NUM_COUNTERS_NON_HT) { + /* standard non-HT CPUs handle both remaining ESCRs*/ + msrs->controls.addrs[i++] = MSR_P4_CRU_ESCR5; + msrs->controls.addrs[i++] = MSR_P4_CRU_ESCR4; + + } else if (stag == 0) { + /* HT CPUs give the first remainder to the even thread, as + the 32nd control register */ + msrs->controls.addrs[i++] = MSR_P4_CRU_ESCR4; + + } else { + /* and two copies of the second to the odd thread, + for the 31st and 32nd control registers */ + msrs->controls.addrs[i++] = MSR_P4_CRU_ESCR5; + msrs->controls.addrs[i++] = MSR_P4_CRU_ESCR5; + } +} + + +static void pmc_setup_one_p4_counter(unsigned int ctr) +{ + int i; + int const maxbind = 2; + unsigned int cccr = 0; + unsigned int escr = 0; + unsigned int high = 0; + unsigned int counter_bit; + struct p4_event_binding * ev = 0; + unsigned int stag; + + stag = get_stagger(); + + /* convert from counter *number* to counter *bit* */ + counter_bit = 1 << ctr; + + /* find our event binding structure. */ + if (counter_config[ctr].event <= 0 || counter_config[ctr].event > NUM_EVENTS) { + printk(KERN_ERR + "oprofile: P4 event code 0x%lx out of range\n", + counter_config[ctr].event); + return; + } + + ev = &(p4_events[counter_config[ctr].event - 1]); + + for (i = 0; i < maxbind; i++) { + if (ev->bindings[i].virt_counter & counter_bit) { + + /* modify ESCR */ + ESCR_READ(escr, high, ev, i); + ESCR_CLEAR(escr); + if (stag == 0) { + ESCR_SET_USR_0(escr, counter_config[ctr].user); + ESCR_SET_OS_0(escr, counter_config[ctr].kernel); + } else { + ESCR_SET_USR_1(escr, counter_config[ctr].user); + ESCR_SET_OS_1(escr, counter_config[ctr].kernel); + } + ESCR_SET_EVENT_SELECT(escr, ev->event_select); + ESCR_SET_EVENT_MASK(escr, counter_config[ctr].unit_mask); + ESCR_WRITE(escr, high, ev, i); + + /* modify CCCR */ + CCCR_READ(cccr, high, VIRT_CTR(stag, ctr)); + CCCR_CLEAR(cccr); + CCCR_SET_REQUIRED_BITS(cccr); + CCCR_SET_ESCR_SELECT(cccr, ev->escr_select); + if (stag == 0) { + CCCR_SET_PMI_OVF_0(cccr); + } else { + CCCR_SET_PMI_OVF_1(cccr); + } + CCCR_WRITE(cccr, high, VIRT_CTR(stag, ctr)); + return; + } + } +} + + +static void p4_setup_ctrs(struct op_msrs const * const msrs) +{ + unsigned int i; + unsigned int low, high; + unsigned int addr; + unsigned int stag; + + stag = get_stagger(); + + rdmsr(MSR_IA32_MISC_ENABLE, low, high); + if (! MISC_PMC_ENABLED_P(low)) { + printk(KERN_ERR "oprofile: P4 PMC not available\n"); + return; + } + + /* clear all cccrs (including those outside our concern) */ + for (i = stag ; i < num_cccrs ; i += (1 + stag)) { + RAW_CCCR_READ(low, high, i); + CCCR_CLEAR(low); + CCCR_SET_REQUIRED_BITS(low); + RAW_CCCR_WRITE(low, high, i); + } + + /* clear all escrs (including those outside out concern) */ + for (addr = MSR_P4_BSU_ESCR0 + stag; + addr <= MSR_P4_SSU_ESCR0; addr += (1 + stag)){ + wrmsr(addr, 0, 0); + } + + for (addr = MSR_P4_MS_ESCR0 + stag; + addr <= MSR_P4_TC_ESCR1; addr += (1 + stag)){ + wrmsr(addr, 0, 0); + } + + for (addr = MSR_P4_IX_ESCR0 + stag; + addr <= MSR_P4_CRU_ESCR3; addr += (1 + stag)){ + wrmsr(addr, 0, 0); + } + + if (num_counters == NUM_COUNTERS_NON_HT) { + wrmsr(MSR_P4_CRU_ESCR4, 0, 0); + wrmsr(MSR_P4_CRU_ESCR5, 0, 0); + } else if (stag == 0) { + wrmsr(MSR_P4_CRU_ESCR4, 0, 0); + } else { + wrmsr(MSR_P4_CRU_ESCR5, 0, 0); + } + + /* setup all counters */ + for (i = 0 ; i < num_counters ; ++i) { + if (counter_config[i].event) { + reset_value[i] = counter_config[i].count; + pmc_setup_one_p4_counter(i); + CTR_WRITE(counter_config[i].count, VIRT_CTR(stag, i)); + } else { + reset_value[i] = 0; + } + } +} + + +static int p4_check_ctrs(unsigned int const cpu, + struct op_msrs const * const msrs, + struct pt_regs * const regs) +{ + unsigned long ctr, low, high, stag, real; + int i; + unsigned long eip = instruction_pointer(regs); + int is_kernel = !user_mode(regs); + + stag = get_stagger(); + + for (i = 0; i < num_counters; ++i) { + + if (!counter_config[i].event) + continue; + + /* + * there is some eccentricity in the hardware which + * requires that we perform 2 extra corrections: + * + * - check both the CCCR:OVF flag for overflow and the + * counter high bit for un-flagged overflows. + * + * - write the counter back twice to ensure it gets + * updated properly. + * + * the former seems to be related to extra NMIs happening + * during the current NMI; the latter is reported as errata + * N15 in intel doc 249199-029, pentium 4 specification + * update, though their suggested work-around does not + * appear to solve the problem. + */ + + real = VIRT_CTR(stag, i); + + CCCR_READ(low, high, real); + CTR_READ(ctr, high, real); + if (CCCR_OVF_P(low) || CTR_OVERFLOW_P(ctr)) { + oprofile_add_sample(eip, is_kernel, i, cpu); + CTR_WRITE(reset_value[i], real); + CCCR_CLEAR_OVF(low); + CCCR_WRITE(low, high, real); + CTR_WRITE(reset_value[i], real); + /* P4 quirk: you have to re-unmask the apic vector */ + apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED); + return 1; + } + } + + /* P4 quirk: you have to re-unmask the apic vector */ + apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED); + return 0; +} + + +static void p4_start(struct op_msrs const * const msrs) +{ + unsigned int low, high, stag; + int i; + + stag = get_stagger(); + + for (i = 0; i < num_counters; ++i) { + if (!reset_value[i]) + continue; + CCCR_READ(low, high, VIRT_CTR(stag, i)); + CCCR_SET_ENABLE(low); + CCCR_WRITE(low, high, VIRT_CTR(stag, i)); + } +} + + +static void p4_stop(struct op_msrs const * const msrs) +{ + unsigned int low, high, stag; + int i; + + stag = get_stagger(); + + for (i = 0; i < num_counters; ++i) { + CCCR_READ(low, high, VIRT_CTR(stag, i)); + CCCR_SET_DISABLE(low); + CCCR_WRITE(low, high, VIRT_CTR(stag, i)); + } +} + + +#ifdef CONFIG_SMP +struct op_x86_model_spec const op_p4_ht2_spec = { + .num_counters = NUM_COUNTERS_HT2, + .num_controls = NUM_CONTROLS_HT2, + .fill_in_addresses = &p4_fill_in_addresses, + .setup_ctrs = &p4_setup_ctrs, + .check_ctrs = &p4_check_ctrs, + .start = &p4_start, + .stop = &p4_stop +}; +#endif + +struct op_x86_model_spec const op_p4_spec = { + .num_counters = NUM_COUNTERS_NON_HT, + .num_controls = NUM_CONTROLS_NON_HT, + .fill_in_addresses = &p4_fill_in_addresses, + .setup_ctrs = &p4_setup_ctrs, + .check_ctrs = &p4_check_ctrs, + .start = &p4_start, + .stop = &p4_stop +}; diff -Nru a/arch/i386/oprofile/op_model_ppro.c b/arch/i386/oprofile/op_model_ppro.c --- a/arch/i386/oprofile/op_model_ppro.c Fri Feb 14 00:27:29 2003 +++ b/arch/i386/oprofile/op_model_ppro.c Fri Feb 14 00:27:29 2003 @@ -90,11 +90,13 @@ { unsigned int low, high; int i; + unsigned long eip = instruction_pointer(regs); + int is_kernel = !user_mode(regs); for (i = 0 ; i < NUM_COUNTERS; ++i) { CTR_READ(low, high, msrs, i); if (CTR_OVERFLOWED(low)) { - oprofile_add_sample(instruction_pointer(regs), i, cpu); + oprofile_add_sample(eip, is_kernel, i, cpu); CTR_WRITE(reset_value[i], msrs, i); return 1; } diff -Nru a/arch/i386/oprofile/op_x86_model.h b/arch/i386/oprofile/op_x86_model.h --- a/arch/i386/oprofile/op_x86_model.h Fri Feb 14 00:27:27 2003 +++ b/arch/i386/oprofile/op_x86_model.h Fri Feb 14 00:27:27 2003 @@ -11,8 +11,8 @@ #ifndef OP_X86_MODEL_H #define OP_X86_MODEL_H -/* will need re-working for Pentium IV */ -#define MAX_MSR 4 +/* Pentium IV needs all these */ +#define MAX_MSR 63 struct op_saved_msr { unsigned int high; @@ -47,6 +47,8 @@ }; extern struct op_x86_model_spec const op_ppro_spec; +extern struct op_x86_model_spec const op_p4_spec; +extern struct op_x86_model_spec const op_p4_ht2_spec; extern struct op_x86_model_spec const op_athlon_spec; #endif /* OP_X86_MODEL_H */ diff -Nru a/arch/i386/oprofile/timer_int.c b/arch/i386/oprofile/timer_int.c --- a/arch/i386/oprofile/timer_int.c Fri Feb 14 00:27:27 2003 +++ b/arch/i386/oprofile/timer_int.c Fri Feb 14 00:27:27 2003 @@ -20,8 +20,9 @@ { struct pt_regs * regs = (struct pt_regs *)data; int cpu = smp_processor_id(); + unsigned long eip = instruction_pointer(regs); - oprofile_add_sample(instruction_pointer(regs), 0, cpu); + oprofile_add_sample(eip, !user_mode(regs), 0, cpu); return 0; } @@ -45,13 +46,13 @@ static struct oprofile_operations timer_ops = { .start = timer_start, - .stop = timer_stop + .stop = timer_stop, + .cpu_type = "timer" }; -void __init timer_init(struct oprofile_operations ** ops, enum oprofile_cpu * cpu) +void __init timer_init(struct oprofile_operations ** ops) { *ops = &timer_ops; - *cpu = OPROFILE_CPU_TIMER; printk(KERN_INFO "oprofile: using timer interrupt.\n"); } diff -Nru a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c --- a/arch/ia64/kernel/signal.c Fri Feb 14 00:27:28 2003 +++ b/arch/ia64/kernel/signal.c Fri Feb 14 00:27:28 2003 @@ -517,7 +517,7 @@ restart = 0; while (1) { - int signr = get_signal_to_deliver(&info, &scr->pt); + int signr = get_signal_to_deliver(&info, &scr->pt, NULL); if (signr <= 0) break; diff -Nru a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c --- a/arch/ia64/mm/hugetlbpage.c Fri Feb 14 00:27:28 2003 +++ b/arch/ia64/mm/hugetlbpage.c Fri Feb 14 00:27:28 2003 @@ -96,6 +96,18 @@ return; } +/* + * This function checks for proper alignment of input addr and len parameters. + */ +int is_aligned_hugepage_range(unsigned long addr, unsigned long len) +{ + if (len & ~HPAGE_MASK) + return -EINVAL; + if (addr & ~HPAGE_MASK) + return -EINVAL; + return 0; +} + int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma) { diff -Nru a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c --- a/arch/m68k/kernel/signal.c Fri Feb 14 00:27:29 2003 +++ b/arch/m68k/kernel/signal.c Fri Feb 14 00:27:29 2003 @@ -1004,7 +1004,7 @@ for (;;) { int signr; - signr = dequeue_signal(¤t->blocked, &info); + signr = dequeue_signal(current, ¤t->blocked, &info); if (!signr) break; diff -Nru a/arch/m68knommu/kernel/signal.c b/arch/m68knommu/kernel/signal.c --- a/arch/m68knommu/kernel/signal.c Fri Feb 14 00:27:29 2003 +++ b/arch/m68knommu/kernel/signal.c Fri Feb 14 00:27:29 2003 @@ -768,7 +768,7 @@ for (;;) { int signr; - signr = get_signal_to_deliver(&info, regs); + signr = get_signal_to_deliver(&info, regs, NULL); if (!signr) break; diff -Nru a/arch/mips/baget/vacserial.c b/arch/mips/baget/vacserial.c --- a/arch/mips/baget/vacserial.c Fri Feb 14 00:27:29 2003 +++ b/arch/mips/baget/vacserial.c Fri Feb 14 00:27:29 2003 @@ -1785,7 +1785,7 @@ schedule_timeout(char_time); if (signal_pending(current)) break; - if (timeout && ((orig_jiffies + timeout) < jiffies)) + if (timeout && time_after(jiffies, orig_jiffies + timeout)) break; } current->state = TASK_RUNNING; diff -Nru a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c --- a/arch/mips/kernel/irixsig.c Fri Feb 14 00:27:29 2003 +++ b/arch/mips/kernel/irixsig.c Fri Feb 14 00:27:29 2003 @@ -183,7 +183,7 @@ unsigned long signr; spin_lock_irq(¤t->sigmask_lock); - signr = dequeue_signal(¤t->blocked, &info); + signr = dequeue_signal(current, ¤t->blocked, &info); spin_unlock_irq(¤t->sigmask_lock); if (!signr) diff -Nru a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c --- a/arch/mips/kernel/signal.c Fri Feb 14 00:27:29 2003 +++ b/arch/mips/kernel/signal.c Fri Feb 14 00:27:29 2003 @@ -544,7 +544,7 @@ if (!oldset) oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, regs); + signr = get_signal_to_deliver(&info, regs, NULL); if (signr > 0) { if (regs->regs[0]) syscall_restart(regs, ka); diff -Nru a/arch/mips64/kernel/signal.c b/arch/mips64/kernel/signal.c --- a/arch/mips64/kernel/signal.c Fri Feb 14 00:27:27 2003 +++ b/arch/mips64/kernel/signal.c Fri Feb 14 00:27:27 2003 @@ -602,7 +602,7 @@ if (!oldset) oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, regs); + signr = get_signal_to_deliver(&info, regs, NULL); if (signr > 0) { if (regs->regs[0]) syscall_restart(regs, ka); diff -Nru a/arch/mips64/kernel/signal32.c b/arch/mips64/kernel/signal32.c --- a/arch/mips64/kernel/signal32.c Fri Feb 14 00:27:28 2003 +++ b/arch/mips64/kernel/signal32.c Fri Feb 14 00:27:28 2003 @@ -676,7 +676,7 @@ if (!oldset) oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, regs); + signr = get_signal_to_deliver(&info, regs, NULL); if (signr > 0) { if (regs->regs[0]) syscall_restart(regs, ka); diff -Nru a/arch/parisc/kernel/binfmt_elf32.c b/arch/parisc/kernel/binfmt_elf32.c --- a/arch/parisc/kernel/binfmt_elf32.c Fri Feb 14 00:27:28 2003 +++ b/arch/parisc/kernel/binfmt_elf32.c Fri Feb 14 00:27:28 2003 @@ -19,7 +19,7 @@ #include #include #include -#include +#include /* struct compat_timeval */ #define elf_prstatus elf_prstatus32 struct elf_prstatus32 diff -Nru a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c --- a/arch/parisc/kernel/signal.c Fri Feb 14 00:27:30 2003 +++ b/arch/parisc/kernel/signal.c Fri Feb 14 00:27:30 2003 @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -97,13 +98,13 @@ sigset_t saveset, newset; #ifdef __LP64__ /* XXX FIXME -- assumes 32-bit user app! */ - sigset_t32 newset32; + compat_sigset_t newset32; /* XXX: Don't preclude handling different sized sigset_t's. */ - if (sigsetsize != sizeof(sigset_t32)) + if (sigsetsize != sizeof(compat_sigset_t)) return -EINVAL; - if (copy_from_user(&newset32, (sigset_t32 *)unewset, sizeof(newset32))) + if (copy_from_user(&newset32, (compat_sigset_t *)unewset, sizeof(newset32))) return -EFAULT; newset.sig[0] = newset32.sig[0] | ((unsigned long)newset32.sig[1] << 32); diff -Nru a/arch/parisc/kernel/signal32.c b/arch/parisc/kernel/signal32.c --- a/arch/parisc/kernel/signal32.c Fri Feb 14 00:27:27 2003 +++ b/arch/parisc/kernel/signal32.c Fri Feb 14 00:27:27 2003 @@ -18,22 +18,22 @@ }; static inline void -sigset_32to64(sigset_t *s64, sigset_t32 *s32) +sigset_32to64(sigset_t *s64, compat_sigset_t *s32) { s64->sig[0] = s32->sig[0] | ((unsigned long)s32->sig[1] << 32); } static inline void -sigset_64to32(sigset_t32 *s32, sigset_t *s64) +sigset_64to32(compat_sigset_t *s32, sigset_t *s64) { s32->sig[0] = s64->sig[0] & 0xffffffffUL; s32->sig[1] = (s64->sig[0] >> 32) & 0xffffffffUL; } static int -put_sigset32(sigset_t32 *up, sigset_t *set, size_t sz) +put_sigset32(compat_sigset_t *up, sigset_t *set, size_t sz) { - sigset_t32 s; + compat_sigset_t s; if (sz != sizeof *set) panic("put_sigset32()"); sigset_64to32(&s, set); @@ -42,9 +42,9 @@ } static int -get_sigset32(sigset_t32 *up, sigset_t *set, size_t sz) +get_sigset32(compat_sigset_t *up, sigset_t *set, size_t sz) { - sigset_t32 s; + compat_sigset_t s; int r; if (sz != sizeof *set) panic("put_sigset32()"); @@ -56,7 +56,7 @@ return r; } -int sys32_rt_sigprocmask(int how, sigset_t32 *set, sigset_t32 *oset, +int sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset_t *oset, unsigned int sigsetsize) { extern long sys_rt_sigprocmask(int how, @@ -78,7 +78,7 @@ } -int sys32_rt_sigpending(sigset_t32 *uset, unsigned int sigsetsize) +int sys32_rt_sigpending(compat_sigset_t *uset, unsigned int sigsetsize) { int ret; sigset_t set; diff -Nru a/arch/parisc/kernel/sys32.h b/arch/parisc/kernel/sys32.h --- a/arch/parisc/kernel/sys32.h Fri Feb 14 00:27:28 2003 +++ b/arch/parisc/kernel/sys32.h Fri Feb 14 00:27:28 2003 @@ -14,15 +14,10 @@ typedef __u32 __sighandler_t32; -#include -typedef struct { - unsigned int sig[_NSIG_WORDS * 2]; -} sigset_t32; - struct sigaction32 { __sighandler_t32 sa_handler; unsigned int sa_flags; - sigset_t32 sa_mask; /* mask last for extensibility */ + compat_sigset_t sa_mask; /* mask last for extensibility */ }; #endif diff -Nru a/arch/parisc/oprofile/init.c b/arch/parisc/oprofile/init.c --- a/arch/parisc/oprofile/init.c Fri Feb 14 00:27:28 2003 +++ b/arch/parisc/oprofile/init.c Fri Feb 14 00:27:28 2003 @@ -11,10 +11,10 @@ #include #include -extern void timer_init(struct oprofile_operations ** ops, enum oprofile_cpu * cpu); +extern void timer_init(struct oprofile_operations ** ops); -int __init oprofile_arch_init(struct oprofile_operations ** ops, enum oprofile_cpu * cpu) +int __init oprofile_arch_init(struct oprofile_operations ** ops) { - timer_init(ops, cpu); + timer_init(ops); return 0; } diff -Nru a/arch/parisc/oprofile/timer_int.c b/arch/parisc/oprofile/timer_int.c --- a/arch/parisc/oprofile/timer_int.c Fri Feb 14 00:27:26 2003 +++ b/arch/parisc/oprofile/timer_int.c Fri Feb 14 00:27:26 2003 @@ -19,8 +19,10 @@ { struct pt_regs * regs = (struct pt_regs *)data; int cpu = smp_processor_id(); + unsigned long pc = regs->iaoq[0]; + int is_kernel = !user_mode(regs); - oprofile_add_sample(regs->iaoq[0], 0, cpu); + oprofile_add_sample(pc, is_kernel, 0, cpu); return 0; } @@ -44,13 +46,13 @@ static struct oprofile_operations timer_ops = { .start = timer_start, - .stop = timer_stop + .stop = timer_stop, + .cpu_type = "timer" }; -void __init timer_init(struct oprofile_operations ** ops, enum oprofile_cpu * cpu) +void __init timer_init(struct oprofile_operations ** ops) { *ops = &timer_ops; - *cpu = OPROFILE_CPU_TIMER; printk(KERN_INFO "oprofile: using timer interrupt.\n"); } diff -Nru a/arch/ppc/kernel/signal.c b/arch/ppc/kernel/signal.c --- a/arch/ppc/kernel/signal.c Fri Feb 14 00:27:30 2003 +++ b/arch/ppc/kernel/signal.c Fri Feb 14 00:27:30 2003 @@ -484,7 +484,7 @@ newsp = frame = 0; - signr = get_signal_to_deliver(&info, regs); + signr = get_signal_to_deliver(&info, regs, NULL); if (signr > 0) { ka = ¤t->sig->action[signr-1]; if ( (ka->sa.sa_flags & SA_ONSTACK) diff -Nru a/arch/ppc64/kernel/rtasd.c b/arch/ppc64/kernel/rtasd.c --- a/arch/ppc64/kernel/rtasd.c Fri Feb 14 00:27:27 2003 +++ b/arch/ppc64/kernel/rtasd.c Fri Feb 14 00:27:27 2003 @@ -211,9 +211,7 @@ DEBUG("will sleep for %d jiffies\n", (HZ*60/rtas_event_scan_rate) / 2); - daemonize(); - sigfillset(¤t->blocked); - sprintf(current->comm, "rtasd"); + daemonize("rtasd"); #if 0 /* Rusty unreal time task */ diff -Nru a/arch/ppc64/kernel/signal.c b/arch/ppc64/kernel/signal.c --- a/arch/ppc64/kernel/signal.c Fri Feb 14 00:27:26 2003 +++ b/arch/ppc64/kernel/signal.c Fri Feb 14 00:27:26 2003 @@ -551,7 +551,7 @@ newsp = frame = 0; - signr = get_signal_to_deliver(&info, regs); + signr = get_signal_to_deliver(&info, regs, NULL); if (signr > 0) { ka = ¤t->sighand->action[signr-1]; if ((ka->sa.sa_flags & SA_ONSTACK) diff -Nru a/arch/ppc64/kernel/signal32.c b/arch/ppc64/kernel/signal32.c --- a/arch/ppc64/kernel/signal32.c Fri Feb 14 00:27:30 2003 +++ b/arch/ppc64/kernel/signal32.c Fri Feb 14 00:27:30 2003 @@ -1063,7 +1063,7 @@ newsp = frame = 0; - signr = get_signal_to_deliver(&info, regs); + signr = get_signal_to_deliver(&info, regs, NULL); if (signr > 0) { ka = ¤t->sighand->action[signr-1]; if ((ka->sa.sa_flags & SA_ONSTACK) diff -Nru a/arch/ppc64/oprofile/init.c b/arch/ppc64/oprofile/init.c --- a/arch/ppc64/oprofile/init.c Fri Feb 14 00:27:28 2003 +++ b/arch/ppc64/oprofile/init.c Fri Feb 14 00:27:28 2003 @@ -11,10 +11,10 @@ #include #include -extern void timer_init(struct oprofile_operations ** ops, enum oprofile_cpu * cpu); +extern void timer_init(struct oprofile_operations ** ops); -int __init oprofile_arch_init(struct oprofile_operations ** ops, enum oprofile_cpu * cpu) +int __init oprofile_arch_init(struct oprofile_operations ** ops) { - timer_init(ops, cpu); + timer_init(ops); return 0; } diff -Nru a/arch/ppc64/oprofile/timer_int.c b/arch/ppc64/oprofile/timer_int.c --- a/arch/ppc64/oprofile/timer_int.c Fri Feb 14 00:27:30 2003 +++ b/arch/ppc64/oprofile/timer_int.c Fri Feb 14 00:27:30 2003 @@ -19,8 +19,10 @@ { struct pt_regs * regs = (struct pt_regs *)data; int cpu = smp_processor_id(); + unsigned long pc = instruction_pointer(regs); + int is_kernel = !user_mode(regs); - oprofile_add_sample(instruction_pointer(regs), 0, cpu); + oprofile_add_sample(pc, is_kernel, 0, cpu); return 0; } @@ -44,13 +46,13 @@ static struct oprofile_operations timer_ops = { .start = timer_start, - .stop = timer_stop + .stop = timer_stop, + .cpu_type = "timer" }; -void __init timer_init(struct oprofile_operations ** ops, enum oprofile_cpu * cpu) +void __init timer_init(struct oprofile_operations ** ops) { *ops = &timer_ops; - *cpu = OPROFILE_CPU_TIMER; printk(KERN_INFO "oprofile: using timer interrupt.\n"); } diff -Nru a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c --- a/arch/s390/kernel/signal.c Fri Feb 14 00:27:29 2003 +++ b/arch/s390/kernel/signal.c Fri Feb 14 00:27:29 2003 @@ -461,7 +461,7 @@ if (!oldset) oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, regs); + signr = get_signal_to_deliver(&info, regs, NULL); if (signr > 0) { /* Whee! Actually deliver the signal. */ handle_signal(signr, &info, oldset, regs); diff -Nru a/arch/s390x/kernel/linux32.c b/arch/s390x/kernel/linux32.c --- a/arch/s390x/kernel/linux32.c Fri Feb 14 00:27:29 2003 +++ b/arch/s390x/kernel/linux32.c Fri Feb 14 00:27:29 2003 @@ -1726,7 +1726,7 @@ } spin_lock_irq(¤t->sighand->siglock); - sig = dequeue_signal(&these, &info); + sig = dequeue_signal(current, &these, &info); if (!sig) { /* None ready -- temporarily unblock those we're interested in so that we'll be awakened when they arrive. */ @@ -1744,7 +1744,7 @@ timeout = schedule_timeout(timeout); spin_lock_irq(¤t->sighand->siglock); - sig = dequeue_signal(&these, &info); + sig = dequeue_signal(current, &these, &info); current->blocked = current->real_blocked; siginitset(¤t->real_blocked, 0); recalc_sigpending(); diff -Nru a/arch/s390x/kernel/signal.c b/arch/s390x/kernel/signal.c --- a/arch/s390x/kernel/signal.c Fri Feb 14 00:27:29 2003 +++ b/arch/s390x/kernel/signal.c Fri Feb 14 00:27:29 2003 @@ -461,7 +461,7 @@ } #endif - signr = get_signal_to_deliver(&info, regs); + signr = get_signal_to_deliver(&info, regs, NULL); if (signr > 0) { /* Whee! Actually deliver the signal. */ handle_signal(signr, &info, oldset, regs); diff -Nru a/arch/s390x/kernel/signal32.c b/arch/s390x/kernel/signal32.c --- a/arch/s390x/kernel/signal32.c Fri Feb 14 00:27:28 2003 +++ b/arch/s390x/kernel/signal32.c Fri Feb 14 00:27:28 2003 @@ -622,7 +622,7 @@ if (!oldset) oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, regs); + signr = get_signal_to_deliver(&info, regs, NULL); if (signr > 0) { /* Whee! Actually deliver the signal. */ handle_signal32(signr, &info, oldset, regs); diff -Nru a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c --- a/arch/sh/kernel/signal.c Fri Feb 14 00:27:30 2003 +++ b/arch/sh/kernel/signal.c Fri Feb 14 00:27:30 2003 @@ -556,7 +556,7 @@ if (!oldset) oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, regs); + signr = get_signal_to_deliver(&info, regs, NULL); if (signr > 0) { /* Whee! Actually deliver the signal. */ handle_signal(signr, &info, oldset, regs); diff -Nru a/arch/sparc/Makefile b/arch/sparc/Makefile --- a/arch/sparc/Makefile Fri Feb 14 00:27:27 2003 +++ b/arch/sparc/Makefile Fri Feb 14 00:27:27 2003 @@ -38,7 +38,7 @@ LDFLAGS_vmlinux = -r head-y := arch/sparc/kernel/head.o arch/sparc/kernel/init_task.o -HEAD := $(head-y) +HEAD_Y := $(head-y) core-y += arch/sparc/kernel/ arch/sparc/mm/ arch/sparc/math-emu/ libs-y += arch/sparc/prom/ arch/sparc/lib/ @@ -52,7 +52,7 @@ DRIVERS_Y := $(patsubst %/, %/built-in.o, $(drivers-y)) NET_Y := $(patsubst %/, %/built-in.o, $(net-y)) LIBS_Y := $(patsubst %/, %/lib.a, $(libs-y)) -export INIT_Y CORE_Y DRIVERS_Y NET_Y LIBS_Y HEAD +export INIT_Y CORE_Y DRIVERS_Y NET_Y LIBS_Y HEAD_Y makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/$(ARCH)/boot $(1) diff -Nru a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile --- a/arch/sparc/boot/Makefile Fri Feb 14 00:27:30 2003 +++ b/arch/sparc/boot/Makefile Fri Feb 14 00:27:30 2003 @@ -17,7 +17,7 @@ quiet_cmd_btfix = BTFIX $@ cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@ -BTOBJS := $(HEAD) $(INIT_Y) +BTOBJS := $(HEAD_Y) $(INIT_Y) BTLIBS := $(CORE_Y) $(LIBS_Y) $(DRIVERS_Y) $(NET_Y) LDFLAGS_image := -T arch/sparc/vmlinux.lds.s $(BTOBJS) --start-group $(BTLIBS) --end-group diff -Nru a/arch/sparc/kernel/init_task.c b/arch/sparc/kernel/init_task.c --- a/arch/sparc/kernel/init_task.c Fri Feb 14 00:27:28 2003 +++ b/arch/sparc/kernel/init_task.c Fri Feb 14 00:27:28 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); struct task_struct init_task = INIT_TASK(init_task); diff -Nru a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c --- a/arch/sparc/kernel/signal.c Fri Feb 14 00:27:29 2003 +++ b/arch/sparc/kernel/signal.c Fri Feb 14 00:27:29 2003 @@ -1045,8 +1045,9 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs, unsigned long orig_i0, int restart_syscall) { - struct k_sigaction *ka; siginfo_t info; + struct sparc_deliver_cookie cookie; + int signr; /* * XXX Disable svr4 signal handling until solaris emulation works. @@ -1059,142 +1060,32 @@ int svr4_signal = current->personality == PER_SVR4; #endif + cookie.restart_syscall = restart_syscall; + cookie.orig_i0 = orig_i0; + if (!oldset) oldset = ¤t->blocked; - for (;;) { - sigset_t *mask = ¤t->blocked; - unsigned long signr = 0; - - spin_lock_irq(¤t->sighand->siglock); - signr = dequeue_signal(mask, &info); - spin_unlock_irq(¤t->sighand->siglock); - - if (!signr) - break; - - if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { - /* Do the syscall restart before we let the debugger - * look at the child registers. - */ - if (restart_syscall && - (regs->u_regs[UREG_I0] == ERESTARTNOHAND || - regs->u_regs[UREG_I0] == ERESTARTSYS || - regs->u_regs[UREG_I0] == ERESTARTNOINTR)) { - /* replay the system call when we are done */ - regs->u_regs[UREG_I0] = orig_i0; - regs->pc -= 4; - regs->npc -= 4; - restart_syscall = 0; - } - if (restart_syscall && - regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { - regs->u_regs[UREG_G1] = __NR_restart_syscall; - regs->pc -= 4; - regs->npc -= 4; - restart_syscall = 0; - } - current->exit_code = signr; - set_current_state(TASK_STOPPED); - - /* This happens to be SMP safe so no need to - * grab master kernel lock even in this case. - */ - notify_parent(current, SIGCHLD); - schedule(); - if (!(signr = current->exit_code)) - continue; - current->exit_code = 0; - if (signr == SIGSTOP) - continue; - - /* Update the siginfo structure. Is this good? */ - if (signr != info.si_signo) { - info.si_signo = signr; - info.si_errno = 0; - info.si_code = SI_USER; - info.si_pid = current->parent->pid; - info.si_uid = current->parent->uid; - } - - /* If the (new) signal is now blocked, requeue it. */ - if (sigismember(¤t->blocked, signr)) { - send_sig_info(signr, &info, current); - continue; - } - } - - ka = ¤t->sig->action[signr-1]; - - if (ka->sa.sa_handler == SIG_IGN) { - if (signr != SIGCHLD) - continue; - - /* sys_wait4() grabs the master kernel lock, so - * we need not do so, that sucker should be - * threaded and would not be that difficult to - * do anyways. - */ - while(sys_wait4(-1, NULL, WNOHANG, NULL) > 0) - ; - continue; - } - if (ka->sa.sa_handler == SIG_DFL) { - unsigned long exit_code = signr; - - if (current->pid == 1) - continue; - switch (signr) { - case SIGCONT: case SIGCHLD: case SIGWINCH: case SIGURG: - continue; - - case SIGTSTP: case SIGTTIN: case SIGTTOU: - /* The operations performed by - * is_orphaned_pgrp() are protected by - * the tasklist_lock. - */ - if (is_orphaned_pgrp(current->pgrp)) - continue; - - case SIGSTOP: { - struct signal_struct *sig; - set_current_state(TASK_STOPPED); - current->exit_code = signr; - sig = current->parent->sig; - if (sig && !(sig->action[SIGCHLD-1].sa.sa_flags & - SA_NOCLDSTOP)) - notify_parent(current, SIGCHLD); - schedule(); - continue; - } - - case SIGQUIT: case SIGILL: case SIGTRAP: - case SIGABRT: case SIGFPE: case SIGSEGV: - case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: - if (do_coredump(signr, exit_code, regs)) - exit_code |= 0x80; - /* FALLTHRU */ - - default: - sig_exit(signr, exit_code, &info); - /* NOT REACHED */ - } - } - if (restart_syscall) - syscall_restart(orig_i0, regs, &ka->sa); + signr = get_signal_to_deliver(&info, regs, &cookie); + if (signr > 0) { + struct k_sigaction *ka; + + ka = ¤t->sighand->action[signr-1]; + if (cookie.restart_syscall) + syscall_restart(cookie.orig_i0, regs, &ka->sa); handle_signal(signr, ka, &info, oldset, regs, svr4_signal); return 1; } - if (restart_syscall && + if (cookie.restart_syscall && (regs->u_regs[UREG_I0] == ERESTARTNOHAND || regs->u_regs[UREG_I0] == ERESTARTSYS || regs->u_regs[UREG_I0] == ERESTARTNOINTR)) { /* replay the system call when we are done */ - regs->u_regs[UREG_I0] = orig_i0; + regs->u_regs[UREG_I0] = cookie.orig_i0; regs->pc -= 4; regs->npc -= 4; } - if (restart_syscall && + if (cookie.restart_syscall && regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { regs->u_regs[UREG_G1] = __NR_restart_syscall; regs->pc -= 4; diff -Nru a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c --- a/arch/sparc/mm/init.c Fri Feb 14 00:27:28 2003 +++ b/arch/sparc/mm/init.c Fri Feb 14 00:27:28 2003 @@ -525,7 +525,7 @@ } #endif -void flush_page_to_ram(struct page *page) +void sparc_flush_page_to_ram(struct page *page) { unsigned long vaddr = (unsigned long)page_address(page); diff -Nru a/arch/sparc64/kernel/init_task.c b/arch/sparc64/kernel/init_task.c --- a/arch/sparc64/kernel/init_task.c Fri Feb 14 00:27:30 2003 +++ b/arch/sparc64/kernel/init_task.c Fri Feb 14 00:27:30 2003 @@ -9,6 +9,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); /* .text section in head.S is aligned at 2 page boundry and this gets linked diff -Nru a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c --- a/arch/sparc64/kernel/ioctl32.c Fri Feb 14 00:27:30 2003 +++ b/arch/sparc64/kernel/ioctl32.c Fri Feb 14 00:27:30 2003 @@ -4285,6 +4285,7 @@ COMPATIBLE_IOCTL(TCSETAW) COMPATIBLE_IOCTL(TCSETAF) COMPATIBLE_IOCTL(TCSBRK) +COMPATIBLE_IOCTL(TCSBRKP) COMPATIBLE_IOCTL(TCXONC) COMPATIBLE_IOCTL(TCFLSH) COMPATIBLE_IOCTL(TCGETS) diff -Nru a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c --- a/arch/sparc64/kernel/irq.c Fri Feb 14 00:27:30 2003 +++ b/arch/sparc64/kernel/irq.c Fri Feb 14 00:27:30 2003 @@ -740,9 +740,6 @@ irq_enter(); kstat_cpu(cpu).irqs[irq]++; - if (irq == 9) - kbd_pt_regs = regs; - /* Sliiiick... */ #ifndef CONFIG_SMP bp = ((irq != 0) ? diff -Nru a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c --- a/arch/sparc64/kernel/power.c Fri Feb 14 00:27:30 2003 +++ b/arch/sparc64/kernel/power.c Fri Feb 14 00:27:30 2003 @@ -65,14 +65,11 @@ static char *envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL }; char *argv[] = { "/sbin/shutdown", "-h", "now", NULL }; - daemonize(); - sprintf(current->comm, "powerd"); + daemonize("powerd"); again: while (button_pressed == 0) { - spin_lock_irq(¤t->sighand->siglock); flush_signals(current); - spin_unlock_irq(¤t->sighand->siglock); interruptible_sleep_on(&powerd_wait); } diff -Nru a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c --- a/arch/sparc64/kernel/signal.c Fri Feb 14 00:27:28 2003 +++ b/arch/sparc64/kernel/signal.c Fri Feb 14 00:27:28 2003 @@ -603,8 +603,12 @@ unsigned long orig_i0, int restart_syscall) { siginfo_t info; - struct k_sigaction *ka; + struct signal_deliver_cookie cookie; + int signr; + cookie.restart_syscall = restart_syscall; + cookie.orig_i0 = orig_i0; + if (!oldset) oldset = ¤t->blocked; @@ -612,135 +616,31 @@ if (test_thread_flag(TIF_32BIT)) { extern int do_signal32(sigset_t *, struct pt_regs *, unsigned long, int); - return do_signal32(oldset, regs, orig_i0, restart_syscall); + return do_signal32(oldset, regs, orig_i0, + cookie.restart_syscall); } #endif - for (;;) { - sigset_t *mask = ¤t->blocked; - unsigned long signr = 0; - - spin_lock_irq(¤t->sighand->siglock); - signr = dequeue_signal(mask, &info); - spin_unlock_irq(¤t->sighand->siglock); - - if (!signr) - break; - - if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { - /* Do the syscall restart before we let the debugger - * look at the child registers. - */ - if (restart_syscall && - (regs->u_regs[UREG_I0] == ERESTARTNOHAND || - regs->u_regs[UREG_I0] == ERESTARTSYS || - regs->u_regs[UREG_I0] == ERESTARTNOINTR)) { - /* replay the system call when we are done */ - regs->u_regs[UREG_I0] = orig_i0; - regs->tpc -= 4; - regs->tnpc -= 4; - restart_syscall = 0; - } - if (restart_syscall && - regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { - regs->u_regs[UREG_G1] = __NR_restart_syscall; - regs->tpc -= 4; - regs->tnpc -= 4; - restart_syscall = 0; - } - - current->exit_code = signr; - set_current_state(TASK_STOPPED); - notify_parent(current, SIGCHLD); - schedule(); - if (!(signr = current->exit_code)) - continue; - current->exit_code = 0; - if (signr == SIGSTOP) - continue; - - /* Update the siginfo structure. Is this good? */ - if (signr != info.si_signo) { - info.si_signo = signr; - info.si_errno = 0; - info.si_code = SI_USER; - info.si_pid = current->parent->pid; - info.si_uid = current->parent->uid; - } - - /* If the (new) signal is now blocked, requeue it. */ - if (sigismember(¤t->blocked, signr)) { - send_sig_info(signr, &info, current); - continue; - } - } - - ka = ¤t->sig->action[signr-1]; - - if (ka->sa.sa_handler == SIG_IGN) { - if (signr != SIGCHLD) - continue; - - /* sys_wait4() grabs the master kernel lock, so - * we need not do so, that sucker should be - * threaded and would not be that difficult to - * do anyways. - */ - while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0) - ; - continue; - } - if (ka->sa.sa_handler == SIG_DFL) { - unsigned long exit_code = signr; - - if (current->pid == 1) - continue; - switch (signr) { - case SIGCONT: case SIGCHLD: case SIGWINCH: case SIGURG: - continue; - - case SIGTSTP: case SIGTTIN: case SIGTTOU: - if (is_orphaned_pgrp(current->pgrp)) - continue; - - case SIGSTOP: { - struct signal_struct *sig; - set_current_state(TASK_STOPPED); - current->exit_code = signr; - sig = current->parent->sig; - if (sig && !(sig->action[SIGCHLD-1].sa.sa_flags & - SA_NOCLDSTOP)) - notify_parent(current, SIGCHLD); - schedule(); - continue; - } - case SIGQUIT: case SIGILL: case SIGTRAP: - case SIGABRT: case SIGFPE: case SIGSEGV: - case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: - if (do_coredump(signr, exit_code, regs)) - exit_code |= 0x80; - /* FALLTHRU */ + signr = get_signal_to_deliver(&info, regs, &cookie); + if (signr > 0) { + struct k_sigaction *ka; - default: - sig_exit(signr, exit_code, &info); - /* NOT REACHED */ - } - } - if (restart_syscall) + ka = ¤t->sighand->action[signr-1]; + if (cookie.restart_syscall) syscall_restart(orig_i0, regs, &ka->sa); handle_signal(signr, ka, &info, oldset, regs); return 1; } - if (restart_syscall && + if (cookie.restart_syscall && (regs->u_regs[UREG_I0] == ERESTARTNOHAND || regs->u_regs[UREG_I0] == ERESTARTSYS || regs->u_regs[UREG_I0] == ERESTARTNOINTR)) { /* replay the system call when we are done */ - regs->u_regs[UREG_I0] = orig_i0; + regs->u_regs[UREG_I0] = cookie.orig_i0; regs->tpc -= 4; regs->tnpc -= 4; } - if (restart_syscall && + if (cookie.restart_syscall && regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { regs->u_regs[UREG_G1] = __NR_restart_syscall; regs->tpc -= 4; diff -Nru a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c --- a/arch/sparc64/kernel/signal32.c Fri Feb 14 00:27:26 2003 +++ b/arch/sparc64/kernel/signal32.c Fri Feb 14 00:27:26 2003 @@ -1279,136 +1279,34 @@ int do_signal32(sigset_t *oldset, struct pt_regs * regs, unsigned long orig_i0, int restart_syscall) { - struct k_sigaction *ka; siginfo_t info; - + struct signal_deliver_cookie cookie; + int signr; int svr4_signal = current->personality == PER_SVR4; - for (;;) { - sigset_t *mask = ¤t->blocked; - unsigned long signr = 0; - - spin_lock_irq(¤t->sighand->siglock); - signr = dequeue_signal(mask, &info); - spin_unlock_irq(¤t->sighand->siglock); - - if (!signr) - break; - - if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { - /* Do the syscall restart before we let the debugger - * look at the child registers. - */ - if (restart_syscall && - (regs->u_regs[UREG_I0] == ERESTARTNOHAND || - regs->u_regs[UREG_I0] == ERESTARTSYS || - regs->u_regs[UREG_I0] == ERESTARTNOINTR)) { - /* replay the system call when we are done */ - regs->u_regs[UREG_I0] = orig_i0; - regs->tpc -= 4; - regs->tnpc -= 4; - restart_syscall = 0; - } - if (restart_syscall && - regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { - regs->u_regs[UREG_G1] = __NR_restart_syscall; - regs->tpc -= 4; - regs->tnpc -= 4; - restart_syscall = 0; - } - - current->exit_code = signr; - set_current_state(TASK_STOPPED); - notify_parent(current, SIGCHLD); - schedule(); - if (!(signr = current->exit_code)) - continue; - current->exit_code = 0; - if (signr == SIGSTOP) - continue; - - /* Update the siginfo structure. Is this good? */ - if (signr != info.si_signo) { - info.si_signo = signr; - info.si_errno = 0; - info.si_code = SI_USER; - info.si_pid = current->parent->pid; - info.si_uid = current->parent->uid; - } - - /* If the (new) signal is now blocked, requeue it. */ - if (sigismember(¤t->blocked, signr)) { - send_sig_info(signr, &info, current); - continue; - } - } - - ka = ¤t->sig->action[signr-1]; - - if (ka->sa.sa_handler == SIG_IGN) { - if (signr != SIGCHLD) - continue; - - /* sys_wait4() grabs the master kernel lock, so - * we need not do so, that sucker should be - * threaded and would not be that difficult to - * do anyways. - */ - while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0) - ; - continue; - } - if (ka->sa.sa_handler == SIG_DFL) { - unsigned long exit_code = signr; - - if (current->pid == 1) - continue; - switch (signr) { - case SIGCONT: case SIGCHLD: case SIGWINCH: case SIGURG: - continue; - - case SIGTSTP: case SIGTTIN: case SIGTTOU: - if (is_orphaned_pgrp(current->pgrp)) - continue; + cookie.restart_syscall = restart_syscall; + cookie.orig_i0 = orig_i0; - case SIGSTOP: { - struct signal_struct *sig; - set_current_state(TASK_STOPPED); - current->exit_code = signr; - sig = current->parent->sig; - if (sig && !(sig->action[SIGCHLD-1].sa.sa_flags & - SA_NOCLDSTOP)) - notify_parent(current, SIGCHLD); - schedule(); - continue; - } - case SIGQUIT: case SIGILL: case SIGTRAP: - case SIGABRT: case SIGFPE: case SIGSEGV: - case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: - if (do_coredump(signr, exit_code, regs)) - exit_code |= 0x80; - /* FALLTHRU */ + signr = get_signal_to_deliver(&info, regs, &cookie); + if (signr > 0) { + struct k_sigaction *ka; - default: - sig_exit(signr, exit_code, &info); - /* NOT REACHED */ - } - } - if (restart_syscall) + ka = ¤t->sighand->action[signr-1]; + if (cookie.restart_syscall) syscall_restart32(orig_i0, regs, &ka->sa); handle_signal32(signr, ka, &info, oldset, regs, svr4_signal); return 1; } - if (restart_syscall && + if (cookie.restart_syscall && (regs->u_regs[UREG_I0] == ERESTARTNOHAND || regs->u_regs[UREG_I0] == ERESTARTSYS || regs->u_regs[UREG_I0] == ERESTARTNOINTR)) { /* replay the system call when we are done */ - regs->u_regs[UREG_I0] = orig_i0; + regs->u_regs[UREG_I0] = cookie.orig_i0; regs->tpc -= 4; regs->tnpc -= 4; } - if (restart_syscall && + if (cookie.restart_syscall && regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { regs->u_regs[UREG_G1] = __NR_restart_syscall; regs->tpc -= 4; diff -Nru a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c --- a/arch/sparc64/kernel/sys_sparc32.c Fri Feb 14 00:27:29 2003 +++ b/arch/sparc64/kernel/sys_sparc32.c Fri Feb 14 00:27:29 2003 @@ -1679,23 +1679,6 @@ return ret; } -extern asmlinkage int sys_sigprocmask(int how, old_sigset_t *set, old_sigset_t *oset); - -asmlinkage int sys32_sigprocmask(int how, compat_old_sigset_t *set, compat_old_sigset_t *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(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; -} - extern asmlinkage int sys_rt_sigprocmask(int how, sigset_t *set, sigset_t *oset, size_t sigsetsize); asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset_t *oset, compat_size_t sigsetsize) @@ -1732,21 +1715,6 @@ return 0; } -extern asmlinkage int sys_sigpending(old_sigset_t *set); - -asmlinkage int sys32_sigpending(compat_old_sigset_t *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 asmlinkage int sys_rt_sigpending(sigset_t *set, size_t sigsetsize); asmlinkage int sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize) @@ -1813,7 +1781,7 @@ } spin_lock_irq(¤t->sighand->siglock); - sig = dequeue_signal(&these, &info); + sig = dequeue_signal(current, &these, &info); if (!sig) { timeout = MAX_SCHEDULE_TIMEOUT; if (uts) @@ -1833,7 +1801,7 @@ timeout = schedule_timeout(timeout); spin_lock_irq(¤t->sighand->siglock); - sig = dequeue_signal(&these, &info); + sig = dequeue_signal(current, &these, &info); current->blocked = current->real_blocked; siginitset(¤t->real_blocked, 0); recalc_sigpending(); diff -Nru a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S --- a/arch/sparc64/kernel/systbls.S Fri Feb 14 00:27:28 2003 +++ b/arch/sparc64/kernel/systbls.S Fri Feb 14 00:27:28 2003 @@ -55,7 +55,7 @@ .word sys_quotactl, sys_set_tid_address, sys32_mount, sys_ustat, sys_setxattr /*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys32_getdents .word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr -/*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys32_sigpending, sys_ni_syscall +/*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall .word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sparc64_newuname /*190*/ .word sys32_init_module, sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl .word sys_epoll_wait, sys_nis_syscall, sys_getppid, sys32_sigaction, sys_sgetmask @@ -63,7 +63,7 @@ .word sys32_readahead, sys32_socketcall, sys_syslog, sys32_lookup_dcookie, sys_nis_syscall /*210*/ .word sys_nis_syscall, sys_nis_syscall, sys_waitpid, sys_swapoff, sys32_sysinfo .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 +/*220*/ .word compat_sys_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys_getpgid .word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16 /*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 @@ -203,7 +203,7 @@ .word sunos_nosys, sunos_getdents, sys_setsid .word sys_fchdir, sunos_nosys, sunos_nosys .word sunos_nosys, sunos_nosys, sunos_nosys - .word sunos_nosys, sys32_sigpending, sunos_nosys + .word sunos_nosys, compat_sys_sigpending, sunos_nosys .word sys_setpgid, sunos_pathconf, sunos_fpathconf .word sunos_sysconf, sunos_uname, sunos_nosys .word sunos_nosys, sunos_nosys, sunos_nosys diff -Nru a/arch/sparc64/mm/hugetlbpage.c b/arch/sparc64/mm/hugetlbpage.c --- a/arch/sparc64/mm/hugetlbpage.c Fri Feb 14 00:27:29 2003 +++ b/arch/sparc64/mm/hugetlbpage.c Fri Feb 14 00:27:29 2003 @@ -232,6 +232,18 @@ return -1; } +/* + * This function checks for proper alignment of input addr and len parameters. + */ +int is_aligned_hugepage_range(unsigned long addr, unsigned long len) +{ + if (len & ~HPAGE_MASK) + return -EINVAL; + if (addr & ~HPAGE_MASK) + return -EINVAL; + return 0; +} + int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma) { diff -Nru a/arch/sparc64/oprofile/init.c b/arch/sparc64/oprofile/init.c --- a/arch/sparc64/oprofile/init.c Fri Feb 14 00:27:28 2003 +++ b/arch/sparc64/oprofile/init.c Fri Feb 14 00:27:28 2003 @@ -11,10 +11,10 @@ #include #include -extern void timer_init(struct oprofile_operations ** ops, enum oprofile_cpu * cpu); +extern void timer_init(struct oprofile_operations ** ops); -int __init oprofile_arch_init(struct oprofile_operations ** ops, enum oprofile_cpu * cpu) +int __init oprofile_arch_init(struct oprofile_operations ** ops) { - timer_init(ops, cpu); + timer_init(ops); return 0; } diff -Nru a/arch/sparc64/oprofile/timer_int.c b/arch/sparc64/oprofile/timer_int.c --- a/arch/sparc64/oprofile/timer_int.c Fri Feb 14 00:27:29 2003 +++ b/arch/sparc64/oprofile/timer_int.c Fri Feb 14 00:27:29 2003 @@ -19,8 +19,10 @@ { struct pt_regs * regs = (struct pt_regs *)data; int cpu = smp_processor_id(); + unsigned long pc = instruction_pointer(regs); + int is_kernel = !user_mode(regs); - oprofile_add_sample(instruction_pointer(regs), 0, cpu); + oprofile_add_sample(pc, is_kernel, 0, cpu); return 0; } @@ -44,13 +46,13 @@ static struct oprofile_operations timer_ops = { .start = timer_start, - .stop = timer_stop + .stop = timer_stop, + .cpu_type = "timer" }; -void __init timer_init(struct oprofile_operations ** ops, enum oprofile_cpu * cpu) +void __init timer_init(struct oprofile_operations ** ops) { *ops = &timer_ops; - *cpu = OPROFILE_CPU_TIMER; printk(KERN_INFO "oprofile: using timer interrupt.\n"); } diff -Nru a/arch/um/kernel/signal_kern.c b/arch/um/kernel/signal_kern.c --- a/arch/um/kernel/signal_kern.c Fri Feb 14 00:27:28 2003 +++ b/arch/um/kernel/signal_kern.c Fri Feb 14 00:27:28 2003 @@ -136,7 +136,7 @@ if (!oldset) oldset = ¤t->blocked; - sig = get_signal_to_deliver(&info, regs); + sig = get_signal_to_deliver(&info, regs, NULL); if(sig == 0) return(0); diff -Nru a/arch/v850/kernel/signal.c b/arch/v850/kernel/signal.c --- a/arch/v850/kernel/signal.c Fri Feb 14 00:27:30 2003 +++ b/arch/v850/kernel/signal.c Fri Feb 14 00:27:30 2003 @@ -506,7 +506,7 @@ if (!oldset) oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, regs); + signr = get_signal_to_deliver(&info, regs, NULL); if (signr > 0) { /* Whee! Actually deliver the signal. */ handle_signal(signr, &info, oldset, regs); diff -Nru a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig --- a/arch/x86_64/Kconfig Fri Feb 14 00:27:29 2003 +++ b/arch/x86_64/Kconfig Fri Feb 14 00:27:29 2003 @@ -19,11 +19,6 @@ config X86 bool default y - help - This is Linux's home port. Linux was originally native to the Intel - 386, and runs on all the later x86 processors including the Intel - 486, 586, Pentiums, and various instruction-set-compatible chips by - AMD, Cyrix, and others. config MMU bool @@ -35,20 +30,10 @@ config ISA bool - help - Find out whether you have ISA slots on your motherboard. ISA is the - name of a bus system, i.e. the way the CPU talks to the other stuff - inside your box. Other bus systems are PCI, EISA, MicroChannel - (MCA) or VESA. ISA is an older system, now being displaced by PCI; - newer boards don't support it. If you have ISA, say Y, otherwise N. config SBUS bool -config UID16 - bool - default y - config RWSEM_GENERIC_SPINLOCK bool default y @@ -86,14 +71,14 @@ default MK8 config MK8 - bool "AMD-Hammer" + bool "AMD-Opteron/Athlon64" help - Support for AMD Clawhammer/Sledgehammer CPUs. Only choice for x86-64 - currently so you should choose this if you want a x86-64 kernel. In fact - you will have no other choice than to choose this. + Optimize for AMD Opteron/Athlon64/Hammer/K8 CPUs. config GENERIC_CPU bool "Generic-x86-64" + help + Generic x86-64 CPU. endchoice @@ -196,25 +181,12 @@ singleprocessor machines. On a singleprocessor machine, the kernel will run faster if you say N here. - Note that if you say Y here and choose architecture "586" or - "Pentium" under "Processor family", the kernel will not work on 486 - architectures. Similarly, multiprocessor kernels for the "PPro" - architecture may not work on all Pentium based boards. - - People using multiprocessor machines who say Y here should also say - Y to "Enhanced Real Time Clock Support", below. The "Advanced Power - Management" code will be disabled if you say Y here. - - See also the , - , , - and the SMP-HOWTO available at - . - If you don't know what to do here, say N. +# broken currently config PREEMPT + depends on NOT_WORKING bool "Preemptible Kernel" - depends on !SMP ---help--- This option reduces the latency of the kernel when reacting to real-time or interactive events by allowing a low priority process to @@ -229,6 +201,28 @@ Say Y here if you are feeling brave and building a kernel for a desktop, embedded or real-time system. Say N if you are unsure. +# someone write a better help text please. +config K8_NUMA + bool "K8 NUMA support" + depends on SMP + help + Enable NUMA (Non Unified Memory Architecture) support for + AMD Opteron Multiprocessor systems. The kernel will try to allocate + memory used by a CPU on the local memory controller of the CPU + and in the future do more optimizations. This may improve performance + or it may not. Code is still experimental. + Say N if unsure. + +config DISCONTIGMEM + bool + depends on K8_NUMA + default y + +config NUMA + bool + depends on K8_NUMA + default y + config HAVE_DEC_LOCK bool depends on SMP @@ -245,15 +239,17 @@ kernel will support. The maximum supported value is 32 and the minimum value which makes sense is 2. - This is purely to save memory - each supported CPU adds - approximately eight kilobytes to the kernel image. + This is purely to save memory - each supported CPU requires + memory in the static kernel configuration. config GART_IOMMU bool "IOMMU support" help Support the K8 IOMMU. Needed to run systems with more than 4GB of memory - properly with 32-bit devices. You should probably turn this on. - The iommu can be turned off at runtime with the iommu=off parameter. + properly with 32-bit PCI devices that do not support DAC (Double Address + Cycle). The IOMMU can be turned off at runtime with the iommu=off parameter. + Normally the kernel will take the right choice by itself. + If unsure say Y config DUMMY_IOMMU bool @@ -291,7 +287,8 @@ Note that, even if you say N here, Linux on the x86 architecture will issue the hlt instruction if nothing is to be done, thereby - sending the processor to sleep and saving power. + sending the processor to limited sleep and saving power. However + using ACPI will likely save more power. config SOFTWARE_SUSPEND bool "Software Suspend (EXPERIMENTAL)" @@ -331,16 +328,6 @@ config PCI bool "PCI support" - help - Find out whether you have a PCI motherboard. PCI is the name of a - bus system, i.e. the way the CPU talks to the other stuff inside - your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or - VESA. If you have PCI, say Y, otherwise N. - - The PCI-HOWTO, available from - , contains valuable - information about which PCI hardware does work under Linux and which - doesn't. # x86-64 doesn't support PCI BIOS access from long mode so always go direct. config PCI_DIRECT @@ -381,54 +368,10 @@ bool depends on PROC_FS default y - ---help--- - If you enabled support for /proc file system then the file - /proc/kcore will contain the kernel core image. This can be used - in gdb: - - $ cd /usr/src/linux ; gdb vmlinux /proc/kcore - - You have two choices here: ELF and A.OUT. Selecting ELF will make - /proc/kcore appear in ELF core format as defined by the Executable - and Linkable Format specification. Selecting A.OUT will choose the - old "a.out" format which may be necessary for some old versions - of binutils or on some architectures. - - This is especially useful if you have compiled the kernel with the - "-g" option to preserve debugging information. It is mainly used - for examining kernel data structures on the live kernel so if you - don't understand what this means or are not a kernel hacker, just - leave it at its default value ELF. -#tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT config BINFMT_ELF - tristate "Kernel support for ELF binaries" - ---help--- - ELF (Executable and Linkable Format) is a format for libraries and - executables used across different architectures and operating - systems. Saying Y here will enable your kernel to run ELF binaries - and enlarge it by about 13 KB. ELF support under Linux has now all - but replaced the traditional Linux a.out formats (QMAGIC and ZMAGIC) - because it is portable (this does *not* mean that you will be able - to run executables from different architectures or operating systems - however) and makes building run-time libraries very easy. Many new - executables are distributed solely in ELF format. You definitely - want to say Y here. - - Information about ELF is contained in the ELF HOWTO available from - . - - If you find that after upgrading from Linux kernel 1.2 and saying Y - here, you still can't run any ELF binaries (they just crash), then - you'll have to install the newest ELF runtime libraries, including - ld.so (check the file for location and - latest version). - - 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. Saying M or N here is dangerous because - some crucial programs on your system might be in ELF format. + bool + default y config BINFMT_MISC tristate "Kernel support for MISC binaries" @@ -436,12 +379,9 @@ If you say Y here, it will be possible to plug wrapper-driven binary formats into the kernel. You will like this especially when you use programs that need an interpreter to run like Java, Python or - Emacs-Lisp. It's also useful if you often run DOS executables under - the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have - registered such a binary class with the kernel, you can start one of - those programs simply by typing in its name at a shell prompt; Linux - will automatically feed it to the correct interpreter. + Emacs-Lisp. Once you have registered such a binary class with the kernel, + you can start one of those programs simply by typing in its name at a shell + prompt; Linux will automatically feed it to the correct interpreter. You can do other nice things, too. Read the file to learn how to use this @@ -467,6 +407,12 @@ depends on IA32_EMULATION default y + +config UID16 + bool + depends on IA32_EMULATION + default y + endmenu source "drivers/mtd/Kconfig" @@ -672,9 +618,11 @@ best used in conjunction with the NMI watchdog so that spinlock deadlocks are also debuggable. +# !SMP for now because the context switch early causes GPF in segment reloading +# and the GS base checking does the wrong thing then, causing a hang. config CHECKING bool "Additional run-time checks" - depends on DEBUG_KERNEL + depends on DEBUG_KERNEL && !SMP help Enables some internal consistency checks for kernel debugging. You should normally say N. @@ -683,7 +631,8 @@ bool "Debug __init statements" depends on DEBUG_KERNEL help - Fill __init and __initdata at the end of boot. This is only for debugging. + Fill __init and __initdata at the end of boot. This helps debugging + illegal uses of __init and __initdata after initialization. config KALLSYMS bool "Load all symbols for debugging/kksymoops" @@ -696,11 +645,11 @@ bool "Compile the kernel with frame pointers" depends on DEBUG_KERNEL help - If you say Y here the resulting kernel image will be slightly larger - and slower, but it will give very useful debugging information. - If you don't debug the kernel, you can say N, but we may not be able - to solve problems without frame pointers. - Note this is normally not needed on x86-64. + Compile the kernel with frame pointers. This may help for some + debugging with external debuggers. Note the standard oops backtracer + doesn't make use of it and the x86-64 kernel doesn't ensure an consistent + frame pointer through inline assembly (semaphores etc.) + Normally you should say N. endmenu diff -Nru a/arch/x86_64/Makefile b/arch/x86_64/Makefile --- a/arch/x86_64/Makefile Fri Feb 14 00:27:30 2003 +++ b/arch/x86_64/Makefile Fri Feb 14 00:27:30 2003 @@ -58,7 +58,8 @@ boot := arch/x86_64/boot -.PHONY: bzImage bzlilo bzdisk install archmrproper +.PHONY: bzImage bzlilo install archmrproper \ + fdimage fdimage144 fdimage288 archclean #Default target when executing "make" all: bzImage @@ -74,7 +75,7 @@ bzdisk: vmlinux $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zdisk -install: vmlinux +install fdimage fdimage144 fdimage288: vmlinux $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ archclean: @@ -102,4 +103,7 @@ echo ' (distribution) /sbin/installkernel or' echo ' install to $$(INSTALL_PATH) and run lilo' endef + +CLEAN_FILES += arch/$(ARCH)/boot/fdimage arch/$(ARCH)/boot/mtools.conf + diff -Nru a/arch/x86_64/boot/Makefile b/arch/x86_64/boot/Makefile --- a/arch/x86_64/boot/Makefile Fri Feb 14 00:27:28 2003 +++ b/arch/x86_64/boot/Makefile Fri Feb 14 00:27:28 2003 @@ -59,8 +59,36 @@ $(obj)/compressed/vmlinux: FORCE $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@ -zdisk: $(BOOTIMAGE) - dd bs=8192 if=$(BOOTIMAGE) of=/dev/fd0 +# Set this if you want to pass append arguments to the zdisk/fdimage kernel +FDARGS = + +$(obj)/mtools.conf: $(obj)/mtools.conf.in + sed -e 's|@OBJ@|$(obj)|g' < $< > $@ + +# This requires write access to /dev/fd0 +zdisk: $(BOOTIMAGE) $(obj)/mtools.conf + MTOOLSRC=$(src)/mtools.conf mformat a: ; sync + syslinux /dev/fd0 ; sync + echo 'default linux $(FDARGS)' | \ + MTOOLSRC=$(src)/mtools.conf mcopy - a:syslinux.cfg + MTOOLSRC=$(src)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync + +# These require being root or having syslinux run setuid +fdimage fdimage144: $(BOOTIMAGE) $(src)/mtools.conf + dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440 + MTOOLSRC=$(src)/mtools.conf mformat v: ; sync + syslinux $(obj)/fdimage ; sync + echo 'default linux $(FDARGS)' | \ + MTOOLSRC=$(src)/mtools.conf mcopy - v:syslinux.cfg + MTOOLSRC=$(src)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync + +fdimage288: $(BOOTIMAGE) $(src)/mtools.conf + dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880 + MTOOLSRC=$(src)/mtools.conf mformat w: ; sync + syslinux $(obj)/fdimage ; sync + echo 'default linux $(FDARGS)' | \ + MTOOLSRC=$(src)/mtools.conf mcopy - w:syslinux.cfg + MTOOLSRC=$(src)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync zlilo: $(BOOTIMAGE) if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi diff -Nru a/arch/x86_64/boot/bootsect.S b/arch/x86_64/boot/bootsect.S --- a/arch/x86_64/boot/bootsect.S Fri Feb 14 00:27:29 2003 +++ b/arch/x86_64/boot/bootsect.S Fri Feb 14 00:27:29 2003 @@ -4,29 +4,13 @@ * modified by Drew Eckhardt * modified by Bruce Evans (bde) * modified by Chris Noe (May 1999) (as86 -> gas) - * - * 360k/720k disk support: Andrzej Krzysztofowicz + * gutted by H. Peter Anvin (Jan 2003) * * BIG FAT NOTE: We're in real mode using 64k segments. Therefore segment * addresses must be multiplied by 16 to obtain their respective linear * addresses. To avoid confusion, linear addresses are written using leading * hex while segment addresses are written as segment:offset. * - * bde - should not jump blindly, there may be systems with only 512K low - * memory. Use int 0x12 to get the top of memory, etc. - * - * It then loads 'setup' directly after itself (0x90200), and the system - * at 0x10000, using BIOS interrupts. - * - * NOTE! currently system is at most (8*65536-4096) bytes long. This should - * be no problem, even in the future. I want to keep it simple. This 508 kB - * kernel size should be enough, especially as this doesn't contain the - * buffer cache as in minix (and especially now that the kernel is - * compressed :-) - * - * The loader has been made as simple as possible, and continuous - * read errors will result in a unbreakable loop. Reboot by hand. It - * loads pretty fast by getting whole tracks at a time whenever possible. */ #include @@ -59,353 +43,51 @@ .global _start _start: -# First things first. Move ourself from 0x7C00 -> 0x90000 and jump there. + # Normalize the start address + jmpl $BOOTSEG, $start2 - movw $BOOTSEG, %ax - movw %ax, %ds # %ds = BOOTSEG - movw $INITSEG, %ax - movw %ax, %es # %ax = %es = INITSEG - movw $256, %cx - subw %si, %si - subw %di, %di - cld - rep - movsw - ljmp $INITSEG, $go - -# bde - changed 0xff00 to 0x4000 to use debugger at 0x6400 up (bde). We -# wouldn't have to worry about this if we checked the top of memory. Also -# my BIOS can be configured to put the wini drive tables in high memory -# instead of in the vector table. The old stack might have clobbered the -# drive table. - -go: movw $0x4000-12, %di # 0x4000 is an arbitrary value >= - # length of bootsect + length of - # setup + room for stack; - # 12 is disk parm size. - movw %ax, %ds # %ax and %es already contain INITSEG +start2: + movw %cs, %ax + movw %ax, %ds + movw %ax, %es movw %ax, %ss - movw %di, %sp # put stack at INITSEG:0x4000-12. + movw $0x7c00, %sp + sti + cld -# Many BIOS's default disk parameter tables will not recognize -# multi-sector reads beyond the maximum sector number specified -# in the default diskette parameter tables - this may mean 7 -# sectors in some cases. -# -# Since single sector reads are slow and out of the question, -# we must take care of this by creating new parameter tables -# (for the first disk) in RAM. We will set the maximum sector -# count to 36 - the most we will encounter on an ED 2.88. -# -# High doesn't hurt. Low does. -# -# Segments are as follows: %cs = %ds = %es = %ss = INITSEG, %fs = 0, -# and %gs is unused. - - movw %cx, %fs # %fs = 0 - movw $0x78, %bx # %fs:%bx is parameter table address - pushw %ds - ldsw %fs:(%bx), %si # %ds:%si is source - movb $6, %cl # copy 12 bytes - pushw %di # %di = 0x4000-12. - rep # don't worry about cld - movsw # already done above - popw %di - popw %ds - movb $36, 0x4(%di) # patch sector count - movw %di, %fs:(%bx) - movw %es, %fs:2(%bx) - -# Get disk drive parameters, specifically number of sectors/track. - -# It seems that there is no BIOS call to get the number of sectors. -# Guess 36 sectors if sector 36 can be read, 18 sectors if sector 18 -# can be read, 15 if sector 15 can be read. Otherwise guess 9. -# Note that %cx = 0 from rep movsw above. + movw $bugger_off_msg, %si - movw $disksizes, %si # table of sizes to try -probe_loop: +msg_loop: lodsb - cbtw # extend to word - movw %ax, sectors - cmpw $disksizes+4, %si - jae got_sectors # If all else fails, try 9 - - xchgw %cx, %ax # %cx = track and sector - xorw %dx, %dx # drive 0, head 0 - movw $0x0200, %bx # address = 512, in INITSEG (%es = %cs) - movw $0x0201, %ax # service 2, 1 sector - int $0x13 - jc probe_loop # try next value - -got_sectors: - movb $0x03, %ah # read cursor pos - xorb %bh, %bh - int $0x10 - movw $9, %cx - movb $0x07, %bl # page 0, attribute 7 (normal) - # %bh is set above; int10 doesn't - # modify it - movw $msg1, %bp - movw $0x1301, %ax # write string, move cursor - int $0x10 # tell the user we're loading.. - -# Load the setup-sectors directly after the moved bootblock (at 0x90200). -# We should know the drive geometry to do it, as setup may exceed first -# cylinder (for 9-sector 360K and 720K floppies). - - movw $0x0001, %ax # set sread (sector-to-read) to 1 as - movw $sread, %si # the boot sector has already been read - movw %ax, (%si) - - call kill_motor # reset FDC - movw $0x0200, %bx # address = 512, in INITSEG -next_step: - movb setup_sects, %al - movw sectors, %cx - subw (%si), %cx # (%si) = sread - cmpb %cl, %al - jbe no_cyl_crossing - movw sectors, %ax - subw (%si), %ax # (%si) = sread -no_cyl_crossing: - call read_track - pushw %ax # save it - call set_next # set %bx properly; it uses %ax,%cx,%dx - popw %ax # restore - subb %al, setup_sects # rest - for next step - jnz next_step - - pushw $SYSSEG - popw %es # %es = SYSSEG - call read_it - call kill_motor - call print_nl - -# After that we check which root-device to use. If the device is -# defined (!= 0), nothing is done and the given device is used. -# Otherwise, one of /dev/fd0H2880 (2,32) or /dev/PS0 (2,28) or /dev/at0 (2,8) -# depending on the number of sectors we pretend to know we have. - -# Segments are as follows: %cs = %ds = %ss = INITSEG, -# %es = SYSSEG, %fs = 0, %gs is unused. - - movw root_dev, %ax - orw %ax, %ax - jne root_defined - - movw sectors, %bx - movw $0x0208, %ax # /dev/ps0 - 1.2Mb - cmpw $15, %bx - je root_defined - - movb $0x1c, %al # /dev/PS0 - 1.44Mb - cmpw $18, %bx - je root_defined - - movb $0x20, %al # /dev/fd0H2880 - 2.88Mb - cmpw $36, %bx - je root_defined - - movb $0, %al # /dev/fd0 - autodetect -root_defined: - movw %ax, root_dev - -# After that (everything loaded), we jump to the setup-routine -# loaded directly after the bootblock: - - ljmp $SETUPSEG, $0 - -# These variables are addressed via %si register as it gives shorter code. - -sread: .word 0 # sectors read of current track -head: .word 0 # current head -track: .word 0 # current track - -# This routine loads the system at address SYSSEG, making sure -# no 64kB boundaries are crossed. We try to load it as fast as -# possible, loading whole tracks whenever we can. - -read_it: - movw %es, %ax # %es = SYSSEG when called - testw $0x0fff, %ax -die: jne die # %es must be at 64kB boundary - xorw %bx, %bx # %bx is starting address within segment -rp_read: -#ifdef __BIG_KERNEL__ # look in setup.S for bootsect_kludge - bootsect_kludge = 0x220 # 0x200 + 0x20 which is the size of the - lcall *bootsect_kludge # bootsector + bootsect_kludge offset -#else - movw %es, %ax - subw $SYSSEG, %ax - movw %bx, %cx - shr $4, %cx - add %cx, %ax # check offset -#endif - cmpw syssize, %ax # have we loaded everything yet? - jbe ok1_read - - ret - -ok1_read: - movw sectors, %ax - subw (%si), %ax # (%si) = sread - movw %ax, %cx - shlw $9, %cx - addw %bx, %cx - jnc ok2_read - - je ok2_read - - xorw %ax, %ax - subw %bx, %ax - shrw $9, %ax -ok2_read: - call read_track - call set_next - jmp rp_read - -read_track: - pusha - pusha - movw $0xe2e, %ax # loading... message 2e = . + andb %al, %al + jz die + movb $0xe, %ah movw $7, %bx int $0x10 - popa - -# Accessing head, track, sread via %si gives shorter code. + jmp msg_loop - movw 4(%si), %dx # 4(%si) = track - movw (%si), %cx # (%si) = sread - incw %cx - movb %dl, %ch - movw 2(%si), %dx # 2(%si) = head - movb %dl, %dh - andw $0x0100, %dx - movb $2, %ah - pushw %dx # save for error dump - pushw %cx - pushw %bx - pushw %ax - int $0x13 - jc bad_rt - - addw $8, %sp - popa - ret - -set_next: - movw %ax, %cx - addw (%si), %ax # (%si) = sread - cmp sectors, %ax - jne ok3_set - movw $0x0001, %ax - xorw %ax, 2(%si) # change head - jne ok4_set - incw 4(%si) # next track -ok4_set: +die: + # Allow the user to press a key, then reboot xorw %ax, %ax -ok3_set: - movw %ax, (%si) # set sread - shlw $9, %cx - addw %cx, %bx - jnc set_next_fin - movw %es, %ax - addb $0x10, %ah - movw %ax, %es - xorw %bx, %bx -set_next_fin: - ret - -bad_rt: - pushw %ax # save error code - call print_all # %ah = error, %al = read - xorb %ah, %ah - xorb %dl, %dl - int $0x13 - addw $10, %sp - popa - jmp read_track - -# print_all is for debugging purposes. -# -# it will print out all of the registers. The assumption is that this is -# called from a routine, with a stack frame like -# -# %dx -# %cx -# %bx -# %ax -# (error) -# ret <- %sp - -print_all: - movw $5, %cx # error code + 4 registers - movw %sp, %bp -print_loop: - pushw %cx # save count remaining - call print_nl # <-- for readability - cmpb $5, %cl - jae no_reg # see if register name is needed + int $0x16 + int $0x19 - movw $0xe05 + 'A' - 1, %ax - subb %cl, %al - int $0x10 - movb $'X', %al - int $0x10 - movb $':', %al - int $0x10 -no_reg: - addw $2, %bp # next register - call print_hex # print it - popw %cx - loop print_loop - ret - -print_nl: - movw $0xe0d, %ax # CR - int $0x10 - movb $0xa, %al # LF - int $0x10 - ret - -# print_hex is for debugging purposes, and prints the word -# pointed to by %ss:%bp in hexadecimal. - -print_hex: - movw $4, %cx # 4 hex digits - movw (%bp), %dx # load word into %dx -print_digit: - rolw $4, %dx # rotate to use low 4 bits - movw $0xe0f, %ax # %ah = request - andb %dl, %al # %al = mask for nybble - addb $0x90, %al # convert %al to ascii hex - daa # in only four instructions! - adc $0x40, %al - daa - int $0x10 - loop print_digit - ret - -# This procedure turns off the floppy drive motor, so -# that we enter the kernel in a known state, and -# don't have to worry about it later. -# NOTE: Doesn't save %ax or %dx; do it yourself if you need to. - -kill_motor: - movw $0x3f2, %dx - xorb %al, %al - outb %al, %dx - ret - -sectors: .word 0 -disksizes: .byte 36, 18, 15, 9 -msg1: .byte 13, 10 - .ascii "Loading" + # int 0x19 should never return. In case it does anyway, + # invoke the BIOS reset code... + ljmp $0xf000,$0xfff0 + + +bugger_off_msg: + .ascii "Direct booting from floppy is no longer supported.\r\n" + .ascii "Please use a boot loader program instead.\r\n" + .ascii "\n" + .ascii "Remove disk and press any key to reboot . . .\r\n" + .byte 0 + -# XXX: This is a fairly snug fit. + # Kernel attributes; used by setup -.org 497 + .org 497 setup_sects: .byte SETUPSECTS root_flags: .word ROOT_RDONLY syssize: .word SYSSIZE diff -Nru a/arch/x86_64/boot/mtools.conf.in b/arch/x86_64/boot/mtools.conf.in --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/x86_64/boot/mtools.conf.in Fri Feb 14 00:27:30 2003 @@ -0,0 +1,17 @@ +# +# mtools configuration file for "make (b)zdisk" +# + +# Actual floppy drive +drive a: + file="/dev/fd0" + +# 1.44 MB floppy disk image +drive v: + file="@OBJ@/fdimage" cylinders=80 heads=2 sectors=18 filter + +# 2.88 MB floppy disk image (mostly for virtual uses) +drive w: + file="@OBJ@/fdimage" cylinders=80 heads=2 sectors=36 filter + + diff -Nru a/arch/x86_64/boot/tools/build.c b/arch/x86_64/boot/tools/build.c --- a/arch/x86_64/boot/tools/build.c Fri Feb 14 00:27:27 2003 +++ b/arch/x86_64/boot/tools/build.c Fri Feb 14 00:27:27 2003 @@ -150,13 +150,10 @@ sz = sb.st_size; fprintf (stderr, "System is %d kB\n", sz/1024); sys_size = (sz + 15) / 16; - /* 0x28000*16 = 2.5 MB, conservative estimate for the current maximum */ - if (sys_size > (is_big_kernel ? 0x28000 : DEF_SYSSIZE)) + /* 0x40000*16 = 4.0 MB, reasonable estimate for the current maximum */ + if (sys_size > (is_big_kernel ? 0x40000 : DEF_SYSSIZE)) die("System is too big. Try using %smodules.", is_big_kernel ? "" : "bzImage or "); - if (sys_size > 0xefff) - fprintf(stderr,"warning: kernel is too big for standalone boot " - "from floppy\n"); while (sz > 0) { int l, n; diff -Nru a/arch/x86_64/defconfig b/arch/x86_64/defconfig --- a/arch/x86_64/defconfig Fri Feb 14 00:27:29 2003 +++ b/arch/x86_64/defconfig Fri Feb 14 00:27:29 2003 @@ -5,7 +5,6 @@ CONFIG_X86=y CONFIG_MMU=y CONFIG_SWAP=y -CONFIG_UID16=y CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_X86_CMPXCHG=y CONFIG_EARLY_PRINTK=y @@ -22,12 +21,6 @@ CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y -# CONFIG_LOG_BUF_SHIFT_17 is not set -CONFIG_LOG_BUF_SHIFT_16=y -# CONFIG_LOG_BUF_SHIFT_15 is not set -# CONFIG_LOG_BUF_SHIFT_14 is not set -# CONFIG_LOG_BUF_SHIFT_13 is not set -# CONFIG_LOG_BUF_SHIFT_12 is not set CONFIG_LOG_BUF_SHIFT=16 # @@ -37,6 +30,7 @@ CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y +# CONFIG_MODVERSIONS is not set # CONFIG_KMOD is not set # @@ -103,6 +97,7 @@ # CONFIG_BINFMT_MISC is not set CONFIG_IA32_EMULATION=y CONFIG_COMPAT=y +CONFIG_UID16=y # # Memory Technology Devices (MTD) @@ -290,6 +285,7 @@ # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y +# CONFIG_MII is not set # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set # CONFIG_NET_VENDOR_3COM is not set @@ -490,6 +486,7 @@ # CONFIG_DRM is not set # CONFIG_MWAVE is not set CONFIG_RAW_DRIVER=y +# CONFIG_HANGCHECK_TIMER is not set # # Misc devices @@ -615,7 +612,6 @@ # CONFIG_DEBUG_SLAB is not set CONFIG_MAGIC_SYSRQ=y # CONFIG_DEBUG_SPINLOCK is not set -CONFIG_CHECKING=y # CONFIG_INIT_DEBUG is not set CONFIG_KALLSYMS=y # CONFIG_FRAME_POINTER is not set diff -Nru a/arch/x86_64/ia32/fpu32.c b/arch/x86_64/ia32/fpu32.c --- a/arch/x86_64/ia32/fpu32.c Fri Feb 14 00:27:26 2003 +++ b/arch/x86_64/ia32/fpu32.c Fri Feb 14 00:27:26 2003 @@ -146,6 +146,7 @@ return -1; } tsk->thread.i387.fxsave.mxcsr &= 0xffbf; + current->used_math = 1; return convert_fxsr_from_user(&tsk->thread.i387.fxsave, buf); } 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 Fri Feb 14 00:27:30 2003 +++ b/arch/x86_64/ia32/ia32_signal.c Fri Feb 14 00:27:30 2003 @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -134,7 +135,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]; }; @@ -237,7 +238,7 @@ if (verify_area(VERIFY_READ, frame, sizeof(*frame))) goto badframe; if (__get_user(set.sig[0], &frame->sc.oldmask) - || (_IA32_NSIG_WORDS > 1 + || (_COMPAT_NSIG_WORDS > 1 && __copy_from_user((((char *) &set.sig) + 4), &frame->extramask, sizeof(frame->extramask)))) goto badframe; @@ -373,7 +374,7 @@ } void ia32_setup_frame(int sig, struct k_sigaction *ka, - sigset32_t *set, struct pt_regs * regs) + compat_sigset_t *set, struct pt_regs * regs) { struct sigframe *frame; int err = 0; @@ -399,7 +400,7 @@ if (err) goto give_sigsegv; - if (_IA32_NSIG_WORDS > 1) { + if (_COMPAT_NSIG_WORDS > 1) { err |= __copy_to_user(frame->extramask, &set->sig[1], sizeof(frame->extramask)); } @@ -460,7 +461,7 @@ } void ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, - sigset32_t *set, struct pt_regs * regs) + compat_sigset_t *set, struct pt_regs * regs) { struct rt_sigframe *frame; int err = 0; diff -Nru a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S --- a/arch/x86_64/ia32/ia32entry.S Fri Feb 14 00:27:28 2003 +++ b/arch/x86_64/ia32/ia32entry.S Fri Feb 14 00:27:28 2003 @@ -273,7 +273,7 @@ .quad sys_setreuid16 /* 70 */ .quad sys_setregid16 .quad stub32_sigsuspend - .quad sys32_sigpending + .quad compat_sys_sigpending .quad sys_sethostname .quad sys32_setrlimit /* 75 */ .quad sys32_old_getrlimit /* old_getrlimit */ @@ -326,7 +326,7 @@ .quad sys32_modify_ldt .quad sys32_adjtimex .quad sys32_mprotect /* 125 */ - .quad sys32_sigprocmask + .quad compat_sys_sigprocmask .quad sys32_module_warning /* create_module */ .quad sys_init_module .quad sys_delete_module @@ -450,7 +450,7 @@ .quad sys32_io_getevents .quad sys32_io_submit .quad sys_io_cancel - .quad sys_ni_syscall /* 250 alloc_huge_pages */ + .quad sys_fadvise64 .quad sys_ni_syscall /* free_huge_pages */ .quad sys_exit_group /* exit_group */ .quad sys_lookup_dcookie diff -Nru a/arch/x86_64/ia32/ipc32.c b/arch/x86_64/ia32/ipc32.c --- a/arch/x86_64/ia32/ipc32.c Fri Feb 14 00:27:28 2003 +++ b/arch/x86_64/ia32/ipc32.c Fri Feb 14 00:27:28 2003 @@ -626,9 +626,7 @@ return -E2BIG; if (!access_ok(VERIFY_READ, sb, nsops * sizeof(struct sembuf))) return -EFAULT; - if (ts32 && - (get_user(ts.tv_sec, &ts32->tv_sec) || - __get_user(ts.tv_nsec, &ts32->tv_nsec))) + if (ts32 && get_compat_timespec(&ts, ts32)) return -EFAULT; set_fs(KERNEL_DS); diff -Nru a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c --- a/arch/x86_64/ia32/sys_ia32.c Fri Feb 14 00:27:28 2003 +++ b/arch/x86_64/ia32/sys_ia32.c Fri Feb 14 00:27:28 2003 @@ -276,10 +276,10 @@ { 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) { @@ -287,10 +287,10 @@ __get_user((long)new_ka.sa.sa_handler, &act->sa_handler) || __get_user(new_ka.sa.sa_flags, &act->sa_flags) || __get_user((long)new_ka.sa.sa_restorer, &act->sa_restorer)|| - __copy_from_user(&set32, &act->sa_mask, sizeof(sigset32_t))) + __copy_from_user(&set32, &act->sa_mask, sizeof(compat_sigset_t))) return -EFAULT; - /* FIXME: here we rely on _IA32_NSIG_WORS to be >= than _NSIG_WORDS << 1 */ + /* FIXME: here we rely on _COMPAT_NSIG_WORS to be >= than _NSIG_WORDS << 1 */ switch (_NSIG_WORDS) { case 4: new_ka.sa.sa_mask.sig[3] = set32.sig[6] | (((long)set32.sig[7]) << 32); @@ -306,7 +306,7 @@ ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); if (!ret && oact) { - /* FIXME: here we rely on _IA32_NSIG_WORS to be >= than _NSIG_WORDS << 1 */ + /* FIXME: here we rely on _COMPAT_NSIG_WORS to be >= than _NSIG_WORDS << 1 */ switch (_NSIG_WORDS) { case 4: set32.sig[7] = (old_ka.sa.sa_mask.sig[3] >> 32); @@ -325,7 +325,7 @@ __put_user((long)old_ka.sa.sa_handler, &oact->sa_handler) || __put_user((long)old_ka.sa.sa_restorer, &oact->sa_restorer) || __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || - __copy_to_user(&oact->sa_mask, &set32, sizeof(sigset32_t))) + __copy_to_user(&oact->sa_mask, &set32, sizeof(compat_sigset_t))) return -EFAULT; } @@ -339,7 +339,7 @@ int ret; if (act) { - old_sigset32_t mask; + compat_old_sigset_t mask; if (verify_area(VERIFY_READ, act, sizeof(*act)) || __get_user((long)new_ka.sa.sa_handler, &act->sa_handler) || @@ -368,16 +368,16 @@ size_t sigsetsize); asmlinkage long -sys32_rt_sigprocmask(int how, sigset32_t *set, sigset32_t *oset, +sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset_t *oset, unsigned int 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) { case 4: s.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32); @@ -398,7 +398,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; @@ -1219,55 +1219,18 @@ set_fs (KERNEL_DS); ret = sys_sched_rr_get_interval(pid, &t); set_fs (old_fs); - if (verify_area(VERIFY_WRITE, interval, sizeof(struct compat_timespec)) || - __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; } -extern asmlinkage long sys_sigprocmask(int how, old_sigset_t *set, - old_sigset_t *oset); - -asmlinkage long -sys32_sigprocmask(int how, old_sigset32_t *set, old_sigset32_t *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(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; -} - -extern asmlinkage long sys_sigpending(old_sigset_t *set); - -asmlinkage long -sys32_sigpending(old_sigset32_t *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 asmlinkage long sys_rt_sigpending(sigset_t *set, size_t sigsetsize); asmlinkage long -sys32_rt_sigpending(sigset32_t *set, compat_size_t sigsetsize) +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(); @@ -1281,7 +1244,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; @@ -1369,18 +1332,18 @@ const struct timespec *uts, size_t sigsetsize); 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, 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; siginfo_t32 info32; - 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); @@ -1388,14 +1351,11 @@ case 2: s.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32); case 1: s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32); } - if (uts) { - if (verify_area(VERIFY_READ, uts, sizeof(struct compat_timespec)) || - __get_user (t.tv_sec, &uts->tv_sec) || - __get_user (t.tv_nsec, &uts->tv_nsec)) - return -EFAULT; - } + if (uts && get_compat_timespec(&t, uts)) + 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_to_user (uinfo, siginfo64to32(&info32, &info), @@ -2248,20 +2208,13 @@ mm_segment_t oldfs = get_fs(); int err; - if (utime32) { - if (verify_area(VERIFY_READ, utime32, sizeof(*utime32))) - return -EFAULT; - - if (__get_user(t.tv_sec, &utime32->tv_sec) || - __get_user(t.tv_nsec, &utime32->tv_nsec)) - return -EFAULT; - - } + if (utime32 && get_compat_timespec(&t, utime32)) + return -EFAULT; /* the set_fs is safe because futex doesn't use the seg limit for valid page checking of uaddr. */ set_fs(KERNEL_DS); - err = sys_futex(uaddr, op, val, &t); + err = sys_futex(uaddr, op, val, utime32 ? &t : NULL); set_fs(oldfs); return err; } @@ -2340,22 +2293,18 @@ { long ret; mm_segment_t oldfs; - struct timespec t32; + struct timespec t; /* Harden against bogus ptrace */ if (nr >= 0xffffffff || !access_ok(VERIFY_WRITE, events, nr * sizeof(struct io_event))) return -EFAULT; - if (timeout && - (get_user(t32.tv_sec, &timeout->tv_sec) || - __get_user(t32.tv_nsec, &timeout->tv_nsec))) + if (timeout && get_compat_timespec(&t, timeout)) return -EFAULT; oldfs = get_fs(); set_fs(KERNEL_DS); - ret = sys_io_getevents(ctx_id,min_nr,nr,events,timeout ? &t32 : NULL); + ret = sys_io_getevents(ctx_id,min_nr,nr,events,timeout ? &t : NULL); set_fs(oldfs); - if (timeout && - (__put_user(t32.tv_sec, &timeout->tv_sec) || - __put_user(t32.tv_nsec, &timeout->tv_nsec))) + if (timeout && put_compat_timespec(&t, timeout)) return -EFAULT; return ret; } diff -Nru a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile --- a/arch/x86_64/kernel/Makefile Fri Feb 14 00:27:29 2003 +++ b/arch/x86_64/kernel/Makefile Fri Feb 14 00:27:29 2003 @@ -17,7 +17,7 @@ obj-$(CONFIG_X86_IO_APIC) += io_apic.o mpparse.o obj-$(CONFIG_SOFTWARE_SUSPEND) += suspend.o suspend_asm.o obj-$(CONFIG_ACPI) += acpi.o -#obj-$(CONFIG_ACPI_SLEEP) += acpi_wakeup.o +obj-$(CONFIG_ACPI_SLEEP) += wakeup.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o obj-$(CONFIG_GART_IOMMU) += pci-gart.o aperture.o obj-$(CONFIG_DUMMY_IOMMU) += pci-nommu.o diff -Nru a/arch/x86_64/kernel/acpi.c b/arch/x86_64/kernel/acpi.c --- a/arch/x86_64/kernel/acpi.c Fri Feb 14 00:27:27 2003 +++ b/arch/x86_64/kernel/acpi.c Fri Feb 14 00:27:27 2003 @@ -44,6 +44,9 @@ #include #include #include +#include +#include +#include extern int acpi_disabled; @@ -70,7 +73,6 @@ if (phys_addr < (end_pfn_map << PAGE_SHIFT)) return __va(phys_addr); - printk("acpi mapping beyond end_pfn: %lx > %lx\n", phys_addr, end_pfn< -#endif +extern void acpi_prepare_wakeup(void); +extern unsigned char acpi_wakeup[], acpi_wakeup_end[], s3_prot16[]; /* address in low memory of the wakeup routine. */ -unsigned long acpi_wakeup_address = 0; - -/* new page directory that we will be using */ -static pmd_t *pmd; - -/* saved page directory */ -static pmd_t saved_pmd; - -/* page which we'll use for the new page directory */ -static pte_t *ptep; - -extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long)); - -/* - * acpi_create_identity_pmd - * - * Create a new, identity mapped pmd. - * - * Do this by creating new page directory, and marking all the pages as R/W - * Then set it as the new Page Middle Directory. - * And, of course, flush the TLB so it takes effect. - * - * We save the address of the old one, for later restoration. - */ -static void acpi_create_identity_pmd (void) -{ - pgd_t *pgd; - int i; - - ptep = (pte_t*)__get_free_page(GFP_KERNEL); - - /* fill page with low mapping */ - for (i = 0; i < PTRS_PER_PTE; i++) - set_pte(ptep + i, mk_pte_phys(i << PAGE_SHIFT, PAGE_SHARED)); - - pgd = pgd_offset(current->active_mm, 0); - pmd = pmd_alloc(current->mm,pgd, 0); - - /* save the old pmd */ - saved_pmd = *pmd; - - /* set the new one */ - set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(ptep))); - - /* flush the TLB */ - local_flush_tlb(); -} - -/* - * acpi_restore_pmd - * - * Restore the old pmd saved by acpi_create_identity_pmd and - * free the page that said function alloc'd - */ -static void acpi_restore_pmd (void) -{ - set_pmd(pmd, saved_pmd); - local_flush_tlb(); - free_page((unsigned long)ptep); -} +unsigned long acpi_wakeup_address; /** * acpi_save_state_mem - save kernel state - * - * Create an identity mapped page table and copy the wakeup routine to - * low memory. */ int acpi_save_state_mem (void) { - acpi_create_identity_pmd(); - acpi_copy_wakeup_routine(acpi_wakeup_address); + if (!acpi_wakeup_address) + return -1; + memcpy((void*)acpi_wakeup_address, acpi_wakeup, acpi_wakeup_end - acpi_wakeup); return 0; } /** * acpi_save_state_disk - save kernel state to disk * + * Assume preemption/interrupts are already turned off and that we're running + * on the BP (note this doesn't imply SMP is handled correctly) */ int acpi_save_state_disk (void) { + unsigned long pbase = read_cr3() & PAGE_MASK; + if (pbase >= 0xffffffffUL) { + printk(KERN_ERR "ACPI: High page table. Suspend disabled.\n"); return 1; + } + set_seg_base(smp_processor_id(), GDT_ENTRY_KERNELCS16, s3_prot16); + swap_low_mappings(); + acpi_prepare_wakeup(); + return 0; } /* @@ -537,13 +484,13 @@ */ void acpi_restore_state_mem (void) { - acpi_restore_pmd(); + swap_low_mappings(); } /** * acpi_reserve_bootmem - do _very_ early ACPI initialisation * - * We allocate a page in low memory for the wakeup + * We allocate a page in 1MB low memory for the real-mode wakeup * routine for when we come back from a sleep state. The * runtime allocator allows specification of <16M pages, but not * <1M pages. @@ -551,7 +498,10 @@ void __init acpi_reserve_bootmem(void) { acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE); - printk(KERN_DEBUG "ACPI: have wakeup address 0x%8.8lx\n", acpi_wakeup_address); + if (!acpi_wakeup_address) { + printk(KERN_ERR "ACPI: Cannot allocate lowmem. S3 disabled.\n"); + return; + } } #endif /*CONFIG_ACPI_SLEEP*/ diff -Nru a/arch/x86_64/kernel/aperture.c b/arch/x86_64/kernel/aperture.c --- a/arch/x86_64/kernel/aperture.c Fri Feb 14 00:27:29 2003 +++ b/arch/x86_64/kernel/aperture.c Fri Feb 14 00:27:29 2003 @@ -57,7 +57,7 @@ printk("Cannot allocate aperture memory hole (%p,%uK)\n", p, aper_size>>10); if (p) - free_bootmem((unsigned long)p, aper_size); + free_bootmem_node(nd0, (unsigned long)p, aper_size); return 0; } printk("Mapping aperture over %d KB of RAM @ %lx\n", diff -Nru a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c --- a/arch/x86_64/kernel/apic.c Fri Feb 14 00:27:27 2003 +++ b/arch/x86_64/kernel/apic.c Fri Feb 14 00:27:27 2003 @@ -1026,7 +1026,7 @@ irq_exit(); } -int disable_apic __initdata; +int disable_apic; /* * This initializes the IO-APIC and APIC hardware if this is @@ -1038,8 +1038,10 @@ printk(KERN_INFO "Apic disabled\n"); return -1; } - if (!smp_found_config && !cpu_has_apic) + if (!smp_found_config && !cpu_has_apic) { + disable_apic = 1; return -1; + } /* * Complain if the BIOS pretends there is one. @@ -1047,6 +1049,7 @@ if (!cpu_has_apic && APIC_INTEGRATED(apic_version[boot_cpu_id])) { printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n", boot_cpu_id); + disable_apic = 1; return -1; } diff -Nru a/arch/x86_64/kernel/bluesmoke.c b/arch/x86_64/kernel/bluesmoke.c --- a/arch/x86_64/kernel/bluesmoke.c Fri Feb 14 00:27:30 2003 +++ b/arch/x86_64/kernel/bluesmoke.c Fri Feb 14 00:27:30 2003 @@ -1,5 +1,9 @@ /* * arch/x86_64/kernel/bluesmoke.c - x86-64 Machine Check Exception Reporting + * + +RED-PEN: need to add power management to restore after S3 wakeup. + */ #include diff -Nru a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c --- a/arch/x86_64/kernel/e820.c Fri Feb 14 00:27:27 2003 +++ b/arch/x86_64/kernel/e820.c Fri Feb 14 00:27:27 2003 @@ -19,13 +19,17 @@ #include #include -extern unsigned long table_start, table_end; extern char _end[]; /* + * PFN of last memory page. + */ +unsigned long end_pfn; + +/* * end_pfn only includes RAM, while end_pfn_map includes all e820 entries. * The direct mapping extends to end_pfn_map, so that we can directly access - * ACPI and other tables without having to play with fixmaps. + * apertures, ACPI and other tables without having to play with fixmaps. */ unsigned long end_pfn_map; @@ -42,18 +46,16 @@ unsigned long addr = *addrp, last = addr + size; /* various gunk below that needed for SMP startup */ - if (addr < 7*PAGE_SIZE) { - *addrp = 7*PAGE_SIZE; + if (addr < 0x8000) { + *addrp = 0x8000; return 1; } -#if 0 /* direct mapping tables of the kernel */ if (last >= table_start< end_pfn_map) end_pfn = end_pfn_map; + + return end_pfn; } /* diff -Nru a/arch/x86_64/kernel/early_printk.c b/arch/x86_64/kernel/early_printk.c --- a/arch/x86_64/kernel/early_printk.c Fri Feb 14 00:27:29 2003 +++ b/arch/x86_64/kernel/early_printk.c Fri Feb 14 00:27:29 2003 @@ -3,6 +3,7 @@ #include #include #include +#include /* Simple VGA output */ @@ -104,9 +105,9 @@ s = strsep(&opt, ","); if (s != NULL) { unsigned port; - if (!strncmp(s,"0x",2)) + if (!strncmp(s,"0x",2)) { early_serial_base = simple_strtoul(s, &e, 16); - else { + } else { static int bases[] = { 0x3f8, 0x2f8 }; if (!strncmp(s,"ttyS",4)) s+=4; diff -Nru a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S --- a/arch/x86_64/kernel/entry.S Fri Feb 14 00:27:27 2003 +++ b/arch/x86_64/kernel/entry.S Fri Feb 14 00:27:27 2003 @@ -512,8 +512,7 @@ * Exception entry point. This expects an error code/orig_rax on the stack * and the exception handler in %rax. */ - ALIGN -error_entry: +ENTRY(error_entry) /* rdi slot contains rax, oldrax contains error code */ pushq %rsi movq 8(%rsp),%rsi /* load rax */ @@ -532,10 +531,7 @@ xorl %ebx,%ebx swapgs error_sti: - bt $9,EFLAGS(%rsp) - jnc 1f - sti -1: movq %rdi,RDI(%rsp) + movq %rdi,RDI(%rsp) movq %rsp,%rdi movq ORIG_RAX(%rsp),%rsi /* get error code */ movq $-1,ORIG_RAX(%rsp) @@ -573,7 +569,8 @@ swapgs gs_change: movl %edi,%gs -2: swapgs +2: sfence /* workaround */ + swapgs popf ret diff -Nru a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S --- a/arch/x86_64/kernel/head.S Fri Feb 14 00:27:29 2003 +++ b/arch/x86_64/kernel/head.S Fri Feb 14 00:27:29 2003 @@ -72,8 +72,7 @@ /* Setup EFER (Extended Feature Enable Register) */ movl $MSR_EFER, %ecx rdmsr - /* Fool rdmsr and reset %eax to avoid dependences */ - xorl %eax, %eax + /* Enable Long Mode */ btsl $_EFER_LME, %eax /* Enable System Call */ @@ -112,7 +111,6 @@ jnz second /* Load new GDT with the 64bit segment using 32bit descriptor */ - /* to avoid 32bit relocations we use fixed adresses here */ movl $(pGDT32 - __START_KERNEL_map), %eax lgdt (%eax) @@ -349,17 +347,14 @@ .quad 0x00cffe000000ffff /* __USER32_CS */ .quad 0x00cff2000000ffff /* __USER_DS, __USER32_DS */ .quad 0x00affa000000ffff /* __USER_CS */ - .word 0xFFFF # 4Gb - (0x100000*0x1000 = 4Gb) - .word 0 # base address = 0 - .word 0x9A00 # code read/exec - .word 0x00CF # granularity = 4096, 386 - # (+5th nibble of limit) - /* __KERNEL32_CS */ + .quad 0x00cf9a000000ffff /* __KERNEL32_CS */ .quad 0,0 /* TSS */ .quad 0 /* LDT */ .quad 0,0,0 /* three TLS descriptors */ - .quad 0x00cff2000000ffff /* dummy descriptor for long base */ - .quad 0 /* pad to cache line boundary */ + .quad 0 /* unused now */ + .quad 0x00009a000000ffff /* __KERNEL16_CS - 16bit PM for S3 wakeup. */ + /* base must be patched for real base address. */ + /* This should be a multiple of the cache line size */ gdt_end: .globl gdt_end diff -Nru a/arch/x86_64/kernel/head64.c b/arch/x86_64/kernel/head64.c --- a/arch/x86_64/kernel/head64.c Fri Feb 14 00:27:28 2003 +++ b/arch/x86_64/kernel/head64.c Fri Feb 14 00:27:28 2003 @@ -13,6 +13,8 @@ #include #include +#include +#include /* Don't add a printk in there. printk relies on the PDA which is not initialized yet. */ @@ -70,9 +72,6 @@ boot_cpu_data.x86_mask = eax & 0xf; } -extern void start_kernel(void), pda_init(int), setup_early_printk(char *); -extern int disable_apic; - void __init x86_64_start_kernel(char * real_mode_data) { char *s; @@ -83,6 +82,11 @@ s = strstr(saved_command_line, "earlyprintk="); if (s != NULL) setup_early_printk(s+12); +#ifdef CONFIG_DISCONTIGMEM + s = strstr(saved_command_line, "numa="); + if (s != NULL) + numa_setup(s+5); +#endif #ifdef CONFIG_X86_IO_APIC if (strstr(saved_command_line, "disableapic")) disable_apic = 1; diff -Nru a/arch/x86_64/kernel/init_task.c b/arch/x86_64/kernel/init_task.c --- a/arch/x86_64/kernel/init_task.c Fri Feb 14 00:27:28 2003 +++ b/arch/x86_64/kernel/init_task.c Fri Feb 14 00:27:28 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/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c --- a/arch/x86_64/kernel/irq.c Fri Feb 14 00:27:28 2003 +++ b/arch/x86_64/kernel/irq.c Fri Feb 14 00:27:28 2003 @@ -137,7 +137,8 @@ struct irqaction * action; seq_printf(p, " "); - for_each_cpu(j) + for (j=0; jnext) { + for (prevp = &mod_vmlist ; (map = *prevp) ; prevp = &map->next) { if ((unsigned long)map->addr == addr) { *prevp = map->next; write_unlock(&vmlist_lock); @@ -81,7 +86,7 @@ write_lock(&vmlist_lock); addr = (void *) MODULES_VADDR; - for (p = &vmlist; (tmp = *p); p = &tmp->next) { + for (p = &mod_vmlist; (tmp = *p); p = &tmp->next) { void *next; DEBUGP("vmlist %p %lu addr %p\n", tmp->addr, tmp->size, addr); if (size + (unsigned long) addr + PAGE_SIZE < (unsigned long) tmp->addr) diff -Nru a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c --- a/arch/x86_64/kernel/mpparse.c Fri Feb 14 00:27:27 2003 +++ b/arch/x86_64/kernel/mpparse.c Fri Feb 14 00:27:27 2003 @@ -29,6 +29,7 @@ #include #include #include +#include /* Have we found an MP table */ int smp_found_config; @@ -83,7 +84,6 @@ * Intel MP BIOS table parsing routines: */ -#ifndef CONFIG_X86_VISWS_APIC /* * Checksum an MP configuration block. */ @@ -582,9 +582,9 @@ smp_found_config = 1; printk("found SMP MP-table at %08lx\n", virt_to_phys(mpf)); - reserve_bootmem(virt_to_phys(mpf), PAGE_SIZE); + reserve_bootmem_generic(virt_to_phys(mpf), PAGE_SIZE); if (mpf->mpf_physptr) - reserve_bootmem(mpf->mpf_physptr, PAGE_SIZE); + reserve_bootmem_generic(mpf->mpf_physptr, PAGE_SIZE); mpf_found = mpf; return 1; } @@ -632,37 +632,13 @@ printk(KERN_WARNING "WARNING: MP table in the EBDA can be UNSAFE, contact linux-smp@vger.kernel.org if you experience SMP problems!\n"); } -#else - -/* - * The Visual Workstation is Intel MP compliant in the hardware - * sense, but it doesnt have a BIOS(-configuration table). - * No problem for Linux. - */ -void __init find_visws_smp(void) -{ - smp_found_config = 1; - - phys_cpu_present_map |= 2; /* or in id 1 */ - apic_version[1] |= 0x10; /* integrated APIC */ - apic_version[0] |= 0x10; - - mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; -} - -#endif - /* * - Intel MP Configuration Table - * - or SGI Visual Workstation configuration */ void __init find_smp_config (void) { #ifdef CONFIG_X86_LOCAL_APIC find_intel_smp(); -#endif -#ifdef CONFIG_VISWS - find_visws_smp(); #endif } diff -Nru a/arch/x86_64/kernel/msr.c b/arch/x86_64/kernel/msr.c --- a/arch/x86_64/kernel/msr.c Fri Feb 14 00:27:27 2003 +++ b/arch/x86_64/kernel/msr.c Fri Feb 14 00:27:27 2003 @@ -22,6 +22,9 @@ * * This driver uses /dev/cpu/%d/msr where %d is the minor number, and on * an SMP box will direct the access to CPU %d. + +RED-PEN: need to get power management for S3 restore + */ #include diff -Nru a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c --- a/arch/x86_64/kernel/nmi.c Fri Feb 14 00:27:28 2003 +++ b/arch/x86_64/kernel/nmi.c Fri Feb 14 00:27:28 2003 @@ -24,6 +24,7 @@ #include #include #include +#include extern void default_do_nmi(struct pt_regs *); @@ -71,13 +72,14 @@ printk(KERN_INFO "testing NMI watchdog ... "); - for_each_cpu(cpu) { + for (cpu = 0; cpu < NR_CPUS; cpu++) counts[cpu] = cpu_pda[cpu].__nmi_count; - } local_irq_enable(); mdelay((10*1000)/nmi_hz); // wait 10 ticks - for_each_cpu(cpu) { + for (cpu = 0; cpu < NR_CPUS; cpu++) { + if (!cpu_online(cpu)) + continue; if (cpu_pda[cpu].__nmi_count - counts[cpu] <= 5) { printk("CPU#%d: NMI appears to be stuck (%d)!\n", cpu, @@ -173,7 +175,7 @@ * Original code written by Keith Owens. */ -static void __pminit setup_k7_watchdog(void) +static void setup_k7_watchdog(void) { int i; unsigned int evntsel; @@ -183,8 +185,10 @@ nmi_perfctr_msr = MSR_K7_PERFCTR0; for(i = 0; i < 4; ++i) { - wrmsr(MSR_K7_EVNTSEL0+i, 0, 0); - wrmsr(MSR_K7_PERFCTR0+i, 0, 0); + /* Simulator may not support it */ + if (checking_wrmsrl(MSR_K7_EVNTSEL0+i, 0UL)) + return; + wrmsrl(MSR_K7_PERFCTR0+i, 0UL); } evntsel = K7_EVNTSEL_INT @@ -200,15 +204,11 @@ wrmsr(MSR_K7_EVNTSEL0, evntsel, 0); } -void __pminit setup_apic_nmi_watchdog (void) +void setup_apic_nmi_watchdog (void) { switch (boot_cpu_data.x86_vendor) { case X86_VENDOR_AMD: if (boot_cpu_data.x86 < 6) - return; - /* Simics masquerades as AMD, but does not support - performance counters */ - if (strstr(boot_cpu_data.x86_model_id, "Screwdriver")) return; setup_k7_watchdog(); break; diff -Nru a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c --- a/arch/x86_64/kernel/process.c Fri Feb 14 00:27:26 2003 +++ b/arch/x86_64/kernel/process.c Fri Feb 14 00:27:26 2003 @@ -366,12 +366,15 @@ also reload when it has changed. when prev process used 64bit base always reload to avoid an information leak. */ - if (unlikely((fsindex | next->fsindex) || prev->fs)) + if (unlikely(fsindex | next->fsindex | prev->fs)) { loadsegment(fs, next->fsindex); - /* check if the user changed the selector - if yes clear 64bit base. */ - if (unlikely(fsindex != prev->fsindex)) + /* check if the user used a selector != 0 + * if yes clear 64bit base, since overloaded base + * is always mapped to the Null selector + */ + if (fsindex) prev->fs = 0; + } /* when next process has a 64bit base use it */ if (next->fs) wrmsrl(MSR_FS_BASE, next->fs); @@ -380,10 +383,11 @@ { unsigned gsindex; asm volatile("movl %%gs,%0" : "=g" (gsindex)); - if (unlikely((gsindex | next->gsindex) || prev->gs)) + if (unlikely(gsindex | next->gsindex | prev->gs)) { load_gs_index(next->gsindex); - if (unlikely(gsindex != prev->gsindex)) + if (gsindex) prev->gs = 0; + } if (next->gs) wrmsrl(MSR_KERNEL_GS_BASE, next->gs); prev->gsindex = gsindex; @@ -537,29 +541,23 @@ switch (code) { case ARCH_SET_GS: -#if 1 - /* For now. We still have one unsolved bug in long gs base context - switch handling. */ - return -EINVAL; -#else if (addr >= TASK_SIZE) return -EPERM; get_cpu(); - load_gs_index(__USER_LONGBASE); - current->thread.gsindex = __USER_LONGBASE; + load_gs_index(0); + current->thread.gsindex = 0; current->thread.gs = addr; ret = checking_wrmsrl(MSR_KERNEL_GS_BASE, addr); put_cpu(); break; -#endif case ARCH_SET_FS: /* Not strictly needed for fs, but do it for symmetry with gs */ if (addr >= TASK_SIZE) return -EPERM; get_cpu(); - asm volatile("movl %0,%%fs" :: "r" (__USER_LONGBASE)); - current->thread.fsindex = __USER_LONGBASE; + asm volatile("movl %0,%%fs" :: "r" (0)); + current->thread.fsindex = 0; current->thread.fs = addr; ret = checking_wrmsrl(MSR_FS_BASE, addr); put_cpu(); diff -Nru a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c --- a/arch/x86_64/kernel/setup.c Fri Feb 14 00:27:26 2003 +++ b/arch/x86_64/kernel/setup.c Fri Feb 14 00:27:26 2003 @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -53,6 +54,8 @@ #include #include +#define Dprintk(x...) printk(x) + /* * Machine setup.. */ @@ -236,6 +239,8 @@ { int i; + Dprintk("setup_arch\n"); + ROOT_DEV = ORIG_ROOT_DEV; drive_info = DRIVE_INFO; screen_info = SCREEN_INFO; @@ -263,34 +268,34 @@ parse_cmdline_early(cmdline_p); -#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) -#define PFN_DOWN(x) ((x) >> PAGE_SHIFT) -#define PFN_PHYS(x) ((x) << PAGE_SHIFT) - -#define MAXMEM (120UL * 1024 * 1024 * 1024 * 1024) /* 120TB */ -#define MAXMEM_PFN PFN_DOWN(MAXMEM) -#define MAX_NONPAE_PFN (1 << 20) - /* * partially used pages are not usable - thus * we are rounding upwards: */ - start_pfn = PFN_UP(__pa_symbol(&_end)); - - e820_end_of_ram(); + end_pfn = e820_end_of_ram(); init_memory_mapping(); +#ifdef CONFIG_DISCONTIGMEM + numa_initmem_init(0, end_pfn); +#else contig_initmem_init(); +#endif + + /* Reserve direct mapping */ + reserve_bootmem_generic(table_start << PAGE_SHIFT, + (table_end - table_start) << PAGE_SHIFT); /* reserve kernel */ - reserve_bootmem(HIGH_MEMORY, PFN_PHYS(start_pfn) - HIGH_MEMORY); + unsigned long kernel_end; + kernel_end = round_up(__pa_symbol(&_end),PAGE_SIZE); + reserve_bootmem_generic(HIGH_MEMORY, kernel_end - HIGH_MEMORY); /* * reserve physical page 0 - it's a special BIOS page on many boxes, * enabling clean reboots, SMP operation, laptop functions. */ - reserve_bootmem(0, PAGE_SIZE); + reserve_bootmem_generic(0, PAGE_SIZE); #ifdef CONFIG_SMP /* @@ -298,8 +303,12 @@ * FIXME: Don't need the extra page at 4K, but need to fix * trampoline before removing it. (see the GDT stuff) */ - reserve_bootmem(PAGE_SIZE, PAGE_SIZE); + reserve_bootmem_generic(PAGE_SIZE, PAGE_SIZE); + + /* Reserve SMP trampoline */ + reserve_bootmem_generic(SMP_TRAMPOLINE_BASE, PAGE_SIZE); #endif + #ifdef CONFIG_ACPI_SLEEP /* * Reserve low memory region for sleep support. @@ -315,7 +324,7 @@ #ifdef CONFIG_BLK_DEV_INITRD if (LOADER_TYPE && INITRD_START) { if (INITRD_START + INITRD_SIZE <= (end_pfn << PAGE_SHIFT)) { - reserve_bootmem(INITRD_START, INITRD_SIZE); + reserve_bootmem_generic(INITRD_START, INITRD_SIZE); initrd_start = INITRD_START ? INITRD_START + PAGE_OFFSET : 0; initrd_end = initrd_start+INITRD_SIZE; @@ -330,14 +339,6 @@ } #endif - /* - * NOTE: before this point _nobody_ is allowed to allocate - * any memory using the bootmem allocator. - */ - -#ifdef CONFIG_SMP - smp_alloc_memory(); /* AP processor realmode stacks in low memory*/ -#endif paging_init(); #ifdef CONFIG_ACPI_BOOT /* @@ -347,7 +348,7 @@ * of MADT). */ if (!acpi_disabled) - acpi_boot_init(*cmdline_p); + acpi_boot_init(); #endif #ifdef CONFIG_X86_LOCAL_APIC /* diff -Nru a/arch/x86_64/kernel/setup64.c b/arch/x86_64/kernel/setup64.c --- a/arch/x86_64/kernel/setup64.c Fri Feb 14 00:27:27 2003 +++ b/arch/x86_64/kernel/setup64.c Fri Feb 14 00:27:27 2003 @@ -1,7 +1,7 @@ /* * X86-64 specific CPU setup. * Copyright (C) 1995 Linus Torvalds - * Copyright 2001, 2002 SuSE Labs / Andi Kleen. + * Copyright 2001, 2002, 2003 SuSE Labs / Andi Kleen. * See setup.c for older changelog. * $Id: setup64.c,v 1.12 2002/03/21 10:09:17 ak Exp $ */ @@ -90,6 +90,17 @@ pml4_t *level4; struct x8664_pda *pda = &cpu_pda[cpu]; + /* Setup up data that may be needed in __get_free_pages early */ + asm volatile("movl %0,%%fs ; movl %0,%%gs" :: "r" (0)); + wrmsrl(MSR_GS_BASE, cpu_pda + cpu); + + pda->me = pda; + pda->cpunumber = cpu; + pda->irqcount = -1; + pda->cpudata_offset = 0; + pda->kernelstack = + (unsigned long)current_thread_info() - PDA_STACKOFFSET + THREAD_SIZE; + if (cpu == 0) { /* others are initialized in smpboot.c */ pda->pcurrent = &init_task; @@ -112,18 +123,8 @@ asm volatile("movq %0,%%cr3" :: "r" (__pa(level4))); pda->irqstackptr += IRQSTACKSIZE-64; - pda->cpunumber = cpu; - pda->irqcount = -1; - pda->kernelstack = - (unsigned long)stack_thread_info() - PDA_STACKOFFSET + THREAD_SIZE; - pda->me = pda; - pda->cpudata_offset = 0; - pda->active_mm = &init_mm; pda->mmu_state = 0; - - asm volatile("movl %0,%%fs ; movl %0,%%gs" :: "r" (0)); - wrmsrl(MSR_GS_BASE, cpu_pda + cpu); } #define EXCEPTION_STK_ORDER 0 /* >= N_EXCEPTION_STACKS*EXCEPTION_STKSZ */ @@ -150,10 +151,10 @@ /* CPU 0 is initialised in head64.c */ if (cpu != 0) { + pda_init(cpu); estacks = (char *)__get_free_pages(GFP_ATOMIC, 0); if (!estacks) panic("Can't allocate exception stacks for CPU %d\n",cpu); - pda_init(cpu); } else estacks = boot_exception_stacks; diff -Nru a/arch/x86_64/kernel/signal.c b/arch/x86_64/kernel/signal.c --- a/arch/x86_64/kernel/signal.c Fri Feb 14 00:27:29 2003 +++ b/arch/x86_64/kernel/signal.c Fri Feb 14 00:27:29 2003 @@ -353,7 +353,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]; #if DEBUG_SIG printk("handle_signal pid:%d sig:%lu rip:%lx rsp:%lx regs=%p\n", current->pid, sig, @@ -437,7 +437,7 @@ if (!oldset) oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, regs); + signr = get_signal_to_deliver(&info, regs, NULL); if (signr > 0) { /* Reenable any watchpoints before delivering the * signal to user space. The processor register will diff -Nru a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c --- a/arch/x86_64/kernel/smp.c Fri Feb 14 00:27:27 2003 +++ b/arch/x86_64/kernel/smp.c Fri Feb 14 00:27:27 2003 @@ -3,6 +3,7 @@ * * (c) 1995 Alan Cox, Building #3 * (c) 1998-99, 2000 Ingo Molnar + * (c) 2002,2003 Andi Kleen, SuSE Labs. * * This code is released under the GNU General Public License version 2 or * later. @@ -491,3 +492,24 @@ } } + +/* Slow. Should be only used for debugging. */ +int slow_smp_processor_id(void) +{ + int stack_location; + unsigned long sp = (unsigned long)&stack_location; + int cpu; + unsigned long mask; + + for_each_cpu(cpu, mask) { + if (sp >= (u64)cpu_pda[cpu].irqstackptr - IRQSTACKSIZE && + sp <= (u64)cpu_pda[cpu].irqstackptr) + return cpu; + + unsigned long estack = init_tss[cpu].ist[0] - EXCEPTION_STKSZ; + if (sp >= estack && sp <= estack+(1<<(PAGE_SHIFT+EXCEPTION_STK_ORDER))) + return cpu; + } + + return stack_smp_processor_id(); +} diff -Nru a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c --- a/arch/x86_64/kernel/smpboot.c Fri Feb 14 00:27:30 2003 +++ b/arch/x86_64/kernel/smpboot.c Fri Feb 14 00:27:30 2003 @@ -51,13 +51,10 @@ #include #include -/* Bitmask of currently online CPUs */ -unsigned long cpu_online_map; +extern int disable_apic; -/* which CPU (physical APIC ID) maps to which logical CPU number */ -volatile int x86_apicid_to_cpu[NR_CPUS]; -/* which logical CPU number maps to which CPU (physical APIC ID) */ -volatile int x86_cpu_to_apicid[NR_CPUS]; +/* Bitmask of currently online CPUs */ +unsigned long cpu_online_map = 1; static volatile unsigned long cpu_callin_map; volatile unsigned long cpu_callout_map; @@ -75,7 +72,6 @@ extern unsigned char trampoline_data []; extern unsigned char trampoline_end []; -static unsigned char *trampoline_base; /* * Currently trivial. Write the real->protected mode @@ -85,25 +81,11 @@ static unsigned long __init setup_trampoline(void) { + void *tramp = __va(SMP_TRAMPOLINE_BASE); extern volatile __u32 tramp_gdt_ptr; tramp_gdt_ptr = __pa_symbol(&cpu_gdt_table); - memcpy(trampoline_base, trampoline_data, trampoline_end - trampoline_data); - return virt_to_phys(trampoline_base); -} - -/* - * We are called very early to get the low memory for the - * SMP bootup trampoline page. - */ -void __init smp_alloc_memory(void) -{ - trampoline_base = (void *) alloc_bootmem_low_pages(PAGE_SIZE); - /* - * Has to be in very low memory so we can execute - * real-mode AP code. - */ - if (__pa(trampoline_base) >= 0x9F000) - BUG(); + memcpy(tramp, trampoline_data, trampoline_end - trampoline_data); + return virt_to_phys(tramp); } /* @@ -174,6 +156,7 @@ */ atomic_inc(&tsc_count_start); + sync_core(); rdtscll(tsc_values[smp_processor_id()]); /* * We clear the TSC in the last loop: @@ -245,6 +228,7 @@ atomic_inc(&tsc_count_start); while (atomic_read(&tsc_count_start) != num_booting_cpus()) mb(); + sync_core(); rdtscll(tsc_values[smp_processor_id()]); if (i == NR_LOOPS-1) write_tsc(0, 0); @@ -369,6 +353,9 @@ cpu_init(); smp_callin(); + /* otherwise gcc will move up the smp_processor_id before the cpu_init */ + barrier(); + Dprintk("cpu %d: waiting for commence\n", smp_processor_id()); while (!test_bit(smp_processor_id(), &smp_commenced_mask)) rep_nop(); @@ -620,8 +607,6 @@ */ init_idle(idle,cpu); - x86_cpu_to_apicid[cpu] = apicid; - x86_apicid_to_cpu[apicid] = cpu; idle->thread.rip = (unsigned long)start_secondary; // idle->thread.rsp = (unsigned long)idle->thread_info + THREAD_SIZE - 512; @@ -713,8 +698,6 @@ } } if (boot_error) { - x86_cpu_to_apicid[cpu] = -1; - x86_apicid_to_cpu[apicid] = -1; clear_bit(cpu, &cpu_callout_map); /* was set here (do_boot_cpu()) */ clear_bit(cpu, &cpu_initialized); /* was set by cpu_init() */ cpucount--; @@ -777,22 +760,12 @@ int apicid, cpu; /* - * Initialize the logical to physical CPU number mapping - */ - - for (apicid = 0; apicid < NR_CPUS; apicid++) { - x86_apicid_to_cpu[apicid] = -1; - } - - /* * Setup boot CPU information */ smp_store_cpu_info(0); /* Final full version of the data */ printk("CPU%d: ", 0); print_cpu_info(&cpu_data[0]); - x86_apicid_to_cpu[boot_cpu_id] = 0; - x86_cpu_to_apicid[0] = boot_cpu_id; current_thread_info()->cpu = 0; smp_tune_scheduling(); @@ -837,6 +810,7 @@ io_apic_irqs = 0; cpu_online_map = phys_cpu_present_map = 1; phys_cpu_present_map = 1; + disable_apic = 1; return; } @@ -851,6 +825,7 @@ io_apic_irqs = 0; cpu_online_map = phys_cpu_present_map = 1; phys_cpu_present_map = 1; + disable_apic = 1; return; } @@ -878,13 +853,6 @@ continue; do_boot_cpu(apicid); - - /* - * Make sure we unmap all failed CPUs - */ - if ((x86_apicid_to_cpu[apicid] == -1) && - (phys_cpu_present_map & (1 << apicid))) - printk("phys CPU #%d not responding - cannot use it.\n",apicid); } /* diff -Nru a/arch/x86_64/kernel/sys_x86_64.c b/arch/x86_64/kernel/sys_x86_64.c --- a/arch/x86_64/kernel/sys_x86_64.c Fri Feb 14 00:27:29 2003 +++ b/arch/x86_64/kernel/sys_x86_64.c Fri Feb 14 00:27:29 2003 @@ -55,7 +55,6 @@ if (!file) goto out; } - down_write(¤t->mm->mmap_sem); error = do_mmap_pgoff(file, addr, len, prot, flags, off >> PAGE_SHIFT); up_write(¤t->mm->mmap_sem); diff -Nru a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c --- a/arch/x86_64/kernel/time.c Fri Feb 14 00:27:29 2003 +++ b/arch/x86_64/kernel/time.c Fri Feb 14 00:27:29 2003 @@ -9,6 +9,7 @@ * Copyright (c) 1996 Ingo Molnar * Copyright (c) 1998 Andrea Arcangeli * Copyright (c) 2002 Vojtech Pavlik + * Copyright (c) 2003 Andi Kleen * */ @@ -25,9 +26,14 @@ #include #include #include +#ifdef CONFIG_X86_LOCAL_APIC +#include +#endif u64 jiffies_64; +extern int using_apic_timer; + spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; extern int using_apic_timer; @@ -56,12 +62,10 @@ * together by xtime_lock. */ -static spinlock_t time_offset_lock = SPIN_LOCK_UNLOCKED; -static unsigned long timeoffset = 0; - inline unsigned int do_gettimeoffset(void) { unsigned long t; + sync_core(); rdtscll(t); return (t - hpet.last_tsc) * (1000000L / HZ) / hpet.ticks + hpet.offset; } @@ -74,10 +78,9 @@ void do_gettimeofday(struct timeval *tv) { - unsigned long flags, t, seq; + unsigned long seq, t; unsigned int sec, usec; - spin_lock_irqsave(&time_offset_lock, flags); do { seq = read_seqbegin(&xtime_lock); @@ -85,11 +88,9 @@ usec = xtime.tv_nsec / 1000; t = (jiffies - wall_jiffies) * (1000000L / HZ) + do_gettimeoffset(); - if (t > timeoffset) timeoffset = t; - usec += timeoffset; + usec += t; } while (read_seqretry(&xtime_lock, seq)); - spin_unlock_irqrestore(&time_offset_lock, flags); tv->tv_sec = sec + usec / 1000000; tv->tv_usec = usec % 1000000; @@ -104,7 +105,6 @@ void do_settimeofday(struct timeval *tv) { write_seqlock_irq(&xtime_lock); - vxtime_lock(); tv->tv_usec -= do_gettimeoffset() + (jiffies - wall_jiffies) * tick_usec; @@ -116,7 +116,6 @@ xtime.tv_sec = tv->tv_sec; xtime.tv_nsec = (tv->tv_usec * 1000); - vxtime_unlock(); time_adjust = 0; /* stop active adjtime() */ time_status |= STA_UNSYNC; @@ -207,11 +206,11 @@ */ write_seqlock(&xtime_lock); - vxtime_lock(); { unsigned long t; + sync_core(); rdtscll(t); hpet.offset = (t - hpet.last_tsc) * (1000000L / HZ) / hpet.ticks + hpet.offset - 1000000L / HZ; if (hpet.offset >= 1000000L / HZ) @@ -219,7 +218,6 @@ 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; } /* @@ -255,7 +253,6 @@ rtc_update = xtime.tv_sec + 660; } - vxtime_unlock(); write_sequnlock(&xtime_lock); } @@ -348,8 +345,9 @@ outb((1193182 / (1000 / 50)) & 0xff, 0x42); outb((1193182 / (1000 / 50)) >> 8, 0x42); rdtscll(start); - + sync_core(); while ((inb(0x61) & 0x20) == 0); + sync_core(); rdtscll(end); @@ -382,12 +380,12 @@ pit_init(); printk(KERN_INFO "time.c: Using 1.1931816 MHz PIT timer.\n"); - setup_irq(0, &irq0); cpu_khz = pit_calibrate_tsc(); printk(KERN_INFO "time.c: Detected %d.%03d MHz processor.\n", cpu_khz / 1000, cpu_khz % 1000); hpet.ticks = cpu_khz * (1000 / HZ); rdtscll(hpet.last_tsc); + setup_irq(0, &irq0); } __setup("report_lost_ticks", time_setup); diff -Nru a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c --- a/arch/x86_64/kernel/traps.c Fri Feb 14 00:27:26 2003 +++ b/arch/x86_64/kernel/traps.c Fri Feb 14 00:27:26 2003 @@ -77,6 +77,12 @@ struct notifier_block *die_chain; +static inline void conditional_sti(struct pt_regs *regs) +{ + if (regs->eflags & X86_EFLAGS_IF) + local_irq_enable(); +} + static int kstack_depth_to_print = 10; #ifdef CONFIG_KALLSYMS @@ -128,8 +134,7 @@ { unsigned long addr; unsigned long *irqstack, *irqstack_end, *estack_end; - /* FIXME: should read the cpuid from the APIC; to still work with bogus %gs */ - const int cpu = smp_processor_id(); + const int cpu = safe_smp_processor_id(); int i; printk("\nCall Trace:"); @@ -210,7 +215,7 @@ { unsigned long *stack; int i; - const int cpu = smp_processor_id(); + const int cpu = safe_smp_processor_id(); unsigned long *irqstack_end = (unsigned long *) (cpu_pda[cpu].irqstackptr); unsigned long *irqstack = (unsigned long *) (cpu_pda[cpu].irqstackptr - IRQSTACKSIZE); @@ -252,12 +257,7 @@ int i; int in_kernel = (regs->cs & 3) == 0; unsigned long rsp; -#ifdef CONFIG_SMP - /* For SMP should get the APIC id here, just to protect against corrupted GS */ - const int cpu = smp_processor_id(); -#else - const int cpu = 0; -#endif + const int cpu = safe_smp_processor_id(); struct task_struct *cur = cpu_pda[cpu].pcurrent; rsp = regs->rsp; @@ -330,7 +330,7 @@ bust_spinlocks(1); handle_BUG(regs); printk("%s: %04lx\n", str, err & 0xffff); - cpu = smp_processor_id(); + cpu = safe_smp_processor_id(); /* racy, but better than risking deadlock. */ local_irq_disable(); if (!spin_trylock(&die_lock)) { @@ -365,10 +365,12 @@ static void do_trap(int trapnr, int signr, char *str, struct pt_regs * regs, long error_code, siginfo_t *info) { + conditional_sti(regs); + #ifdef CONFIG_CHECKING { unsigned long gs; - struct x8664_pda *pda = cpu_pda + stack_smp_processor_id(); + struct x8664_pda *pda = cpu_pda + safe_smp_processor_id(); rdmsrl(MSR_GS_BASE, gs); if (gs != (unsigned long)pda) { wrmsrl(MSR_GS_BASE, pda); @@ -454,10 +456,12 @@ asmlinkage void do_general_protection(struct pt_regs * regs, long error_code) { + conditional_sti(regs); + #ifdef CONFIG_CHECKING { unsigned long gs; - struct x8664_pda *pda = cpu_pda + hard_smp_processor_id(); + struct x8664_pda *pda = cpu_pda + safe_smp_processor_id(); rdmsrl(MSR_GS_BASE, gs); if (gs != (unsigned long)pda) { wrmsrl(MSR_GS_BASE, pda); @@ -565,7 +569,7 @@ #ifdef CONFIG_CHECKING { unsigned long gs; - struct x8664_pda *pda = cpu_pda + stack_smp_processor_id(); + struct x8664_pda *pda = cpu_pda + safe_smp_processor_id(); rdmsrl(MSR_GS_BASE, gs); if (gs != (unsigned long)pda) { wrmsrl(MSR_GS_BASE, pda); @@ -576,6 +580,8 @@ asm("movq %%db6,%0" : "=r" (condition)); + conditional_sti(regs); + if (notify_die(DIE_DEBUG, "debug", regs, error_code) == NOTIFY_BAD) return; @@ -636,7 +642,6 @@ struct task_struct * task; siginfo_t info; unsigned short cwd, swd; - /* * Save the info for the exception handler and clear the error. */ @@ -688,6 +693,7 @@ asmlinkage void do_coprocessor_error(struct pt_regs * regs, long error_code) { + conditional_sti(regs); math_error((void *)regs->rip); } @@ -747,6 +753,7 @@ asmlinkage void do_simd_coprocessor_error(struct pt_regs * regs, long error_code) { + conditional_sti(regs); simd_math_error((void *)regs->rip); } diff -Nru a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c --- a/arch/x86_64/kernel/vsyscall.c Fri Feb 14 00:27:29 2003 +++ b/arch/x86_64/kernel/vsyscall.c Fri Feb 14 00:27:29 2003 @@ -2,6 +2,7 @@ * linux/arch/x86_64/kernel/vsyscall.c * * Copyright (C) 2001 Andrea Arcangeli SuSE + * Copyright 2003 Andi Kleen, SuSE Labs. * * Thanks to hpa@transmeta.com for some useful hint. * Special thanks to Ingo Molnar for his early experience with @@ -12,7 +13,8 @@ * vsyscalls. One vsyscall can reserve more than 1 slot to avoid * jumping out of line if necessary. * - * $Id: vsyscall.c,v 1.9 2002/03/21 13:42:58 ak Exp $ + * Note: the concept clashes with user mode linux. If you use UML just + * set the kernel.vsyscall sysctl to 0. */ /* @@ -29,6 +31,9 @@ * broken programs will segfault and there's no security risk until we choose to * fix it. * + * Add HPET support (port from 2.4). Still needed? + * Nop out vsyscall syscall to avoid anchor for buffer overflows when sysctl off. + * * These are not urgent things that we need to address only before shipping the first * production binary kernels. */ @@ -37,6 +42,7 @@ #include #include #include +#include #include #include @@ -44,19 +50,13 @@ #include #include - #define __vsyscall(nr) __attribute__ ((unused,__section__(".vsyscall_" #nr))) -#define NO_VSYSCALL 1 +int __sysctl_vsyscall __section_sysctl_vsyscall = 1; +seqlock_t __xtime_lock __section_xtime_lock = SEQLOCK_UNLOCKED; -#ifdef NO_VSYSCALL #include -static int errno __section_vxtime_sequence; - -static inline _syscall2(int,gettimeofday,struct timeval *,tv,struct timezone *,tz) - -#else static inline void timeval_normalize(struct timeval * tv) { time_t __sec; @@ -69,63 +69,60 @@ } } -long __vxtime_sequence[2] __section_vxtime_sequence; - - static inline void do_vgettimeofday(struct timeval * tv) { long sequence, t; unsigned long sec, usec; do { - sequence = __vxtime_sequence[1]; - rmb(); + sequence = read_seqbegin(&__xtime_lock); + sync_core(); rdtscll(t); sec = __xtime.tv_sec; - usec = __xtime.tv_usec + + usec = (__xtime.tv_nsec * 1000) + (__jiffies - __wall_jiffies) * (1000000 / HZ) + (t - __hpet.last_tsc) * (1000000 / HZ) / __hpet.ticks + __hpet.offset; - rmb(); - } while (sequence != __vxtime_sequence[0]); + } while (read_seqretry(&__xtime_lock, sequence)); tv->tv_sec = sec + usec / 1000000; tv->tv_usec = usec % 1000000; } +/* RED-PEN may want to readd seq locking, but then the variable should be write-once. */ static inline void do_get_tz(struct timezone * tz) { - long sequence; - - do { - sequence = __vxtime_sequence[1]; - rmb(); - *tz = __sys_tz; +} - rmb(); - } while (sequence != __vxtime_sequence[0]); +static inline int gettimeofday(struct timeval *tv, struct timezone *tz) +{ + int ret; + asm volatile("syscall" + : "=a" (ret) + : "0" (__NR_gettimeofday),"D" (tv),"S" (tz) : __syscall_clobber ); + return ret; } -#endif static int __vsyscall(0) vgettimeofday(struct timeval * tv, struct timezone * tz) { -#ifdef NO_VSYSCALL + if (unlikely(!__sysctl_vsyscall)) return gettimeofday(tv,tz); -#else if (tv) do_vgettimeofday(tv); if (tz) do_get_tz(tz); return 0; -#endif } static time_t __vsyscall(1) vtime(time_t * t) { struct timeval tv; - vgettimeofday(&tv,NULL); + if (unlikely(!__sysctl_vsyscall)) + gettimeofday(&tv, NULL); + else + do_vgettimeofday(&tv); if (t) *t = tv.tv_sec; return tv.tv_sec; @@ -139,12 +136,13 @@ static long __vsyscall(3) venosys_1(void) { return -ENOSYS; + } static void __init map_vsyscall(void) { extern char __vsyscall_0; - unsigned long physaddr_page0 = (unsigned long) &__vsyscall_0 - __START_KERNEL_map; + unsigned long physaddr_page0 = __pa_symbol(&__vsyscall_0); __set_fixmap(VSYSCALL_FIRST_PAGE, physaddr_page0, PAGE_KERNEL_VSYSCALL); } diff -Nru a/arch/x86_64/kernel/wakeup.S b/arch/x86_64/kernel/wakeup.S --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/x86_64/kernel/wakeup.S Fri Feb 14 00:27:30 2003 @@ -0,0 +1,306 @@ +/* + * ACPI S3 entry/exit handling. + * + * Notes: + * Relies on kernel being loaded below 4GB. + * Needs restore_low_mappings called before. + * + * Copyright 2003 by Andi Kleen, SuSE Labs. + * + * Long mode entry losely based on example code in chapter 14 of the x86-64 system + * programmer's manual. + * + * Notebook: + + FIXME need to interface with suspend.c properly. do_magic. check i386. rename to suspend64.S + + Need to fix vgacon,mtrr,bluesmoke to do resume + + Interrupts should be off until the io-apic code has reinited the APIC. + Need support for that in the pm frame work or a special hack? + + SMP support is non existent. Need to somehow restart the other CPUs again. + If CPU hotplug was working it could be used. Save/Restore needs to run on the same CPU. + + Should check magic like i386 code + + suspend code copies something. check what it is. + */ + +#include + +#include +#include +#include + +#define O(x) (x-acpi_wakeup) + + .text + .code16 +ENTRY(acpi_wakeup) + /* 16bit real mode entered from ACPI BIOS */ + /* The machine is just through BIOS setup after power down and everything set up + by Linux needs to be restored. */ + /* The code here needs to be position independent or manually relocated, + because it is copied to a <1MB page for real mode execution */ + + /* A20 enabled (according to ACPI spec) */ + /* cs = acpi_wakeup >> 4 ; eip = acpi_wakeup & 0xF */ + + movw %cs,%ax + movw %ax,%ds /* make %ds point to acpi_wakeup */ + movw %ax,%ss + movw $O(wakeup_stack),%sp /* setup stack */ + + pushl $0 + popfl /* clear EFLAGS */ + + lgdt %ds:O(pGDT) /* load kernel GDT */ + + movl $0x1,%eax /* enable protected mode */ + movl %eax,%cr0 + + movl %ds:O(wakeup_page_table),%edi + ljmpl $__KERNEL16_CS,$0 /* -> s3_prot16 (filled in earlier by caller) */ + + /* patched by s3_restore_state below */ +pGDT: + .short 0 + .quad 0 + + .align 4 + .globl wakeup_page_table +wakeup_page_table: + .long 0 + + .align 8 +wakeup_stack: + .fill 128,1,0 + .globl acpi_wakeup_end +acpi_wakeup_end: + /* end of real mode trampoline */ + + /* pointed to by __KERNEL16_CS:0 */ + .code16 +ENTRY(s3_prot16) + /* Now in 16bit protected mode, still no paging, stack/data segments invalid */ + + /* Prepare everything for 64bit paging, but still keep it turned off */ + movl %cr4,%eax + bts $5,%eax /* set PAE bit */ + movl %eax,%cr4 + + movl %edi,%cr3 /* load kernel page table */ + + movl $0x80000001,%eax + cpuid /* no execute supported ? */ + movl %edx,%esi + + movl $MSR_EFER,%ecx + rdmsr + bts $8,%eax /* long mode */ + bt $20,%esi /* NX supported ? */ + jnc 1f + bt $_EFER_NX,%eax +1: + wrmsr /* set temporary efer - real one is restored a bit later */ + + movl %cr0,%eax + bts $31,%eax /* paging */ + movl %eax,%cr0 + + /* running in identity mapping now */ + + /* go to 64bit code segment */ + ljmpl $__KERNEL_CS,$s3_restore_state-__START_KERNEL_map + + .code64 + .macro SAVEMSR msr,target + movl $\msr,%ecx + rdmsr + shlq $32,%rdx + orq %rax,%rdx + movq %rdx,\target(%rip) + .endm + + .macro RESTMSR msr,src + movl $\msr,%ecx + movq \src(%rip),%rax + movq %rax,%rdx + shrq $32,%rdx + wrmsr + .endm + + .macro SAVECTL reg + movq %\reg,%rax + movq %rax,saved_\reg(%rip) + .endm + + .macro RESTCTL reg + movq saved_\reg(%rip),%rax + movq %rax,%\reg + .endm + + /* Running in identity mapping, long mode */ +s3_restore_state_low: + movq $s3_restore_state,%rax + jmpq *%rax + + /* Running in real kernel mapping now */ +s3_restore_state: + xorl %eax,%eax + movl %eax,%ds + movq saved_rsp(%rip),%rsp + movw saved_ss(%rip),%ss + movw saved_fs(%rip),%fs + movw saved_gs(%rip),%gs + movw saved_es(%rip),%es + movw saved_ds(%rip),%ds + + lidt saved_idt + ltr saved_tr + lldt saved_ldt + /* gdt is already loaded */ + + RESTCTL cr0 + RESTCTL cr4 + /* cr3 is already loaded */ + + RESTMSR MSR_EFER,saved_efer + RESTMSR MSR_LSTAR,saved_lstar + RESTMSR MSR_CSTAR,saved_cstar + RESTMSR MSR_FS_BASE,saved_fs_base + RESTMSR MSR_GS_BASE,saved_gs_base + RESTMSR MSR_KERNEL_GS_BASE,saved_kernel_gs_base + RESTMSR MSR_SYSCALL_MASK,saved_syscall_mask + + fxrstor fpustate(%rip) + + RESTCTL dr0 + RESTCTL dr1 + RESTCTL dr2 + RESTCTL dr3 + RESTCTL dr6 + RESTCTL dr7 + + movq saved_rflags(%rip),%rax + pushq %rax + popfq + + movq saved_rbp(%rip),%rbp + movq saved_rbx(%rip),%rbx + movq saved_r12(%rip),%r12 + movq saved_r13(%rip),%r13 + movq saved_r14(%rip),%r14 + movq saved_r15(%rip),%r15 + ret + +ENTRY(acpi_prepare_wakeup) + sgdt saved_gdt + + /* copy gdt descr and page table to low level wakeup code so that it can + reload them early. */ + movq acpi_wakeup_address(%rip),%rax + movw saved_gdt+8(%rip),%cx + movw %cx,O(pGDT)+8(%rax) + movq saved_gdt(%rip),%rcx + movq %rcx,O(pGDT)(%rax) + + movq %cr3,%rdi + movl %edi,O(wakeup_page_table)(%rax) + ret + + /* Save CPU state. */ + /* Everything saved here needs to be restored above. */ +ENTRY(do_suspend_lowlevel) + testl %edi,%edi + jnz s3_restore_state + + SAVECTL cr0 + SAVECTL cr4 + SAVECTL cr3 + + str saved_tr + sidt saved_idt + sgdt saved_gdt + sldt saved_ldt + + SAVEMSR MSR_EFER,saved_efer + SAVEMSR MSR_LSTAR,saved_lstar + SAVEMSR MSR_CSTAR,saved_cstar + SAVEMSR MSR_FS_BASE,saved_fs_base + SAVEMSR MSR_GS_BASE,saved_gs_base + SAVEMSR MSR_KERNEL_GS_BASE,saved_kernel_gs_base + SAVEMSR MSR_SYSCALL_MASK,saved_syscall_mask + + movw %ds,saved_ds(%rip) + movw %es,saved_es(%rip) + movw %fs,saved_fs(%rip) + movw %gs,saved_gs(%rip) + movw %ss,saved_ss(%rip) + movq %rsp,saved_rsp(%rip) + + pushfq + popq %rax + movq %rax,saved_rflags(%rip) + + SAVECTL dr0 + SAVECTL dr1 + SAVECTL dr2 + SAVECTL dr3 + SAVECTL dr6 + SAVECTL dr7 + + fxsave fpustate(%rip) + + /* finally save callee saved registers */ + movq %rbp,saved_rbp(%rip) + movq %rbx,saved_rbx(%rip) + movq %r12,saved_r12(%rip) + movq %r13,saved_r13(%rip) + movq %r14,saved_r14(%rip) + movq %r15,saved_r15(%rip) + movq $3,%rdi + call acpi_enter_sleep_state + ret /* should not happen */ + + .data + .align 8 +saved_efer: .quad 0 +saved_lstar: .quad 0 +saved_cstar: .quad 0 +saved_cr4: .quad 0 +saved_cr3: .quad 0 +saved_cr0: .quad 0 +saved_rbp: .quad 0 +saved_rbx: .quad 0 +saved_rsp: .quad 0 +saved_r12: .quad 0 +saved_r13: .quad 0 +saved_r14: .quad 0 +saved_r15: .quad 0 +saved_rflags: .quad 0 +saved_gs_base: .quad 0 +saved_fs_base: .quad 0 +saved_kernel_gs_base: .quad 0 +saved_syscall_mask: .quad 0 +saved_dr0: .quad 0 +saved_dr1: .quad 0 +saved_dr2: .quad 0 +saved_dr3: .quad 0 +saved_dr6: .quad 0 +saved_dr7: .quad 0 +saved_ds: .short 0 +saved_fs: .short 0 +saved_gs: .short 0 +saved_es: .short 0 +saved_ss: .short 0 +saved_idt: .short 0 + .quad 0 +saved_ldt: .short 0 +saved_gdt: .short 0 + .quad 0 +saved_tr: .short 0 + + .align 16 +fpustate: .fill 512,1,0 diff -Nru a/arch/x86_64/mm/Makefile b/arch/x86_64/mm/Makefile --- a/arch/x86_64/mm/Makefile Fri Feb 14 00:27:29 2003 +++ b/arch/x86_64/mm/Makefile Fri Feb 14 00:27:29 2003 @@ -1,6 +1,8 @@ # -# Makefile for the linux i386-specific parts of the memory manager. +# Makefile for the linux x86_64-specific parts of the memory manager. # obj-y := init.o fault.o ioremap.o extable.o pageattr.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o +obj-$(CONFIG_DISCONTIGMEM) += numa.o +obj-$(CONFIG_K8_NUMA) += k8topology.o diff -Nru a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c --- a/arch/x86_64/mm/fault.c Fri Feb 14 00:27:26 2003 +++ b/arch/x86_64/mm/fault.c Fri Feb 14 00:27:26 2003 @@ -121,7 +121,10 @@ /* get the address */ __asm__("movq %%cr2,%0":"=r" (address)); - if (page_fault_trace) + if (likely(regs->eflags & X86_EFLAGS_IF)) + local_irq_enable(); + + if (unlikely(page_fault_trace)) printk("pagefault rip:%lx rsp:%lx cs:%lu ss:%lu address %lx error %lx\n", regs->rip,regs->rsp,regs->cs,regs->ss,address,error_code); @@ -139,7 +142,7 @@ * If we're in an interrupt or have no user * context, we must not take the fault.. */ - if (in_atomic() || !mm) + if (unlikely(in_atomic() || !mm)) goto no_context; again: @@ -148,7 +151,7 @@ vma = find_vma(mm, address); if (!vma) goto bad_area; - if (vma->vm_start <= address) + if (likely(vma->vm_start <= address)) goto good_area; if (!(vma->vm_flags & VM_GROWSDOWN)) goto bad_area; @@ -222,7 +225,8 @@ return; } #endif - printk("%s[%d] segfault at rip:%lx rsp:%lx adr:%lx err:%lx\n", + printk(KERN_INFO + "%s[%d] segfault at rip:%lx rsp:%lx adr:%lx err:%lx\n", tsk->comm, tsk->pid, regs->rip, regs->rsp, address, error_code); diff -Nru a/arch/x86_64/mm/hugetlbpage.c b/arch/x86_64/mm/hugetlbpage.c --- a/arch/x86_64/mm/hugetlbpage.c Fri Feb 14 00:27:28 2003 +++ b/arch/x86_64/mm/hugetlbpage.c Fri Feb 14 00:27:28 2003 @@ -86,6 +86,18 @@ set_pte(page_table, entry); } +/* + * This function checks for proper alignment of input addr and len parameters. + */ +int is_aligned_hugepage_range(unsigned long addr, unsigned long len) +{ + if (len & ~HPAGE_MASK) + return -EINVAL; + if (addr & ~HPAGE_MASK) + return -EINVAL; + return 0; +} + int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma) @@ -150,6 +162,37 @@ return i; } +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; +} + void free_huge_page(struct page *page) { BUG_ON(page_count(page)); @@ -181,8 +224,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); page = pte_page(*pte); @@ -204,7 +245,6 @@ 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; @@ -228,7 +268,6 @@ + (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) { @@ -241,9 +280,6 @@ 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); } diff -Nru a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c --- a/arch/x86_64/mm/init.c Fri Feb 14 00:27:27 2003 +++ b/arch/x86_64/mm/init.c Fri Feb 14 00:27:27 2003 @@ -3,7 +3,7 @@ * * Copyright (C) 1995 Linus Torvalds * Copyright (C) 2000 Pavel Machek - * Copyright (C) 2002 Andi Kleen + * Copyright (C) 2002,2003 Andi Kleen */ #include @@ -37,8 +37,9 @@ #include #include #include +#include -unsigned long start_pfn, end_pfn; +#define Dprintk(x...) printk(x) struct mmu_gather mmu_gathers[NR_CPUS]; @@ -90,9 +91,11 @@ if (after_bootmem) ptr = (void *) get_zeroed_page(GFP_ATOMIC); else - ptr = alloc_bootmem_low(PAGE_SIZE); - if (!ptr) + ptr = alloc_bootmem_pages(PAGE_SIZE); + if (!ptr || ((unsigned long)ptr & ~PAGE_MASK)) panic("set_pte_phys: cannot allocate page data %s\n", after_bootmem?"after bootmem":""); + + Dprintk("spp_getpage %p\n", ptr); return ptr; } @@ -104,6 +107,8 @@ pmd_t *pmd; pte_t *pte; + Dprintk("set_pte_phys %lx to %lx\n", vaddr, phys); + level4 = pml4_offset_k(vaddr); if (pml4_none(*level4)) { printk("PML4 FIXMAP MISSING, it should be setup in head.S!\n"); @@ -114,7 +119,7 @@ pmd = (pmd_t *) spp_getpage(); set_pgd(pgd, __pgd(__pa(pmd) | _KERNPG_TABLE | _PAGE_USER)); if (pmd != pmd_offset(pgd, 0)) { - printk("PAGETABLE BUG #01!\n"); + printk("PAGETABLE BUG #01! %p <-> %p\n", pmd, pmd_offset(pgd,0)); return; } } @@ -128,6 +133,7 @@ } } pte = pte_offset_kernel(pmd, vaddr); + /* CHECKME: */ if (pte_val(*pte)) pte_ERROR(*pte); set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, prot)); @@ -151,7 +157,8 @@ set_pte_phys(address, phys, prot); } -extern unsigned long start_pfn, end_pfn; +unsigned long __initdata table_start, table_end; + extern pmd_t temp_boot_pmds[]; static struct temp_map { @@ -168,21 +175,21 @@ { struct temp_map *ti; int i; - unsigned long pfn = start_pfn++, paddr; + unsigned long pfn = table_end++, paddr; void *adr; - if (pfn >= end_pfn_map) + if (pfn >= end_pfn) panic("alloc_low_page: ran out of memory"); for (i = 0; temp_mappings[i].allocated; i++) { if (!temp_mappings[i].pmd) panic("alloc_low_page: ran out of temp mappings"); } ti = &temp_mappings[i]; - paddr = (pfn & (~511)) << PAGE_SHIFT; + paddr = (pfn << PAGE_SHIFT) & PMD_MASK; set_pmd(ti->pmd, __pmd(paddr | _KERNPG_TABLE | _PAGE_PSE)); ti->allocated = 1; __flush_tlb(); - adr = ti->address + (pfn & 511)*PAGE_SIZE; + adr = ti->address + ((pfn << PAGE_SHIFT) & ~PMD_MASK); *index = i; *phys = pfn * PAGE_SIZE; return adr; @@ -203,20 +210,26 @@ pgd = pgd + i; for (; i < PTRS_PER_PGD; pgd++, i++) { int map; - unsigned long paddr = i*PGDIR_SIZE, pmd_phys; + unsigned long paddr, pmd_phys; pmd_t *pmd; + paddr = (address & PML4_MASK) + i*PGDIR_SIZE; if (paddr >= end) { for (; i < PTRS_PER_PGD; i++, pgd++) set_pgd(pgd, __pgd(0)); break; } + + if (!e820_mapped(paddr, paddr+PGDIR_SIZE, 0)) { + set_pgd(pgd, __pgd(0)); + continue; + } + pmd = alloc_low_page(&map, &pmd_phys); set_pgd(pgd, __pgd(pmd_phys | _KERNPG_TABLE)); - for (j = 0; j < PTRS_PER_PMD; pmd++, j++) { + for (j = 0; j < PTRS_PER_PMD; pmd++, j++, paddr += PMD_SIZE) { unsigned long pe; - paddr = i*PGDIR_SIZE + j*PMD_SIZE; if (paddr >= end) { for (; j < PTRS_PER_PMD; j++, pmd++) set_pmd(pmd, __pmd(0)); @@ -239,13 +252,37 @@ unsigned long adr; unsigned long end; unsigned long next; + unsigned long pgds, pmds, tables; + + Dprintk("init_memory_mapping\n"); + + end = end_pfn_map << PAGE_SHIFT; + + /* + * Find space for the kernel direct mapping tables. + * Later we should allocate these tables in the local node of the memory + * mapped. Unfortunately this is done currently before the nodes are + * discovered. + */ + + pgds = (end + PGDIR_SIZE - 1) >> PGDIR_SHIFT; + pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT; + tables = round_up(pgds*8, PAGE_SIZE) + round_up(pmds * 8, PAGE_SIZE); + + table_start = find_e820_area(0x8000, __pa_symbol(&_text), tables); + if (table_start == -1UL) + panic("Cannot find space for the kernel page tables"); + + table_start >>= PAGE_SHIFT; + table_end = table_start; + + end += __PAGE_OFFSET; /* turn virtual */ - end = PAGE_OFFSET + (end_pfn_map * PAGE_SIZE); for (adr = PAGE_OFFSET; adr < end; adr = next) { int map; unsigned long pgd_phys; pgd_t *pgd = alloc_low_page(&map, &pgd_phys); - next = adr + (512UL * 1024 * 1024 * 1024); + next = adr + PML4_SIZE; if (next > end) next = end; phys_pgd_init(pgd, adr-PAGE_OFFSET, next-PAGE_OFFSET); @@ -254,20 +291,35 @@ } asm volatile("movq %%cr4,%0" : "=r" (mmu_cr4_features)); __flush_tlb_all(); + early_printk("kernel direct mapping tables upto %lx @ %lx-%lx\n", end, + table_start<> 10, reservedpages << (PAGE_SHIFT-10), datasize >> 10, @@ -392,3 +453,16 @@ } } #endif + +void __init reserve_bootmem_generic(unsigned long phys, unsigned len) +{ + /* Should check here against the e820 map to avoid double free */ +#ifdef CONFIG_DISCONTIGMEM + int nid = phys_to_nid(phys); + if (phys < HIGH_MEMORY && nid) + panic("reserve of %lx at node %d", phys, nid); + reserve_bootmem_node(NODE_DATA(nid), phys, len); +#else + reserve_bootmem(phys, len); +#endif +} diff -Nru a/arch/x86_64/mm/ioremap.c b/arch/x86_64/mm/ioremap.c --- a/arch/x86_64/mm/ioremap.c Fri Feb 14 00:27:30 2003 +++ b/arch/x86_64/mm/ioremap.c Fri Feb 14 00:27:30 2003 @@ -133,14 +133,16 @@ */ if (phys_addr < virt_to_phys(high_memory)) { char *t_addr, *t_end; - struct page *page; t_addr = __va(phys_addr); t_end = t_addr + (size - 1); +#ifndef CONFIG_DISCONTIGMEM + struct page *page; for(page = virt_to_page(t_addr); page <= virt_to_page(t_end); page++) if(!PageReserved(page)) return NULL; +#endif } /* diff -Nru a/arch/x86_64/mm/k8topology.c b/arch/x86_64/mm/k8topology.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/x86_64/mm/k8topology.c Fri Feb 14 00:27:30 2003 @@ -0,0 +1,141 @@ +/* + * AMD K8 NUMA support. + * Discover the memory map and associated nodes. + * + * Doesn't use the ACPI SRAT table because it has a questionable license. + * Instead the northbridge registers are read directly. + * XXX in 2.5 we could use the generic SRAT code + * + * Copyright 2002,2003 Andi Kleen, SuSE Labs. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int find_northbridge(void) +{ + int num; + + for (num = 0; num < 32; num++) { + u32 header; + + header = read_pci_config(0, num, 0, 0x00); + if (header != (PCI_VENDOR_ID_AMD | (0x1100<<16))) + continue; + + header = read_pci_config(0, num, 1, 0x00); + if (header != (PCI_VENDOR_ID_AMD | (0x1101<<16))) + continue; + return num; + } + + return -1; +} + +int __init k8_scan_nodes(unsigned long start, unsigned long end) +{ + unsigned long prevbase; + struct node nodes[MAXNODE]; + int nodeid, numnodes, maxnode, i, nb; + + nb = find_northbridge(); + if (nb < 0) + return nb; + + printk(KERN_INFO "Scanning NUMA topology in Northbridge %d\n", nb); + + numnodes = (read_pci_config(0, nb, 0, 0x60 ) >> 4) & 3; + + memset(&nodes,0,sizeof(nodes)); + prevbase = 0; + maxnode = -1; + for (i = 0; i < MAXNODE; i++) { + unsigned long base,limit; + + base = read_pci_config(0, nb, 1, 0x40 + i*8); + limit = read_pci_config(0, nb, 1, 0x44 + i*8); + + nodeid = limit & 3; + if (!limit) { + printk(KERN_INFO "Skipping node entry %d (base %lx)\n", i, base); + continue; + } + if ((base >> 8) & 3 || (limit >> 8) & 3) { + printk(KERN_ERR "Node %d using interleaving mode %lx/%lx\n", + nodeid, (base>>8)&3, (limit>>8) & 3); + return -1; + } + if (nodeid > maxnode) + maxnode = nodeid; + if ((1UL << nodeid) & nodes_present) { + printk("Node %d already present. Skipping\n", nodeid); + continue; + } + + limit >>= 16; + limit <<= 24; + + if (limit > end_pfn_map << PAGE_SHIFT) + limit = end_pfn_map << PAGE_SHIFT; + if (limit <= base) { + printk(KERN_INFO "Node %d beyond memory map\n", nodeid); + continue; + } + + base >>= 16; + base <<= 24; + + if (base < start) + base = start; + if (limit > end) + limit = end; + if (limit == base) + continue; + if (limit < base) { + printk(KERN_INFO"Node %d bogus settings %lx-%lx. Ignored.\n", + nodeid, base, limit); + continue; + } + + /* Could sort here, but pun for now. Should not happen anyroads. */ + if (prevbase > base) { + printk(KERN_INFO "Node map not sorted %lx,%lx\n", + prevbase,base); + return -1; + } + + printk(KERN_INFO "Node %d MemBase %016lx Limit %016lx\n", + nodeid, base, limit); + + nodes[nodeid].start = base; + nodes[nodeid].end = limit; + + prevbase = base; + } + + if (maxnode <= 0) + return -1; + + memnode_shift = compute_hash_shift(nodes,maxnode,end); + if (memnode_shift < 0) { + printk(KERN_ERR "No NUMA node hash function found. Contact maintainer\n"); + return -1; + } + printk(KERN_INFO "Using node hash shift of %d\n", memnode_shift); + + early_for_all_nodes(i) { + setup_node_bootmem(i, nodes[i].start, nodes[i].end); + } + + return 0; +} + diff -Nru a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/x86_64/mm/numa.c Fri Feb 14 00:27:30 2003 @@ -0,0 +1,207 @@ +/* + * Generic VM initialization for x86-64 NUMA setups. + * Copyright 2002,2003 Andi Kleen, SuSE Labs. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define Dprintk(x...) printk(x) + +struct pglist_data *node_data[MAXNODE]; +bootmem_data_t plat_node_bdata[MAX_NUMNODES]; + +int memnode_shift; +u8 memnodemap[NODEMAPSIZE]; + +static int numa_off __initdata; + +unsigned long nodes_present; +int maxnode; + +static int emunodes __initdata; + +int compute_hash_shift(struct node *nodes, int numnodes, u64 maxmem) +{ + int i; + int shift = 24; + u64 addr; + + /* When in doubt use brute force. */ + while (shift < 48) { + memset(memnodemap,0xff,sizeof(*memnodemap) * NODEMAPSIZE); + early_for_all_nodes (i) { + for (addr = nodes[i].start; + addr < nodes[i].end; + addr += (1UL << shift)) { + if (memnodemap[addr >> shift] != 0xff) { + printk("node %d shift %d addr %Lx conflict %d\n", + i, shift, addr, memnodemap[addr>>shift]); + goto next; + } + memnodemap[addr >> shift] = i; + } + } + return shift; + next: + shift++; + } + memset(memnodemap,0,sizeof(*memnodemap) * NODEMAPSIZE); + return -1; +} + +/* Initialize bootmem allocator for a node */ +void __init setup_node_bootmem(int nodeid, unsigned long start, unsigned long end) +{ + unsigned long start_pfn, end_pfn, bootmap_pages, bootmap_size, bootmap_start; + unsigned long nodedata_phys; + const int pgdat_size = round_up(sizeof(pg_data_t), PAGE_SIZE); + + start = round_up(start, ZONE_ALIGN); + + printk("Bootmem setup node %d %016lx-%016lx\n", nodeid, start, end); + + start_pfn = start >> PAGE_SHIFT; + end_pfn = end >> PAGE_SHIFT; + + nodedata_phys = find_e820_area(start, end, pgdat_size); + if (nodedata_phys == -1L) + panic("Cannot find memory pgdat in node %d\n", nodeid); + + Dprintk("nodedata_phys %lx\n", nodedata_phys); + + node_data[nodeid] = phys_to_virt(nodedata_phys); + memset(NODE_DATA(nodeid), 0, sizeof(pg_data_t)); + NODE_DATA(nodeid)->bdata = &plat_node_bdata[nodeid]; + NODE_DATA(nodeid)->node_start_pfn = start_pfn; + NODE_DATA(nodeid)->node_size = end_pfn - start_pfn; + + /* Find a place for the bootmem map */ + bootmap_pages = bootmem_bootmap_pages(end_pfn - start_pfn); + bootmap_start = round_up(nodedata_phys + pgdat_size, PAGE_SIZE); + bootmap_start = find_e820_area(bootmap_start, end, bootmap_pages<> PAGE_SHIFT, + start_pfn, end_pfn); + + e820_bootmem_free(NODE_DATA(nodeid), start, end); + + reserve_bootmem_node(NODE_DATA(nodeid), nodedata_phys, pgdat_size); + reserve_bootmem_node(NODE_DATA(nodeid), bootmap_start, bootmap_pages< maxnode) + maxnode = nodeid; + nodes_present |= (1UL << nodeid); +} + +/* Initialize final allocator for a zone */ +void __init setup_node_zones(int nodeid) +{ + unsigned long start_pfn, end_pfn; + unsigned long zones[MAX_NR_ZONES]; + unsigned long dma_end_pfn; + + memset(zones, 0, sizeof(unsigned long) * MAX_NR_ZONES); + + start_pfn = node_start_pfn(nodeid); + end_pfn = node_end_pfn(nodeid); + + printk("setting up node %d %lx-%lx\n", nodeid, start_pfn, end_pfn); + + /* All nodes > 0 have a zero length zone DMA */ + dma_end_pfn = __pa(MAX_DMA_ADDRESS) >> PAGE_SHIFT; + if (start_pfn < dma_end_pfn) { + zones[ZONE_DMA] = dma_end_pfn - start_pfn; + zones[ZONE_NORMAL] = end_pfn - dma_end_pfn; + } else { + zones[ZONE_NORMAL] = end_pfn - start_pfn; + } + + free_area_init_node(nodeid, NODE_DATA(nodeid), NULL, zones, + start_pfn, NULL); +} + +int fake_node; + +int __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn) +{ +#ifdef CONFIG_K8_NUMA + if (!numa_off && !k8_scan_nodes(start_pfn< 0) { + struct node nodes[MAXNODE]; + unsigned long nodesize = (end_pfn << PAGE_SHIFT) / emunodes; + int i; + if (emunodes > MAXNODE) + emunodes = MAXNODE; + printk(KERN_INFO "Faking %d nodes of size %ld MB\n", emunodes, nodesize>>20); + for (i = 0; i < emunodes; i++) { + unsigned long end = (i+1)*nodesize; + if (i == emunodes-1) + end = end_pfn << PAGE_SHIFT; + nodes[i].start = i * nodesize; + nodes[i].end = end; + setup_node_bootmem(i, nodes[i].start, nodes[i].end); + } + memnode_shift = compute_hash_shift(nodes, emunodes, nodes[i-1].end); + return 0; + } + + printk(KERN_INFO "Faking a node at %016lx-%016lx\n", + start_pfn << PAGE_SHIFT, + end_pfn << PAGE_SHIFT); + /* setup dummy node covering all memory */ + fake_node = 1; + memnode_shift = 63; + memnodemap[0] = 0; + setup_node_bootmem(0, start_pfn< #include #include -#include "acpi_bus.h" -#include "acpi_drivers.h" +#include +#include #define ACPI_AC_COMPONENT 0x00020000 diff -Nru a/drivers/acpi/acpi_ksyms.c b/drivers/acpi/acpi_ksyms.c --- a/drivers/acpi/acpi_ksyms.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/acpi_ksyms.c Fri Feb 14 00:27:27 2003 @@ -26,7 +26,7 @@ #include #include #include -#include "acpi_bus.h" +#include #ifdef CONFIG_ACPI_INTERPRETER diff -Nru a/drivers/acpi/battery.c b/drivers/acpi/battery.c --- a/drivers/acpi/battery.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/battery.c Fri Feb 14 00:27:29 2003 @@ -28,8 +28,8 @@ #include #include #include -#include "acpi_bus.h" -#include "acpi_drivers.h" +#include +#include #define ACPI_BATTERY_VALUE_UNKNOWN 0xFFFFFFFF diff -Nru a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c --- a/drivers/acpi/blacklist.c Fri Feb 14 00:27:26 2003 +++ b/drivers/acpi/blacklist.c Fri Feb 14 00:27:26 2003 @@ -29,7 +29,7 @@ #include #include #include -#include "acpi_bus.h" +#include enum acpi_blacklist_predicates { diff -Nru a/drivers/acpi/bus.c b/drivers/acpi/bus.c --- a/drivers/acpi/bus.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/bus.c Fri Feb 14 00:27:28 2003 @@ -32,8 +32,8 @@ #ifdef CONFIG_X86 #include #endif -#include "acpi_bus.h" -#include "acpi_drivers.h" +#include +#include #define _COMPONENT ACPI_BUS_COMPONENT diff -Nru a/drivers/acpi/button.c b/drivers/acpi/button.c --- a/drivers/acpi/button.c Fri Feb 14 00:27:26 2003 +++ b/drivers/acpi/button.c Fri Feb 14 00:27:26 2003 @@ -29,8 +29,8 @@ #include #include #include -#include "acpi_bus.h" -#include "acpi_drivers.h" +#include +#include #define ACPI_BUTTON_COMPONENT 0x00080000 diff -Nru a/drivers/acpi/debug.c b/drivers/acpi/debug.c --- a/drivers/acpi/debug.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/debug.c Fri Feb 14 00:27:29 2003 @@ -5,7 +5,7 @@ #include #include #include -#include "acpi_drivers.h" +#include #define _COMPONENT ACPI_SYSTEM_COMPONENT ACPI_MODULE_NAME ("debug") diff -Nru a/drivers/acpi/dispatcher/dsfield.c b/drivers/acpi/dispatcher/dsfield.c --- a/drivers/acpi/dispatcher/dsfield.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/dispatcher/dsfield.c Fri Feb 14 00:27:27 2003 @@ -23,12 +23,12 @@ */ -#include "acpi.h" -#include "amlcode.h" -#include "acdispat.h" -#include "acinterp.h" -#include "acnamesp.h" -#include "acparser.h" +#include +#include +#include +#include +#include +#include #define _COMPONENT ACPI_DISPATCHER diff -Nru a/drivers/acpi/dispatcher/dsinit.c b/drivers/acpi/dispatcher/dsinit.c --- a/drivers/acpi/dispatcher/dsinit.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/dispatcher/dsinit.c Fri Feb 14 00:27:30 2003 @@ -23,9 +23,9 @@ */ -#include "acpi.h" -#include "acdispat.h" -#include "acnamesp.h" +#include +#include +#include #define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME ("dsinit") diff -Nru a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c --- a/drivers/acpi/dispatcher/dsmethod.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/dispatcher/dsmethod.c Fri Feb 14 00:27:28 2003 @@ -23,12 +23,12 @@ */ -#include "acpi.h" -#include "acparser.h" -#include "amlcode.h" -#include "acdispat.h" -#include "acinterp.h" -#include "acnamesp.h" +#include +#include +#include +#include +#include +#include #define _COMPONENT ACPI_DISPATCHER diff -Nru a/drivers/acpi/dispatcher/dsmthdat.c b/drivers/acpi/dispatcher/dsmthdat.c --- a/drivers/acpi/dispatcher/dsmthdat.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/dispatcher/dsmthdat.c Fri Feb 14 00:27:27 2003 @@ -23,11 +23,11 @@ */ -#include "acpi.h" -#include "acdispat.h" -#include "amlcode.h" -#include "acnamesp.h" -#include "acinterp.h" +#include +#include +#include +#include +#include #define _COMPONENT ACPI_DISPATCHER diff -Nru a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c --- a/drivers/acpi/dispatcher/dsobject.c Fri Feb 14 00:27:26 2003 +++ b/drivers/acpi/dispatcher/dsobject.c Fri Feb 14 00:27:26 2003 @@ -23,12 +23,12 @@ */ -#include "acpi.h" -#include "acparser.h" -#include "amlcode.h" -#include "acdispat.h" -#include "acnamesp.h" -#include "acinterp.h" +#include +#include +#include +#include +#include +#include #define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME ("dsobject") diff -Nru a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c --- a/drivers/acpi/dispatcher/dsopcode.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/dispatcher/dsopcode.c Fri Feb 14 00:27:29 2003 @@ -24,13 +24,13 @@ */ -#include "acpi.h" -#include "acparser.h" -#include "amlcode.h" -#include "acdispat.h" -#include "acinterp.h" -#include "acnamesp.h" -#include "acevents.h" +#include +#include +#include +#include +#include +#include +#include #define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME ("dsopcode") diff -Nru a/drivers/acpi/dispatcher/dsutils.c b/drivers/acpi/dispatcher/dsutils.c --- a/drivers/acpi/dispatcher/dsutils.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/dispatcher/dsutils.c Fri Feb 14 00:27:28 2003 @@ -23,13 +23,13 @@ */ -#include "acpi.h" -#include "acparser.h" -#include "amlcode.h" -#include "acdispat.h" -#include "acinterp.h" -#include "acnamesp.h" -#include "acdebug.h" +#include +#include +#include +#include +#include +#include +#include #define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME ("dsutils") diff -Nru a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c --- a/drivers/acpi/dispatcher/dswexec.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/dispatcher/dswexec.c Fri Feb 14 00:27:30 2003 @@ -24,13 +24,13 @@ */ -#include "acpi.h" -#include "acparser.h" -#include "amlcode.h" -#include "acdispat.h" -#include "acinterp.h" -#include "acnamesp.h" -#include "acdebug.h" +#include +#include +#include +#include +#include +#include +#include #define _COMPONENT ACPI_DISPATCHER diff -Nru a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c --- a/drivers/acpi/dispatcher/dswload.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/dispatcher/dswload.c Fri Feb 14 00:27:27 2003 @@ -23,13 +23,13 @@ */ -#include "acpi.h" -#include "acparser.h" -#include "amlcode.h" -#include "acdispat.h" -#include "acinterp.h" -#include "acnamesp.h" -#include "acevents.h" +#include +#include +#include +#include +#include +#include +#include #define _COMPONENT ACPI_DISPATCHER diff -Nru a/drivers/acpi/dispatcher/dswscope.c b/drivers/acpi/dispatcher/dswscope.c --- a/drivers/acpi/dispatcher/dswscope.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/dispatcher/dswscope.c Fri Feb 14 00:27:30 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "acdispat.h" +#include +#include #define _COMPONENT ACPI_DISPATCHER diff -Nru a/drivers/acpi/dispatcher/dswstate.c b/drivers/acpi/dispatcher/dswstate.c --- a/drivers/acpi/dispatcher/dswstate.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/dispatcher/dswstate.c Fri Feb 14 00:27:29 2003 @@ -23,10 +23,10 @@ */ -#include "acpi.h" -#include "acparser.h" -#include "acdispat.h" -#include "acnamesp.h" +#include +#include +#include +#include #define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME ("dswstate") diff -Nru a/drivers/acpi/ec.c b/drivers/acpi/ec.c --- a/drivers/acpi/ec.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/ec.c Fri Feb 14 00:27:28 2003 @@ -30,8 +30,8 @@ #include #include #include -#include "acpi_bus.h" -#include "acpi_drivers.h" +#include +#include #define _COMPONENT ACPI_EC_COMPONENT diff -Nru a/drivers/acpi/event.c b/drivers/acpi/event.c --- a/drivers/acpi/event.c Fri Feb 14 00:27:26 2003 +++ b/drivers/acpi/event.c Fri Feb 14 00:27:26 2003 @@ -10,7 +10,7 @@ #include #include #include -#include "acpi_drivers.h" +#include #define _COMPONENT ACPI_SYSTEM_COMPONENT ACPI_MODULE_NAME ("event") diff -Nru a/drivers/acpi/events/evevent.c b/drivers/acpi/events/evevent.c --- a/drivers/acpi/events/evevent.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/events/evevent.c Fri Feb 14 00:27:29 2003 @@ -22,8 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "acpi.h" -#include "acevents.h" +#include +#include #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evevent") diff -Nru a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c --- a/drivers/acpi/events/evgpe.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/events/evgpe.c Fri Feb 14 00:27:28 2003 @@ -22,9 +22,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "acpi.h" -#include "acevents.h" -#include "acnamesp.h" +#include +#include +#include #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evgpe") diff -Nru a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c --- a/drivers/acpi/events/evmisc.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/events/evmisc.c Fri Feb 14 00:27:28 2003 @@ -22,10 +22,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "acpi.h" -#include "acevents.h" -#include "acnamesp.h" -#include "acinterp.h" +#include +#include +#include +#include #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evmisc") diff -Nru a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c --- a/drivers/acpi/events/evregion.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/events/evregion.c Fri Feb 14 00:27:27 2003 @@ -23,10 +23,10 @@ */ -#include "acpi.h" -#include "acevents.h" -#include "acnamesp.h" -#include "acinterp.h" +#include +#include +#include +#include #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evregion") diff -Nru a/drivers/acpi/events/evrgnini.c b/drivers/acpi/events/evrgnini.c --- a/drivers/acpi/events/evrgnini.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/events/evrgnini.c Fri Feb 14 00:27:27 2003 @@ -23,9 +23,9 @@ */ -#include "acpi.h" -#include "acevents.h" -#include "acnamesp.h" +#include +#include +#include #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evrgnini") diff -Nru a/drivers/acpi/events/evsci.c b/drivers/acpi/events/evsci.c --- a/drivers/acpi/events/evsci.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/events/evsci.c Fri Feb 14 00:27:29 2003 @@ -23,8 +23,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "acpi.h" -#include "acevents.h" +#include +#include #define _COMPONENT ACPI_EVENTS diff -Nru a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c --- a/drivers/acpi/events/evxface.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/events/evxface.c Fri Feb 14 00:27:28 2003 @@ -23,10 +23,10 @@ */ -#include "acpi.h" -#include "acnamesp.h" -#include "acevents.h" -#include "acinterp.h" +#include +#include +#include +#include #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evxface") diff -Nru a/drivers/acpi/events/evxfevnt.c b/drivers/acpi/events/evxfevnt.c --- a/drivers/acpi/events/evxfevnt.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/events/evxfevnt.c Fri Feb 14 00:27:27 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "acevents.h" +#include +#include #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evxfevnt") diff -Nru a/drivers/acpi/events/evxfregn.c b/drivers/acpi/events/evxfregn.c --- a/drivers/acpi/events/evxfregn.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/events/evxfregn.c Fri Feb 14 00:27:27 2003 @@ -24,10 +24,10 @@ */ -#include "acpi.h" -#include "acnamesp.h" -#include "acevents.h" -#include "acinterp.h" +#include +#include +#include +#include #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evxfregn") diff -Nru a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c --- a/drivers/acpi/executer/exconfig.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/executer/exconfig.c Fri Feb 14 00:27:28 2003 @@ -23,12 +23,12 @@ */ -#include "acpi.h" -#include "acinterp.h" -#include "amlcode.h" -#include "acnamesp.h" -#include "acevents.h" -#include "actables.h" +#include +#include +#include +#include +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exconvrt.c b/drivers/acpi/executer/exconvrt.c --- a/drivers/acpi/executer/exconvrt.c Fri Feb 14 00:27:26 2003 +++ b/drivers/acpi/executer/exconvrt.c Fri Feb 14 00:27:26 2003 @@ -23,9 +23,9 @@ */ -#include "acpi.h" -#include "acinterp.h" -#include "amlcode.h" +#include +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c --- a/drivers/acpi/executer/excreate.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/executer/excreate.c Fri Feb 14 00:27:30 2003 @@ -23,12 +23,12 @@ */ -#include "acpi.h" -#include "acinterp.h" -#include "amlcode.h" -#include "acnamesp.h" -#include "acevents.h" -#include "actables.h" +#include +#include +#include +#include +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c --- a/drivers/acpi/executer/exdump.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/executer/exdump.c Fri Feb 14 00:27:27 2003 @@ -23,11 +23,11 @@ */ -#include "acpi.h" -#include "acinterp.h" -#include "amlcode.h" -#include "acnamesp.h" -#include "acparser.h" +#include +#include +#include +#include +#include #define _COMPONENT ACPI_EXECUTER ACPI_MODULE_NAME ("exdump") diff -Nru a/drivers/acpi/executer/exfield.c b/drivers/acpi/executer/exfield.c --- a/drivers/acpi/executer/exfield.c Fri Feb 14 00:27:26 2003 +++ b/drivers/acpi/executer/exfield.c Fri Feb 14 00:27:26 2003 @@ -23,9 +23,9 @@ */ -#include "acpi.h" -#include "acdispat.h" -#include "acinterp.h" +#include +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c --- a/drivers/acpi/executer/exfldio.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/executer/exfldio.c Fri Feb 14 00:27:27 2003 @@ -23,11 +23,11 @@ */ -#include "acpi.h" -#include "acinterp.h" -#include "amlcode.h" -#include "acevents.h" -#include "acdispat.h" +#include +#include +#include +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exmisc.c b/drivers/acpi/executer/exmisc.c --- a/drivers/acpi/executer/exmisc.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/executer/exmisc.c Fri Feb 14 00:27:29 2003 @@ -24,9 +24,9 @@ */ -#include "acpi.h" -#include "acinterp.h" -#include "amlcode.h" +#include +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c --- a/drivers/acpi/executer/exmutex.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/executer/exmutex.c Fri Feb 14 00:27:29 2003 @@ -24,8 +24,8 @@ */ -#include "acpi.h" -#include "acinterp.h" +#include +#include #define _COMPONENT ACPI_EXECUTER ACPI_MODULE_NAME ("exmutex") diff -Nru a/drivers/acpi/executer/exnames.c b/drivers/acpi/executer/exnames.c --- a/drivers/acpi/executer/exnames.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/executer/exnames.c Fri Feb 14 00:27:27 2003 @@ -24,9 +24,9 @@ */ -#include "acpi.h" -#include "acinterp.h" -#include "amlcode.h" +#include +#include +#include #define _COMPONENT ACPI_EXECUTER ACPI_MODULE_NAME ("exnames") diff -Nru a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c --- a/drivers/acpi/executer/exoparg1.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/executer/exoparg1.c Fri Feb 14 00:27:30 2003 @@ -24,12 +24,12 @@ */ -#include "acpi.h" -#include "acparser.h" -#include "acdispat.h" -#include "acinterp.h" -#include "amlcode.h" -#include "acnamesp.h" +#include +#include +#include +#include +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exoparg2.c b/drivers/acpi/executer/exoparg2.c --- a/drivers/acpi/executer/exoparg2.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/executer/exoparg2.c Fri Feb 14 00:27:28 2003 @@ -23,11 +23,11 @@ */ -#include "acpi.h" -#include "acparser.h" -#include "acinterp.h" -#include "acevents.h" -#include "amlcode.h" +#include +#include +#include +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exoparg3.c b/drivers/acpi/executer/exoparg3.c --- a/drivers/acpi/executer/exoparg3.c Fri Feb 14 00:27:26 2003 +++ b/drivers/acpi/executer/exoparg3.c Fri Feb 14 00:27:26 2003 @@ -24,10 +24,10 @@ */ -#include "acpi.h" -#include "acinterp.h" -#include "acparser.h" -#include "amlcode.h" +#include +#include +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exoparg6.c b/drivers/acpi/executer/exoparg6.c --- a/drivers/acpi/executer/exoparg6.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/executer/exoparg6.c Fri Feb 14 00:27:29 2003 @@ -24,10 +24,10 @@ */ -#include "acpi.h" -#include "acinterp.h" -#include "acparser.h" -#include "amlcode.h" +#include +#include +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exprep.c b/drivers/acpi/executer/exprep.c --- a/drivers/acpi/executer/exprep.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/executer/exprep.c Fri Feb 14 00:27:27 2003 @@ -24,10 +24,10 @@ */ -#include "acpi.h" -#include "acinterp.h" -#include "amlcode.h" -#include "acnamesp.h" +#include +#include +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c --- a/drivers/acpi/executer/exregion.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/executer/exregion.c Fri Feb 14 00:27:27 2003 @@ -24,8 +24,8 @@ */ -#include "acpi.h" -#include "acinterp.h" +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exresnte.c b/drivers/acpi/executer/exresnte.c --- a/drivers/acpi/executer/exresnte.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/executer/exresnte.c Fri Feb 14 00:27:27 2003 @@ -24,10 +24,10 @@ */ -#include "acpi.h" -#include "acdispat.h" -#include "acinterp.h" -#include "acnamesp.h" +#include +#include +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c --- a/drivers/acpi/executer/exresolv.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/executer/exresolv.c Fri Feb 14 00:27:28 2003 @@ -24,11 +24,11 @@ */ -#include "acpi.h" -#include "amlcode.h" -#include "acdispat.h" -#include "acinterp.h" -#include "acnamesp.h" +#include +#include +#include +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exresop.c b/drivers/acpi/executer/exresop.c --- a/drivers/acpi/executer/exresop.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/executer/exresop.c Fri Feb 14 00:27:30 2003 @@ -24,10 +24,10 @@ */ -#include "acpi.h" -#include "amlcode.h" -#include "acparser.h" -#include "acinterp.h" +#include +#include +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c --- a/drivers/acpi/executer/exstore.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/executer/exstore.c Fri Feb 14 00:27:28 2003 @@ -24,11 +24,11 @@ */ -#include "acpi.h" -#include "acdispat.h" -#include "acinterp.h" -#include "amlcode.h" -#include "acnamesp.h" +#include +#include +#include +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exstoren.c b/drivers/acpi/executer/exstoren.c --- a/drivers/acpi/executer/exstoren.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/executer/exstoren.c Fri Feb 14 00:27:27 2003 @@ -25,8 +25,8 @@ */ -#include "acpi.h" -#include "acinterp.h" +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exstorob.c b/drivers/acpi/executer/exstorob.c --- a/drivers/acpi/executer/exstorob.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/executer/exstorob.c Fri Feb 14 00:27:30 2003 @@ -24,8 +24,8 @@ */ -#include "acpi.h" -#include "acinterp.h" +#include +#include #define _COMPONENT ACPI_EXECUTER diff -Nru a/drivers/acpi/executer/exsystem.c b/drivers/acpi/executer/exsystem.c --- a/drivers/acpi/executer/exsystem.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/executer/exsystem.c Fri Feb 14 00:27:29 2003 @@ -24,9 +24,9 @@ */ -#include "acpi.h" -#include "acinterp.h" -#include "acevents.h" +#include +#include +#include #define _COMPONENT ACPI_EXECUTER ACPI_MODULE_NAME ("exsystem") diff -Nru a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c --- a/drivers/acpi/executer/exutils.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/executer/exutils.c Fri Feb 14 00:27:27 2003 @@ -40,10 +40,10 @@ #define DEFINE_AML_GLOBALS -#include "acpi.h" -#include "acinterp.h" -#include "amlcode.h" -#include "acevents.h" +#include +#include +#include +#include #define _COMPONENT ACPI_EXECUTER ACPI_MODULE_NAME ("exutils") diff -Nru a/drivers/acpi/fan.c b/drivers/acpi/fan.c --- a/drivers/acpi/fan.c Fri Feb 14 00:27:26 2003 +++ b/drivers/acpi/fan.c Fri Feb 14 00:27:26 2003 @@ -28,8 +28,8 @@ #include #include #include -#include "acpi_bus.h" -#include "acpi_drivers.h" +#include +#include #define ACPI_FAN_COMPONENT 0x00200000 diff -Nru a/drivers/acpi/hardware/hwacpi.c b/drivers/acpi/hardware/hwacpi.c --- a/drivers/acpi/hardware/hwacpi.c Fri Feb 14 00:27:26 2003 +++ b/drivers/acpi/hardware/hwacpi.c Fri Feb 14 00:27:26 2003 @@ -24,7 +24,7 @@ */ -#include "acpi.h" +#include #define _COMPONENT ACPI_HARDWARE diff -Nru a/drivers/acpi/hardware/hwgpe.c b/drivers/acpi/hardware/hwgpe.c --- a/drivers/acpi/hardware/hwgpe.c Fri Feb 14 00:27:26 2003 +++ b/drivers/acpi/hardware/hwgpe.c Fri Feb 14 00:27:26 2003 @@ -23,8 +23,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "acpi.h" -#include "acevents.h" +#include +#include #define _COMPONENT ACPI_HARDWARE ACPI_MODULE_NAME ("hwgpe") diff -Nru a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c --- a/drivers/acpi/hardware/hwregs.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/hardware/hwregs.c Fri Feb 14 00:27:29 2003 @@ -25,8 +25,8 @@ */ -#include "acpi.h" -#include "acnamesp.h" +#include +#include #define _COMPONENT ACPI_HARDWARE ACPI_MODULE_NAME ("hwregs") diff -Nru a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c --- a/drivers/acpi/hardware/hwsleep.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/hardware/hwsleep.c Fri Feb 14 00:27:27 2003 @@ -23,7 +23,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "acpi.h" +#include #define _COMPONENT ACPI_HARDWARE ACPI_MODULE_NAME ("hwsleep") diff -Nru a/drivers/acpi/hardware/hwtimer.c b/drivers/acpi/hardware/hwtimer.c --- a/drivers/acpi/hardware/hwtimer.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/hardware/hwtimer.c Fri Feb 14 00:27:27 2003 @@ -23,7 +23,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "acpi.h" +#include #define _COMPONENT ACPI_HARDWARE ACPI_MODULE_NAME ("hwtimer") diff -Nru a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c --- a/drivers/acpi/namespace/nsaccess.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/namespace/nsaccess.c Fri Feb 14 00:27:30 2003 @@ -23,10 +23,10 @@ */ -#include "acpi.h" -#include "amlcode.h" -#include "acnamesp.h" -#include "acdispat.h" +#include +#include +#include +#include #define _COMPONENT ACPI_NAMESPACE diff -Nru a/drivers/acpi/namespace/nsalloc.c b/drivers/acpi/namespace/nsalloc.c --- a/drivers/acpi/namespace/nsalloc.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/namespace/nsalloc.c Fri Feb 14 00:27:28 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "acnamesp.h" +#include +#include #define _COMPONENT ACPI_NAMESPACE diff -Nru a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c --- a/drivers/acpi/namespace/nsdump.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/namespace/nsdump.c Fri Feb 14 00:27:30 2003 @@ -23,9 +23,9 @@ */ -#include "acpi.h" -#include "acnamesp.h" -#include "acparser.h" +#include +#include +#include #define _COMPONENT ACPI_NAMESPACE diff -Nru a/drivers/acpi/namespace/nsdumpdv.c b/drivers/acpi/namespace/nsdumpdv.c --- a/drivers/acpi/namespace/nsdumpdv.c Fri Feb 14 00:27:26 2003 +++ b/drivers/acpi/namespace/nsdumpdv.c Fri Feb 14 00:27:26 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "acnamesp.h" +#include +#include #define _COMPONENT ACPI_NAMESPACE diff -Nru a/drivers/acpi/namespace/nseval.c b/drivers/acpi/namespace/nseval.c --- a/drivers/acpi/namespace/nseval.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/namespace/nseval.c Fri Feb 14 00:27:28 2003 @@ -24,10 +24,10 @@ */ -#include "acpi.h" -#include "acparser.h" -#include "acinterp.h" -#include "acnamesp.h" +#include +#include +#include +#include #define _COMPONENT ACPI_NAMESPACE diff -Nru a/drivers/acpi/namespace/nsinit.c b/drivers/acpi/namespace/nsinit.c --- a/drivers/acpi/namespace/nsinit.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/namespace/nsinit.c Fri Feb 14 00:27:27 2003 @@ -23,10 +23,10 @@ */ -#include "acpi.h" -#include "acnamesp.h" -#include "acdispat.h" -#include "acinterp.h" +#include +#include +#include +#include #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsinit") diff -Nru a/drivers/acpi/namespace/nsload.c b/drivers/acpi/namespace/nsload.c --- a/drivers/acpi/namespace/nsload.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/namespace/nsload.c Fri Feb 14 00:27:30 2003 @@ -23,9 +23,9 @@ */ -#include "acpi.h" -#include "acnamesp.h" -#include "acdispat.h" +#include +#include +#include #define _COMPONENT ACPI_NAMESPACE diff -Nru a/drivers/acpi/namespace/nsnames.c b/drivers/acpi/namespace/nsnames.c --- a/drivers/acpi/namespace/nsnames.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/namespace/nsnames.c Fri Feb 14 00:27:30 2003 @@ -23,9 +23,9 @@ */ -#include "acpi.h" -#include "amlcode.h" -#include "acnamesp.h" +#include +#include +#include #define _COMPONENT ACPI_NAMESPACE diff -Nru a/drivers/acpi/namespace/nsobject.c b/drivers/acpi/namespace/nsobject.c --- a/drivers/acpi/namespace/nsobject.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/namespace/nsobject.c Fri Feb 14 00:27:28 2003 @@ -24,8 +24,8 @@ */ -#include "acpi.h" -#include "acnamesp.h" +#include +#include #define _COMPONENT ACPI_NAMESPACE diff -Nru a/drivers/acpi/namespace/nsparse.c b/drivers/acpi/namespace/nsparse.c --- a/drivers/acpi/namespace/nsparse.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/namespace/nsparse.c Fri Feb 14 00:27:27 2003 @@ -23,10 +23,10 @@ */ -#include "acpi.h" -#include "acnamesp.h" -#include "acparser.h" -#include "acdispat.h" +#include +#include +#include +#include #define _COMPONENT ACPI_NAMESPACE diff -Nru a/drivers/acpi/namespace/nssearch.c b/drivers/acpi/namespace/nssearch.c --- a/drivers/acpi/namespace/nssearch.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/namespace/nssearch.c Fri Feb 14 00:27:30 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "acnamesp.h" +#include +#include #define _COMPONENT ACPI_NAMESPACE diff -Nru a/drivers/acpi/namespace/nsutils.c b/drivers/acpi/namespace/nsutils.c --- a/drivers/acpi/namespace/nsutils.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/namespace/nsutils.c Fri Feb 14 00:27:28 2003 @@ -24,10 +24,10 @@ */ -#include "acpi.h" -#include "acnamesp.h" -#include "amlcode.h" -#include "actables.h" +#include +#include +#include +#include #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsutils") diff -Nru a/drivers/acpi/namespace/nswalk.c b/drivers/acpi/namespace/nswalk.c --- a/drivers/acpi/namespace/nswalk.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/namespace/nswalk.c Fri Feb 14 00:27:30 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "acnamesp.h" +#include +#include #define _COMPONENT ACPI_NAMESPACE diff -Nru a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c --- a/drivers/acpi/namespace/nsxfeval.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/namespace/nsxfeval.c Fri Feb 14 00:27:30 2003 @@ -24,8 +24,8 @@ */ -#include "acpi.h" -#include "acnamesp.h" +#include +#include #define _COMPONENT ACPI_NAMESPACE diff -Nru a/drivers/acpi/namespace/nsxfname.c b/drivers/acpi/namespace/nsxfname.c --- a/drivers/acpi/namespace/nsxfname.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/namespace/nsxfname.c Fri Feb 14 00:27:27 2003 @@ -24,8 +24,8 @@ */ -#include "acpi.h" -#include "acnamesp.h" +#include +#include #define _COMPONENT ACPI_NAMESPACE diff -Nru a/drivers/acpi/namespace/nsxfobj.c b/drivers/acpi/namespace/nsxfobj.c --- a/drivers/acpi/namespace/nsxfobj.c Fri Feb 14 00:27:26 2003 +++ b/drivers/acpi/namespace/nsxfobj.c Fri Feb 14 00:27:26 2003 @@ -24,8 +24,8 @@ */ -#include "acpi.h" -#include "acnamesp.h" +#include +#include #define _COMPONENT ACPI_NAMESPACE diff -Nru a/drivers/acpi/numa.c b/drivers/acpi/numa.c --- a/drivers/acpi/numa.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/numa.c Fri Feb 14 00:27:29 2003 @@ -29,7 +29,7 @@ #include #include #include -#include "acpi_bus.h" +#include extern int __init acpi_table_parse_madt_family (enum acpi_table_id id, unsigned long madt_size, int entry_id, acpi_madt_entry_handler handler); diff -Nru a/drivers/acpi/osl.c b/drivers/acpi/osl.c --- a/drivers/acpi/osl.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/osl.c Fri Feb 14 00:27:29 2003 @@ -37,7 +37,7 @@ #include #include #include -#include "acpi_bus.h" +#include #ifdef CONFIG_ACPI_EFI #include @@ -143,9 +143,9 @@ #ifdef CONFIG_ACPI_EFI addr->pointer_type = ACPI_PHYSICAL_POINTER; if (efi.acpi20) - addr->pointer.physical = (ACPI_PHYSICAL_ADDRESS) virt_to_phys(efi.acpi20); + addr->pointer.physical = (acpi_physical_address) virt_to_phys(efi.acpi20); else if (efi.acpi) - addr->pointer.physical = (ACPI_PHYSICAL_ADDRESS) virt_to_phys(efi.acpi); + addr->pointer.physical = (acpi_physical_address) virt_to_phys(efi.acpi); else { printk(KERN_ERR PREFIX "System description tables not found\n"); return AE_NOT_FOUND; diff -Nru a/drivers/acpi/parser/psargs.c b/drivers/acpi/parser/psargs.c --- a/drivers/acpi/parser/psargs.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/parser/psargs.c Fri Feb 14 00:27:27 2003 @@ -23,10 +23,10 @@ */ -#include "acpi.h" -#include "acparser.h" -#include "amlcode.h" -#include "acnamesp.h" +#include +#include +#include +#include #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("psargs") diff -Nru a/drivers/acpi/parser/psopcode.c b/drivers/acpi/parser/psopcode.c --- a/drivers/acpi/parser/psopcode.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/parser/psopcode.c Fri Feb 14 00:27:27 2003 @@ -23,9 +23,9 @@ */ -#include "acpi.h" -#include "acparser.h" -#include "amlcode.h" +#include +#include +#include #define _COMPONENT ACPI_PARSER diff -Nru a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c --- a/drivers/acpi/parser/psparse.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/parser/psparse.c Fri Feb 14 00:27:27 2003 @@ -32,12 +32,12 @@ * templates in aml_op_info[] */ -#include "acpi.h" -#include "acparser.h" -#include "acdispat.h" -#include "amlcode.h" -#include "acnamesp.h" -#include "acinterp.h" +#include +#include +#include +#include +#include +#include #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("psparse") diff -Nru a/drivers/acpi/parser/psscope.c b/drivers/acpi/parser/psscope.c --- a/drivers/acpi/parser/psscope.c Fri Feb 14 00:27:26 2003 +++ b/drivers/acpi/parser/psscope.c Fri Feb 14 00:27:26 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "acparser.h" +#include +#include #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("psscope") diff -Nru a/drivers/acpi/parser/pstree.c b/drivers/acpi/parser/pstree.c --- a/drivers/acpi/parser/pstree.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/parser/pstree.c Fri Feb 14 00:27:27 2003 @@ -23,9 +23,9 @@ */ -#include "acpi.h" -#include "acparser.h" -#include "amlcode.h" +#include +#include +#include #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("pstree") diff -Nru a/drivers/acpi/parser/psutils.c b/drivers/acpi/parser/psutils.c --- a/drivers/acpi/parser/psutils.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/parser/psutils.c Fri Feb 14 00:27:28 2003 @@ -23,10 +23,10 @@ */ -#include "acpi.h" -#include "acparser.h" -#include "amlcode.h" -#include "acnamesp.h" +#include +#include +#include +#include #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("psutils") diff -Nru a/drivers/acpi/parser/pswalk.c b/drivers/acpi/parser/pswalk.c --- a/drivers/acpi/parser/pswalk.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/parser/pswalk.c Fri Feb 14 00:27:29 2003 @@ -23,9 +23,9 @@ */ -#include "acpi.h" -#include "acparser.h" -#include "acdispat.h" +#include +#include +#include #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("pswalk") diff -Nru a/drivers/acpi/parser/psxface.c b/drivers/acpi/parser/psxface.c --- a/drivers/acpi/parser/psxface.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/parser/psxface.c Fri Feb 14 00:27:29 2003 @@ -23,11 +23,11 @@ */ -#include "acpi.h" -#include "acparser.h" -#include "acdispat.h" -#include "acinterp.h" -#include "acnamesp.h" +#include +#include +#include +#include +#include #define _COMPONENT ACPI_PARSER diff -Nru a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c --- a/drivers/acpi/pci_bind.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/pci_bind.c Fri Feb 14 00:27:29 2003 @@ -32,8 +32,8 @@ #include #include #include -#include "acpi_bus.h" -#include "acpi_drivers.h" +#include +#include #define _COMPONENT ACPI_PCI_COMPONENT @@ -185,7 +185,7 @@ */ data->dev = pci_find_slot(data->id.bus, PCI_DEVFN(data->id.device, data->id.function)); if (!data->dev) { - ACPI_DEBUG_PRINT((ACPI_DB_WARN, + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device %02x:%02x:%02x.%02x not present in PCI namespace\n", data->id.segment, data->id.bus, data->id.device, data->id.function)); diff -Nru a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c --- a/drivers/acpi/pci_irq.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/pci_irq.c Fri Feb 14 00:27:28 2003 @@ -36,8 +36,8 @@ #ifdef CONFIG_X86_IO_APIC #include #endif -#include "acpi_bus.h" -#include "acpi_drivers.h" +#include +#include #define _COMPONENT ACPI_PCI_COMPONENT diff -Nru a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c --- a/drivers/acpi/pci_link.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/pci_link.c Fri Feb 14 00:27:27 2003 @@ -38,8 +38,8 @@ #include #include -#include "acpi_bus.h" -#include "acpi_drivers.h" +#include +#include #define _COMPONENT ACPI_PCI_COMPONENT diff -Nru a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c --- a/drivers/acpi/pci_root.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/pci_root.c Fri Feb 14 00:27:27 2003 @@ -32,8 +32,8 @@ #include #include #include -#include "acpi_bus.h" -#include "acpi_drivers.h" +#include +#include #define _COMPONENT ACPI_PCI_COMPONENT diff -Nru a/drivers/acpi/power.c b/drivers/acpi/power.c --- a/drivers/acpi/power.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/power.c Fri Feb 14 00:27:28 2003 @@ -29,8 +29,8 @@ #include #include #include -#include "acpi_bus.h" -#include "acpi_drivers.h" +#include +#include #define _COMPONENT ACPI_POWER_COMPONENT diff -Nru a/drivers/acpi/processor.c b/drivers/acpi/processor.c --- a/drivers/acpi/processor.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/processor.c Fri Feb 14 00:27:29 2003 @@ -44,9 +44,9 @@ #include #include -#include "acpi_bus.h" -#include "acpi_drivers.h" -#include "processor.h" +#include +#include +#include #define ACPI_PROCESSOR_COMPONENT 0x01000000 diff -Nru a/drivers/acpi/resources/rsaddr.c b/drivers/acpi/resources/rsaddr.c --- a/drivers/acpi/resources/rsaddr.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/resources/rsaddr.c Fri Feb 14 00:27:28 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "acresrc.h" +#include +#include #define _COMPONENT ACPI_RESOURCES ACPI_MODULE_NAME ("rsaddr") diff -Nru a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c --- a/drivers/acpi/resources/rscalc.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/resources/rscalc.c Fri Feb 14 00:27:28 2003 @@ -23,10 +23,10 @@ */ -#include "acpi.h" -#include "acresrc.h" -#include "amlcode.h" -#include "acnamesp.h" +#include +#include +#include +#include #define _COMPONENT ACPI_RESOURCES ACPI_MODULE_NAME ("rscalc") diff -Nru a/drivers/acpi/resources/rscreate.c b/drivers/acpi/resources/rscreate.c --- a/drivers/acpi/resources/rscreate.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/resources/rscreate.c Fri Feb 14 00:27:27 2003 @@ -23,10 +23,10 @@ */ -#include "acpi.h" -#include "acresrc.h" -#include "amlcode.h" -#include "acnamesp.h" +#include +#include +#include +#include #define _COMPONENT ACPI_RESOURCES ACPI_MODULE_NAME ("rscreate") diff -Nru a/drivers/acpi/resources/rsdump.c b/drivers/acpi/resources/rsdump.c --- a/drivers/acpi/resources/rsdump.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/resources/rsdump.c Fri Feb 14 00:27:28 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "acresrc.h" +#include +#include #define _COMPONENT ACPI_RESOURCES ACPI_MODULE_NAME ("rsdump") diff -Nru a/drivers/acpi/resources/rsio.c b/drivers/acpi/resources/rsio.c --- a/drivers/acpi/resources/rsio.c Fri Feb 14 00:27:26 2003 +++ b/drivers/acpi/resources/rsio.c Fri Feb 14 00:27:26 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "acresrc.h" +#include +#include #define _COMPONENT ACPI_RESOURCES ACPI_MODULE_NAME ("rsio") diff -Nru a/drivers/acpi/resources/rsirq.c b/drivers/acpi/resources/rsirq.c --- a/drivers/acpi/resources/rsirq.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/resources/rsirq.c Fri Feb 14 00:27:30 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "acresrc.h" +#include +#include #define _COMPONENT ACPI_RESOURCES ACPI_MODULE_NAME ("rsirq") diff -Nru a/drivers/acpi/resources/rslist.c b/drivers/acpi/resources/rslist.c --- a/drivers/acpi/resources/rslist.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/resources/rslist.c Fri Feb 14 00:27:30 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "acresrc.h" +#include +#include #define _COMPONENT ACPI_RESOURCES ACPI_MODULE_NAME ("rslist") diff -Nru a/drivers/acpi/resources/rsmemory.c b/drivers/acpi/resources/rsmemory.c --- a/drivers/acpi/resources/rsmemory.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/resources/rsmemory.c Fri Feb 14 00:27:29 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "acresrc.h" +#include +#include #define _COMPONENT ACPI_RESOURCES ACPI_MODULE_NAME ("rsmemory") diff -Nru a/drivers/acpi/resources/rsmisc.c b/drivers/acpi/resources/rsmisc.c --- a/drivers/acpi/resources/rsmisc.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/resources/rsmisc.c Fri Feb 14 00:27:27 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "acresrc.h" +#include +#include #define _COMPONENT ACPI_RESOURCES ACPI_MODULE_NAME ("rsmisc") diff -Nru a/drivers/acpi/resources/rsutils.c b/drivers/acpi/resources/rsutils.c --- a/drivers/acpi/resources/rsutils.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/resources/rsutils.c Fri Feb 14 00:27:27 2003 @@ -23,9 +23,9 @@ */ -#include "acpi.h" -#include "acnamesp.h" -#include "acresrc.h" +#include +#include +#include #define _COMPONENT ACPI_RESOURCES diff -Nru a/drivers/acpi/resources/rsxface.c b/drivers/acpi/resources/rsxface.c --- a/drivers/acpi/resources/rsxface.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/resources/rsxface.c Fri Feb 14 00:27:29 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "acresrc.h" +#include +#include #define _COMPONENT ACPI_RESOURCES ACPI_MODULE_NAME ("rsxface") diff -Nru a/drivers/acpi/scan.c b/drivers/acpi/scan.c --- a/drivers/acpi/scan.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/scan.c Fri Feb 14 00:27:28 2003 @@ -5,7 +5,7 @@ #include #include -#include "acpi_drivers.h" +#include #include /* for acpi_ex_eisa_id_to_string() */ @@ -295,15 +295,15 @@ ACPI_FUNCTION_TRACE("acpi_driver_attach"); spin_lock(&acpi_device_lock); - list_for_each_safe(node,next,&acpi_device_list) { - struct acpi_device * dev = container_of(node,struct acpi_device,g_list); + list_for_each_safe(node, next, &acpi_device_list) { + struct acpi_device * dev = container_of(node, struct acpi_device, g_list); if (dev->driver || !dev->status.present) continue; spin_unlock(&acpi_device_lock); - if (!acpi_bus_match(dev,drv)) { - if (!acpi_bus_driver_init(dev,drv)) { + if (!acpi_bus_match(dev, drv)) { + if (!acpi_bus_driver_init(dev, drv)) { atomic_inc(&drv->references); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found driver [%s] for device [%s]\n", drv->name, dev->pnp.bus_id)); diff -Nru a/drivers/acpi/sleep/Makefile b/drivers/acpi/sleep/Makefile --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/drivers/acpi/sleep/Makefile Fri Feb 14 00:27:30 2003 @@ -0,0 +1,5 @@ +obj-y := poweroff.o +obj-$(CONFIG_ACPI_SLEEP) += main.o +obj-$(CONFIG_ACPI_SLEEP_PROC_FS) += proc.o + +EXTRA_CFLAGS += $(ACPI_CFLAGS) diff -Nru a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/drivers/acpi/sleep/main.c Fri Feb 14 00:27:26 2003 @@ -0,0 +1,277 @@ +/* + * sleep.c - ACPI sleep support. + * + * Copyright (c) 2000-2003 Patrick Mochel + * + * Portions are + * Copyright (C) 2001, 2002 Andy Grover + * Copyright (C) 2001, 2002 Paul Diefenbaugh + */ + +#include +#include +#include +#include +#include +#include +#include "sleep.h" + +#define _COMPONENT ACPI_SYSTEM_COMPONENT +ACPI_MODULE_NAME ("sleep") + +u8 sleep_states[ACPI_S_STATE_COUNT]; + +/** + * acpi_system_restore_state - OS-specific restoration of state + * @state: sleep state we're exiting + * + * Note that if we're coming back from S4, the memory image should have already + * been loaded from the disk and is already in place. (Otherwise how else would we + * be here?). + */ +acpi_status +acpi_system_restore_state ( + u32 state) +{ + /* restore processor state + * We should only be here if we're coming back from STR or STD. + * And, in the case of the latter, the memory image should have already + * been loaded from disk. + */ + if (state > ACPI_STATE_S1) + acpi_restore_state_mem(); + + /* wait for power to come back */ + mdelay(10); + + /* turn all the devices back on */ + device_resume(RESUME_POWER_ON); + + /* enable interrupts once again */ + ACPI_ENABLE_IRQS(); + + /* restore device context */ + device_resume(RESUME_RESTORE_STATE); + + if (dmi_broken & BROKEN_INIT_AFTER_S1) { + printk("Broken toshiba laptop -> kicking interrupts\n"); + init_8259A(0); + } + + return AE_OK; +} + +/** + * acpi_system_save_state - save OS specific state and power down devices + * @state: sleep state we're entering. + * + * This handles saving all context to memory, and possibly disk. + * First, we call to the device driver layer to save device state. + * Once we have that, we save whatevery processor and kernel state we + * need to memory. + * If we're entering S4, we then write the memory image to disk. + * + * Only then is it safe for us to power down devices, since we may need + * the disks and upstream buses to write to. + */ +acpi_status +acpi_system_save_state( + u32 state) +{ + int error = 0; + + /* Send notification to devices that they will be suspended. + * If any device or driver cannot make the transition, either up + * or down, we'll get an error back. + */ + error = device_suspend(state, SUSPEND_NOTIFY); + if (error) + return AE_ERROR; + + if (state < ACPI_STATE_S5) { + + /* Tell devices to stop I/O and actually save their state. + * It is theoretically possible that something could fail, + * so handle that gracefully.. + */ + error = device_suspend(state, SUSPEND_SAVE_STATE); + if (error) { + /* tell devices to restore state if they have + * it saved and to start taking I/O requests. + */ + device_resume(RESUME_RESTORE_STATE); + return error; + } + + /* flush caches */ + ACPI_FLUSH_CPU_CACHE(); + + /* Do arch specific saving of state. */ + if (state > ACPI_STATE_S1) { + error = acpi_save_state_mem(); + + if (!error && (state == ACPI_STATE_S4)) + error = acpi_save_state_disk(); + + if (error) { + device_resume(RESUME_RESTORE_STATE); + return error; + } + } + } + + /* disable interrupts + * Note that acpi_suspend -- our caller -- will do this once we return. + * But, we want it done early, so we don't get any suprises during + * the device suspend sequence. + */ + ACPI_DISABLE_IRQS(); + + /* Unconditionally turn off devices. + * Obvious if we enter a sleep state. + * If entering S5 (soft off), this should put devices in a + * quiescent state. + */ + error = device_suspend(state, SUSPEND_POWER_DOWN); + + /* We're pretty screwed if we got an error from this. + * We try to recover by simply calling our own restore_state + * function; see above for definition. + * + * If it's S5 though, go through with it anyway.. + */ + if (error && state != ACPI_STATE_S5) + acpi_system_restore_state(state); + + return error ? AE_ERROR : AE_OK; +} + + +/**************************************************************************** + * + * FUNCTION: acpi_system_suspend + * + * PARAMETERS: %state: Sleep state to enter. + * + * RETURN: acpi_status, whether or not we successfully entered and + * exited sleep. + * + * DESCRIPTION: Perform OS-specific action to enter sleep state. + * This is the final step in going to sleep, per spec. If we + * know we're coming back (i.e. not entering S5), we save the + * processor flags. [ We'll have to save and restore them anyway, + * so we use the arch-agnostic save_flags and restore_flags + * here.] We then set the place to return to in arch-specific + * globals using arch_set_return_point. Finally, we call the + * ACPI function to write the proper values to I/O ports. + * + ****************************************************************************/ + +acpi_status +acpi_system_suspend( + u32 state) +{ + acpi_status status = AE_ERROR; + unsigned long flags = 0; + + local_irq_save(flags); + + switch (state) + { + case ACPI_STATE_S1: + barrier(); + status = acpi_enter_sleep_state(state); + break; + + case ACPI_STATE_S2: +#ifdef CONFIG_SOFTWARE_SUSPEND + case ACPI_STATE_S3: + do_suspend_lowlevel(0); +#endif + break; + } + local_irq_restore(flags); + + return status; +} + + +/** + * acpi_suspend - OS-agnostic system suspend/resume support (S? states) + * @state: state we're entering + * + */ +acpi_status +acpi_suspend ( + u32 state) +{ + acpi_status status; + + /* get out if state is invalid */ + if (state < ACPI_STATE_S1 || state > ACPI_STATE_S5) + return AE_ERROR; + + freeze_processes(); /* device_suspend needs processes to be stopped */ + + /* do we have a wakeup address for S2 and S3? */ + if (state == ACPI_STATE_S2 || state == ACPI_STATE_S3) { + if (!acpi_wakeup_address) + return AE_ERROR; + acpi_set_firmware_waking_vector((acpi_physical_address) acpi_wakeup_address); + } + + acpi_enter_sleep_state_prep(state); + + status = acpi_system_save_state(state); + if (!ACPI_SUCCESS(status)) + return status; + + /* disable interrupts and flush caches */ + ACPI_DISABLE_IRQS(); + ACPI_FLUSH_CPU_CACHE(); + + /* perform OS-specific sleep actions */ + status = acpi_system_suspend(state); + + /* Even if we failed to go to sleep, all of the devices are in an suspended + * mode. So, we run these unconditionaly to make sure we have a usable system + * no matter what. + */ + acpi_system_restore_state(state); + acpi_leave_sleep_state(state); + + /* make sure interrupts are enabled */ + ACPI_ENABLE_IRQS(); + + /* reset firmware waking vector */ + acpi_set_firmware_waking_vector((acpi_physical_address) 0); + thaw_processes(); + + return status; +} + +static int __init acpi_sleep_init(void) +{ + int i = 0; + + ACPI_FUNCTION_TRACE("acpi_system_add_fs"); + + if (acpi_disabled) + return_VALUE(0); + + printk(KERN_INFO PREFIX "(supports"); + for (i=0; i +#include +#include + +static void +acpi_power_off (void) +{ + printk("%s called\n",__FUNCTION__); + acpi_enter_sleep_state_prep(ACPI_STATE_S5); + ACPI_DISABLE_IRQS(); + acpi_enter_sleep_state(ACPI_STATE_S5); +} + +static int acpi_poweroff_init(void) +{ + if (!acpi_disabled) { + u8 type_a, type_b; + acpi_status status; + + status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b); + if (ACPI_SUCCESS(status)) + pm_power_off = acpi_power_off; + } + return 0; +} + +late_initcall(acpi_poweroff_init); diff -Nru a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/drivers/acpi/sleep/proc.c Fri Feb 14 00:27:30 2003 @@ -0,0 +1,397 @@ +#include +#include +#include +#include +#include + +#include +#include + +#ifdef CONFIG_X86 +#include +#endif + +#include "sleep.h" + +#define ACPI_SYSTEM_FILE_SLEEP "sleep" +#define ACPI_SYSTEM_FILE_ALARM "alarm" + +#define _COMPONENT ACPI_SYSTEM_COMPONENT +ACPI_MODULE_NAME ("sleep") + + +static int acpi_system_sleep_seq_show(struct seq_file *seq, void *offset) +{ + int i; + + ACPI_FUNCTION_TRACE("acpi_system_sleep_seq_show"); + + for (i = 0; i <= ACPI_STATE_S5; i++) { + if (sleep_states[i]) + seq_printf(seq,"S%d ", i); + } + + seq_puts(seq, "\n"); + + return 0; +} + +static int acpi_system_sleep_open_fs(struct inode *inode, struct file *file) +{ + return single_open(file, acpi_system_sleep_seq_show, PDE(inode)->data); +} + +static int +acpi_system_write_sleep ( + struct file *file, + const char *buffer, + size_t count, + loff_t *ppos) +{ + acpi_status status = AE_ERROR; + char state_string[12] = {'\0'}; + u32 state = 0; + + ACPI_FUNCTION_TRACE("acpi_system_write_sleep"); + + if (count > sizeof(state_string) - 1) + goto Done; + + if (copy_from_user(state_string, buffer, count)) + return_VALUE(-EFAULT); + + state_string[count] = '\0'; + + state = simple_strtoul(state_string, NULL, 0); + + if (state < 1 || state > 4) + goto Done; + + if (!sleep_states[state]) + goto Done; + +#ifdef CONFIG_SOFTWARE_SUSPEND + if (state == 4) { + software_suspend(); + goto Done; + } +#endif + status = acpi_suspend(state); + Done: + if (ACPI_FAILURE(status)) + return_VALUE(-EINVAL); + else + return_VALUE(count); +} + +static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset) +{ + u32 sec, min, hr; + u32 day, mo, yr; + + ACPI_FUNCTION_TRACE("acpi_system_alarm_seq_show"); + + spin_lock(&rtc_lock); + + sec = CMOS_READ(RTC_SECONDS_ALARM); + min = CMOS_READ(RTC_MINUTES_ALARM); + hr = CMOS_READ(RTC_HOURS_ALARM); + +#if 0 /* If we ever get an FACP with proper values... */ + if (acpi_gbl_FADT->day_alrm) + day = CMOS_READ(acpi_gbl_FADT->day_alrm); + else + day = CMOS_READ(RTC_DAY_OF_MONTH); + if (acpi_gbl_FADT->mon_alrm) + mo = CMOS_READ(acpi_gbl_FADT->mon_alrm); + else + mo = CMOS_READ(RTC_MONTH);; + if (acpi_gbl_FADT->century) + yr = CMOS_READ(acpi_gbl_FADT->century) * 100 + CMOS_READ(RTC_YEAR); + else + yr = CMOS_READ(RTC_YEAR); +#else + day = CMOS_READ(RTC_DAY_OF_MONTH); + mo = CMOS_READ(RTC_MONTH); + yr = CMOS_READ(RTC_YEAR); +#endif + + spin_unlock(&rtc_lock); + + BCD_TO_BIN(sec); + BCD_TO_BIN(min); + BCD_TO_BIN(hr); + BCD_TO_BIN(day); + BCD_TO_BIN(mo); + BCD_TO_BIN(yr); + +#if 0 + /* we're trusting the FADT (see above)*/ +#else + /* If we're not trusting the FADT, we should at least make it + * right for _this_ century... ehm, what is _this_ century? + * + * TBD: + * ASAP: find piece of code in the kernel, e.g. star tracker driver, + * which we can trust to determine the century correctly. Atom + * watch driver would be nice, too... + * + * if that has not happened, change for first release in 2050: + * if (yr<50) + * yr += 2100; + * else + * yr += 2000; // current line of code + * + * if that has not happened either, please do on 2099/12/31:23:59:59 + * s/2000/2100 + * + */ + yr += 2000; +#endif + + seq_printf(seq,"%4.4u-", yr); + (mo > 12) ? seq_puts(seq, "**-") : seq_printf(seq, "%2.2u-", mo); + (day > 31) ? seq_puts(seq, "** ") : seq_printf(seq, "%2.2u ", day); + (hr > 23) ? seq_puts(seq, "**:") : seq_printf(seq, "%2.2u:", hr); + (min > 59) ? seq_puts(seq, "**:") : seq_printf(seq, "%2.2u:", min); + (sec > 59) ? seq_puts(seq, "**\n") : seq_printf(seq, "%2.2u\n", sec); + + return 0; +} + +static int acpi_system_alarm_open_fs(struct inode *inode, struct file *file) +{ + return single_open(file, acpi_system_alarm_seq_show, PDE(inode)->data); +} + + +static int +get_date_field ( + char **p, + u32 *value) +{ + char *next = NULL; + char *string_end = NULL; + int result = -EINVAL; + + /* + * Try to find delimeter, only to insert null. The end of the + * string won't have one, but is still valid. + */ + next = strpbrk(*p, "- :"); + if (next) + *next++ = '\0'; + + *value = simple_strtoul(*p, &string_end, 10); + + /* Signal success if we got a good digit */ + if (string_end != *p) + result = 0; + + if (next) + *p = next; + + return result; +} + + +static int +acpi_system_write_alarm ( + struct file *file, + const char *buffer, + size_t count, + loff_t *ppos) +{ + int result = 0; + char alarm_string[30] = {'\0'}; + char *p = alarm_string; + u32 sec, min, hr, day, mo, yr; + int adjust = 0; + unsigned char rtc_control = 0; + + ACPI_FUNCTION_TRACE("acpi_system_write_alarm"); + + if (count > sizeof(alarm_string) - 1) + return_VALUE(-EINVAL); + + if (copy_from_user(alarm_string, buffer, count)) + return_VALUE(-EFAULT); + + alarm_string[count] = '\0'; + + /* check for time adjustment */ + if (alarm_string[0] == '+') { + p++; + adjust = 1; + } + + if ((result = get_date_field(&p, &yr))) + goto end; + if ((result = get_date_field(&p, &mo))) + goto end; + if ((result = get_date_field(&p, &day))) + goto end; + if ((result = get_date_field(&p, &hr))) + goto end; + if ((result = get_date_field(&p, &min))) + goto end; + if ((result = get_date_field(&p, &sec))) + goto end; + + if (sec > 59) { + min += 1; + sec -= 60; + } + if (min > 59) { + hr += 1; + min -= 60; + } + if (hr > 23) { + day += 1; + hr -= 24; + } + if (day > 31) { + mo += 1; + day -= 31; + } + if (mo > 12) { + yr += 1; + mo -= 12; + } + + spin_lock_irq(&rtc_lock); + + rtc_control = CMOS_READ(RTC_CONTROL); + if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { + BIN_TO_BCD(yr); + BIN_TO_BCD(mo); + BIN_TO_BCD(day); + BIN_TO_BCD(hr); + BIN_TO_BCD(min); + BIN_TO_BCD(sec); + } + + if (adjust) { + yr += CMOS_READ(RTC_YEAR); + mo += CMOS_READ(RTC_MONTH); + day += CMOS_READ(RTC_DAY_OF_MONTH); + hr += CMOS_READ(RTC_HOURS); + min += CMOS_READ(RTC_MINUTES); + sec += CMOS_READ(RTC_SECONDS); + } + + spin_unlock_irq(&rtc_lock); + + if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { + BCD_TO_BIN(yr); + BCD_TO_BIN(mo); + BCD_TO_BIN(day); + BCD_TO_BIN(hr); + BCD_TO_BIN(min); + BCD_TO_BIN(sec); + } + + if (sec > 59) { + min++; + sec -= 60; + } + if (min > 59) { + hr++; + min -= 60; + } + if (hr > 23) { + day++; + hr -= 24; + } + if (day > 31) { + mo++; + day -= 31; + } + if (mo > 12) { + yr++; + mo -= 12; + } + if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { + BIN_TO_BCD(yr); + BIN_TO_BCD(mo); + BIN_TO_BCD(day); + BIN_TO_BCD(hr); + BIN_TO_BCD(min); + BIN_TO_BCD(sec); + } + + spin_lock_irq(&rtc_lock); + + /* write the fields the rtc knows about */ + CMOS_WRITE(hr, RTC_HOURS_ALARM); + CMOS_WRITE(min, RTC_MINUTES_ALARM); + CMOS_WRITE(sec, RTC_SECONDS_ALARM); + + /* + * If the system supports an enhanced alarm it will have non-zero + * offsets into the CMOS RAM here -- which for some reason are pointing + * to the RTC area of memory. + */ +#if 0 + if (acpi_gbl_FADT->day_alrm) + CMOS_WRITE(day, acpi_gbl_FADT->day_alrm); + if (acpi_gbl_FADT->mon_alrm) + CMOS_WRITE(mo, acpi_gbl_FADT->mon_alrm); + if (acpi_gbl_FADT->century) + CMOS_WRITE(yr/100, acpi_gbl_FADT->century); +#endif + /* enable the rtc alarm interrupt */ + if (!(rtc_control & RTC_AIE)) { + rtc_control |= RTC_AIE; + CMOS_WRITE(rtc_control,RTC_CONTROL); + CMOS_READ(RTC_INTR_FLAGS); + } + + spin_unlock_irq(&rtc_lock); + + acpi_set_register(ACPI_BITREG_RT_CLOCK_ENABLE, 1, ACPI_MTX_LOCK); + + file->f_pos += count; + + result = 0; +end: + return_VALUE(result ? result : count); +} + + +static struct file_operations acpi_system_sleep_fops = { + .open = acpi_system_sleep_open_fs, + .read = seq_read, + .write = acpi_system_write_sleep, + .llseek = seq_lseek, + .release = single_release, +}; + +static struct file_operations acpi_system_alarm_fops = { + .open = acpi_system_alarm_open_fs, + .read = seq_read, + .write = acpi_system_write_alarm, + .llseek = seq_lseek, + .release = single_release, +}; + + +static int acpi_sleep_proc_init(void) +{ + struct proc_dir_entry *entry = NULL; + + /* 'sleep' [R/W]*/ + entry = create_proc_entry(ACPI_SYSTEM_FILE_SLEEP, + S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir); + if (entry) + entry->proc_fops = &acpi_system_sleep_fops; + + /* 'alarm' [R/W] */ + entry = create_proc_entry(ACPI_SYSTEM_FILE_ALARM, + S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir); + if (entry) + entry->proc_fops = &acpi_system_alarm_fops; + return 0; +} + +late_initcall(acpi_sleep_proc_init); diff -Nru a/drivers/acpi/sleep/sleep.h b/drivers/acpi/sleep/sleep.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/drivers/acpi/sleep/sleep.h Fri Feb 14 00:27:30 2003 @@ -0,0 +1,5 @@ + +extern u8 sleep_states[]; + +extern acpi_status acpi_suspend (u32 state); + diff -Nru a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c --- a/drivers/acpi/sleep.c Fri Feb 14 00:27:26 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,707 +0,0 @@ -/* - * sleep.c - ACPI sleep support. - * - * Copyright (c) 2000-2002 Patrick Mochel - * - * Portions are - * Copyright (C) 2001, 2002 Andy Grover - * Copyright (C) 2001, 2002 Paul Diefenbaugh - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "acpi_bus.h" -#include "acpi_drivers.h" - -#ifdef CONFIG_X86 -#include -#endif - -#define _COMPONENT ACPI_SYSTEM_COMPONENT -ACPI_MODULE_NAME ("sleep") - -#define ACPI_SYSTEM_FILE_SLEEP "sleep" -#define ACPI_SYSTEM_FILE_ALARM "alarm" - -static int acpi_system_sleep_open_fs(struct inode *inode, struct file *file); -static int acpi_system_alarm_open_fs(struct inode *inode, struct file *file); - -static u8 sleep_states[ACPI_S_STATE_COUNT]; - -static struct file_operations acpi_system_sleep_fops = { - .open = acpi_system_sleep_open_fs, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static struct file_operations acpi_system_alarm_fops = { - .open = acpi_system_alarm_open_fs, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static void -acpi_power_off (void) -{ - acpi_enter_sleep_state_prep(ACPI_STATE_S5); - ACPI_DISABLE_IRQS(); - acpi_enter_sleep_state(ACPI_STATE_S5); -} - -/** - * acpi_system_restore_state - OS-specific restoration of state - * @state: sleep state we're exiting - * - * Note that if we're coming back from S4, the memory image should have already - * been loaded from the disk and is already in place. (Otherwise how else would we - * be here?). - */ -acpi_status -acpi_system_restore_state ( - u32 state) -{ - /* restore processor state - * We should only be here if we're coming back from STR or STD. - * And, in the case of the latter, the memory image should have already - * been loaded from disk. - */ - if (state > ACPI_STATE_S1) - acpi_restore_state_mem(); - - /* wait for power to come back */ - mdelay(10); - - /* turn all the devices back on */ - device_resume(RESUME_POWER_ON); - - /* enable interrupts once again */ - ACPI_ENABLE_IRQS(); - - /* restore device context */ - device_resume(RESUME_RESTORE_STATE); - - if (dmi_broken & BROKEN_INIT_AFTER_S1) { - printk("Broken toshiba laptop -> kicking interrupts\n"); - init_8259A(0); - } - - return AE_OK; -} - -/** - * acpi_system_save_state - save OS specific state and power down devices - * @state: sleep state we're entering. - * - * This handles saving all context to memory, and possibly disk. - * First, we call to the device driver layer to save device state. - * Once we have that, we save whatevery processor and kernel state we - * need to memory. - * If we're entering S4, we then write the memory image to disk. - * - * Only then is it safe for us to power down devices, since we may need - * the disks and upstream buses to write to. - */ -acpi_status -acpi_system_save_state( - u32 state) -{ - int error = 0; - - /* Send notification to devices that they will be suspended. - * If any device or driver cannot make the transition, either up - * or down, we'll get an error back. - */ - error = device_suspend(state, SUSPEND_NOTIFY); - if (error) - return AE_ERROR; - - if (state < ACPI_STATE_S5) { - - /* Tell devices to stop I/O and actually save their state. - * It is theoretically possible that something could fail, - * so handle that gracefully.. - */ - error = device_suspend(state, SUSPEND_SAVE_STATE); - if (error) { - /* tell devices to restore state if they have - * it saved and to start taking I/O requests. - */ - device_resume(RESUME_RESTORE_STATE); - return error; - } - - /* flush caches */ - ACPI_FLUSH_CPU_CACHE(); - - /* Do arch specific saving of state. */ - if (state > ACPI_STATE_S1) { - error = acpi_save_state_mem(); - - if (!error && (state == ACPI_STATE_S4)) - error = acpi_save_state_disk(); - - if (error) { - device_resume(RESUME_RESTORE_STATE); - return error; - } - } - } - - /* disable interrupts - * Note that acpi_suspend -- our caller -- will do this once we return. - * But, we want it done early, so we don't get any suprises during - * the device suspend sequence. - */ - ACPI_DISABLE_IRQS(); - - /* Unconditionally turn off devices. - * Obvious if we enter a sleep state. - * If entering S5 (soft off), this should put devices in a - * quiescent state. - */ - error = device_suspend(state, SUSPEND_POWER_DOWN); - - /* We're pretty screwed if we got an error from this. - * We try to recover by simply calling our own restore_state - * function; see above for definition. - * - * If it's S5 though, go through with it anyway.. - */ - if (error && state != ACPI_STATE_S5) - acpi_system_restore_state(state); - - return error ? AE_ERROR : AE_OK; -} - - -/**************************************************************************** - * - * FUNCTION: acpi_system_suspend - * - * PARAMETERS: %state: Sleep state to enter. - * - * RETURN: acpi_status, whether or not we successfully entered and - * exited sleep. - * - * DESCRIPTION: Perform OS-specific action to enter sleep state. - * This is the final step in going to sleep, per spec. If we - * know we're coming back (i.e. not entering S5), we save the - * processor flags. [ We'll have to save and restore them anyway, - * so we use the arch-agnostic save_flags and restore_flags - * here.] We then set the place to return to in arch-specific - * globals using arch_set_return_point. Finally, we call the - * ACPI function to write the proper values to I/O ports. - * - ****************************************************************************/ - -acpi_status -acpi_system_suspend( - u32 state) -{ - acpi_status status = AE_ERROR; - unsigned long flags = 0; - - local_irq_save(flags); - - switch (state) - { - case ACPI_STATE_S1: - barrier(); - status = acpi_enter_sleep_state(state); - break; - - case ACPI_STATE_S2: -#ifdef CONFIG_SOFTWARE_SUSPEND - case ACPI_STATE_S3: - do_suspend_lowlevel(0); -#endif - break; - } - local_irq_restore(flags); - - return status; -} - - -/** - * acpi_suspend - OS-agnostic system suspend/resume support (S? states) - * @state: state we're entering - * - */ -acpi_status -acpi_suspend ( - u32 state) -{ - acpi_status status; - - /* get out if state is invalid */ - if (state < ACPI_STATE_S1 || state > ACPI_STATE_S5) - return AE_ERROR; - - freeze_processes(); /* device_suspend needs processes to be stopped */ - - /* do we have a wakeup address for S2 and S3? */ - if (state == ACPI_STATE_S2 || state == ACPI_STATE_S3) { - if (!acpi_wakeup_address) - return AE_ERROR; - acpi_set_firmware_waking_vector((acpi_physical_address) acpi_wakeup_address); - } - - acpi_enter_sleep_state_prep(state); - - status = acpi_system_save_state(state); - if (!ACPI_SUCCESS(status)) - return status; - - /* disable interrupts and flush caches */ - ACPI_DISABLE_IRQS(); - ACPI_FLUSH_CPU_CACHE(); - - /* perform OS-specific sleep actions */ - status = acpi_system_suspend(state); - - /* Even if we failed to go to sleep, all of the devices are in an suspended - * mode. So, we run these unconditionaly to make sure we have a usable system - * no matter what. - */ - acpi_system_restore_state(state); - acpi_leave_sleep_state(state); - - /* make sure interrupts are enabled */ - ACPI_ENABLE_IRQS(); - - /* reset firmware waking vector */ - acpi_set_firmware_waking_vector((acpi_physical_address) 0); - thaw_processes(); - - return status; -} - -static int acpi_system_sleep_seq_show(struct seq_file *seq, void *offset) -{ - int i; - - ACPI_FUNCTION_TRACE("acpi_system_sleep_seq_show"); - - for (i = 0; i <= ACPI_STATE_S5; i++) { - if (sleep_states[i]) - seq_printf(seq,"S%d ", i); - } - - seq_puts(seq, "\n"); - - return 0; -} - -static int acpi_system_sleep_open_fs(struct inode *inode, struct file *file) -{ - return single_open(file, acpi_system_sleep_seq_show, PDE(inode)->data); -} - -static int -acpi_system_write_sleep ( - struct file *file, - const char *buffer, - size_t count, - loff_t *ppos) -{ - acpi_status status = AE_OK; - char state_string[12] = {'\0'}; - u32 state = 0; - - ACPI_FUNCTION_TRACE("acpi_system_write_sleep"); - - if (count > sizeof(state_string) - 1) - return_VALUE(-EINVAL); - - if (copy_from_user(state_string, buffer, count)) - return_VALUE(-EFAULT); - - state_string[count] = '\0'; - - state = simple_strtoul(state_string, NULL, 0); - - if (!sleep_states[state]) - return_VALUE(-ENODEV); - -#ifdef CONFIG_SOFTWARE_SUSPEND - if (state == 4) { - software_suspend(); - return_VALUE(count); - } -#endif - status = acpi_suspend(state); - - if (ACPI_FAILURE(status)) - return_VALUE(-ENODEV); - - return_VALUE(count); -} - -static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset) -{ - u32 sec, min, hr; - u32 day, mo, yr; - - ACPI_FUNCTION_TRACE("acpi_system_alarm_seq_show"); - - spin_lock(&rtc_lock); - - sec = CMOS_READ(RTC_SECONDS_ALARM); - min = CMOS_READ(RTC_MINUTES_ALARM); - hr = CMOS_READ(RTC_HOURS_ALARM); - -#if 0 /* If we ever get an FACP with proper values... */ - if (acpi_gbl_FADT->day_alrm) - day = CMOS_READ(acpi_gbl_FADT->day_alrm); - else - day = CMOS_READ(RTC_DAY_OF_MONTH); - if (acpi_gbl_FADT->mon_alrm) - mo = CMOS_READ(acpi_gbl_FADT->mon_alrm); - else - mo = CMOS_READ(RTC_MONTH);; - if (acpi_gbl_FADT->century) - yr = CMOS_READ(acpi_gbl_FADT->century) * 100 + CMOS_READ(RTC_YEAR); - else - yr = CMOS_READ(RTC_YEAR); -#else - day = CMOS_READ(RTC_DAY_OF_MONTH); - mo = CMOS_READ(RTC_MONTH); - yr = CMOS_READ(RTC_YEAR); -#endif - - spin_unlock(&rtc_lock); - - BCD_TO_BIN(sec); - BCD_TO_BIN(min); - BCD_TO_BIN(hr); - BCD_TO_BIN(day); - BCD_TO_BIN(mo); - BCD_TO_BIN(yr); - -#if 0 - /* we're trusting the FADT (see above)*/ -#else - /* If we're not trusting the FADT, we should at least make it - * right for _this_ century... ehm, what is _this_ century? - * - * TBD: - * ASAP: find piece of code in the kernel, e.g. star tracker driver, - * which we can trust to determine the century correctly. Atom - * watch driver would be nice, too... - * - * if that has not happened, change for first release in 2050: - * if (yr<50) - * yr += 2100; - * else - * yr += 2000; // current line of code - * - * if that has not happened either, please do on 2099/12/31:23:59:59 - * s/2000/2100 - * - */ - yr += 2000; -#endif - - seq_printf(seq,"%4.4u-", yr); - (mo > 12) ? seq_puts(seq, "**-") : seq_printf(seq, "%2.2u-", mo); - (day > 31) ? seq_puts(seq, "** ") : seq_printf(seq, "%2.2u ", day); - (hr > 23) ? seq_puts(seq, "**:") : seq_printf(seq, "%2.2u:", hr); - (min > 59) ? seq_puts(seq, "**:") : seq_printf(seq, "%2.2u:", min); - (sec > 59) ? seq_puts(seq, "**\n") : seq_printf(seq, "%2.2u\n", sec); - - return 0; -} - -static int acpi_system_alarm_open_fs(struct inode *inode, struct file *file) -{ - return single_open(file, acpi_system_alarm_seq_show, PDE(inode)->data); -} - - -static int -get_date_field ( - char **p, - u32 *value) -{ - char *next = NULL; - char *string_end = NULL; - int result = -EINVAL; - - /* - * Try to find delimeter, only to insert null. The end of the - * string won't have one, but is still valid. - */ - next = strpbrk(*p, "- :"); - if (next) - *next++ = '\0'; - - *value = simple_strtoul(*p, &string_end, 10); - - /* Signal success if we got a good digit */ - if (string_end != *p) - result = 0; - - if (next) - *p = next; - - return result; -} - - -static int -acpi_system_write_alarm ( - struct file *file, - const char *buffer, - size_t count, - loff_t *ppos) -{ - int result = 0; - char alarm_string[30] = {'\0'}; - char *p = alarm_string; - u32 sec, min, hr, day, mo, yr; - int adjust = 0; - unsigned char rtc_control = 0; - - ACPI_FUNCTION_TRACE("acpi_system_write_alarm"); - - if (count > sizeof(alarm_string) - 1) - return_VALUE(-EINVAL); - - if (copy_from_user(alarm_string, buffer, count)) - return_VALUE(-EFAULT); - - alarm_string[count] = '\0'; - - /* check for time adjustment */ - if (alarm_string[0] == '+') { - p++; - adjust = 1; - } - - if ((result = get_date_field(&p, &yr))) - goto end; - if ((result = get_date_field(&p, &mo))) - goto end; - if ((result = get_date_field(&p, &day))) - goto end; - if ((result = get_date_field(&p, &hr))) - goto end; - if ((result = get_date_field(&p, &min))) - goto end; - if ((result = get_date_field(&p, &sec))) - goto end; - - if (sec > 59) { - min += 1; - sec -= 60; - } - if (min > 59) { - hr += 1; - min -= 60; - } - if (hr > 23) { - day += 1; - hr -= 24; - } - if (day > 31) { - mo += 1; - day -= 31; - } - if (mo > 12) { - yr += 1; - mo -= 12; - } - - spin_lock_irq(&rtc_lock); - - rtc_control = CMOS_READ(RTC_CONTROL); - if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { - BIN_TO_BCD(yr); - BIN_TO_BCD(mo); - BIN_TO_BCD(day); - BIN_TO_BCD(hr); - BIN_TO_BCD(min); - BIN_TO_BCD(sec); - } - - if (adjust) { - yr += CMOS_READ(RTC_YEAR); - mo += CMOS_READ(RTC_MONTH); - day += CMOS_READ(RTC_DAY_OF_MONTH); - hr += CMOS_READ(RTC_HOURS); - min += CMOS_READ(RTC_MINUTES); - sec += CMOS_READ(RTC_SECONDS); - } - - spin_unlock_irq(&rtc_lock); - - if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { - BCD_TO_BIN(yr); - BCD_TO_BIN(mo); - BCD_TO_BIN(day); - BCD_TO_BIN(hr); - BCD_TO_BIN(min); - BCD_TO_BIN(sec); - } - - if (sec > 59) { - min++; - sec -= 60; - } - if (min > 59) { - hr++; - min -= 60; - } - if (hr > 23) { - day++; - hr -= 24; - } - if (day > 31) { - mo++; - day -= 31; - } - if (mo > 12) { - yr++; - mo -= 12; - } - if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { - BIN_TO_BCD(yr); - BIN_TO_BCD(mo); - BIN_TO_BCD(day); - BIN_TO_BCD(hr); - BIN_TO_BCD(min); - BIN_TO_BCD(sec); - } - - spin_lock_irq(&rtc_lock); - - /* write the fields the rtc knows about */ - CMOS_WRITE(hr, RTC_HOURS_ALARM); - CMOS_WRITE(min, RTC_MINUTES_ALARM); - CMOS_WRITE(sec, RTC_SECONDS_ALARM); - - /* - * If the system supports an enhanced alarm it will have non-zero - * offsets into the CMOS RAM here -- which for some reason are pointing - * to the RTC area of memory. - */ -#if 0 - if (acpi_gbl_FADT->day_alrm) - CMOS_WRITE(day, acpi_gbl_FADT->day_alrm); - if (acpi_gbl_FADT->mon_alrm) - CMOS_WRITE(mo, acpi_gbl_FADT->mon_alrm); - if (acpi_gbl_FADT->century) - CMOS_WRITE(yr/100, acpi_gbl_FADT->century); -#endif - /* enable the rtc alarm interrupt */ - if (!(rtc_control & RTC_AIE)) { - rtc_control |= RTC_AIE; - CMOS_WRITE(rtc_control,RTC_CONTROL); - CMOS_READ(RTC_INTR_FLAGS); - } - - spin_unlock_irq(&rtc_lock); - - acpi_set_register(ACPI_BITREG_RT_CLOCK_ENABLE, 1, ACPI_MTX_LOCK); - - file->f_pos += count; - - result = 0; -end: - return_VALUE(result ? result : count); -} - - -#if defined(CONFIG_MAGIC_SYSRQ) && defined(CONFIG_PM) - -/* Simple wrapper calling power down function. */ -static void acpi_sysrq_power_off(int key, struct pt_regs *pt_regs, - struct tty_struct *tty) -{ - acpi_power_off(); -} - -struct sysrq_key_op sysrq_acpi_poweroff_op = { - .handler = &acpi_sysrq_power_off, - .help_msg = "Off", - .action_msg = "Power Off\n" -}; - -#endif /* CONFIG_MAGIC_SYSRQ */ - -static int __init acpi_sleep_init(void) -{ - struct proc_dir_entry *entry = NULL; - acpi_status status = AE_OK; - int i = 0; - - ACPI_FUNCTION_TRACE("acpi_system_add_fs"); - - if (acpi_disabled) - return_VALUE(0); - - printk(KERN_INFO PREFIX "(supports"); - for (i=0; iproc_fops = &acpi_system_sleep_fops; - entry->proc_fops->write = acpi_system_write_sleep; - } - - /* 'alarm' [R/W] */ - entry = create_proc_entry(ACPI_SYSTEM_FILE_ALARM, - S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir); - if (!entry) - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Unable to create '%s' fs entry\n", - ACPI_SYSTEM_FILE_ALARM)); - else { - entry->proc_fops = &acpi_system_alarm_fops; - entry->proc_fops->write = acpi_system_write_alarm; - } - - /* Install the soft-off (S5) handler. */ - if (sleep_states[ACPI_STATE_S5]) { - pm_power_off = acpi_power_off; - register_sysrq_key('o', &sysrq_acpi_poweroff_op); - - /* workaround: some systems don't claim S4 support, but they - do support S5 (power-down). That is all we need, so - indicate support. */ - sleep_states[ACPI_STATE_S4] = 1; - } - - return_VALUE(0); -} - -subsys_initcall(acpi_sleep_init); diff -Nru a/drivers/acpi/system.c b/drivers/acpi/system.c --- a/drivers/acpi/system.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/system.c Fri Feb 14 00:27:28 2003 @@ -27,7 +27,7 @@ #include #include -#include "acpi_drivers.h" +#include #define _COMPONENT ACPI_SYSTEM_COMPONENT diff -Nru a/drivers/acpi/tables/tbconvrt.c b/drivers/acpi/tables/tbconvrt.c --- a/drivers/acpi/tables/tbconvrt.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/tables/tbconvrt.c Fri Feb 14 00:27:28 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "actables.h" +#include +#include #define _COMPONENT ACPI_TABLES diff -Nru a/drivers/acpi/tables/tbget.c b/drivers/acpi/tables/tbget.c --- a/drivers/acpi/tables/tbget.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/tables/tbget.c Fri Feb 14 00:27:29 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "actables.h" +#include +#include #define _COMPONENT ACPI_TABLES diff -Nru a/drivers/acpi/tables/tbgetall.c b/drivers/acpi/tables/tbgetall.c --- a/drivers/acpi/tables/tbgetall.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/tables/tbgetall.c Fri Feb 14 00:27:29 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "actables.h" +#include +#include #define _COMPONENT ACPI_TABLES diff -Nru a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c --- a/drivers/acpi/tables/tbinstal.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/tables/tbinstal.c Fri Feb 14 00:27:27 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "actables.h" +#include +#include #define _COMPONENT ACPI_TABLES diff -Nru a/drivers/acpi/tables/tbrsdt.c b/drivers/acpi/tables/tbrsdt.c --- a/drivers/acpi/tables/tbrsdt.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/tables/tbrsdt.c Fri Feb 14 00:27:29 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "actables.h" +#include +#include #define _COMPONENT ACPI_TABLES diff -Nru a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c --- a/drivers/acpi/tables/tbutils.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/tables/tbutils.c Fri Feb 14 00:27:29 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "actables.h" +#include +#include #define _COMPONENT ACPI_TABLES diff -Nru a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c --- a/drivers/acpi/tables/tbxface.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/tables/tbxface.c Fri Feb 14 00:27:30 2003 @@ -24,9 +24,9 @@ */ -#include "acpi.h" -#include "acnamesp.h" -#include "actables.h" +#include +#include +#include #define _COMPONENT ACPI_TABLES diff -Nru a/drivers/acpi/tables/tbxfroot.c b/drivers/acpi/tables/tbxfroot.c --- a/drivers/acpi/tables/tbxfroot.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/tables/tbxfroot.c Fri Feb 14 00:27:29 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "actables.h" +#include +#include #define _COMPONENT ACPI_TABLES diff -Nru a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c --- a/drivers/acpi/thermal.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/thermal.c Fri Feb 14 00:27:29 2003 @@ -39,8 +39,8 @@ #include #include #include -#include "acpi_bus.h" -#include "acpi_drivers.h" +#include +#include #define ACPI_THERMAL_COMPONENT 0x04000000 #define ACPI_THERMAL_CLASS "thermal_zone" @@ -82,8 +82,11 @@ static int acpi_thermal_state_open_fs(struct inode *inode, struct file *file); static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file); static int acpi_thermal_trip_open_fs(struct inode *inode, struct file *file); +static int acpi_thermal_write_trip_points (struct file*,const char *,size_t,loff_t *); static int acpi_thermal_cooling_open_fs(struct inode *inode, struct file *file); +static int acpi_thermal_write_cooling_mode (struct file*,const char *,size_t,loff_t *); static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file); +static int acpi_thermal_write_polling(struct file*,const char *,size_t,loff_t *); static struct acpi_driver acpi_thermal_driver = { .name = ACPI_THERMAL_DRIVER_NAME, @@ -179,6 +182,7 @@ static struct file_operations acpi_thermal_trip_fops = { .open = acpi_thermal_trip_open_fs, .read = seq_read, + .write = acpi_thermal_write_trip_points, .llseek = seq_lseek, .release = single_release, }; @@ -186,6 +190,7 @@ static struct file_operations acpi_thermal_cooling_fops = { .open = acpi_thermal_cooling_open_fs, .read = seq_read, + .write = acpi_thermal_write_cooling_mode, .llseek = seq_lseek, .release = single_release, }; @@ -193,6 +198,7 @@ static struct file_operations acpi_thermal_polling_fops = { .open = acpi_thermal_polling_open_fs, .read = seq_read, + .write = acpi_thermal_write_polling, .llseek = seq_lseek, .release = single_release, }; @@ -947,10 +953,11 @@ struct file *file, const char *buffer, size_t count, - loff_t *data) + loff_t *ppos) { + struct seq_file *m = (struct seq_file *)file->private_data; + struct acpi_thermal *tz = (struct acpi_thermal *)m->private; int result = 0; - struct acpi_thermal *tz = (struct acpi_thermal *) data; char mode_string[12] = {'\0'}; ACPI_FUNCTION_TRACE("acpi_thermal_write_cooling_mode"); @@ -1007,10 +1014,11 @@ struct file *file, const char *buffer, size_t count, - loff_t *data) + loff_t *ppos) { + struct seq_file *m = (struct seq_file *)file->private_data; + struct acpi_thermal *tz = (struct acpi_thermal *)m->private; int result = 0; - struct acpi_thermal *tz = (struct acpi_thermal *) data; char polling_string[12] = {'\0'}; int seconds = 0; @@ -1084,7 +1092,6 @@ ACPI_THERMAL_FILE_TRIP_POINTS)); else { entry->proc_fops = &acpi_thermal_trip_fops; - entry->proc_fops->write = acpi_thermal_write_trip_points; entry->data = acpi_driver_data(device); } @@ -1097,7 +1104,6 @@ ACPI_THERMAL_FILE_COOLING_MODE)); else { entry->proc_fops = &acpi_thermal_cooling_fops; - entry->proc_fops->write = acpi_thermal_write_cooling_mode; entry->data = acpi_driver_data(device); } @@ -1110,7 +1116,6 @@ ACPI_THERMAL_FILE_POLLING_FREQ)); else { entry->proc_fops = &acpi_thermal_polling_fops; - entry->proc_fops->write = acpi_thermal_write_polling; entry->data = acpi_driver_data(device); } diff -Nru a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c --- a/drivers/acpi/toshiba_acpi.c Fri Feb 14 00:27:26 2003 +++ b/drivers/acpi/toshiba_acpi.c Fri Feb 14 00:27:26 2003 @@ -44,7 +44,7 @@ #include #include -#include +#include #define OLD_ACPI_INTERFACE (ACPI_CA_VERSION < 0x20020000) #if OLD_ACPI_INTERFACE @@ -52,7 +52,7 @@ extern struct proc_dir_entry* bm_proc_root; #define acpi_root_dir bm_proc_root #else -#include "acpi_drivers.h" +#include #endif MODULE_AUTHOR("John Belmonte"); diff -Nru a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c --- a/drivers/acpi/utilities/utalloc.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/utilities/utalloc.c Fri Feb 14 00:27:27 2003 @@ -23,7 +23,7 @@ */ -#include "acpi.h" +#include #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utalloc") diff -Nru a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c --- a/drivers/acpi/utilities/utcopy.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/utilities/utcopy.c Fri Feb 14 00:27:28 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "amlcode.h" +#include +#include #define _COMPONENT ACPI_UTILITIES diff -Nru a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c --- a/drivers/acpi/utilities/utdebug.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/utilities/utdebug.c Fri Feb 14 00:27:29 2003 @@ -23,7 +23,7 @@ */ -#include "acpi.h" +#include #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utdebug") diff -Nru a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c --- a/drivers/acpi/utilities/utdelete.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/utilities/utdelete.c Fri Feb 14 00:27:28 2003 @@ -23,9 +23,9 @@ */ -#include "acpi.h" -#include "acinterp.h" -#include "acnamesp.h" +#include +#include +#include #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utdelete") diff -Nru a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c --- a/drivers/acpi/utilities/uteval.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/utilities/uteval.c Fri Feb 14 00:27:27 2003 @@ -23,9 +23,9 @@ */ -#include "acpi.h" -#include "acnamesp.h" -#include "acinterp.h" +#include +#include +#include #define _COMPONENT ACPI_UTILITIES diff -Nru a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c --- a/drivers/acpi/utilities/utglobal.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/utilities/utglobal.c Fri Feb 14 00:27:27 2003 @@ -24,8 +24,8 @@ #define DEFINE_ACPI_GLOBALS -#include "acpi.h" -#include "acnamesp.h" +#include +#include #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utglobal") diff -Nru a/drivers/acpi/utilities/utinit.c b/drivers/acpi/utilities/utinit.c --- a/drivers/acpi/utilities/utinit.c Fri Feb 14 00:27:28 2003 +++ b/drivers/acpi/utilities/utinit.c Fri Feb 14 00:27:28 2003 @@ -23,9 +23,9 @@ */ -#include "acpi.h" -#include "acnamesp.h" -#include "acevents.h" +#include +#include +#include #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utinit") diff -Nru a/drivers/acpi/utilities/utmath.c b/drivers/acpi/utilities/utmath.c --- a/drivers/acpi/utilities/utmath.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/utilities/utmath.c Fri Feb 14 00:27:30 2003 @@ -23,7 +23,7 @@ */ -#include "acpi.h" +#include #define _COMPONENT ACPI_UTILITIES diff -Nru a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c --- a/drivers/acpi/utilities/utmisc.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/utilities/utmisc.c Fri Feb 14 00:27:27 2003 @@ -23,8 +23,8 @@ */ -#include "acpi.h" -#include "acnamesp.h" +#include +#include #define _COMPONENT ACPI_UTILITIES diff -Nru a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c --- a/drivers/acpi/utilities/utobject.c Fri Feb 14 00:27:29 2003 +++ b/drivers/acpi/utilities/utobject.c Fri Feb 14 00:27:29 2003 @@ -23,9 +23,9 @@ */ -#include "acpi.h" -#include "acnamesp.h" -#include "amlcode.h" +#include +#include +#include #define _COMPONENT ACPI_UTILITIES diff -Nru a/drivers/acpi/utilities/utxface.c b/drivers/acpi/utilities/utxface.c --- a/drivers/acpi/utilities/utxface.c Fri Feb 14 00:27:27 2003 +++ b/drivers/acpi/utilities/utxface.c Fri Feb 14 00:27:27 2003 @@ -23,12 +23,12 @@ */ -#include "acpi.h" -#include "acevents.h" -#include "acnamesp.h" -#include "acparser.h" -#include "acdispat.h" -#include "acdebug.h" +#include +#include +#include +#include +#include +#include #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utxface") diff -Nru a/drivers/acpi/utils.c b/drivers/acpi/utils.c --- a/drivers/acpi/utils.c Fri Feb 14 00:27:30 2003 +++ b/drivers/acpi/utils.c Fri Feb 14 00:27:30 2003 @@ -27,8 +27,8 @@ #include #include #include -#include "acpi_bus.h" -#include "acpi_drivers.h" +#include +#include #define _COMPONENT ACPI_BUS_COMPONENT diff -Nru a/drivers/block/DAC960.c b/drivers/block/DAC960.c --- a/drivers/block/DAC960.c Fri Feb 14 00:27:29 2003 +++ b/drivers/block/DAC960.c Fri Feb 14 00:27:29 2003 @@ -1731,12 +1731,17 @@ if (!DAC960_V2_NewLogicalDeviceInfo(Controller, LogicalDeviceNumber)) break; LogicalDeviceNumber = NewLogicalDeviceInfo->LogicalDeviceNumber; - if (LogicalDeviceNumber > DAC960_MaxLogicalDrives) - panic("DAC960: Logical Drive Number %d not supported\n", - LogicalDeviceNumber); - if (NewLogicalDeviceInfo->DeviceBlockSizeInBytes != DAC960_BlockSize) - panic("DAC960: Logical Drive Block Size %d not supported\n", - NewLogicalDeviceInfo->DeviceBlockSizeInBytes); + if (LogicalDeviceNumber >= DAC960_MaxLogicalDrives) { + DAC960_Error("DAC960: Logical Drive Number %d not supported\n", + Controller, LogicalDeviceNumber); + break; + } + if (NewLogicalDeviceInfo->DeviceBlockSizeInBytes != DAC960_BlockSize) { + DAC960_Error("DAC960: Logical Drive Block Size %d not supported\n", + Controller, NewLogicalDeviceInfo->DeviceBlockSizeInBytes); + LogicalDeviceNumber++; + continue; + } PhysicalDevice.Controller = 0; PhysicalDevice.Channel = NewLogicalDeviceInfo->Channel; PhysicalDevice.TargetID = NewLogicalDeviceInfo->TargetID; diff -Nru a/drivers/block/cciss.c b/drivers/block/cciss.c --- a/drivers/block/cciss.c Fri Feb 14 00:27:30 2003 +++ b/drivers/block/cciss.c Fri Feb 14 00:27:30 2003 @@ -345,7 +345,7 @@ printk(KERN_DEBUG "cciss_open %x (%x:%x)\n", inode->i_rdev, ctlr, dsk); #endif /* CCISS_DEBUG */ - if (ctlr > MAX_CTLR || hba[ctlr] == NULL) + if (ctlr >= MAX_CTLR || hba[ctlr] == NULL) return -ENXIO; /* * Root is allowed to open raw volume zero even if its not configured diff -Nru a/drivers/block/genhd.c b/drivers/block/genhd.c --- a/drivers/block/genhd.c Fri Feb 14 00:27:28 2003 +++ b/drivers/block/genhd.c Fri Feb 14 00:27:28 2003 @@ -74,7 +74,7 @@ down_write(&block_subsys.rwsem); for (s = &probes[index]; *s; s = &(*s)->next) { struct blk_probe *p = *s; - if (p->dev == dev || p->range == range) { + if (p->dev == dev && p->range == range) { *s = p->next; kfree(p); break; @@ -299,7 +299,7 @@ static ssize_t disk_dev_read(struct gendisk * disk, char *page) { dev_t base = MKDEV(disk->major, disk->first_minor); - return sprintf(page, "%04x\n",base); + return sprintf(page, "%04x\n", (unsigned)base); } static ssize_t disk_range_read(struct gendisk * disk, char *page) { diff -Nru a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c --- a/drivers/block/ll_rw_blk.c Fri Feb 14 00:27:27 2003 +++ b/drivers/block/ll_rw_blk.c Fri Feb 14 00:27:27 2003 @@ -28,6 +28,7 @@ #include static void blk_unplug_work(void *data); +static void blk_unplug_timeout(unsigned long data); /* * For the allocated request tables @@ -247,6 +248,9 @@ init_timer(&q->unplug_timer); INIT_WORK(&q->unplug_work, blk_unplug_work, q); + q->unplug_timer.function = blk_unplug_timeout; + q->unplug_timer.data = (unsigned long)q; + /* * by default assume old behaviour and bounce for any highmem page */ @@ -677,7 +681,7 @@ "REQ_SENSE", "REQ_FAILED", "REQ_QUIET", - "REQ_SPECIAL" + "REQ_SPECIAL", "REQ_DRIVE_CMD", "REQ_DRIVE_TASK", "REQ_DRIVE_TASKFILE", @@ -1297,9 +1301,6 @@ blk_queue_make_request(q, __make_request); blk_queue_max_segment_size(q, MAX_SEGMENT_SIZE); - - q->unplug_timer.function = blk_unplug_timeout; - q->unplug_timer.data = (unsigned long)q; blk_queue_max_hw_segments(q, MAX_HW_SEGMENTS); blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS); diff -Nru a/drivers/block/loop.c b/drivers/block/loop.c --- a/drivers/block/loop.c Fri Feb 14 00:27:28 2003 +++ b/drivers/block/loop.c Fri Feb 14 00:27:28 2003 @@ -577,17 +577,11 @@ struct loop_device *lo = data; struct bio *bio; - daemonize(); + daemonize("loop%d", lo->lo_number); - sprintf(current->comm, "loop%d", lo->lo_number); current->flags |= PF_IOTHREAD; /* loop can be used in an encrypted device hence, it mustn't be stopped at all because it could be indirectly used during suspension */ - - spin_lock_irq(¤t->sighand->siglock); - sigfillset(¤t->blocked); - flush_signals(current); - spin_unlock_irq(¤t->sighand->siglock); set_user_nice(current, -20); diff -Nru a/drivers/block/nbd.c b/drivers/block/nbd.c --- a/drivers/block/nbd.c Fri Feb 14 00:27:27 2003 +++ b/drivers/block/nbd.c Fri Feb 14 00:27:27 2003 @@ -149,7 +149,7 @@ spin_lock_irqsave(¤t->sighand->siglock, flags); printk(KERN_WARNING "NBD (pid %d: %s) got signal %d\n", current->pid, current->comm, - dequeue_signal(¤t->blocked, &info)); + dequeue_signal(current, ¤t->blocked, &info)); spin_unlock_irqrestore(¤t->sighand->siglock, flags); result = -EINTR; break; diff -Nru a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig --- a/drivers/char/agp/Kconfig Fri Feb 14 00:27:28 2003 +++ b/drivers/char/agp/Kconfig Fri Feb 14 00:27:28 2003 @@ -61,16 +61,6 @@ You should say Y here if you use XFree86 3.3.6 or 4.x and want to use GLX or DRI. If unsure, say N. -config AGP_VIA_KT400 - tristate "VIA KT400 chipset support" - depends on AGP3 - help - This option gives you AGP support for the GLX component of the - XFree86 4.x on VIA KT400 AGP 3.0 chipsets. - - You should say Y here if you use XFree86 3.3.6 or 4.x and want to - use GLX or DRI. If unsure, say N. - config AGP_AMD tristate "AMD Irongate, 761, and 762 support" depends on AGP @@ -140,6 +130,11 @@ help This option gives you AGP GART support for the HP ZX1 chipset for IA64 processors. + +config AGP_ALPHA_CORE + tristate + depends on AGP && (ALPHA_GENERIC || ALPHA_TITAN || ALPHA_MARVEL) + default AGP # Put AGP 3.0 entries below here. diff -Nru a/drivers/char/agp/Makefile b/drivers/char/agp/Makefile --- a/drivers/char/agp/Makefile Fri Feb 14 00:27:27 2003 +++ b/drivers/char/agp/Makefile Fri Feb 14 00:27:27 2003 @@ -10,7 +10,6 @@ obj-$(CONFIG_AGP_INTEL) += intel-agp.o obj-$(CONFIG_AGP_VIA) += via-agp.o -obj-$(CONFIG_AGP_VIA_KT400) += via-kt400.o obj-$(CONFIG_AGP_AMD) += amd-k7-agp.o obj-$(CONFIG_AGP_SIS) += sis-agp.o obj-$(CONFIG_AGP_ALI) += ali-agp.o @@ -18,6 +17,7 @@ obj-$(CONFIG_AGP_I460) += i460-agp.o obj-$(CONFIG_AGP_HP_ZX1) += hp-agp.o obj-$(CONFIG_AGP_AMD_8151) += amd-k8-agp.o +obj-$(CONFIG_AGP_ALPHA_CORE) += alpha-agp.o obj-$(CONFIG_AGP_I7x05) += i7x05-agp.o diff -Nru a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h --- a/drivers/char/agp/agp.h Fri Feb 14 00:27:28 2003 +++ b/drivers/char/agp/agp.h Fri Feb 14 00:27:28 2003 @@ -30,7 +30,7 @@ #include /* for flush_agp_cache() */ -extern struct agp_bridge_data agp_bridge; +extern struct agp_bridge_data *agp_bridge; #define PFX "agpgart: " @@ -128,6 +128,7 @@ int num_aperture_sizes; int capndx; int cant_use_aperture; + struct vm_operations_struct *vm_ops; /* Links to driver specific functions */ @@ -165,20 +166,20 @@ #define MB(x) (KB (KB (x))) #define GB(x) (MB (KB (x))) -#define CACHE_FLUSH agp_bridge.cache_flush +#define CACHE_FLUSH agp_bridge->cache_flush #define A_SIZE_8(x) ((struct aper_size_info_8 *) x) #define A_SIZE_16(x) ((struct aper_size_info_16 *) x) #define A_SIZE_32(x) ((struct aper_size_info_32 *) x) #define A_SIZE_LVL2(x) ((struct aper_size_info_lvl2 *) x) #define A_SIZE_FIX(x) ((struct aper_size_info_fixed *) x) -#define A_IDX8() (A_SIZE_8(agp_bridge.aperture_sizes) + i) -#define A_IDX16() (A_SIZE_16(agp_bridge.aperture_sizes) + i) -#define A_IDX32() (A_SIZE_32(agp_bridge.aperture_sizes) + i) -#define A_IDXLVL2() (A_SIZE_LVL2(agp_bridge.aperture_sizes) + i) -#define A_IDXFIX() (A_SIZE_FIX(agp_bridge.aperture_sizes) + i) +#define A_IDX8() (A_SIZE_8(agp_bridge->aperture_sizes) + i) +#define A_IDX16() (A_SIZE_16(agp_bridge->aperture_sizes) + i) +#define A_IDX32() (A_SIZE_32(agp_bridge->aperture_sizes) + i) +#define A_IDXLVL2() (A_SIZE_LVL2(agp_bridge->aperture_sizes) + i) +#define A_IDXFIX() (A_SIZE_FIX(agp_bridge->aperture_sizes) + i) #define MAXKEY (4096 * 32) -#define PGE_EMPTY(p) (!(p) || (p) == (unsigned long) agp_bridge.scratch_page) +#define PGE_EMPTY(p) (!(p) || (p) == (unsigned long) agp_bridge->scratch_page) /* intel register */ #define INTEL_APBASE 0x10 @@ -366,7 +367,7 @@ /* Generic routines. */ void agp_generic_agp_enable(u32 mode); -int agp_generic_agp_3_0_enable(u32 mode); +void agp_generic_agp_3_0_enable(u32 mode); int agp_generic_create_gatt_table(void); int agp_generic_free_gatt_table(void); agp_memory *agp_create_memory(int scratch_pages); diff -Nru a/drivers/char/agp/ali-agp.c b/drivers/char/agp/ali-agp.c --- a/drivers/char/agp/ali-agp.c Fri Feb 14 00:27:29 2003 +++ b/drivers/char/agp/ali-agp.c Fri Feb 14 00:27:29 2003 @@ -17,15 +17,15 @@ u32 temp; struct aper_size_info_32 *values; - pci_read_config_dword(agp_bridge.dev, ALI_ATTBASE, &temp); + pci_read_config_dword(agp_bridge->dev, ALI_ATTBASE, &temp); temp &= ~(0xfffffff0); - values = A_SIZE_32(agp_bridge.aperture_sizes); + values = A_SIZE_32(agp_bridge->aperture_sizes); - for (i = 0; i < agp_bridge.num_aperture_sizes; i++) { + for (i = 0; i < agp_bridge->num_aperture_sizes; i++) { if (temp == values[i].size_value) { - agp_bridge.previous_size = - agp_bridge.current_size = (void *) (values + i); - agp_bridge.aperture_size_idx = i; + agp_bridge->previous_size = + agp_bridge->current_size = (void *) (values + i); + agp_bridge->aperture_size_idx = i; return values[i].size; } } @@ -37,9 +37,9 @@ { u32 temp; - pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp); + pci_read_config_dword(agp_bridge->dev, ALI_TLBCTRL, &temp); // clear tag - pci_write_config_dword(agp_bridge.dev, ALI_TAGCTRL, + pci_write_config_dword(agp_bridge->dev, ALI_TAGCTRL, ((temp & 0xfffffff0) | 0x00000001|0x00000002)); } @@ -48,15 +48,15 @@ struct aper_size_info_32 *previous_size; u32 temp; - previous_size = A_SIZE_32(agp_bridge.previous_size); + previous_size = A_SIZE_32(agp_bridge->previous_size); - pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp); + pci_read_config_dword(agp_bridge->dev, ALI_TLBCTRL, &temp); // clear tag - pci_write_config_dword(agp_bridge.dev, ALI_TAGCTRL, + pci_write_config_dword(agp_bridge->dev, ALI_TAGCTRL, ((temp & 0xffffff00) | 0x00000001|0x00000002)); - pci_read_config_dword(agp_bridge.dev, ALI_ATTBASE, &temp); - pci_write_config_dword(agp_bridge.dev, ALI_ATTBASE, + pci_read_config_dword(agp_bridge->dev, ALI_ATTBASE, &temp); + pci_write_config_dword(agp_bridge->dev, ALI_ATTBASE, ((temp & 0x00000ff0) | previous_size->size_value)); } @@ -65,24 +65,24 @@ u32 temp; struct aper_size_info_32 *current_size; - current_size = A_SIZE_32(agp_bridge.current_size); + current_size = A_SIZE_32(agp_bridge->current_size); /* aperture size and gatt addr */ - pci_read_config_dword(agp_bridge.dev, ALI_ATTBASE, &temp); - temp = (((temp & 0x00000ff0) | (agp_bridge.gatt_bus_addr & 0xfffff000)) + pci_read_config_dword(agp_bridge->dev, ALI_ATTBASE, &temp); + temp = (((temp & 0x00000ff0) | (agp_bridge->gatt_bus_addr & 0xfffff000)) | (current_size->size_value & 0xf)); - pci_write_config_dword(agp_bridge.dev, ALI_ATTBASE, temp); + pci_write_config_dword(agp_bridge->dev, ALI_ATTBASE, temp); /* tlb control */ - pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp); - pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL, ((temp & 0xffffff00) | 0x00000010)); + pci_read_config_dword(agp_bridge->dev, ALI_TLBCTRL, &temp); + pci_write_config_dword(agp_bridge->dev, ALI_TLBCTRL, ((temp & 0xffffff00) | 0x00000010)); /* address to map to */ - pci_read_config_dword(agp_bridge.dev, ALI_APBASE, &temp); - agp_bridge.gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); + pci_read_config_dword(agp_bridge->dev, ALI_APBASE, &temp); + agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); #if 0 - if (agp_bridge.type == ALI_M1541) { + if (agp_bridge->type == ALI_M1541) { u32 nlvm_addr = 0; switch (current_size->size_value) { @@ -101,15 +101,15 @@ nlvm_addr--; nlvm_addr&=0xfff00000; - nlvm_addr+= agp_bridge.gart_bus_addr; - nlvm_addr|=(agp_bridge.gart_bus_addr>>12); + nlvm_addr+= agp_bridge->gart_bus_addr; + nlvm_addr|=(agp_bridge->gart_bus_addr>>12); printk(KERN_INFO PFX "nlvm top &base = %8x\n",nlvm_addr); } #endif - pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp); + pci_read_config_dword(agp_bridge->dev, ALI_TLBCTRL, &temp); temp &= 0xffffff7f; //enable TLB - pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL, temp); + pci_write_config_dword(agp_bridge->dev, ALI_TLBCTRL, temp); return 0; } @@ -118,23 +118,23 @@ { /* Memory type is ignored */ - return addr | agp_bridge.masks[0].mask; + return addr | agp_bridge->masks[0].mask; } static void ali_cache_flush(void) { global_cache_flush(); - if (agp_bridge.type == ALI_M1541) { + if (agp_bridge->type == ALI_M1541) { int i, page_count; u32 temp; - page_count = 1 << A_SIZE_32(agp_bridge.current_size)->page_order; + page_count = 1 << A_SIZE_32(agp_bridge->current_size)->page_order; for (i = 0; i < PAGE_SIZE * page_count; i += PAGE_SIZE) { - pci_read_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, &temp); - pci_write_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, + pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp); + pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | - (agp_bridge.gatt_bus_addr + i)) | + (agp_bridge->gatt_bus_addr + i)) | ALI_CACHE_FLUSH_EN)); } } @@ -148,9 +148,9 @@ if (adr == 0) return 0; - if (agp_bridge.type == ALI_M1541) { - pci_read_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, &temp); - pci_write_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, + if (agp_bridge->type == ALI_M1541) { + pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp); + pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | virt_to_phys(adr)) | ALI_CACHE_FLUSH_EN )); @@ -167,9 +167,9 @@ global_cache_flush(); - if (agp_bridge.type == ALI_M1541) { - pci_read_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, &temp); - pci_write_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, + if (agp_bridge->type == ALI_M1541) { + pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp); + pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | virt_to_phys(addr)) | ALI_CACHE_FLUSH_EN)); @@ -197,30 +197,30 @@ static int __init ali_generic_setup (struct pci_dev *pdev) { - agp_bridge.masks = ali_generic_masks; - agp_bridge.aperture_sizes = (void *) ali_generic_sizes; - agp_bridge.size_type = U32_APER_SIZE; - agp_bridge.num_aperture_sizes = 7; - agp_bridge.dev_private_data = NULL; - agp_bridge.needs_scratch_page = FALSE; - agp_bridge.configure = ali_configure; - agp_bridge.fetch_size = ali_fetch_size; - agp_bridge.cleanup = ali_cleanup; - agp_bridge.tlb_flush = ali_tlbflush; - agp_bridge.mask_memory = ali_mask_memory; - agp_bridge.agp_enable = agp_generic_agp_enable; - agp_bridge.cache_flush = ali_cache_flush; - agp_bridge.create_gatt_table = agp_generic_create_gatt_table; - agp_bridge.free_gatt_table = agp_generic_free_gatt_table; - agp_bridge.insert_memory = agp_generic_insert_memory; - agp_bridge.remove_memory = agp_generic_remove_memory; - agp_bridge.alloc_by_type = agp_generic_alloc_by_type; - agp_bridge.free_by_type = agp_generic_free_by_type; - agp_bridge.agp_alloc_page = ali_alloc_page; - agp_bridge.agp_destroy_page = ali_destroy_page; - agp_bridge.suspend = agp_generic_suspend; - agp_bridge.resume = agp_generic_resume; - agp_bridge.cant_use_aperture = 0; + agp_bridge->masks = ali_generic_masks; + agp_bridge->aperture_sizes = (void *) ali_generic_sizes; + agp_bridge->size_type = U32_APER_SIZE; + agp_bridge->num_aperture_sizes = 7; + agp_bridge->dev_private_data = NULL; + agp_bridge->needs_scratch_page = FALSE; + agp_bridge->configure = ali_configure; + agp_bridge->fetch_size = ali_fetch_size; + agp_bridge->cleanup = ali_cleanup; + agp_bridge->tlb_flush = ali_tlbflush; + agp_bridge->mask_memory = ali_mask_memory; + agp_bridge->agp_enable = agp_generic_agp_enable; + agp_bridge->cache_flush = ali_cache_flush; + agp_bridge->create_gatt_table = agp_generic_create_gatt_table; + agp_bridge->free_gatt_table = agp_generic_free_gatt_table; + agp_bridge->insert_memory = agp_generic_insert_memory; + agp_bridge->remove_memory = agp_generic_remove_memory; + agp_bridge->alloc_by_type = agp_generic_alloc_by_type; + agp_bridge->free_by_type = agp_generic_free_by_type; + agp_bridge->agp_alloc_page = ali_alloc_page; + agp_bridge->agp_destroy_page = ali_destroy_page; + agp_bridge->suspend = agp_generic_suspend; + agp_bridge->resume = agp_generic_resume; + agp_bridge->cant_use_aperture = 0; return 0; } @@ -313,7 +313,7 @@ printk (KERN_INFO PFX "Detected ALi %s chipset\n", devs[j].chipset_name); - agp_bridge.type = devs[j].chipset; + agp_bridge->type = devs[j].chipset; if (devs[j].chipset_setup != NULL) return devs[j].chipset_setup(pdev); @@ -327,7 +327,7 @@ if (agp_try_unsupported) { printk(KERN_WARNING PFX "Trying generic ALi routines" " for device id: %04x\n", pdev->device); - agp_bridge.type = ALI_GENERIC; + agp_bridge->type = ALI_GENERIC; return ali_generic_setup(pdev); } @@ -350,10 +350,10 @@ /* probe for known chipsets */ if (agp_lookup_host_bridge(dev) != -ENODEV) { - agp_bridge.dev = dev; - agp_bridge.capndx = cap_ptr; + agp_bridge->dev = dev; + agp_bridge->capndx = cap_ptr; /* Fill in the mode register */ - pci_read_config_dword(agp_bridge.dev, agp_bridge.capndx+PCI_AGP_STATUS, &agp_bridge.mode); + pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx+PCI_AGP_STATUS, &agp_bridge->mode); ali_agp_driver.dev = dev; agp_register_driver(&ali_agp_driver); return 0; @@ -387,7 +387,7 @@ ret_val = pci_module_init(&agp_ali_pci_driver); if (ret_val) - agp_bridge.type = NOT_SUPPORTED; + agp_bridge->type = NOT_SUPPORTED; return ret_val; } diff -Nru a/drivers/char/agp/alpha-agp.c b/drivers/char/agp/alpha-agp.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/drivers/char/agp/alpha-agp.c Fri Feb 14 00:27:30 2003 @@ -0,0 +1,217 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include "../../../arch/alpha/kernel/pci_impl.h" + +#include "agp.h" + +static struct page *alpha_core_agp_vm_nopage(struct vm_area_struct *vma, + unsigned long address, + int write_access) +{ + alpha_agp_info *agp = agp_bridge->dev_private_data; + dma_addr_t dma_addr; + unsigned long pa; + struct page *page; + + dma_addr = address - vma->vm_start + agp->aperture.bus_base; + pa = agp->ops->translate(agp, dma_addr); + + if (pa == (unsigned long)-EINVAL) return NULL; /* no translation */ + + /* + * Get the page, inc the use count, and return it + */ + page = virt_to_page(__va(pa)); + get_page(page); + return page; +} + +static struct aper_size_info_fixed alpha_core_agp_sizes[] = +{ + { 0, 0, 0 }, /* filled in by alpha_core_agp_setup */ +}; + +static struct gatt_mask alpha_core_agp_masks[] = { + { .mask = 0, .type = 0 }, +}; + +struct vm_operations_struct alpha_core_agp_vm_ops = { + .nopage = alpha_core_agp_vm_nopage, +}; + + +static int alpha_core_agp_nop(void) +{ + /* just return success */ + return 0; +} + +static int alpha_core_agp_fetch_size(void) +{ + return alpha_core_agp_sizes[0].size; +} + +static int alpha_core_agp_configure(void) +{ + alpha_agp_info *agp = agp_bridge->dev_private_data; + agp_bridge->gart_bus_addr = agp->aperture.bus_base; + return 0; +} + +static void alpha_core_agp_cleanup(void) +{ + alpha_agp_info *agp = agp_bridge->dev_private_data; + + agp->ops->cleanup(agp); +} + +static void alpha_core_agp_tlbflush(agp_memory *mem) +{ + alpha_agp_info *agp = agp_bridge->dev_private_data; + alpha_mv.mv_pci_tbi(agp->hose, 0, -1); +} + +static unsigned long alpha_core_agp_mask_memory(unsigned long addr, int type) +{ + /* Memory type is ignored */ + return addr | agp_bridge->masks[0].mask; +} + +static void alpha_core_agp_enable(u32 mode) +{ + alpha_agp_info *agp = agp_bridge->dev_private_data; + + agp->mode.lw = agp_collect_device_status(mode, agp->capability.lw); + + agp->mode.bits.enable = 1; + agp->ops->configure(agp); + + agp_device_command(agp->mode.lw, 0); +} + +static int alpha_core_agp_insert_memory(agp_memory *mem, off_t pg_start, + int type) +{ + alpha_agp_info *agp = agp_bridge->dev_private_data; + int num_entries, status; + void *temp; + + temp = agp_bridge->current_size; + num_entries = A_SIZE_FIX(temp)->num_entries; + if ((pg_start + mem->page_count) > num_entries) return -EINVAL; + + status = agp->ops->bind(agp, pg_start, mem); + mb(); + agp_bridge->tlb_flush(mem); + + return status; +} + +static int alpha_core_agp_remove_memory(agp_memory *mem, off_t pg_start, + int type) +{ + alpha_agp_info *agp = agp_bridge->dev_private_data; + int status; + + status = agp->ops->unbind(agp, pg_start, mem); + agp_bridge->tlb_flush(mem); + return status; +} + + +static struct agp_driver alpha_core_agp_driver = { + .owner = THIS_MODULE, +}; + +int __init +alpha_core_agp_setup(void) +{ + alpha_agp_info *agp = alpha_mv.agp_info(); + struct aper_size_info_fixed *aper_size; + + if (!agp) return -ENODEV; + if (agp->ops->setup(agp)) return -ENODEV; + + /* + * Build the aperture size descriptor + */ + aper_size = alpha_core_agp_sizes; + if (!aper_size) return -ENOMEM; + aper_size->size = agp->aperture.size / (1024 * 1024); + aper_size->num_entries = agp->aperture.size / PAGE_SIZE; + aper_size->page_order = ffs(aper_size->num_entries / 1024) - 1; + + /* + * Build a fake pci_dev struct + */ + if (!(agp_bridge->dev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL))) { + return -ENOMEM; + } + agp_bridge->dev->vendor = 0xffff; + agp_bridge->dev->device = 0xffff; + agp_bridge->dev->sysdata = agp->hose; + + /* + * Fill in the rest of the agp_bridge struct + */ + agp_bridge->masks = alpha_core_agp_masks; + agp_bridge->aperture_sizes = aper_size; + agp_bridge->current_size = aper_size; /* only one entry */ + agp_bridge->size_type = FIXED_APER_SIZE; + agp_bridge->num_aperture_sizes = 1; + agp_bridge->dev_private_data = agp; + agp_bridge->needs_scratch_page = FALSE; + agp_bridge->configure = alpha_core_agp_configure; + agp_bridge->fetch_size = alpha_core_agp_fetch_size; + agp_bridge->cleanup = alpha_core_agp_cleanup; + agp_bridge->tlb_flush = alpha_core_agp_tlbflush; + agp_bridge->mask_memory = alpha_core_agp_mask_memory; + agp_bridge->agp_enable = alpha_core_agp_enable; + agp_bridge->cache_flush = global_cache_flush; + agp_bridge->create_gatt_table = alpha_core_agp_nop; + agp_bridge->free_gatt_table = alpha_core_agp_nop; + agp_bridge->insert_memory = alpha_core_agp_insert_memory; + agp_bridge->remove_memory = alpha_core_agp_remove_memory; + agp_bridge->alloc_by_type = agp_generic_alloc_by_type; + agp_bridge->free_by_type = agp_generic_free_by_type; + agp_bridge->agp_alloc_page = agp_generic_alloc_page; + agp_bridge->agp_destroy_page = agp_generic_destroy_page; + agp_bridge->mode = agp->capability.lw; + agp_bridge->cant_use_aperture = 1; + agp_bridgevm_ops = &alpha_core_agp_vm_ops; + + alpha_core_agp_driver.dev = agp_bridge->dev; + agp_register_driver(&alpha_core_agp_driver); + printk(KERN_INFO "Detected AGP on hose %d\n", agp->hose->index); + return 0; +} + +static int __init agp_alpha_core_init(void) +{ + int ret_val = -ENODEV; + if (alpha_mv.agp_info) { + agp_bridge->type = ALPHA_CORE_AGP; + ret_val = alpha_core_agp_setup(); + } + + return ret_val; +} + +static void __exit agp_alpha_core_cleanup(void) +{ + agp_unregister_driver(&alpha_core_agp_driver); + /* no pci driver for core */ +} + +module_init(agp_alpha_core_init); +module_exit(agp_alpha_core_cleanup); + +MODULE_AUTHOR("Jeff Wiedemeier "); +MODULE_LICENSE("GPL and additional rights"); diff -Nru a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c --- a/drivers/char/agp/amd-k7-agp.c Fri Feb 14 00:27:30 2003 +++ b/drivers/char/agp/amd-k7-agp.c Fri Feb 14 00:27:30 2003 @@ -45,7 +45,7 @@ CACHE_FLUSH(); for(i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) { - page_map->remapped[i] = agp_bridge.scratch_page; + page_map->remapped[i] = agp_bridge->scratch_page; } return 0; @@ -115,7 +115,7 @@ #define GET_PAGE_DIR_OFF(addr) (addr >> 22) #define GET_PAGE_DIR_IDX(addr) (GET_PAGE_DIR_OFF(addr) - \ - GET_PAGE_DIR_OFF(agp_bridge.gart_bus_addr)) + GET_PAGE_DIR_OFF(agp_bridge->gart_bus_addr)) #define GET_GATT_OFF(addr) ((addr & 0x003ff000) >> 12) #define GET_GATT(addr) (amd_irongate_private.gatt_pages[\ GET_PAGE_DIR_IDX(addr)]->remapped) @@ -129,7 +129,7 @@ u32 temp; int i; - value = A_SIZE_LVL2(agp_bridge.current_size); + value = A_SIZE_LVL2(agp_bridge->current_size); retval = amd_create_page_map(&page_dir); if (retval != 0) { return retval; @@ -141,18 +141,18 @@ return retval; } - agp_bridge.gatt_table_real = (u32 *)page_dir.real; - agp_bridge.gatt_table = (u32 *)page_dir.remapped; - agp_bridge.gatt_bus_addr = virt_to_phys(page_dir.real); + agp_bridge->gatt_table_real = (u32 *)page_dir.real; + agp_bridge->gatt_table = (u32 *)page_dir.remapped; + agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real); /* Get the address for the gart region. * This is a bus address even on the alpha, b/c its * used to program the agp master not the cpu */ - pci_read_config_dword(agp_bridge.dev, AMD_APBASE, &temp); + pci_read_config_dword(agp_bridge->dev, AMD_APBASE, &temp); addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); - agp_bridge.gart_bus_addr = addr; + agp_bridge->gart_bus_addr = addr; /* Calculate the agp offset */ for(i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { @@ -168,8 +168,8 @@ { struct amd_page_map page_dir; - page_dir.real = (unsigned long *)agp_bridge.gatt_table_real; - page_dir.remapped = (unsigned long *)agp_bridge.gatt_table; + page_dir.real = (unsigned long *)agp_bridge->gatt_table_real; + page_dir.remapped = (unsigned long *)agp_bridge->gatt_table; amd_free_gatt_pages(); amd_free_page_map(&page_dir); @@ -182,15 +182,15 @@ u32 temp; struct aper_size_info_lvl2 *values; - pci_read_config_dword(agp_bridge.dev, AMD_APSIZE, &temp); + pci_read_config_dword(agp_bridge->dev, AMD_APSIZE, &temp); temp = (temp & 0x0000000e); - values = A_SIZE_LVL2(agp_bridge.aperture_sizes); - for (i = 0; i < agp_bridge.num_aperture_sizes; i++) { + values = A_SIZE_LVL2(agp_bridge->aperture_sizes); + for (i = 0; i < agp_bridge->num_aperture_sizes; i++) { if (temp == values[i].size_value) { - agp_bridge.previous_size = - agp_bridge.current_size = (void *) (values + i); + agp_bridge->previous_size = + agp_bridge->current_size = (void *) (values + i); - agp_bridge.aperture_size_idx = i; + agp_bridge->aperture_size_idx = i; return values[i].size; } } @@ -204,22 +204,22 @@ u32 temp; u16 enable_reg; - current_size = A_SIZE_LVL2(agp_bridge.current_size); + current_size = A_SIZE_LVL2(agp_bridge->current_size); /* Get the memory mapped registers */ - pci_read_config_dword(agp_bridge.dev, AMD_MMBASE, &temp); + pci_read_config_dword(agp_bridge->dev, AMD_MMBASE, &temp); temp = (temp & PCI_BASE_ADDRESS_MEM_MASK); amd_irongate_private.registers = (volatile u8 *) ioremap(temp, 4096); /* Write out the address of the gatt table */ OUTREG32(amd_irongate_private.registers, AMD_ATTBASE, - agp_bridge.gatt_bus_addr); + agp_bridge->gatt_bus_addr); /* Write the Sync register */ - pci_write_config_byte(agp_bridge.dev, AMD_MODECNTL, 0x80); + pci_write_config_byte(agp_bridge->dev, AMD_MODECNTL, 0x80); /* Set indexing mode */ - pci_write_config_byte(agp_bridge.dev, AMD_MODECNTL2, 0x00); + pci_write_config_byte(agp_bridge->dev, AMD_MODECNTL2, 0x00); /* Write the enable register */ enable_reg = INREG16(amd_irongate_private.registers, AMD_GARTENABLE); @@ -227,10 +227,10 @@ OUTREG16(amd_irongate_private.registers, AMD_GARTENABLE, enable_reg); /* Write out the size register */ - pci_read_config_dword(agp_bridge.dev, AMD_APSIZE, &temp); + pci_read_config_dword(agp_bridge->dev, AMD_APSIZE, &temp); temp = (((temp & ~(0x0000000e)) | current_size->size_value) | 0x00000001); - pci_write_config_dword(agp_bridge.dev, AMD_APSIZE, temp); + pci_write_config_dword(agp_bridge->dev, AMD_APSIZE, temp); /* Flush the tlb */ OUTREG32(amd_irongate_private.registers, AMD_TLBFLUSH, 0x00000001); @@ -244,16 +244,16 @@ u32 temp; u16 enable_reg; - previous_size = A_SIZE_LVL2(agp_bridge.previous_size); + previous_size = A_SIZE_LVL2(agp_bridge->previous_size); enable_reg = INREG16(amd_irongate_private.registers, AMD_GARTENABLE); enable_reg = (enable_reg & ~(0x0004)); OUTREG16(amd_irongate_private.registers, AMD_GARTENABLE, enable_reg); /* Write back the previous size and disable gart translation */ - pci_read_config_dword(agp_bridge.dev, AMD_APSIZE, &temp); + pci_read_config_dword(agp_bridge->dev, AMD_APSIZE, &temp); temp = ((temp & ~(0x0000000f)) | previous_size->size_value); - pci_write_config_dword(agp_bridge.dev, AMD_APSIZE, temp); + pci_write_config_dword(agp_bridge->dev, AMD_APSIZE, temp); iounmap((void *) amd_irongate_private.registers); } @@ -274,7 +274,7 @@ { /* Only type 0 is supported by the irongate */ - return addr | agp_bridge.masks[0].mask; + return addr | agp_bridge->masks[0].mask; } static int amd_insert_memory(agp_memory * mem, @@ -284,7 +284,7 @@ unsigned long *cur_gatt; unsigned long addr; - num_entries = A_SIZE_LVL2(agp_bridge.current_size)->num_entries; + num_entries = A_SIZE_LVL2(agp_bridge->current_size)->num_entries; if (type != 0 || mem->type != 0) { return -EINVAL; @@ -295,7 +295,7 @@ j = pg_start; while (j < (pg_start + mem->page_count)) { - addr = (j * PAGE_SIZE) + agp_bridge.gart_bus_addr; + addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr; cur_gatt = GET_GATT(addr); if (!PGE_EMPTY(cur_gatt[GET_GATT_OFF(addr)])) { return -EBUSY; @@ -309,12 +309,12 @@ } for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { - addr = (j * PAGE_SIZE) + agp_bridge.gart_bus_addr; + addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr; cur_gatt = GET_GATT(addr); cur_gatt[GET_GATT_OFF(addr)] = - agp_bridge.mask_memory(mem->memory[i], mem->type); + agp_bridge->mask_memory(mem->memory[i], mem->type); } - agp_bridge.tlb_flush(mem); + agp_bridge->tlb_flush(mem); return 0; } @@ -329,13 +329,13 @@ return -EINVAL; } for (i = pg_start; i < (mem->page_count + pg_start); i++) { - addr = (i * PAGE_SIZE) + agp_bridge.gart_bus_addr; + addr = (i * PAGE_SIZE) + agp_bridge->gart_bus_addr; cur_gatt = GET_GATT(addr); cur_gatt[GET_GATT_OFF(addr)] = - (unsigned long) agp_bridge.scratch_page; + (unsigned long) agp_bridge->scratch_page; } - agp_bridge.tlb_flush(mem); + agp_bridge->tlb_flush(mem); return 0; } @@ -357,30 +357,30 @@ static int __init amd_irongate_setup (struct pci_dev *pdev) { - agp_bridge.masks = amd_irongate_masks; - agp_bridge.aperture_sizes = (void *) amd_irongate_sizes; - agp_bridge.size_type = LVL2_APER_SIZE; - agp_bridge.num_aperture_sizes = 7; - agp_bridge.dev_private_data = (void *) &amd_irongate_private; - agp_bridge.needs_scratch_page = FALSE; - agp_bridge.configure = amd_irongate_configure; - agp_bridge.fetch_size = amd_irongate_fetch_size; - agp_bridge.cleanup = amd_irongate_cleanup; - agp_bridge.tlb_flush = amd_irongate_tlbflush; - agp_bridge.mask_memory = amd_irongate_mask_memory; - agp_bridge.agp_enable = agp_generic_agp_enable; - agp_bridge.cache_flush = global_cache_flush; - agp_bridge.create_gatt_table = amd_create_gatt_table; - agp_bridge.free_gatt_table = amd_free_gatt_table; - agp_bridge.insert_memory = amd_insert_memory; - agp_bridge.remove_memory = amd_remove_memory; - agp_bridge.alloc_by_type = agp_generic_alloc_by_type; - agp_bridge.free_by_type = agp_generic_free_by_type; - agp_bridge.agp_alloc_page = agp_generic_alloc_page; - agp_bridge.agp_destroy_page = agp_generic_destroy_page; - agp_bridge.suspend = agp_generic_suspend; - agp_bridge.resume = agp_generic_resume; - agp_bridge.cant_use_aperture = 0; + agp_bridge->masks = amd_irongate_masks; + agp_bridge->aperture_sizes = (void *) amd_irongate_sizes; + agp_bridge->size_type = LVL2_APER_SIZE; + agp_bridge->num_aperture_sizes = 7; + agp_bridge->dev_private_data = (void *) &amd_irongate_private; + agp_bridge->needs_scratch_page = FALSE; + agp_bridge->configure = amd_irongate_configure; + agp_bridge->fetch_size = amd_irongate_fetch_size; + agp_bridge->cleanup = amd_irongate_cleanup; + agp_bridge->tlb_flush = amd_irongate_tlbflush; + agp_bridge->mask_memory = amd_irongate_mask_memory; + agp_bridge->agp_enable = agp_generic_agp_enable; + agp_bridge->cache_flush = global_cache_flush; + agp_bridge->create_gatt_table = amd_create_gatt_table; + agp_bridge->free_gatt_table = amd_free_gatt_table; + agp_bridge->insert_memory = amd_insert_memory; + agp_bridge->remove_memory = amd_remove_memory; + agp_bridge->alloc_by_type = agp_generic_alloc_by_type; + agp_bridge->free_by_type = agp_generic_free_by_type; + agp_bridge->agp_alloc_page = agp_generic_alloc_page; + agp_bridge->agp_destroy_page = agp_generic_destroy_page; + agp_bridge->suspend = agp_generic_suspend; + agp_bridge->resume = agp_generic_resume; + agp_bridge->cant_use_aperture = 0; return 0; } @@ -416,7 +416,7 @@ while (devs[j].chipset_name != NULL) { if (pdev->device == devs[j].device_id) { printk (KERN_INFO PFX "Detected AMD %s chipset\n", devs[j].chipset_name); - agp_bridge.type = devs[j].chipset; + agp_bridge->type = devs[j].chipset; if (devs[j].chipset_setup != NULL) return devs[j].chipset_setup(pdev); @@ -430,7 +430,7 @@ if (agp_try_unsupported) { printk(KERN_WARNING PFX "Trying generic AMD routines" " for device id: %04x\n", pdev->device); - agp_bridge.type = AMD_GENERIC;