From b98cb33e1264420040b9714377afd47ef7f6040c Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:39:32 -0500 Subject: [PATCH] Linux 2.4.0-test10pre4 - disable writing to /proc/xxx/mem. Sure, it works now, but it's still a security risk. - IDE driver update (Victroy66 SouthBridge support) - i810 rng driver cleanup - fix sbus Makefile - named initializers in module.. - ppoe: remove explicit initializer - it's done with initcalls. - x86 WP bit detection: do it cleanly with exception handling - Arnaldo Carvalho de Melo: memory leaks in drivers/media/video - Bartlomiej Zolnierkiewicz: video init functions get __init - David Miller: get rid of net/protocols.c - they get to initialize themselves - David Miller: get rid of dev_mc_lock - we hold dev->xmit_lock anyway. - Geert Uytterhoeven: Zorro (Amiga) bus support update - David Miller: work around gcc-2.7.2 bug - Geert Uytterhoeven: mark struct consw's "const". - Jeff Garzik: network driver cleanups, ns558 joystick driver oops fix - Tigran Aivazian: clean up __alloc_pages(), kill_super() and notify_change() - Tigran Aivazian: move stuff from .data to .bss - Jeff Garzik: divert.h typename cleanups - James Simmons: mdacon using spinlocks - Tigran Aivazian: fix BFS free block calculation - David Miller: sparc32 works again - Bernd Schmidt: fix undefined C code (set/use without a sequence point) - Mikael Pettersson: nicer Pentium IV setup handling. - Georg Acher: usb-uhci cpia oops fix - Kanoj Sarcar: more node_data cleanups for [non]NUMA. - Richard Henderson: alpha update to new vmalloc setup - Ben LaHaise: atomic pte updates (don't lose dirty bit) - David Brownell: ohci memory debugging (== use separate slabs for allocation) --- Documentation/Changes | 19 +- Documentation/Configure.help | 59 +- Documentation/exception.txt | 6 + Documentation/zorro.txt | 16 +- Makefile | 1 + arch/alpha/config.in | 9 + arch/{i386 => alpha}/defconfig | 433 ++++++------- arch/alpha/lib/Makefile | 2 +- arch/alpha/lib/callback_init.c | 79 --- arch/alpha/mm/fault.c | 26 + arch/alpha/mm/init.c | 108 +++- arch/arm/mm/init.c | 16 +- arch/arm/mm/mm-armv.c | 2 +- arch/i386/config.in | 26 +- arch/i386/defconfig | 3 +- arch/i386/kernel/bluesmoke.c | 4 +- arch/i386/kernel/entry.S | 4 +- arch/i386/kernel/i8259.c | 4 +- arch/i386/kernel/mtrr.c | 2 +- arch/i386/kernel/setup.c | 1 - arch/i386/kernel/smp.c | 2 +- arch/i386/kernel/time.c | 8 +- arch/i386/mm/fault.c | 32 - arch/i386/mm/init.c | 52 +- arch/m68k/amiga/amiga_ksyms.c | 1 - arch/m68k/amiga/chipram.c | 2 +- arch/m68k/amiga/config.c | 6 + arch/m68k/config.in | 5 +- arch/m68k/kernel/setup.c | 2 +- arch/m68k/mac/config.c | 1 - arch/m68k/mm/init.c | 2 +- arch/mips/dec/time.c | 4 +- arch/mips/kernel/time.c | 14 +- arch/mips/mm/init.c | 2 +- arch/mips/sgi/kernel/indy_timer.c | 4 +- arch/mips64/kernel/smp.c | 4 +- arch/mips64/mm/init.c | 2 +- arch/mips64/sgi-ip22/ip22-timer.c | 4 +- arch/mips64/sgi-ip27/ip27-memory.c | 8 +- arch/mips64/sgi-ip27/ip27-rtc.c | 4 +- arch/mips64/sgi-ip27/ip27-timer.c | 2 +- arch/ppc/config.in | 1 + arch/ppc/kernel/smp.c | 10 +- arch/ppc/mm/init.c | 12 +- arch/s390/mm/init.c | 2 +- arch/sh/kernel/setup.c | 2 +- arch/sh/kernel/time.c | 2 +- arch/sh/mm/init.c | 4 +- arch/sparc/kernel/semaphore.c | 2 +- arch/sparc/kernel/setup.c | 2 +- arch/sparc/mm/fault.c | 47 +- arch/sparc/mm/init.c | 2 +- arch/sparc/mm/srmmu.c | 24 +- arch/sparc/mm/sun4c.c | 14 +- arch/sparc64/kernel/semaphore.c | 2 +- arch/sparc64/kernel/setup.c | 2 +- arch/sparc64/mm/init.c | 2 +- arch/sparc64/solaris/socksys.c | 2 +- drivers/acorn/char/defkeymap-acorn.c | 2 +- drivers/atm/fore200e.c | 2 +- drivers/atm/nicstar.c | 2 +- drivers/block/DAC960.c | 8 +- drivers/block/acsi_slm.c | 4 +- drivers/block/cciss.c | 6 +- drivers/block/cpqarray.c | 8 +- drivers/block/loop.c | 2 +- drivers/block/nbd.c | 2 +- drivers/block/paride/pg.c | 2 +- drivers/block/paride/pt.c | 2 +- drivers/block/rd.c | 12 +- drivers/cdrom/cdrom.c | 18 +- drivers/cdrom/sbpcd.c | 34 +- drivers/char/acquirewdt.c | 2 +- drivers/char/console.c | 40 +- drivers/char/cyclades.c | 8 +- drivers/char/dsp56k.c | 2 +- drivers/char/epca.c | 6 +- drivers/char/esp.c | 7 +- drivers/char/ftape/lowlevel/fdc-io.c | 22 +- drivers/char/ftape/lowlevel/fdc-isr.c | 14 +- drivers/char/ftape/lowlevel/ftape-bsm.c | 6 +- drivers/char/ftape/lowlevel/ftape-format.c | 2 +- drivers/char/ftape/lowlevel/ftape-io.c | 8 +- drivers/char/ftape/lowlevel/ftape-rw.c | 10 +- drivers/char/ftape/lowlevel/ftape-tracing.c | 4 +- drivers/char/ftape/lowlevel/ftape-write.c | 2 +- drivers/char/ftape/zftape/zftape-buffers.c | 4 +- drivers/char/ftape/zftape/zftape-ctl.c | 14 +- drivers/char/ftape/zftape/zftape-read.c | 6 +- drivers/char/ftape/zftape/zftape-rw.c | 22 +- drivers/char/ftape/zftape/zftape-vtbl.c | 10 +- drivers/char/ftape/zftape/zftape-write.c | 4 +- drivers/char/generic_serial.c | 2 +- drivers/char/i810_rng.c | 35 +- drivers/char/ip2/i2ellis.c | 4 +- drivers/char/ip2main.c | 30 +- drivers/char/istallion.c | 16 +- drivers/char/joystick/gameport.c | 6 +- drivers/char/joystick/ns558.c | 24 +- drivers/char/joystick/serio.c | 6 +- drivers/char/keyboard.c | 18 +- drivers/char/misc.c | 2 +- drivers/char/mxser.c | 6 +- drivers/char/pc110pad.c | 22 +- drivers/char/pc_keyb.c | 12 +- drivers/char/ppdev.c | 2 +- drivers/char/qpmouse.c | 4 +- drivers/char/random.c | 16 +- drivers/char/rio/rio_linux.c | 8 +- drivers/char/riscom8.c | 16 +- drivers/char/rocket.c | 24 +- drivers/char/sbc60xxwdt.c | 6 +- drivers/char/selection.c | 6 +- drivers/char/serial.c | 6 +- drivers/char/softdog.c | 2 +- drivers/char/specialix.c | 16 +- drivers/char/stallion.c | 6 +- drivers/char/sx.c | 12 +- drivers/char/sysrq.c | 2 +- drivers/char/tpqic02.c | 12 +- drivers/char/tty_io.c | 2 +- drivers/char/vc_screen.c | 2 +- drivers/char/vt.c | 2 +- drivers/char/wdt285.c | 2 +- drivers/char/wdt977.c | 4 +- drivers/i2o/i2o_core.c | 2 +- drivers/ide/Config.in | 2 + drivers/ide/Makefile | 1 + drivers/ide/alim15x3.c | 10 +- drivers/ide/buddha.c | 10 +- drivers/ide/ide-disk.c | 4 +- drivers/ide/ide-features.c | 5 +- drivers/ide/ide-pci.c | 39 +- drivers/ide/ide-proc.c | 12 + drivers/ide/ide.c | 18 +- drivers/ide/slc90e66.c | 382 +++++++++++ drivers/ieee1394/raw1394.c | 6 +- drivers/input/input.c | 12 +- drivers/isdn/isdn_common.c | 6 +- drivers/isdn/sc/debug.c | 2 +- drivers/md/md.c | 10 +- drivers/media/video/tda7432.c | 8 +- drivers/media/video/tda8425.c | 8 +- drivers/media/video/tda985x.c | 8 +- drivers/media/video/tda9875.c | 8 +- drivers/media/video/tea6300.c | 8 +- drivers/net/3c515.c | 4 +- drivers/net/3c59x.c | 16 +- drivers/net/Config.in | 3 + drivers/net/a2065.c | 1 - drivers/net/aironet4500_card.c | 6 +- drivers/net/aironet4500_core.c | 36 +- drivers/net/ariadne.c | 1 - drivers/net/ariadne2.c | 1 - drivers/net/arlan.c | 18 +- drivers/net/daynaport.c | 2 +- drivers/net/depca.c | 14 +- drivers/net/e2100.c | 8 +- drivers/net/eepro100.c | 8 +- drivers/net/es3210.c | 6 +- drivers/net/hydra.c | 1 - drivers/net/irda/nsc-ircc.c | 2 +- drivers/net/lne390.c | 6 +- drivers/net/ne3210.c | 6 +- drivers/net/pcmcia/3c574_cs.c | 2 +- drivers/net/pcmcia/xircom_tulip_cb.c | 20 +- drivers/net/pcnet32.c | 8 +- drivers/net/ppp_generic.c | 2 +- drivers/net/pppox.c | 3 - drivers/net/rclanmtl.c | 9 +- drivers/net/rclanmtl.h | 13 +- drivers/net/rcpci45.c | 17 +- drivers/net/skeleton.c | 6 +- drivers/net/tokenring/ibmtr.c | 4 +- drivers/net/tokenring/smctr.c | 6 +- drivers/net/tulip/tulip_core.c | 32 +- drivers/net/wan/cosa.c | 6 +- drivers/net/wan/sdlamain.c | 4 +- drivers/net/wd.c | 8 +- drivers/parport/parport_mfc3.c | 1 - drivers/pci/gen-devlist.c | 2 +- drivers/pci/pci.ids | 4 + drivers/sbus/audio/audio.c | 4 +- drivers/sbus/char/Makefile | 2 +- drivers/sbus/char/bpp.c | 2 +- drivers/sbus/char/sab82532.c | 4 +- drivers/sbus/char/su.c | 4 +- drivers/sbus/char/sunkbd.c | 20 +- drivers/sbus/char/vfc_dev.c | 2 +- drivers/sbus/char/zs.c | 4 +- drivers/scsi/a2091.c | 1 - drivers/scsi/aha152x.c | 3 +- drivers/scsi/amiga7xx.c | 7 - drivers/scsi/blz1230.c | 1 - drivers/scsi/blz2060.c | 2 - drivers/scsi/cyberstorm.c | 2 - drivers/scsi/cyberstormII.c | 1 - drivers/scsi/eata.c | 4 +- drivers/scsi/fastlane.c | 2 - drivers/scsi/gvp11.c | 1 - drivers/scsi/ide-scsi.c | 2 +- drivers/scsi/oktagon_esp.c | 1 - drivers/scsi/scsi.c | 19 +- drivers/scsi/sym53c8xx_comm.h | 8 +- drivers/scsi/wd7000.c | 2 +- drivers/sound/sound_core.c | 2 +- drivers/sound/trident.c | 2 +- drivers/telephony/ixj.c | 14 +- drivers/usb/usb-ohci.c | 48 +- drivers/usb/usb-ohci.h | 106 ++- drivers/usb/usb-uhci.c | 6 +- drivers/video/clgenfb.c | 8 +- drivers/video/controlfb.c | 2 +- drivers/video/cyberfb.c | 1 - drivers/video/dnfb.c | 2 +- drivers/video/dummycon.c | 2 +- drivers/video/fbcon.c | 2 +- drivers/video/fbmem.c | 4 +- drivers/video/macfb.c | 2 +- drivers/video/mdacon.c | 20 +- drivers/video/newport_con.c | 2 +- drivers/video/offb.c | 2 +- drivers/video/promcon.c | 2 +- drivers/video/q40fb.c | 2 +- drivers/video/retz3fb.c | 1 - drivers/video/sisfb.c | 2 +- drivers/video/vesafb.c | 2 +- drivers/video/vgacon.c | 2 +- drivers/video/virgefb.c | 1 - drivers/zorro/Config.in | 7 + drivers/zorro/Makefile | 8 + drivers/zorro/gen-devlist.c | 107 +++ drivers/zorro/names.c | 191 +++--- drivers/zorro/zorro.c | 18 +- drivers/zorro/zorro.ids | 469 ++++++++++++++ fs/attr.c | 5 +- fs/bfs/dir.c | 2 +- fs/bfs/file.c | 41 +- fs/bfs/inode.c | 4 +- fs/coda/dir.c | 2 +- fs/coda/psdev.c | 4 +- fs/cramfs/inode.c | 2 +- fs/devfs/base.c | 2 +- fs/devfs/util.c | 4 +- fs/ext2/namei.c | 29 +- fs/fat/cvf.c | 4 +- fs/hfs/trans.c | 2 +- fs/inode.c | 2 +- fs/lockd/clntlock.c | 2 +- fs/lockd/mon.c | 2 +- fs/lockd/svclock.c | 2 +- fs/nfs/dir.c | 2 +- fs/nfs/nfs2xdr.c | 3 +- fs/nfs/nfs3xdr.c | 6 +- fs/nfs/read.c | 2 +- fs/nfs/write.c | 8 +- fs/nfsd/nfscache.c | 4 +- fs/nfsd/nfsfh.c | 4 +- fs/nfsd/vfs.c | 6 +- fs/nls/nls_base.c | 2 +- fs/nls/nls_big5.c | 2 +- fs/nls/nls_euc-jp.c | 2 +- fs/nls/nls_euc-kr.c | 2 +- fs/nls/nls_gb2312.c | 2 +- fs/nls/nls_sjis.c | 2 +- fs/ntfs/fs.c | 6 +- fs/partitions/check.c | 4 +- fs/proc/base.c | 5 + fs/super.c | 22 +- fs/umsdos/inode.c | 4 +- include/asm-alpha/pgalloc.h | 62 +- include/asm-alpha/pgtable.h | 17 +- include/asm-arm/pgtable.h | 2 + include/asm-generic/pgtable.h | 41 ++ include/asm-i386/bugs.h | 2 +- include/asm-i386/cache.h | 5 +- include/asm-i386/floppy.h | 10 +- include/asm-i386/page.h | 10 +- include/asm-i386/pgtable-2level.h | 7 +- include/asm-i386/pgtable-3level.h | 45 +- include/asm-i386/pgtable.h | 77 ++- include/asm-ia64/pgtable.h | 2 + include/asm-m68k/pgtable.h | 2 + include/asm-mips/pgtable.h | 2 + include/asm-mips64/pgtable.h | 2 + include/asm-ppc/pgtable.h | 1 + include/asm-s390/pgtable.h | 2 + include/asm-sh/pgtable.h | 2 + include/asm-sparc/pgalloc.h | 6 +- include/asm-sparc/pgtable.h | 6 +- include/asm-sparc64/pgtable.h | 2 + include/linux/bootmem.h | 23 +- include/linux/byteorder/big_endian.h | 12 +- include/linux/byteorder/little_endian.h | 20 +- include/linux/byteorder/pdp_endian.h | 20 +- include/linux/byteorder/swab.h | 36 +- include/linux/byteorder/swabb.h | 18 +- include/linux/console.h | 16 +- include/linux/console_struct.h | 2 +- include/linux/ide.h | 3 + include/linux/netlink.h | 2 - include/linux/pci_ids.h | 6 + include/linux/vt_kern.h | 1 - include/linux/zorro.h | 970 ++++++---------------------- include/linux/{zorro.h => zorro_ids.h} | 210 +----- include/net/atalkcall.h | 2 - include/net/ax25.h | 2 - include/net/ax25call.h | 2 - include/net/decnet_call.h | 2 - include/net/divert.h | 38 +- include/net/ipx.h | 2 - include/net/ipxcall.h | 2 - include/net/lapbcall.h | 2 - include/net/llccall.h | 3 - include/net/netbeuicall.h | 2 - include/net/netrom.h | 2 - include/net/nrcall.h | 2 - include/net/p8022call.h | 2 - include/net/psnapcall.h | 2 - include/net/rose.h | 2 - include/net/rosecall.h | 2 - include/net/spxcall.h | 2 - include/net/x25.h | 2 - include/net/x25call.h | 2 - kernel/module.c | 23 +- kernel/panic.c | 2 +- kernel/printk.c | 2 +- kernel/sys.c | 2 +- kernel/time.c | 4 +- kernel/timer.c | 2 +- mm/bootmem.c | 69 +- mm/filemap.c | 41 +- mm/highmem.c | 3 +- mm/memory.c | 34 +- mm/mprotect.c | 11 +- mm/mremap.c | 14 +- mm/numa.c | 2 +- mm/page_alloc.c | 21 +- mm/swapfile.c | 4 +- mm/vmalloc.c | 4 +- mm/vmscan.c | 27 +- net/802/llc_macinit.c | 17 +- net/802/p8022.c | 5 +- net/802/psnap.c | 4 +- net/802/tr.c | 5 +- net/Makefile | 2 +- net/appletalk/ddp.c | 16 +- net/atm/pvc.c | 5 +- net/atm/svc.c | 7 +- net/ax25/af_ax25.c | 20 +- net/core/dev_mcast.c | 54 +- net/decnet/af_decnet.c | 66 +- net/econet/af_econet.c | 2 - net/ipv4/af_inet.c | 8 +- net/ipv4/tcp_ipv4.c | 10 +- net/ipv6/af_inet6.c | 27 +- net/ipx/af_ipx.c | 22 +- net/irda/af_irda.c | 20 +- net/irda/irmod.c | 26 +- net/lapb/lapb_iface.c | 15 +- net/netlink/af_netlink.c | 10 +- net/netlink/netlink_dev.c | 4 +- net/netrom/af_netrom.c | 21 +- net/packet/af_packet.c | 18 +- net/protocols.c | 182 ------ net/rose/af_rose.c | 20 +- net/socket.c | 21 +- net/unix/af_unix.c | 22 +- net/unix/sysctl_net_unix.c | 2 - net/x25/af_x25.c | 32 +- 370 files changed, 3469 insertions(+), 3100 deletions(-) copy arch/{i386 => alpha}/defconfig (62%) delete mode 100644 arch/alpha/lib/callback_init.c create mode 100644 drivers/ide/slc90e66.c create mode 100644 drivers/zorro/Config.in create mode 100644 drivers/zorro/gen-devlist.c rewrite drivers/zorro/names.c (95%) create mode 100644 drivers/zorro/zorro.ids create mode 100644 include/asm-generic/pgtable.h rewrite include/linux/zorro.h (84%) copy include/linux/{zorro.h => zorro_ids.h} (83%) delete mode 100644 include/net/atalkcall.h delete mode 100644 include/net/ax25call.h delete mode 100644 include/net/decnet_call.h delete mode 100644 include/net/ipxcall.h delete mode 100644 include/net/lapbcall.h delete mode 100644 include/net/llccall.h delete mode 100644 include/net/netbeuicall.h delete mode 100644 include/net/nrcall.h delete mode 100644 include/net/p8022call.h delete mode 100644 include/net/psnapcall.h delete mode 100644 include/net/rosecall.h delete mode 100644 include/net/spxcall.h delete mode 100644 include/net/x25call.h delete mode 100644 net/protocols.c diff --git a/Documentation/Changes b/Documentation/Changes index c12ed2e6d..27794adb0 100644 --- a/Documentation/Changes +++ b/Documentation/Changes @@ -28,7 +28,10 @@ russkim perevodom dannogo documenta. Visite para obtener la traducción al español de este documento en varios formatos. -Last updated: August 28, 2000 +Eine deutsche Version dieser Datei finden Sie unter +. + +Last updated: October 13, 2000 Chris Ricker (kaboom@gatech.edu or chris.ricker@genetics.utah.edu). @@ -49,9 +52,9 @@ o Gnu C 2.7.2.3 # gcc --version o Gnu make 3.77 # make --version o binutils 2.9.1.0.25 # ld -v o util-linux 2.10o # kbdrate -v -o modutils 2.3.15 # insmod -V -o e2fsprogs 1.18 # tune2fs --version -o pcmcia-cs 3.1.19 # cardmgr -V +o modutils 2.3.18 # insmod -V +o e2fsprogs 1.19 # tune2fs --version +o pcmcia-cs 3.1.21 # cardmgr -V o PPP 2.4.0 # pppd --version o isdn4k-utils 3.1beta7 # isdnctrl 2>&1|grep version @@ -277,7 +280,7 @@ o Modutils -------- -o +o Mkinitrd -------- @@ -285,8 +288,8 @@ o E2fsprogs --------- -o -o +o +o LVM toolset ----------- @@ -294,7 +297,7 @@ o Pcmcia-cs --------- -o +o Jade ---- diff --git a/Documentation/Configure.help b/Documentation/Configure.help index 081827df7..b32d5508c 100644 --- a/Documentation/Configure.help +++ b/Documentation/Configure.help @@ -938,7 +938,20 @@ CONFIG_BLK_DEV_SIS5513 available" as well. Please read the comments at the top of drivers/ide/sis5513.c - + +SLC90E66 chipset support +CONFIG_BLK_DEV_SLC90E66 + This driver ensures (U)DMA support for Victroy66 SouthBridges for + SMsC with Intel NorthBridges. This is an Ultra66 based chipset. + The nice thing about it is that you can mix Ultra/DMA/PIO devices + and it will handle timing cycles. Since this is an improved look-a-like + to the PIIX4 it should be a nice addition. + + If you say Y here, you need to say Y to "Use DMA by default when + available" as well. + + Please read the comments at the top of drivers/ide/slc90e66.c + Winbond SL82c105 support CONFIG_BLK_DEV_SL82C105 If you have a Winbond SL82c105 IDE controller, say Y here to enable @@ -2146,13 +2159,26 @@ CONFIG_ALPHA_LEGACY_START_ADDRESS If you're using aboot 0.7 or later, the bootloader will examine the ELF headers to determine where to transfer control. Unfortunately, - most older bootloaders -- APB, or MILO -- hardcoded the kernel + most older bootloaders -- APB or MILO -- hardcoded the kernel start address rather than examining the ELF headers, and the result is a hard lockup. Say Y if you have a broken bootloader. Say N if you do not, or if you wish to run on Wildfire. +Large VMALLOC support +CONFIG_ALPHA_LARGE_VMALLOC + Process creation and other aspects of virtual memory management + can be streamlined if we restrict the kernel to one PGD for all + vmalloc allocations. This equates to about 8GB. + + Under normal circumstances, this is so far and above what is needed + as to be laughable. However, there are certain applications (such + as benchmark-grade in-kernel web serving) that can make use of as + much vmalloc space as is available. + + Say N unless you know you need gobs and gobs of vmalloc space. + Non-standard serial port support CONFIG_SERIAL_NONSTANDARD Say Y here if you have any non-standard serial boards -- boards @@ -15131,18 +15157,27 @@ CONFIG_RMW_INSNS really know what you are doing, say N. Try Y only if you're quite adventurous. -Amiga AutoConfig Identification +Zorro support CONFIG_ZORRO - This enables support for automatic identification of Amiga expansion - cards that obey the AutoConfig(tm) specification. - Say Y if you want your expansion cards to be identified on bootup; - it will enlarge your kernel by about 10 KB. The identification - information is then also available through /proc/zorro (say Y to - "/proc file system support"!). Read Documentation/zorro.txt for more - information. + This enables support for the Zorro bus in the Amiga. If you have + expansion cards in your Amiga that conform to the Amiga + AutoConfig(tm) specification, say Y, otherwise N. Note that even + expansion cards that do not fit in the Zorro slots but fit in e.g. + the CPU slot may fall in this category, so you have to say Y to let + Linux use these. + +Zorro device name database +CONFIG_ZORRO_NAMES + By default, the kernel contains a database of all known Zorro device + names to make the information in /proc/iomem comprehensible to the + user. This database increases the size of the kernel image by about + 15KB, but it gets freed after the system boots up, so it doesn't + take up kernel memory. Anyway, if you are building an installation + floppy or kernel for an embedded system where kernel image size + really matters, you can disable this feature and you'll get device + ID numbers instead of names. - Note that even if you say N here, you can still use your expansion - cards. If in doubt, say Y. + When in doubt, say Y. Amiga 1200/600 PCMCIA support (EXPERIMENTAL) CONFIG_AMIGA_PCMCIA diff --git a/Documentation/exception.txt b/Documentation/exception.txt index 6adc97ba1..f1d436993 100644 --- a/Documentation/exception.txt +++ b/Documentation/exception.txt @@ -284,3 +284,9 @@ get_user macro actually returns a value: 0, if the user access was successful, -EFAULT on failure. Our original code did not test this return value, however the inline assembly code in get_user tries to return -EFAULT. GCC selected EAX to return this value. + +NOTE: +Due to the way that the exception table is built and needs to be ordered, +only use exceptions for code in the .text section. Any other section +will cause the exception table to not be sorted correctly, and the +exceptions will fail. diff --git a/Documentation/zorro.txt b/Documentation/zorro.txt index ed77a047c..a56e2c485 100644 --- a/Documentation/zorro.txt +++ b/Documentation/zorro.txt @@ -9,7 +9,7 @@ Last revised: February 27, 2000 --------------- The Zorro bus is the bus used in the Amiga family of computers. Thanks to -AutoConfig(tm), it's is 100% Plug-and-Play. +AutoConfig(tm), it's 100% Plug-and-Play. There are two types of Zorro busses, Zorro II and Zorro III: @@ -32,7 +32,6 @@ for the board with Zorro ID `ZORRO_PROD_xxx' looks like: while ((z = zorro_find_device(ZORRO_PROD_xxx, z))) { if (!zorro_request_region(z->resource.start+MY_START, MY_SIZE, "My explanation")) - strcpy(z->name, "My board name"); ... } @@ -94,16 +93,7 @@ The treatment of these regions depends on the type of Zorro space: iounmap(virt_addr); -5. Zorro Device Naming ----------------------- - -Since we think generic device naming is something for userspace (zorroutils), -we don't keep a Zorro device name database in the kernel. -However, device drivers are allowed to store the expansion board name in struct -zorro_dev. - - -6. References +5. References ------------- linux/include/linux/zorro.h @@ -111,6 +101,6 @@ linux/include/linux/ioport.h linux/include/asm-m68k/io.h linux/include/asm-m68k/amigahw.h linux/include/asm-ppc/io.h -linux/driver/zorro +linux/drivers/zorro /proc/bus/zorro diff --git a/Makefile b/Makefile index b6a911814..035332122 100644 --- a/Makefile +++ b/Makefile @@ -367,6 +367,7 @@ clean: archclean rm -f drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c rm -f drivers/char/conmakehash rm -f drivers/pci/devlist.h drivers/pci/classlist.h drivers/pci/gen-devlist + rm -f drivers/zorro/devlist.h drivers/zorro/gen-devlist rm -f drivers/sound/bin2hex drivers/sound/hex2hex rm -f drivers/atm/fore200e_mkfirm drivers/atm/{pca,sba}*{.bin,.bin1,.bin2} rm -f net/khttpd/make_times_h diff --git a/arch/alpha/config.in b/arch/alpha/config.in index 3b0126e7d..18fdcde8a 100644 --- a/arch/alpha/config.in +++ b/arch/alpha/config.in @@ -63,6 +63,7 @@ unset CONFIG_ALPHA_T2 CONFIG_ALPHA_PYXIS CONFIG_ALPHA_POLARIS unset CONFIG_ALPHA_TSUNAMI CONFIG_ALPHA_MCPCIA unset CONFIG_ALPHA_IRONGATE unset CONFIG_ALPHA_BROKEN_IRQ_MASK +unset CONFIG_ALPHA_LARGE_VMALLOC # Most of these machines have ISA slots; not exactly sure which don't, # and this doesn't activate hordes of code, so do it always. @@ -207,6 +208,14 @@ then bool 'Symmetric multi-processing support' CONFIG_SMP fi +# The machine must be able to support more than 8GB physical memory +# before large vmalloc might even pretend to be an issue. +if [ "$CONFIG_ALPHA_GENERIC" = "y" -o "$CONFIG_ALPHA_DP264" = "y" \ + -o "$CONFIG_ALPHA_WILDFIRE" = "y" -o "$CONFIG_ALPHA_TITAN" = "y" ] +then + bool 'Large VMALLOC support' CONFIG_ALPHA_LARGE_VMALLOC +fi + source drivers/pci/Config.in bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG diff --git a/arch/i386/defconfig b/arch/alpha/defconfig similarity index 62% copy from arch/i386/defconfig copy to arch/alpha/defconfig index 7dddf3057..702778091 100644 --- a/arch/i386/defconfig +++ b/arch/alpha/defconfig @@ -1,105 +1,81 @@ # # Automatically generated make config: don't edit # -CONFIG_X86=y -CONFIG_ISA=y -# CONFIG_SBUS is not set -CONFIG_UID16=y +# CONFIG_UID16 is not set # # Code maturity level options # -# CONFIG_EXPERIMENTAL is not set +CONFIG_EXPERIMENTAL=y # # Loadable module support # CONFIG_MODULES=y -CONFIG_MODVERSIONS=y +# CONFIG_MODVERSIONS is not set CONFIG_KMOD=y # -# Processor type and features -# -# CONFIG_M386 is not set -# CONFIG_M486 is not set -# CONFIG_M586 is not set -# CONFIG_M586TSC is not set -# CONFIG_M586MMX is not set -# CONFIG_M686 is not set -CONFIG_M686FXSR=y -# CONFIG_MK6 is not set -# CONFIG_MK7 is not set -# CONFIG_MCRUSOE is not set -# CONFIG_MWINCHIPC6 is not set -# CONFIG_MWINCHIP2 is not set -# CONFIG_MWINCHIP3D is not set -CONFIG_X86_WP_WORKS_OK=y -CONFIG_X86_INVLPG=y -CONFIG_X86_CMPXCHG=y -CONFIG_X86_BSWAP=y -CONFIG_X86_POPAD_OK=y -CONFIG_X86_L1_CACHE_BYTES=32 -CONFIG_X86_TSC=y -CONFIG_X86_GOOD_APIC=y -CONFIG_X86_PGE=y -CONFIG_X86_USE_PPRO_CHECKSUM=y -CONFIG_X86_FXSR=y -CONFIG_X86_XMM=y -# CONFIG_TOSHIBA is not set -# CONFIG_MICROCODE is not set -# CONFIG_X86_MSR is not set -# CONFIG_X86_CPUID is not set -CONFIG_NOHIGHMEM=y -# CONFIG_HIGHMEM4G is not set -# CONFIG_HIGHMEM64G is not set -# CONFIG_MTRR is not set -CONFIG_SMP=y -CONFIG_HAVE_DEC_LOCK=y - -# # General setup # -CONFIG_NET=y -# CONFIG_VISWS is not set -CONFIG_X86_IO_APIC=y -CONFIG_X86_LOCAL_APIC=y +CONFIG_ALPHA_GENERIC=y +# CONFIG_ALPHA_ALCOR is not set +# CONFIG_ALPHA_XL is not set +# CONFIG_ALPHA_BOOK1 is not set +# CONFIG_ALPHA_AVANTI is not set +# CONFIG_ALPHA_CABRIOLET is not set +# CONFIG_ALPHA_DP264 is not set +# CONFIG_ALPHA_EB164 is not set +# CONFIG_ALPHA_EB64P is not set +# CONFIG_ALPHA_EB66 is not set +# CONFIG_ALPHA_EB66P is not set +# CONFIG_ALPHA_EIGER is not set +# CONFIG_ALPHA_JENSEN is not set +# CONFIG_ALPHA_LX164 is not set +# CONFIG_ALPHA_MIATA is not set +# CONFIG_ALPHA_MIKASA is not set +# CONFIG_ALPHA_NAUTILUS is not set +# CONFIG_ALPHA_NONAME is not set +# CONFIG_ALPHA_NORITAKE is not set +# CONFIG_ALPHA_PC164 is not set +# CONFIG_ALPHA_P2K is not set +# CONFIG_ALPHA_RAWHIDE is not set +# CONFIG_ALPHA_RUFFIAN is not set +# CONFIG_ALPHA_RX164 is not set +# CONFIG_ALPHA_SX164 is not set +# CONFIG_ALPHA_SABLE is not set +# CONFIG_ALPHA_TAKARA is not set +# CONFIG_ALPHA_TITAN is not set +# CONFIG_ALPHA_WILDFIRE is not set +CONFIG_ISA=y +# CONFIG_SBUS is not set CONFIG_PCI=y -# CONFIG_PCI_GOBIOS is not set -# CONFIG_PCI_GODIRECT is not set -CONFIG_PCI_GOANY=y -CONFIG_PCI_BIOS=y -CONFIG_PCI_DIRECT=y +CONFIG_ALPHA_BROKEN_IRQ_MASK=y +# CONFIG_SMP is not set +# CONFIG_ALPHA_LARGE_VMALLOC is not set CONFIG_PCI_NAMES=y -# CONFIG_MCA is not set -CONFIG_HOTPLUG=y - -# -# PCMCIA/CardBus support -# -CONFIG_PCMCIA=y -CONFIG_CARDBUS=y +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set +CONFIG_NET=y CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y CONFIG_KCORE_ELF=y # CONFIG_KCORE_AOUT is not set -CONFIG_BINFMT_AOUT=y +# CONFIG_BINFMT_AOUT is not set CONFIG_BINFMT_ELF=y -CONFIG_BINFMT_MISC=y -CONFIG_PM=y -CONFIG_ACPI=y -# CONFIG_APM is not set +# CONFIG_BINFMT_MISC is not set +# CONFIG_BINFMT_EM86 is not set # -# Memory Technology Devices (MTD) +# Parallel port support # -# CONFIG_MTD is not set +# CONFIG_PARPORT is not set # -# Parallel port support +# Memory Technology Devices (MTD) # -# CONFIG_PARPORT is not set +# CONFIG_MTD is not set # # Plug and Play configuration @@ -116,7 +92,7 @@ CONFIG_BLK_DEV_FD=y # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set -# CONFIG_BLK_DEV_LOOP is not set +CONFIG_BLK_DEV_LOOP=m # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set # CONFIG_BLK_DEV_INITRD is not set @@ -139,31 +115,69 @@ CONFIG_BLK_DEV_FD=y CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set # CONFIG_NETLINK is not set -# CONFIG_NETFILTER is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set # CONFIG_FILTER is not set CONFIG_UNIX=y CONFIG_INET=y -# CONFIG_IP_MULTICAST is not set +CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_PNP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set -# CONFIG_INET_ECN is not set +# CONFIG_IP_MROUTE is not set +CONFIG_INET_ECN=y # CONFIG_SYN_COOKIES is not set # +# IP: Netfilter Configuration +# +CONFIG_IP_NF_CONNTRACK=m +CONFIG_IP_NF_FTP=m +CONFIG_IP_NF_IPTABLES=m +# CONFIG_IP_NF_MATCH_LIMIT is not set +# CONFIG_IP_NF_MATCH_MAC is not set +# CONFIG_IP_NF_MATCH_MARK is not set +# CONFIG_IP_NF_MATCH_MULTIPORT is not set +# CONFIG_IP_NF_MATCH_TOS is not set +# CONFIG_IP_NF_MATCH_STATE is not set +# CONFIG_IP_NF_MATCH_UNCLEAN is not set +# CONFIG_IP_NF_MATCH_OWNER is not set +CONFIG_IP_NF_FILTER=m +# CONFIG_IP_NF_TARGET_REJECT is not set +# CONFIG_IP_NF_TARGET_MIRROR is not set +CONFIG_IP_NF_NAT=m +CONFIG_IP_NF_NAT_NEEDED=y +CONFIG_IP_NF_TARGET_MASQUERADE=m +# CONFIG_IP_NF_TARGET_REDIRECT is not set +# CONFIG_IP_NF_MANGLE is not set +# CONFIG_IP_NF_TARGET_LOG is not set +CONFIG_IP_NF_COMPAT_IPCHAINS=y +CONFIG_IP_NF_NAT_NEEDED=y +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set +# CONFIG_ATM is not set + +# # # # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_DECNET is not set # CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set # -# Telephony Support +# QoS and/or fair queueing # -# CONFIG_PHONE is not set -# CONFIG_PHONE_IXJ is not set +# CONFIG_NET_SCHED is not set # # ATA/IDE/MFM/RLL support @@ -181,7 +195,7 @@ CONFIG_BLK_DEV_IDE=y # CONFIG_BLK_DEV_HD_IDE is not set # CONFIG_BLK_DEV_HD is not set CONFIG_BLK_DEV_IDEDISK=y -# CONFIG_IDEDISK_MULTI_MODE is not set +CONFIG_IDEDISK_MULTI_MODE=y # CONFIG_BLK_DEV_IDEDISK_VENDOR is not set # CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set # CONFIG_BLK_DEV_IDEDISK_IBM is not set @@ -200,32 +214,30 @@ CONFIG_BLK_DEV_IDECD=y # # IDE chipset support/bugfixes # -CONFIG_BLK_DEV_CMD640=y +# CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_CMD640_ENHANCED is not set # CONFIG_BLK_DEV_ISAPNP is not set -CONFIG_BLK_DEV_RZ1000=y +# CONFIG_BLK_DEV_RZ1000 is not set CONFIG_BLK_DEV_IDEPCI=y -CONFIG_IDEPCI_SHARE_IRQ=y -# CONFIG_BLK_DEV_IDEDMA_PCI is not set +# CONFIG_IDEPCI_SHARE_IRQ is not set +CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_OFFBOARD is not set -# CONFIG_IDEDMA_PCI_AUTO is not set -# CONFIG_BLK_DEV_IDEDMA is not set +CONFIG_IDEDMA_PCI_AUTO=y +CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_PCI_WIP is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_AEC62XX_TUNING is not set -# CONFIG_BLK_DEV_ALI15X3 is not set +CONFIG_BLK_DEV_ALI15X3=y # CONFIG_WDC_ALI15X3 is not set # CONFIG_BLK_DEV_AMD7409 is not set # CONFIG_AMD7409_OVERRIDE is not set -# CONFIG_BLK_DEV_CMD64X is not set -# CONFIG_BLK_DEV_CY82C693 is not set +CONFIG_BLK_DEV_CMD64X=y +CONFIG_BLK_DEV_CY82C693=y # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_HPT34X_AUTODMA is not set # CONFIG_BLK_DEV_HPT366 is not set -# CONFIG_BLK_DEV_PIIX is not set -# CONFIG_PIIX_TUNING is not set # CONFIG_BLK_DEV_NS87415 is not set # CONFIG_BLK_DEV_OPTI621 is not set # CONFIG_BLK_DEV_PDC202XX is not set @@ -234,7 +246,8 @@ CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_TRM290 is not set # CONFIG_BLK_DEV_VIA82CXXX is not set # CONFIG_IDE_CHIPSETS is not set -# CONFIG_IDEDMA_AUTO is not set +CONFIG_IDEDMA_AUTO=y +# CONFIG_IDEDMA_IVB is not set # CONFIG_DMA_NONPCI is not set CONFIG_BLK_DEV_IDE_MODES=y @@ -249,15 +262,17 @@ CONFIG_SCSI=y CONFIG_BLK_DEV_SD=y CONFIG_SD_EXTRA_DEVS=40 # CONFIG_CHR_DEV_ST is not set -# CONFIG_BLK_DEV_SR is not set +CONFIG_BLK_DEV_SR=y +CONFIG_BLK_DEV_SR_VENDOR=y +CONFIG_SR_EXTRA_DEVS=2 # CONFIG_CHR_DEV_SG is not set # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # -CONFIG_SCSI_DEBUG_QUEUES=y -CONFIG_SCSI_MULTI_LUN=y -CONFIG_SCSI_CONSTANTS=y +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set # @@ -269,7 +284,11 @@ CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_AHA152X is not set # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1740 is not set -# CONFIG_SCSI_AIC7XXX is not set +CONFIG_SCSI_AIC7XXX=y +CONFIG_AIC7XXX_TCQ_ON_BY_DEFAULT=y +CONFIG_AIC7XXX_CMDS_PER_DEVICE=8 +CONFIG_AIC7XXX_PROC_STATS=y +CONFIG_AIC7XXX_RESET_DELAY=5 # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_IN2000 is not set # CONFIG_SCSI_AM53C974 is not set @@ -284,19 +303,19 @@ CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_GENERIC_NCR5380 is not set -# CONFIG_SCSI_IPS is not set # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_NCR53C7xx is not set -# CONFIG_SCSI_NCR53C8XX is not set +CONFIG_SCSI_NCR53C8XX=y CONFIG_SCSI_SYM53C8XX=y -CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=4 +CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8 CONFIG_SCSI_NCR53C8XX_MAX_TAGS=32 CONFIG_SCSI_NCR53C8XX_SYNC=20 # CONFIG_SCSI_NCR53C8XX_PROFILE is not set # CONFIG_SCSI_NCR53C8XX_IOMAPPED is not set # CONFIG_SCSI_NCR53C8XX_PQS_PDS is not set +# CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT is not set # CONFIG_SCSI_PAS16 is not set # CONFIG_SCSI_PCI2000 is not set # CONFIG_SCSI_PCI2220I is not set @@ -305,28 +324,12 @@ CONFIG_SCSI_NCR53C8XX_SYNC=20 # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set -# CONFIG_SCSI_SEAGATE is not set # CONFIG_SCSI_SIM710 is not set # CONFIG_SCSI_SYM53C416 is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_T128 is not set # CONFIG_SCSI_U14_34F is not set -# CONFIG_SCSI_ULTRASTOR is not set - -# -# PCMCIA SCSI adapter support -# -# CONFIG_SCSI_PCMCIA is not set - -# -# I2O device support -# -# CONFIG_I2O is not set -# CONFIG_I2O_PCI is not set -# CONFIG_I2O_BLOCK is not set -# CONFIG_I2O_LAN is not set -# CONFIG_I2O_SCSI is not set -# CONFIG_I2O_PROC is not set +# CONFIG_SCSI_DEBUG is not set # # Network device support @@ -347,23 +350,37 @@ CONFIG_DUMMY=m # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y -# CONFIG_NET_VENDOR_3COM is not set +CONFIG_NET_VENDOR_3COM=y +# CONFIG_EL1 is not set +# CONFIG_EL2 is not set +# CONFIG_ELPLUS is not set +# CONFIG_EL16 is not set +# CONFIG_EL3 is not set +# CONFIG_3C515 is not set +CONFIG_VORTEX=y # CONFIG_LANCE is not set # CONFIG_NET_VENDOR_SMC is not set # CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_AT1700 is not set # CONFIG_DEPCA is not set # CONFIG_NET_ISA is not set CONFIG_NET_PCI=y # CONFIG_PCNET32 is not set # CONFIG_ADAPTEC_STARFIRE is not set +# CONFIG_AC3200 is not set # CONFIG_APRICOT is not set # CONFIG_CS89x0 is not set # CONFIG_DE4X5 is not set -# CONFIG_TULIP is not set +CONFIG_TULIP=y # CONFIG_DGRS is not set -CONFIG_EEPRO100=y +# CONFIG_DM9102 is not set +# CONFIG_EEPRO100 is not set +# CONFIG_LNE390 is not set # CONFIG_NATSEMI is not set # CONFIG_NE2K_PCI is not set +# CONFIG_NE3210 is not set +# CONFIG_ES3210 is not set +# CONFIG_RTL8129 is not set # CONFIG_8139TOO is not set # CONFIG_SIS900 is not set # CONFIG_EPIC100 is not set @@ -378,8 +395,10 @@ CONFIG_EEPRO100=y # # CONFIG_ACENIC is not set # CONFIG_HAMACHI is not set +CONFIG_YELLOWFIN=y # CONFIG_SK98LIN is not set # CONFIG_FDDI is not set +# CONFIG_HIPPI is not set # CONFIG_PPP is not set # CONFIG_SLIP is not set @@ -393,6 +412,8 @@ CONFIG_EEPRO100=y # # CONFIG_TR is not set # CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set # # Wan interfaces @@ -400,37 +421,11 @@ CONFIG_EEPRO100=y # CONFIG_WAN is not set # -# PCMCIA network device support -# -CONFIG_NET_PCMCIA=y -# CONFIG_PCMCIA_3C589 is not set -# CONFIG_PCMCIA_3C574 is not set -# CONFIG_PCMCIA_FMVJ18X is not set -CONFIG_PCMCIA_PCNET=y -# CONFIG_PCMCIA_NMCLAN is not set -# CONFIG_PCMCIA_SMC91C92 is not set -# CONFIG_PCMCIA_XIRC2PS is not set -# CONFIG_ARCNET_COM20020_CS is not set -# CONFIG_PCMCIA_IBMTR is not set -# CONFIG_PCMCIA_XIRTULIP is not set -CONFIG_NET_PCMCIA_RADIO=y -CONFIG_PCMCIA_RAYCS=y -# CONFIG_PCMCIA_NETWAVE is not set -# CONFIG_PCMCIA_WAVELAN is not set -# CONFIG_AIRONET4500_CS is not set -CONFIG_PCMCIA_NETCARD=y - -# # Amateur Radio support # # CONFIG_HAMRADIO is not set # -# IrDA (infrared) support -# -# CONFIG_IRDA is not set - -# # ISDN subsystem # # CONFIG_ISDN is not set @@ -441,11 +436,6 @@ CONFIG_PCMCIA_NETCARD=y # CONFIG_CD_NO_IDESCSI is not set # -# Input core support -# -# CONFIG_INPUT is not set - -# # Character devices # CONFIG_VT=y @@ -487,7 +477,7 @@ CONFIG_PSMOUSE=y # CONFIG_WATCHDOG is not set # CONFIG_INTEL_RNG is not set # CONFIG_NVRAM is not set -# CONFIG_RTC is not set +CONFIG_RTC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -497,19 +487,7 @@ CONFIG_PSMOUSE=y # # CONFIG_FTAPE is not set # CONFIG_AGP is not set -CONFIG_DRM=y -CONFIG_DRM_TDFX=y -# CONFIG_DRM_GAMMA is not set -# CONFIG_DRM_R128 is not set -# CONFIG_DRM_I810 is not set -# CONFIG_DRM_MGA is not set -CONFIG_PCMCIA_SERIAL=y - -# -# PCMCIA character device support -# -# CONFIG_PCMCIA_SERIAL_CS is not set -# CONFIG_PCMCIA_SERIAL_CB is not set +# CONFIG_DRM is not set # # Multimedia devices @@ -520,17 +498,17 @@ CONFIG_PCMCIA_SERIAL=y # File systems # # CONFIG_QUOTA is not set -# CONFIG_AUTOFS_FS is not set -CONFIG_AUTOFS4_FS=y +CONFIG_AUTOFS_FS=m +# CONFIG_AUTOFS4_FS is not set # CONFIG_ADFS_FS is not set # CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set -# CONFIG_FAT_FS is not set -# CONFIG_MSDOS_FS is not set +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y # CONFIG_UMSDOS_FS is not set -# CONFIG_VFAT_FS is not set +CONFIG_VFAT_FS=y # CONFIG_EFS_FS is not set # CONFIG_JFFS_FS is not set # CONFIG_CRAMFS is not set @@ -561,13 +539,14 @@ CONFIG_EXT2_FS=y # Network File Systems # # CONFIG_CODA_FS is not set -CONFIG_NFS_FS=y -# CONFIG_NFS_V3 is not set +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y # CONFIG_ROOT_NFS is not set -CONFIG_NFSD=y -# CONFIG_NFSD_V3 is not set -CONFIG_SUNRPC=y -CONFIG_LOCKD=y +CONFIG_NFSD=m +CONFIG_NFSD_V3=y +CONFIG_SUNRPC=m +CONFIG_LOCKD=m +CONFIG_LOCKD_V4=y # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set # CONFIG_NCPFS_PACKET_SIGNING is not set @@ -585,78 +564,76 @@ CONFIG_LOCKD=y # Partition Types # # CONFIG_PARTITION_ADVANCED is not set +CONFIG_OSF_PARTITION=y CONFIG_MSDOS_PARTITION=y -# CONFIG_NLS is not set +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_CODEPAGE_437=y +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_UTF8 is not set # # Console drivers # CONFIG_VGA_CONSOLE=y -# CONFIG_VIDEO_SELECT is not set - -# -# Sound -# -CONFIG_SOUND=y -# CONFIG_SOUND_CMPCI is not set -# CONFIG_SOUND_EMU10K1 is not set -# CONFIG_SOUND_FUSION is not set -# CONFIG_SOUND_CS4281 is not set -# CONFIG_SOUND_ES1370 is not set -CONFIG_SOUND_ES1371=y -# CONFIG_SOUND_ESSSOLO1 is not set -# CONFIG_SOUND_MAESTRO is not set -# CONFIG_SOUND_SONICVIBES is not set -# CONFIG_SOUND_TRIDENT is not set -# CONFIG_SOUND_MSNDCLAS is not set -# CONFIG_SOUND_MSNDPIN is not set -# CONFIG_SOUND_VIA82CXXX is not set -# CONFIG_SOUND_OSS is not set -# CONFIG_SOUND_TVMIXER is not set - -# -# USB support -# -CONFIG_USB=y -# CONFIG_USB_DEBUG is not set # -# Miscellaneous USB options +# Frame-buffer support # -# CONFIG_USB_DEVICEFS is not set -# CONFIG_USB_BANDWIDTH is not set +# CONFIG_FB is not set # -# USB Controllers -# -CONFIG_USB_UHCI_ALT=y -# CONFIG_USB_OHCI is not set - -# -# USB Devices +# Sound # -# CONFIG_USB_PRINTER is not set -# CONFIG_USB_SCANNER is not set -# CONFIG_USB_AUDIO is not set -# CONFIG_USB_ACM is not set -# CONFIG_USB_SERIAL is not set -# CONFIG_USB_IBMCAM is not set -# CONFIG_USB_OV511 is not set -# CONFIG_USB_DC2XX is not set -CONFIG_USB_STORAGE=y -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_USS720 is not set -# CONFIG_USB_DABUSB is not set +# CONFIG_SOUND is not set # -# USB Human Interface Devices (HID) +# USB support # +# CONFIG_USB is not set # -# Input core support is needed for USB HID +# Input core support # +# CONFIG_INPUT is not set # # Kernel hacking # -# CONFIG_MAGIC_SYSRQ is not set +CONFIG_MATHEMU=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_ALPHA_LEGACY_START_ADDRESS=y diff --git a/arch/alpha/lib/Makefile b/arch/alpha/lib/Makefile index b6cf88e3d..d22a6f522 100644 --- a/arch/alpha/lib/Makefile +++ b/arch/alpha/lib/Makefile @@ -13,7 +13,7 @@ OBJS = __divqu.o __remqu.o __divlu.o __remlu.o memset.o memcpy.o io.o \ strchr.o strrchr.o memchr.o \ copy_user.o clear_user.o strncpy_from_user.o strlen_user.o \ csum_ipv6_magic.o strcasecmp.o semaphore.o fpreg.o \ - callback_srm.o callback_init.o srm_puts.o srm_printk.o + callback_srm.o srm_puts.o srm_printk.o lib.a: $(OBJS) $(AR) rcs lib.a $(OBJS) diff --git a/arch/alpha/lib/callback_init.c b/arch/alpha/lib/callback_init.c deleted file mode 100644 index fe643ccfc..000000000 --- a/arch/alpha/lib/callback_init.c +++ /dev/null @@ -1,79 +0,0 @@ -#include -#include - -#include -#include -#include -#include - -#include "../kernel/proto.h" - -extern struct hwrpb_struct *hwrpb; - -/* This is the SRM version. Maybe there will be a DBM version. */ - -int callback_init_done = 0; - -void * __init callback_init(void * kernel_end) -{ - int i, j; - unsigned long vaddr = CONSOLE_REMAP_START; - struct crb_struct * crb; - pgd_t * pgd = pgd_offset_k(vaddr); - pmd_t * pmd; - unsigned long two_pte_pages; - - if (!alpha_using_srm) { - switch_to_system_map(); - return kernel_end; - } - - /* Allocate some memory for the pages. */ - two_pte_pages = ((unsigned long)kernel_end + ~PAGE_MASK) & PAGE_MASK; - kernel_end = (void *)(two_pte_pages + 2*PAGE_SIZE); - memset((void *)two_pte_pages, 0, 2*PAGE_SIZE); - - /* Starting at the HWRPB, locate the CRB. */ - crb = (struct crb_struct *)((char *)hwrpb + hwrpb->crb_offset); - - /* Tell the console whither the console is to be remapped. */ - if (srm_fixup(vaddr, (unsigned long)hwrpb)) - __halt(); /* "We're boned." --Bender */ - - /* Edit the procedure descriptors for DISPATCH and FIXUP. */ - crb->dispatch_va = (struct procdesc_struct *) - (vaddr + (unsigned long)crb->dispatch_va - crb->map[0].va); - crb->fixup_va = (struct procdesc_struct *) - (vaddr + (unsigned long)crb->fixup_va - crb->map[0].va); - - switch_to_system_map(); - - /* - * Set up the first and second level PTEs for console callbacks. - * There is an assumption here that only one of each is needed, - * and this allows for 8MB. Currently (late 1999), big consoles - * are still under 4MB. - */ - pgd_set(pgd, (pmd_t *)two_pte_pages); - pmd = pmd_offset(pgd, vaddr); - pmd_set(pmd, (pte_t *)(two_pte_pages + PAGE_SIZE)); - - /* - * Set up the third level PTEs and update the virtual addresses - * of the CRB entries. - */ - for (i = 0; i < crb->map_entries; ++i) { - unsigned long paddr = crb->map[i].pa; - crb->map[i].va = vaddr; - for (j = 0; j < crb->map[i].count; ++j) { - set_pte(pte_offset(pmd, vaddr), - mk_pte_phys(paddr, PAGE_KERNEL)); - paddr += PAGE_SIZE; - vaddr += PAGE_SIZE; - } - } - - callback_init_done = 1; - return kernel_end; -} - diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c index c81a12d18..a5140ce1c 100644 --- a/arch/alpha/mm/fault.c +++ b/arch/alpha/mm/fault.c @@ -108,6 +108,11 @@ do_page_fault(unsigned long address, unsigned long mmcsr, if (!mm || in_interrupt()) goto no_context; +#ifdef CONFIG_ALPHA_LARGE_VMALLOC + if (address >= TASK_SIZE) + goto vmalloc_fault; +#endif + down(&mm->mmap_sem); vma = find_vma(mm, address); if (!vma) @@ -204,4 +209,25 @@ do_sigbus: if (!user_mode(regs)) goto no_context; return; + +#ifdef CONFIG_ALPHA_LARGE_VMALLOC +vmalloc_fault: + if (user_mode(regs)) { + force_sig(SIGSEGV, current); + return; + } else { + /* Synchronize this task's top level page-table + with the "reference" page table from init. */ + long offset = __pgd_offset(address); + pgd_t *pgd, *pgd_k; + + pgd = current->active_mm->pgd + offset; + pgd_k = swapper_pg_dir + offset; + if (!pgd_present(*pgd) && pgd_present(*pgd_k)) { + pgd_val(*pgd) = pgd_val(*pgd_k); + return; + } + goto no_context; + } +#endif } diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c index 2ab7941b2..52e2b36f7 100644 --- a/arch/alpha/mm/init.c +++ b/arch/alpha/mm/init.c @@ -19,6 +19,7 @@ #include #include #include /* max_low_pfn */ +#include #ifdef CONFIG_BLK_DEV_INITRD #include #endif @@ -30,6 +31,7 @@ #include #include #include +#include static unsigned long totalram_pages; @@ -55,6 +57,29 @@ __bad_pte(pmd_t *pmd) pmd_set(pmd, (pte_t *) BAD_PAGETABLE); } +pgd_t * +get_pgd_slow(void) +{ + pgd_t *ret, *init; + + ret = (pgd_t *)__get_free_page(GFP_KERNEL); + init = pgd_offset(&init_mm, 0UL); + if (ret) { + clear_page(ret); +#ifdef CONFIG_ALPHA_LARGE_VMALLOC + memcpy (ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD, + (PTRS_PER_PGD - USER_PTRS_PER_PGD - 1)*sizeof(pgd_t)); +#else + pgd_val(ret[PTRS_PER_PGD-2]) = pgd_val(init[PTRS_PER_PGD-2]); +#endif + + /* The last PGD entry is the VPTB self-map. */ + pgd_val(ret[PTRS_PER_PGD-1]) + = pte_val(mk_pte(virt_to_page(ret), PAGE_KERNEL)); + } + return ret; +} + pmd_t * get_pmd_slow(pgd_t *pgd, unsigned long offset) { @@ -182,8 +207,9 @@ load_PCB(struct thread_struct * pcb) return __reload_thread(pcb); } -/* switch_to_system_map() sets up some necessary page tables. */ -void +/* Set up initial PCB, VPTB, and other such nicities. */ + +static inline void switch_to_system_map(void) { unsigned long newptbr; @@ -225,6 +251,84 @@ switch_to_system_map(void) original_pcb = *(struct thread_struct *) original_pcb_ptr; } +int callback_init_done; + +void * __init +callback_init(void * kernel_end) +{ + struct crb_struct * crb; + pgd_t *pgd; + pmd_t *pmd; + void *two_pages; + + /* Starting at the HWRPB, locate the CRB. */ + crb = (struct crb_struct *)((char *)hwrpb + hwrpb->crb_offset); + + if (alpha_using_srm) { + /* Tell the console whither it is to be remapped. */ + if (srm_fixup(VMALLOC_START, (unsigned long)hwrpb)) + __halt(); /* "We're boned." --Bender */ + + /* Edit the procedure descriptors for DISPATCH and FIXUP. */ + crb->dispatch_va = (struct procdesc_struct *) + (VMALLOC_START + (unsigned long)crb->dispatch_va + - crb->map[0].va); + crb->fixup_va = (struct procdesc_struct *) + (VMALLOC_START + (unsigned long)crb->fixup_va + - crb->map[0].va); + } + + switch_to_system_map(); + + /* Allocate one PGD and one PMD. In the case of SRM, we'll need + these to actually remap the console. There is an assumption + here that only one of each is needed, and this allows for 8MB. + Currently (late 1999), big consoles are still under 4MB. + + In the case of not SRM, but not CONFIG_ALPHA_LARGE_VMALLOC, + we need to allocate the PGD we use for vmalloc before we start + forking other tasks. */ + + two_pages = (void *) + (((unsigned long)kernel_end + ~PAGE_MASK) & PAGE_MASK); + kernel_end = two_pages + 2*PAGE_SIZE; + memset(two_pages, 0, 2*PAGE_SIZE); + + pgd = pgd_offset_k(VMALLOC_START); + pgd_set(pgd, (pmd_t *)two_pages); + pmd = pmd_offset(pgd, VMALLOC_START); + pmd_set(pmd, (pte_t *)(two_pages + PAGE_SIZE)); + + if (alpha_using_srm) { + static struct vm_struct console_remap_vm; + unsigned long vaddr = VMALLOC_START; + long i, j; + + /* Set up the third level PTEs and update the virtual + addresses of the CRB entries. */ + for (i = 0; i < crb->map_entries; ++i) { + unsigned long paddr = crb->map[i].pa; + crb->map[i].va = vaddr; + for (j = 0; j < crb->map[i].count; ++j) { + set_pte(pte_offset(pmd, vaddr), + mk_pte_phys(paddr, PAGE_KERNEL)); + paddr += PAGE_SIZE; + vaddr += PAGE_SIZE; + } + } + + /* Let vmalloc know that we've allocated some space. */ + console_remap_vm.flags = VM_ALLOC; + console_remap_vm.addr = VMALLOC_START; + console_remap_vm.size = vaddr - VMALLOC_START; + vmlist = &console_remap_vm; + } + + callback_init_done = 1; + return kernel_end; +} + + /* * paging_init() sets up the memory map. */ diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 8dc0eaf19..ea833c58d 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -383,27 +383,27 @@ static inline void reserve_node_zero(unsigned int bootmap_pfn, unsigned int boot * Register the kernel text and data with bootmem. * Note that this can only be in node 0. */ - reserve_bootmem_node(0, __pa(&_stext), &_end - &_stext); + reserve_bootmem_node(NODE_DATA(0), __pa(&_stext), &_end - &_stext); #ifdef CONFIG_CPU_32 /* * Reserve the page tables. These are already in use, * and can only be in node 0. */ - reserve_bootmem_node(0, __pa(swapper_pg_dir), + reserve_bootmem_node(NODE_DATA(0), __pa(swapper_pg_dir), PTRS_PER_PGD * sizeof(void *)); #else /* * Stop this memory from being grabbed - its special DMA * memory that is required for the screen. */ - reserve_bootmem_node(0, 0x02000000, 0x00080000); + reserve_bootmem_node(NODE_DATA(0), 0x02000000, 0x00080000); #endif /* * And don't forget to reserve the allocator bitmap, * which will be freed later. */ - reserve_bootmem_node(0, bootmap_pfn << PAGE_SHIFT, + reserve_bootmem_node(NODE_DATA(0), bootmap_pfn << PAGE_SHIFT, bootmap_pages << PAGE_SHIFT); } @@ -416,7 +416,7 @@ static inline void free_bootmem_node_bank(int node, struct meminfo *mi) for (bank = 0; bank < mi->nr_banks; bank++) if (mi->bank[bank].node == node) - free_bootmem_node(node, mi->bank[bank].start, + free_bootmem_node(NODE_DATA(node), mi->bank[bank].start, mi->bank[bank].size); } @@ -450,7 +450,7 @@ void __init bootmem_init(struct meminfo *mi) /* * Initialise the bootmem allocator. */ - init_bootmem_node(node, map_pg, np->start, np->end); + init_bootmem_node(NODE_DATA(node), map_pg, np->start, np->end); free_bootmem_node_bank(node, mi); map_pg += np->bootmap_pages; @@ -465,7 +465,7 @@ void __init bootmem_init(struct meminfo *mi) #ifdef CONFIG_BLK_DEV_INITRD if (initrd_node >= 0) - reserve_bootmem_node(initrd_node, __pa(initrd_start), + reserve_bootmem_node(NODE_DATA(initrd_node), __pa(initrd_start), initrd_end - initrd_start); #endif @@ -583,7 +583,7 @@ void __init mem_init(void) /* this will put all unused low memory onto the freelists */ for (node = 0; node < numnodes; node++) - totalram_pages += free_all_bootmem_node(node); + totalram_pages += free_all_bootmem_node(NODE_DATA(node)); /* * Since our memory may not be contiguous, calculate the diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c index 9ddcc84bc..2ace55d47 100644 --- a/arch/arm/mm/mm-armv.c +++ b/arch/arm/mm/mm-armv.c @@ -438,7 +438,7 @@ static inline void free_memmap(int node, unsigned long start, unsigned long end) start = __virt_to_phys(pg); end = __virt_to_phys(pgend); - free_bootmem_node(node, start, end - start); + free_bootmem_node(NODE_DATA(node), start, end - start); } static inline void free_unused_memmap_node(int node, struct meminfo *mi) diff --git a/arch/i386/config.in b/arch/i386/config.in index 6d1279ed7..327aa736d 100644 --- a/arch/i386/config.in +++ b/arch/i386/config.in @@ -45,7 +45,7 @@ choice 'Processor family' \ # if [ "$CONFIG_M386" = "y" ]; then define_bool CONFIG_X86_CMPXCHG n - define_int CONFIG_X86_L1_CACHE_BYTES 16 + define_int CONFIG_X86_L1_CACHE_SHIFT 4 else define_bool CONFIG_X86_WP_WORKS_OK y define_bool CONFIG_X86_INVLPG y @@ -54,37 +54,37 @@ else define_bool CONFIG_X86_POPAD_OK y fi if [ "$CONFIG_M486" = "y" ]; then - define_int CONFIG_X86_L1_CACHE_BYTES 16 + define_int CONFIG_X86_L1_CACHE_SHIFT 4 define_bool CONFIG_X86_USE_STRING_486 y define_bool CONFIG_X86_ALIGNMENT_16 y fi if [ "$CONFIG_M586" = "y" ]; then - define_int CONFIG_X86_L1_CACHE_BYTES 32 + define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_bool CONFIG_X86_USE_STRING_486 y define_bool CONFIG_X86_ALIGNMENT_16 y fi if [ "$CONFIG_M586TSC" = "y" ]; then - define_int CONFIG_X86_L1_CACHE_BYTES 32 + define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_bool CONFIG_X86_USE_STRING_486 y define_bool CONFIG_X86_ALIGNMENT_16 y define_bool CONFIG_X86_TSC y fi if [ "$CONFIG_M586MMX" = "y" ]; then - define_int CONFIG_X86_L1_CACHE_BYTES 32 + define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_bool CONFIG_X86_USE_STRING_486 y define_bool CONFIG_X86_ALIGNMENT_16 y define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_GOOD_APIC y fi if [ "$CONFIG_M686" = "y" ]; then - define_int CONFIG_X86_L1_CACHE_BYTES 32 + define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_GOOD_APIC y define_bool CONFIG_X86_PGE y define_bool CONFIG_X86_USE_PPRO_CHECKSUM y fi if [ "$CONFIG_M686FXSR" = "y" ]; then - define_int CONFIG_X86_L1_CACHE_BYTES 32 + define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_GOOD_APIC y define_bool CONFIG_X86_PGE y @@ -93,13 +93,13 @@ if [ "$CONFIG_M686FXSR" = "y" ]; then define_bool CONFIG_X86_XMM y fi if [ "$CONFIG_MK6" = "y" ]; then - define_int CONFIG_X86_L1_CACHE_BYTES 32 + define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_bool CONFIG_X86_ALIGNMENT_16 y define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_USE_PPRO_CHECKSUM y fi if [ "$CONFIG_MK7" = "y" ]; then - define_int CONFIG_X86_L1_CACHE_BYTES 64 + define_int CONFIG_X86_L1_CACHE_SHIFT 6 define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_GOOD_APIC y define_bool CONFIG_X86_USE_3DNOW y @@ -107,22 +107,22 @@ if [ "$CONFIG_MK7" = "y" ]; then define_bool CONFIG_X86_USE_PPRO_CHECKSUM y fi if [ "$CONFIG_MCRUSOE" = "y" ]; then - define_int CONFIG_X86_L1_CACHE_BYTES 32 + define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_bool CONFIG_X86_TSC y fi if [ "$CONFIG_MWINCHIPC6" = "y" ]; then - define_int CONFIG_X86_L1_CACHE_BYTES 32 + define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_bool CONFIG_X86_ALIGNMENT_16 y define_bool CONFIG_X86_USE_PPRO_CHECKSUM y fi if [ "$CONFIG_MWINCHIP2" = "y" ]; then - define_int CONFIG_X86_L1_CACHE_BYTES 32 + define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_bool CONFIG_X86_ALIGNMENT_16 y define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_USE_PPRO_CHECKSUM y fi if [ "$CONFIG_MWINCHIP3D" = "y" ]; then - define_int CONFIG_X86_L1_CACHE_BYTES 32 + define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_bool CONFIG_X86_ALIGNMENT_16 y define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_USE_PPRO_CHECKSUM y diff --git a/arch/i386/defconfig b/arch/i386/defconfig index 7dddf3057..3bba4b372 100644 --- a/arch/i386/defconfig +++ b/arch/i386/defconfig @@ -39,7 +39,7 @@ CONFIG_X86_INVLPG=y CONFIG_X86_CMPXCHG=y CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y -CONFIG_X86_L1_CACHE_BYTES=32 +CONFIG_X86_L1_CACHE_SHIFT=5 CONFIG_X86_TSC=y CONFIG_X86_GOOD_APIC=y CONFIG_X86_PGE=y @@ -231,6 +231,7 @@ CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_PDC202XX is not set # CONFIG_PDC202XX_BURST is not set # CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_TRM290 is not set # CONFIG_BLK_DEV_VIA82CXXX is not set # CONFIG_IDE_CHIPSETS is not set diff --git a/arch/i386/kernel/bluesmoke.c b/arch/i386/kernel/bluesmoke.c index 0fecf5851..ee6966d5f 100644 --- a/arch/i386/kernel/bluesmoke.c +++ b/arch/i386/kernel/bluesmoke.c @@ -8,7 +8,7 @@ #include #include -static int banks = 0; +static int banks; void mcheck_fault(void) { @@ -71,7 +71,7 @@ void mcheck_init(void) u32 l, h; int i; struct cpuinfo_x86 *c; - static int done=0; + static int done; c=cpu_data+smp_processor_id(); diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S index 67f1f2445..4ae0ed2ee 100644 --- a/arch/i386/kernel/entry.S +++ b/arch/i386/kernel/entry.S @@ -205,7 +205,7 @@ ENTRY(system_call) ENTRY(ret_from_sys_call) #ifdef CONFIG_SMP movl processor(%ebx),%eax - shll $5,%eax + shll $CONFIG_X86_L1_CACHE_SHIFT,%eax movl SYMBOL_NAME(irq_stat)(,%eax),%ecx # softirq_active testl SYMBOL_NAME(irq_stat)+4(,%eax),%ecx # softirq_mask #else @@ -261,7 +261,7 @@ ret_from_exception: #ifdef CONFIG_SMP GET_CURRENT(%ebx) movl processor(%ebx),%eax - shll $5,%eax + shll $CONFIG_X86_L1_CACHE_SHIFT,%eax movl SYMBOL_NAME(irq_stat)(,%eax),%ecx # softirq_active testl SYMBOL_NAME(irq_stat)+4(,%eax),%ecx # softirq_mask #else diff --git a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c index 46e270774..df377c5b4 100644 --- a/arch/i386/kernel/i8259.c +++ b/arch/i386/kernel/i8259.c @@ -178,7 +178,7 @@ static unsigned int cached_irq_mask = 0xffff; * this 'mixed mode' IRQ handling costs nothing because it's only used * at IRQ setup time. */ -unsigned long io_apic_irqs = 0; +unsigned long io_apic_irqs; void disable_8259A_irq(unsigned int irq) { @@ -312,7 +312,7 @@ spurious_8259A_irq: goto handle_real_irq; { - static int spurious_irq_mask = 0; + static int spurious_irq_mask; /* * At this point we can be sure the IRQ is spurious, * lets ACK and report it. [once per IRQ] diff --git a/arch/i386/kernel/mtrr.c b/arch/i386/kernel/mtrr.c index abe198315..045374d50 100644 --- a/arch/i386/kernel/mtrr.c +++ b/arch/i386/kernel/mtrr.c @@ -1581,7 +1581,7 @@ static struct proc_dir_entry *proc_root_mtrr; # endif /* CONFIG_PROC_FS */ -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; static void compute_ascii (void) { diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index bd4adf92c..9059adcbc 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c @@ -1548,7 +1548,6 @@ void __init identify_cpu(struct cpuinfo_x86 *c) /* Pentium IV. */ if (c->x86 == 15) { - c->x86 = 6; get_model_name(c); goto name_decoded; } diff --git a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c index 6ce9eb61e..f39e42522 100644 --- a/arch/i386/kernel/smp.c +++ b/arch/i386/kernel/smp.c @@ -422,7 +422,7 @@ struct call_data_struct { int wait; }; -static struct call_data_struct * call_data = NULL; +static struct call_data_struct * call_data; /* * this function sends a 'generic call function' IPI to all other CPUs diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c index 3a9df08e7..12ba21b92 100644 --- a/arch/i386/kernel/time.c +++ b/arch/i386/kernel/time.c @@ -76,7 +76,7 @@ static unsigned long last_tsc_low; /* lsb 32 bits of Time Stamp Counter */ * Equal to 2^32 * (1 / (clocks per usec) ). * Initialized in time_init. */ -unsigned long fast_gettimeoffset_quotient=0; +unsigned long fast_gettimeoffset_quotient; extern rwlock_t xtime_lock; extern unsigned long wall_jiffies; @@ -373,9 +373,9 @@ static int set_rtc_mmss(unsigned long nowtime) } /* last time the cmos clock got updated */ -static long last_rtc_update = 0; +static long last_rtc_update; -int timer_ack = 0; +int timer_ack; /* * timer_interrupt() needs to keep up the real-time clock, @@ -449,7 +449,7 @@ static inline void do_timer_interrupt(int irq, void *dev_id, struct pt_regs *reg #endif } -static int use_tsc = 0; +static int use_tsc; /* * This is the same as the above, except we _also_ save the current diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c index 918849c8c..946d1f40a 100644 --- a/arch/i386/mm/fault.c +++ b/arch/i386/mm/fault.c @@ -77,31 +77,6 @@ bad_area: return 0; } -static void __init handle_wp_test (void) -{ - const unsigned long vaddr = PAGE_OFFSET; - pgd_t *pgd; - pmd_t *pmd; - pte_t *pte; - - /* - * make it read/writable temporarily, so that the fault - * can be handled. - */ - pgd = swapper_pg_dir + __pgd_offset(vaddr); - pmd = pmd_offset(pgd, vaddr); - pte = pte_offset(pmd, vaddr); - *pte = mk_pte_phys(0, PAGE_KERNEL); - __flush_tlb_all(); - - boot_cpu_data.wp_works_ok = 1; - /* - * Beware: Black magic here. The printk is needed here to flush - * CPU state on certain buggy processors. - */ - printk("Ok"); -} - asmlinkage void do_invalid_op(struct pt_regs *, unsigned long); extern unsigned long idt; @@ -274,14 +249,7 @@ no_context: /* * Oops. The kernel tried to access some bad page. We'll have to * terminate things with extreme prejudice. - * - * First we check if it was the bootup rw-test, though.. */ - if (boot_cpu_data.wp_works_ok < 0 && - address == PAGE_OFFSET && (error_code & 1)) { - handle_wp_test(); - return; - } if (address < PAGE_SIZE) printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference"); diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c index 9ba2baa31..4b3cc4dfc 100644 --- a/arch/i386/mm/init.c +++ b/arch/i386/mm/init.c @@ -37,8 +37,8 @@ #include unsigned long highstart_pfn, highend_pfn; -static unsigned long totalram_pages = 0; -static unsigned long totalhigh_pages = 0; +static unsigned long totalram_pages; +static unsigned long totalhigh_pages; /* * BAD_PAGE is the page that is used for page faults when linux @@ -491,16 +491,42 @@ void __init paging_init(void) * before and after the test are here to work-around some nasty CPU bugs. */ +/* + * This function cannot be __init, since exceptions don't work in that + * section. + */ +static int do_test_wp_bit(unsigned long vaddr) +{ + char tmp_reg; + int flag; + + __asm__ __volatile__( + " movb %0,%1 \n" + "1: movb %1,%0 \n" + " xorl %2,%2 \n" + "2: \n" + ".section __ex_table,\"a\"\n" + " .align 4 \n" + " .long 1b,2b \n" + ".previous \n" + :"=m" (*(char *) vaddr), + "=q" (tmp_reg), + "=r" (flag) + :"2" (1) + :"memory"); + + return flag; +} + void __init test_wp_bit(void) { /* - * Ok, all PAE-capable CPUs are definitely handling the WP bit right. + * Ok, all PSE-capable CPUs are definitely handling the WP bit right. */ const unsigned long vaddr = PAGE_OFFSET; pgd_t *pgd; pmd_t *pmd; pte_t *pte, old_pte; - char tmp_reg; printk("Checking if this processor honours the WP bit even in supervisor mode... "); @@ -511,27 +537,19 @@ void __init test_wp_bit(void) *pte = mk_pte_phys(0, PAGE_READONLY); local_flush_tlb(); - __asm__ __volatile__( - "jmp 1f; 1:\n" - "movb %0,%1\n" - "movb %1,%0\n" - "jmp 1f; 1:\n" - :"=m" (*(char *) vaddr), - "=q" (tmp_reg) - :/* no inputs */ - :"memory"); + boot_cpu_data.wp_works_ok = do_test_wp_bit(vaddr); *pte = old_pte; local_flush_tlb(); - if (boot_cpu_data.wp_works_ok < 0) { - boot_cpu_data.wp_works_ok = 0; + if (!boot_cpu_data.wp_works_ok) { printk("No.\n"); #ifdef CONFIG_X86_WP_WORKS_OK panic("This kernel doesn't support CPU's with broken WP. Recompile it for a 386!"); #endif - } else - printk(".\n"); + } else { + printk("Ok.\n"); + } } static inline int page_is_ram (unsigned long pagenr) diff --git a/arch/m68k/amiga/amiga_ksyms.c b/arch/m68k/amiga/amiga_ksyms.c index 9b686100a..e9fee546e 100644 --- a/arch/m68k/amiga/amiga_ksyms.c +++ b/arch/m68k/amiga/amiga_ksyms.c @@ -1,7 +1,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/m68k/amiga/chipram.c b/arch/m68k/amiga/chipram.c index 43df3f6c2..b7f9f0508 100644 --- a/arch/m68k/amiga/chipram.c +++ b/arch/m68k/amiga/chipram.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include struct chip_desc { diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index d7cc137a9..528f206ff 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c @@ -20,7 +20,9 @@ #include #include #include +#ifdef CONFIG_ZORRO #include +#endif #include #include @@ -161,6 +163,7 @@ int amiga_parse_bootinfo(const struct bi_record *record) break; case BI_AMIGA_AUTOCON: +#ifdef CONFIG_ZORRO if (zorro_num_autocon < ZORRO_NUM_AUTO) { const struct ConfigDev *cd = (struct ConfigDev *)data; struct zorro_dev *dev = &zorro_autocon[zorro_num_autocon++]; @@ -171,6 +174,7 @@ int amiga_parse_bootinfo(const struct bi_record *record) dev->resource.end = dev->resource.start+cd->cd_BoardSize-1; } else printk("amiga_parse_bootinfo: too many AutoConfig devices\n"); +#endif break; case BI_AMIGA_SERPER: @@ -997,11 +1001,13 @@ static int amiga_get_hardware_list(char *buffer) AMIGAHW_ANNOUNCE(ALICE_NTSC, "NTSC Alice 8374"); AMIGAHW_ANNOUNCE(MAGIC_REKICK, "Magic Hard Rekick"); AMIGAHW_ANNOUNCE(PCMCIA, "PCMCIA Slot"); +#ifdef CONFIG_ZORRO if (AMIGAHW_PRESENT(ZORRO)) len += sprintf(buffer+len, "\tZorro II%s AutoConfig: %d Expansion " "Device%s\n", AMIGAHW_PRESENT(ZORRO3) ? "I" : "", zorro_num_autocon, zorro_num_autocon == 1 ? "" : "s"); +#endif #undef AMIGAHW_ANNOUNCE diff --git a/arch/m68k/config.in b/arch/m68k/config.in index 83381857f..b06fdb516 100644 --- a/arch/m68k/config.in +++ b/arch/m68k/config.in @@ -139,9 +139,8 @@ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then fi fi -if [ "$CONFIG_PCI" = "y" ]; then - source drivers/pci/Config.in -fi +source drivers/pci/Config.in +source drivers/zorro/Config.in endmenu diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c index 015aabfe1..a2e3f47f1 100644 --- a/arch/m68k/kernel/setup.c +++ b/arch/m68k/kernel/setup.c @@ -365,7 +365,7 @@ void __init setup_arch(char **cmdline_p) high_memory += m68k_memory[i].size; } - availmem += init_bootmem_node(0, availmem >> PAGE_SHIFT, + availmem += init_bootmem_node(NODE_DATA(0), availmem >> PAGE_SHIFT, startmem >> PAGE_SHIFT, endmem >> PAGE_SHIFT); for (i = 0; i < m68k_num_memory; i++) diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index c1154b6aa..a0486cf95 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -127,7 +127,6 @@ void mac_waitbut (void) } #endif -extern struct consw fb_con; extern struct fb_info *mac_fb_init(long *); extern void mac_default_handler(int, void *, struct pt_regs *); diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c index 612d51eda..dbb3d81e2 100644 --- a/arch/m68k/mm/init.c +++ b/arch/m68k/mm/init.c @@ -32,7 +32,7 @@ #include #endif -static unsigned long totalram_pages = 0; +static unsigned long totalram_pages; #ifdef CONFIG_SUN3 void mmu_emu_reserve_pages(unsigned long max_page); diff --git a/arch/mips/dec/time.c b/arch/mips/dec/time.c index 84ef4ce9a..38f598d70 100644 --- a/arch/mips/dec/time.c +++ b/arch/mips/dec/time.c @@ -39,7 +39,7 @@ extern rwlock_t xtime_lock; /* Cycle counter value at the previous timer interrupt.. */ -static unsigned int timerhi = 0, timerlo = 0; +static unsigned int timerhi, timerlo; /* * On MIPS only R4000 and better have a cycle counter. @@ -269,7 +269,7 @@ static int set_rtc_mmss(unsigned long nowtime) } /* last time the cmos clock got updated */ -static long last_rtc_update = 0; +static long last_rtc_update; /* * timer_interrupt() needs to keep up the real-time clock, diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c index 4f80173f8..af4af4fc3 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c @@ -26,7 +26,7 @@ #include extern volatile unsigned long wall_jiffies; -unsigned long r4k_interval = 0; +unsigned long r4k_interval; extern rwlock_t xtime_lock; /* @@ -40,7 +40,7 @@ extern rwlock_t xtime_lock; /* Cycle counter value at the previous timer interrupt.. */ -static unsigned int timerhi = 0, timerlo = 0; +static unsigned int timerhi, timerlo; /* * On MIPS only R4000 and better have a cycle counter. @@ -53,14 +53,14 @@ static unsigned long do_fast_gettimeoffset(void) unsigned long res, tmp; /* Last jiffy when do_fast_gettimeoffset() was called. */ - static unsigned long last_jiffies=0; + static unsigned long last_jiffies; unsigned long quotient; /* * Cached "1/(clocks per usec)*2^32" value. * It has to be recalculated once each jiffy. */ - static unsigned long cached_quotient=0; + static unsigned long cached_quotient; tmp = jiffies; @@ -154,7 +154,7 @@ static unsigned long do_slow_gettimeoffset(void) int count; static int count_p = LATCH; /* for the first call after boot */ - static unsigned long jiffies_p = 0; + static unsigned long jiffies_p; /* * cache volatile jiffies temporarily; we have IRQs turned off. @@ -330,7 +330,7 @@ static int set_rtc_mmss(unsigned long nowtime) } /* last time the cmos clock got updated */ -static long last_rtc_update = 0; +static long last_rtc_update; /* * timer_interrupt() needs to keep up the real-time clock, @@ -340,7 +340,7 @@ static void inline timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) { #ifdef CONFIG_DDB5074 - static unsigned cnt = 0, period = 0, dist = 0; + static unsigned cnt, period, dist; if (cnt == 0 || cnt == dist) ddb5074_led_d2(1); diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index a6f448e05..289dcd041 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c @@ -39,7 +39,7 @@ #endif #include -static unsigned long totalram_pages = 0; +static unsigned long totalram_pages; extern void prom_fixup_mem_map(unsigned long start, unsigned long end); extern void prom_free_prom_memory(void); diff --git a/arch/mips/sgi/kernel/indy_timer.c b/arch/mips/sgi/kernel/indy_timer.c index ba3204c59..46a4d0270 100644 --- a/arch/mips/sgi/kernel/indy_timer.c +++ b/arch/mips/sgi/kernel/indy_timer.c @@ -79,8 +79,8 @@ static int set_rtc_mmss(unsigned long nowtime) return retval; } -static long last_rtc_update = 0; -unsigned long missed_heart_beats = 0; +static long last_rtc_update; +unsigned long missed_heart_beats; void indy_timer_interrupt(struct pt_regs *regs) { diff --git a/arch/mips64/kernel/smp.c b/arch/mips64/kernel/smp.c index c36337564..2e0909694 100644 --- a/arch/mips64/kernel/smp.c +++ b/arch/mips64/kernel/smp.c @@ -54,7 +54,7 @@ static void sendintr(int destid, unsigned char status) /* The 'big kernel lock' */ spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED; -int smp_threads_ready = 0; /* Not used */ +int smp_threads_ready; /* Not used */ atomic_t smp_commenced = ATOMIC_INIT(0); struct cpuinfo_mips cpu_data[NR_CPUS]; int smp_num_cpus; /* Number that came online. */ @@ -130,7 +130,7 @@ static volatile struct call_data_struct { atomic_t started; atomic_t finished; int wait; -} *call_data = NULL; +} *call_data; int smp_call_function (void (*func) (void *info), void *info, int retry, int wait) diff --git a/arch/mips64/mm/init.c b/arch/mips64/mm/init.c index f1d95c702..a594c69a0 100644 --- a/arch/mips64/mm/init.c +++ b/arch/mips64/mm/init.c @@ -38,7 +38,7 @@ #endif #include -unsigned long totalram_pages = 0; +unsigned long totalram_pages; void __bad_pte_kernel(pmd_t *pmd) { diff --git a/arch/mips64/sgi-ip22/ip22-timer.c b/arch/mips64/sgi-ip22/ip22-timer.c index e4bf2b201..18f806825 100644 --- a/arch/mips64/sgi-ip22/ip22-timer.c +++ b/arch/mips64/sgi-ip22/ip22-timer.c @@ -79,8 +79,8 @@ static int set_rtc_mmss(unsigned long nowtime) return retval; } -static long last_rtc_update = 0; -unsigned long missed_heart_beats = 0; +static long last_rtc_update; +unsigned long missed_heart_beats; void indy_timer_interrupt(struct pt_regs *regs) { diff --git a/arch/mips64/sgi-ip27/ip27-memory.c b/arch/mips64/sgi-ip27/ip27-memory.c index 50e03413b..7fd009b09 100644 --- a/arch/mips64/sgi-ip27/ip27-memory.c +++ b/arch/mips64/sgi-ip27/ip27-memory.c @@ -200,11 +200,11 @@ void __init prom_meminit(void) << PAGE_SHIFT)); NODE_DATA(node)->bdata = plat_node_bdata + node; slot_freepfn += node_datasz; - bootmap_size = init_bootmem_node(node, slot_freepfn, + bootmap_size = init_bootmem_node(NODE_DATA(node), slot_freepfn, slot_firstpfn, slot_lastpfn); - free_bootmem_node(node, slot_firstpfn << PAGE_SHIFT, + free_bootmem_node(NODE_DATA(node), slot_firstpfn << PAGE_SHIFT, (slot_lastpfn - slot_firstpfn) << PAGE_SHIFT); - reserve_bootmem_node(node, slot_firstpfn << PAGE_SHIFT, + reserve_bootmem_node(NODE_DATA(node), slot_firstpfn << PAGE_SHIFT, ((slot_freepfn - slot_firstpfn) << PAGE_SHIFT) + bootmap_size); } printk("Total memory probed : 0x%lx pages\n", numpages); @@ -278,7 +278,7 @@ void __init mem_init(void) /* * This will free up the bootmem, ie, slot 0 memory. */ - totalram_pages += free_all_bootmem_node(nid); + totalram_pages += free_all_bootmem_node(NODE_DATA(nid)); /* * We need to manually do the other slots. diff --git a/arch/mips64/sgi-ip27/ip27-rtc.c b/arch/mips64/sgi-ip27/ip27-rtc.c index 61fd5421b..cf953dd66 100644 --- a/arch/mips64/sgi-ip27/ip27-rtc.c +++ b/arch/mips64/sgi-ip27/ip27-rtc.c @@ -60,8 +60,8 @@ static void get_rtc_time(struct rtc_time *rtc_tm); #define RTC_IS_OPEN 0x01 /* means /dev/rtc is in use */ #define RTC_TIMER_ON 0x02 /* missed irq timer active */ -static unsigned char rtc_status = 0; /* bitmapped status byte. */ -static unsigned long rtc_freq = 0; /* Current periodic IRQ rate */ +static unsigned char rtc_status; /* bitmapped status byte. */ +static unsigned long rtc_freq; /* Current periodic IRQ rate */ static struct m48t35_rtc *rtc; /* diff --git a/arch/mips64/sgi-ip27/ip27-timer.c b/arch/mips64/sgi-ip27/ip27-timer.c index b8449b256..73f4a7c94 100644 --- a/arch/mips64/sgi-ip27/ip27-timer.c +++ b/arch/mips64/sgi-ip27/ip27-timer.c @@ -36,7 +36,7 @@ #define CYCLES_PER_JIFFY (CYCLES_PER_SEC/HZ) static unsigned long ct_cur[NR_CPUS]; /* What counter should be at next timer irq */ -static long last_rtc_update = 0; /* Last time the rtc clock got updated */ +static long last_rtc_update; /* Last time the rtc clock got updated */ extern rwlock_t xtime_lock; extern volatile unsigned long wall_jiffies; diff --git a/arch/ppc/config.in b/arch/ppc/config.in index 4322aabc5..ef17e6334 100644 --- a/arch/ppc/config.in +++ b/arch/ppc/config.in @@ -126,6 +126,7 @@ define_bool CONFIG_KERNEL_ELF y tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC source drivers/pci/Config.in +source drivers/zorro/Config.in bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG diff --git a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c index 0a66d6c6b..fb7f38444 100644 --- a/arch/ppc/kernel/smp.c +++ b/arch/ppc/kernel/smp.c @@ -41,8 +41,8 @@ #include #include "open_pic.h" -int smp_threads_ready = 0; -volatile int smp_commenced = 0; +int smp_threads_ready; +volatile int smp_commenced; int smp_num_cpus = 1; struct cpuinfo_PPC cpu_data[NR_CPUS]; struct klock_info_struct klock_info = { KLOCK_CLEAR, 0 }; @@ -54,10 +54,10 @@ unsigned int prof_counter[NR_CPUS]; cycles_t cacheflush_time; /* this has to go in the data section because it is accessed from prom_init */ -int smp_hw_index[NR_CPUS] = {0}; +int smp_hw_index[NR_CPUS]; /* all cpu mappings are 1-1 -- Cort */ -volatile unsigned long cpu_callin_map[NR_CPUS] = {0,}; +volatile unsigned long cpu_callin_map[NR_CPUS]; int start_secondary(void *); extern int cpu_idle(void *unused); @@ -226,7 +226,7 @@ static volatile struct call_data_struct { atomic_t started; atomic_t finished; int wait; -} *call_data = NULL; +} *call_data; /* * this function sends a 'generic call function' IPI to all other CPUs diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c index be7d1f063..cc8d2290a 100644 --- a/arch/ppc/mm/init.c +++ b/arch/ppc/mm/init.c @@ -82,8 +82,8 @@ unsigned long total_lowmem; int mem_init_done; int init_bootmem_done; int boot_mapsize; -unsigned long totalram_pages = 0; -unsigned long totalhigh_pages = 0; +unsigned long totalram_pages; +unsigned long totalhigh_pages; extern pgd_t swapper_pg_dir[]; extern char _start[], _end[]; extern char etext[], _stext[]; @@ -138,10 +138,10 @@ struct mem_pieces phys_mem; char *klimit = _end; struct mem_pieces phys_avail; -PTE *Hash=0, *Hash_end; -unsigned long Hash_size=0, Hash_mask; +PTE *Hash, *Hash_end; +unsigned long Hash_size, Hash_mask; #if !defined(CONFIG_4xx) && !defined(CONFIG_8xx) -unsigned long _SDR1=0; +unsigned long _SDR1; static void hash_init(void); union ubat { /* BAT register values to be loaded */ @@ -195,7 +195,7 @@ static inline unsigned long p_mapped_by_bats(unsigned long pa) * (i.e. page tables) instead of the bats. * -- Cort */ -int __map_without_bats = 0; +int __map_without_bats; /* max amount of RAM to use */ unsigned long __max_memory; diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index a45d02ed8..1a22e429b 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c @@ -36,7 +36,7 @@ #include #include -static unsigned long totalram_pages = 0; +static unsigned long totalram_pages; /* * BAD_PAGE is the page that is used for page faults when linux diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 66f7460f9..2f9e722fe 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -367,7 +367,7 @@ void __init setup_arch(char **cmdline_p) * bootstrap step all allocations (until the page allocator * is intact) must be done via bootmem_alloc(). */ - bootmap_size = init_bootmem_node(0, start_pfn, + bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn, __MEMORY_START>>PAGE_SHIFT, max_low_pfn); diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index 5af1e6de8..552cbb3d3 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c @@ -213,7 +213,7 @@ static int set_rtc_time(unsigned long nowtime) } /* last time the RTC clock got updated */ -static long last_rtc_update = 0; +static long last_rtc_update; /* * timer_interrupt() needs to keep up the real-time clock, diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 8568afb31..5a0ac1f10 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c @@ -40,8 +40,8 @@ */ unsigned long mmu_context_cache; -static unsigned long totalram_pages = 0; -static unsigned long totalhigh_pages = 0; +static unsigned long totalram_pages; +static unsigned long totalhigh_pages; extern unsigned long init_smp_mappings(unsigned long); diff --git a/arch/sparc/kernel/semaphore.c b/arch/sparc/kernel/semaphore.c index 9b45d18bd..4359ec232 100644 --- a/arch/sparc/kernel/semaphore.c +++ b/arch/sparc/kernel/semaphore.c @@ -1,4 +1,4 @@ -/* $Id: semaphore.c,v 1.2 1999/12/28 11:50:37 jj Exp $ +/* $Id: semaphore.c,v 1.3 2000/10/14 10:09:00 davem Exp $ * Generic semaphore code. Buyer beware. Do your own * specific changes in */ diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c index 2c64c9ba1..2a0fe9a27 100644 --- a/arch/sparc/kernel/setup.c +++ b/arch/sparc/kernel/setup.c @@ -1,4 +1,4 @@ -/* $Id: setup.c,v 1.119 2000/08/31 10:24:17 anton Exp $ +/* $Id: setup.c,v 1.120 2000/10/14 10:09:00 davem Exp $ * linux/arch/sparc/kernel/setup.c * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) diff --git a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c index 4c86d7658..0deef8989 100644 --- a/arch/sparc/mm/fault.c +++ b/arch/sparc/mm/fault.c @@ -1,4 +1,4 @@ -/* $Id: fault.c,v 1.116 2000/05/03 06:37:03 davem Exp $ +/* $Id: fault.c,v 1.117 2000/10/16 14:32:50 anton Exp $ * fault.c: Page fault handlers for the Sparc. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -200,11 +200,24 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, siginfo_t info; int from_user = !(regs->psr & PSR_PS); - info.si_code = SEGV_MAPERR; if(text_fault) address = regs->pc; /* + * We fault-in kernel-space virtual memory on-demand. The + * 'reference' page table is init_mm.pgd. + * + * NOTE! We MUST NOT take any locks for this case. We may + * be in an interrupt or a critical region, and should + * only copy the information from the master page table, + * nothing more. + */ + if (!ARCH_SUN4C_SUN4 && address >= TASK_SIZE) + goto vmalloc_fault; + + info.si_code = SEGV_MAPERR; + + /* * If we're in an interrupt or have no user * context, we must not take the fault.. */ @@ -271,6 +284,7 @@ good_area: bad_area: up(&mm->mmap_sem); +bad_area_nosemaphore: /* User mode accesses just cause a SIGSEGV */ if(from_user) { #if 0 @@ -340,6 +354,35 @@ do_sigbus: force_sig_info (SIGBUS, &info, tsk); if (!from_user) goto no_context; + +vmalloc_fault: + { + /* + * Synchronize this task's top level page-table + * with the 'reference' page table. + */ + int offset = pgd_index(address); + pgd_t *pgd, *pgd_k; + pmd_t *pmd, *pmd_k; + + pgd = tsk->active_mm->pgd + offset; + pgd_k = init_mm.pgd + offset; + + if (!pgd_present(*pgd)) { + if (!pgd_present(*pgd_k)) + goto bad_area_nosemaphore; + pgd_set(pgd, *pgd_k); + return; + } + + pmd = pmd_offset(pgd, address); + pmd_k = pmd_offset(pgd_k, address); + + if (pmd_present(*pmd) || !pmd_present(*pmd_k)) + goto bad_area_nosemaphore; + pmd_set(pmd, *pmd_k); + return; + } } asmlinkage void do_sun4c_fault(struct pt_regs *regs, int text_fault, int write, diff --git a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c index 642c986bd..457d4fed0 100644 --- a/arch/sparc/mm/init.c +++ b/arch/sparc/mm/init.c @@ -42,7 +42,7 @@ unsigned long page_kernel; struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS]; unsigned long sparc_unmapped_base; -struct pgtable_cache_struct pgt_quicklists = { 0, 0, 0, 0 }; +struct pgtable_cache_struct pgt_quicklists; /* References to section boundaries */ extern char __init_begin, __init_end, _start, _end, etext , edata; diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index 408d59cbf..a91809d03 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c @@ -1,4 +1,4 @@ -/* $Id: srmmu.c,v 1.222 2000/08/29 08:59:23 davem Exp $ +/* $Id: srmmu.c,v 1.223 2000/10/16 14:32:49 anton Exp $ * srmmu.c: SRMMU specific routines for memory management. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -69,9 +69,6 @@ pgd_t *srmmu_swapper_pg_dir; #define FLUSH_END } #endif -BTFIXUPDEF_CALL(void, pmd_set, pmd_t *, pte_t *) -#define pmd_set(pmdp,ptep) BTFIXUP_CALL(pmd_set)(pmdp,ptep) - BTFIXUPDEF_CALL(void, flush_page_for_dma, unsigned long) #define flush_page_for_dma(page) BTFIXUP_CALL(flush_page_for_dma)(page) @@ -482,19 +479,6 @@ static void srmmu_pmd_free(pmd_t * pmd) srmmu_free_nocache((unsigned long)pmd, SRMMU_PMD_TABLE_SIZE); } -static void srmmu_set_pgdir(unsigned long address, pgd_t entry) -{ - struct task_struct * p; - - read_lock(&tasklist_lock); - for_each_task(p) { - if (!p->mm) - continue; - *srmmu_pgd_offset(p->mm,address) = entry; - } - read_unlock(&tasklist_lock); -} - static inline void alloc_context(struct mm_struct *old_mm, struct mm_struct *mm) { struct ctx_list *ctxp; @@ -2148,8 +2132,6 @@ void __init ld_mmu_srmmu(void) #endif BTFIXUPSET_CALL(do_check_pgt_cache, srmmu_check_pgt_cache, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(set_pgdir, srmmu_set_pgdir, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(set_pte, srmmu_set_pte, BTFIXUPCALL_SWAPO0O1); BTFIXUPSET_CALL(switch_mm, srmmu_switch_mm, BTFIXUPCALL_NORM); @@ -2175,6 +2157,7 @@ void __init ld_mmu_srmmu(void) BTFIXUPSET_CALL(mk_pte_phys, srmmu_mk_pte_phys, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(mk_pte_io, srmmu_mk_pte_io, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(pgd_set, srmmu_pgd_set, BTFIXUPCALL_NORM); + BTFIXUPSET_CALL(pmd_set, srmmu_pmd_set, BTFIXUPCALL_NORM); BTFIXUPSET_INT(pte_modify_mask, SRMMU_CHG_MASK); BTFIXUPSET_CALL(pmd_offset, srmmu_pmd_offset, BTFIXUPCALL_NORM); @@ -2209,9 +2192,6 @@ void __init ld_mmu_srmmu(void) BTFIXUPSET_CALL(free_task_struct, srmmu_free_task_struct, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(get_task_struct, srmmu_get_task_struct, BTFIXUPCALL_NORM); - /* SRMMU specific. */ - BTFIXUPSET_CALL(pmd_set, srmmu_pmd_set, BTFIXUPCALL_NORM); - get_srmmu_type(); patch_window_trap_handlers(); diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c index a99ce736e..a416ecf19 100644 --- a/arch/sparc/mm/sun4c.c +++ b/arch/sparc/mm/sun4c.c @@ -1,4 +1,4 @@ -/* $Id: sun4c.c,v 1.199 2000/08/29 08:59:23 davem Exp $ +/* $Id: sun4c.c,v 1.200 2000/10/16 14:32:49 anton Exp $ * sun4c.c: Doing in software what should be done in hardware. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -1904,6 +1904,10 @@ static void sun4c_pgd_set(pgd_t * pgdp, pmd_t * pmdp) { } +static void sun4c_pmd_set(pmd_t * pmdp, pte_t * ptep) +{ +} + void sun4c_mapioaddr(unsigned long physaddr, unsigned long virt_addr, int bus_type, int rdonly) { @@ -2267,11 +2271,6 @@ extern __inline__ pgd_t *sun4c_get_pgd_fast(void) return (pgd_t *)ret; } -static void sun4c_set_pgdir(unsigned long address, pgd_t entry) -{ - /* Nothing to do */ -} - extern __inline__ void sun4c_free_pgd_fast(pgd_t *pgd) { *(unsigned long *)pgd = (unsigned long) pgd_quicklist; @@ -2616,8 +2615,6 @@ void __init ld_mmu_sun4c(void) #endif BTFIXUPSET_CALL(do_check_pgt_cache, sun4c_check_pgt_cache, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(set_pgdir, sun4c_set_pgdir, BTFIXUPCALL_NOP); - BTFIXUPSET_CALL(flush_cache_all, sun4c_flush_cache_all, BTFIXUPCALL_NORM); if (sun4c_vacinfo.do_hwflushes) { @@ -2719,4 +2716,5 @@ void __init ld_mmu_sun4c(void) /* These should _never_ get called with two level tables. */ BTFIXUPSET_CALL(pgd_set, sun4c_pgd_set, BTFIXUPCALL_NOP); BTFIXUPSET_CALL(pgd_page, sun4c_pgd_page, BTFIXUPCALL_RETO0); + BTFIXUPSET_CALL(pmd_set, sun4c_pmd_set, BTFIXUPCALL_NOP); } diff --git a/arch/sparc64/kernel/semaphore.c b/arch/sparc64/kernel/semaphore.c index 5eac19392..8cb6e7211 100644 --- a/arch/sparc64/kernel/semaphore.c +++ b/arch/sparc64/kernel/semaphore.c @@ -1,4 +1,4 @@ -/* $Id: semaphore.c,v 1.3 2000/03/27 10:38:46 davem Exp $ +/* $Id: semaphore.c,v 1.4 2000/10/14 10:09:00 davem Exp $ * Generic semaphore code. Buyer beware. Do your own * specific changes in */ diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c index 6f0d34c4a..fa46489c1 100644 --- a/arch/sparc64/kernel/setup.c +++ b/arch/sparc64/kernel/setup.c @@ -1,4 +1,4 @@ -/* $Id: setup.c,v 1.56 2000/09/21 06:29:01 anton Exp $ +/* $Id: setup.c,v 1.57 2000/10/14 10:09:00 davem Exp $ * linux/arch/sparc64/kernel/setup.c * * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu) diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index d694e40f9..eafbe27ca 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c @@ -873,7 +873,7 @@ unsigned long __init bootmem_init(unsigned long *pages_avail) } #endif /* Initialize the boot-time allocator. */ - bootmap_size = init_bootmem_node(0, bootmap_pfn, phys_base>>PAGE_SHIFT, end_pfn); + bootmap_size = init_bootmem_node(NODE_DATA(0), bootmap_pfn, phys_base>>PAGE_SHIFT, end_pfn); /* Now register the available physical memory with the * allocator. diff --git a/arch/sparc64/solaris/socksys.c b/arch/sparc64/solaris/socksys.c index c40225584..2ad56ad9d 100644 --- a/arch/sparc64/solaris/socksys.c +++ b/arch/sparc64/solaris/socksys.c @@ -161,7 +161,7 @@ static struct file_operations socksys_fops = { release: socksys_release, }; -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; int __init init_socksys(void) diff --git a/drivers/acorn/char/defkeymap-acorn.c b/drivers/acorn/char/defkeymap-acorn.c index 44bca7093..1d2d8a640 100644 --- a/drivers/acorn/char/defkeymap-acorn.c +++ b/drivers/acorn/char/defkeymap-acorn.c @@ -285,7 +285,7 @@ char func_buf[] = { char *funcbufptr = func_buf; int funcbufsize = sizeof(func_buf); -int funcbufleft = 0; /* space left */ +int funcbufleft; /* space left */ char *func_table[MAX_NR_FUNC] = { func_buf + 0, diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c index a8bda5927..5d4fdd543 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c @@ -2920,7 +2920,7 @@ fore200e_proc_read(struct atm_dev *dev,loff_t* pos,char* page) #ifdef MODULE -static unsigned int __init +static int __init fore200e_module_init(void) { DPRINTK(1, "module loaded\n"); diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index 3550acd41..e4d709cb0 100644 --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c @@ -259,7 +259,7 @@ static unsigned char ns_phy_get(struct atm_dev *dev, unsigned long addr); /* Global variables ***********************************************************/ static struct ns_dev *cards[NS_MAX_CARDS]; -static unsigned num_cards = 0; +static unsigned num_cards; static struct atmdev_ops atm_ops = { open: ns_open, diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 318e14f86..dba6b5adf 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c @@ -51,7 +51,7 @@ */ static int - DAC960_ControllerCount = 0; + DAC960_ControllerCount; /* @@ -60,7 +60,7 @@ static int */ static int - DAC960_ActiveControllerCount = 0; + DAC960_ActiveControllerCount; /* @@ -69,7 +69,7 @@ static int */ static DAC960_Controller_T - *DAC960_Controllers[DAC960_MaxControllers] = { NULL }; + *DAC960_Controllers[DAC960_MaxControllers]; /* @@ -5679,7 +5679,7 @@ static void DAC960_Message(DAC960_MessageLevel_T MessageLevel, } if (MessageLevel == DAC960_AnnounceLevel) { - static int AnnouncementLines = 0; + static int AnnouncementLines; if (++AnnouncementLines <= 2) printk("%sDAC960: %s", DAC960_MessageLevelMap[MessageLevel], Buffer); diff --git a/drivers/block/acsi_slm.c b/drivers/block/acsi_slm.c index b8f1c693e..35bab96fe 100644 --- a/drivers/block/acsi_slm.c +++ b/drivers/block/acsi_slm.c @@ -942,7 +942,7 @@ static int slm_get_pagesize( int device, int *w, int *h ) int attach_slm( int target, int lun ) -{ static int did_register = 0; +{ static int did_register; int len; if (N_SLM_Printers >= MAX_SLM) { @@ -992,7 +992,7 @@ int attach_slm( int target, int lun ) return( 1 ); } -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; int slm_init( void ) diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index f88762bb1..75f59e77a 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -71,10 +71,10 @@ static struct board_type products[] = { #define READ_AHEAD 128 #define NR_CMDS 128 /* #commands that can be outstanding */ #define MAX_CTLR 8 -static int nr_ctlr =0; -static ctlr_info_t *hba[MAX_CTLR] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +static int nr_ctlr; +static ctlr_info_t *hba[MAX_CTLR]; -static struct proc_dir_entry *proc_cciss = NULL; +static struct proc_dir_entry *proc_cciss; static void do_cciss_request(int i); /* diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c index f26611bc3..0bfa895b7 100644 --- a/drivers/block/cpqarray.c +++ b/drivers/block/cpqarray.c @@ -68,10 +68,10 @@ MODULE_DESCRIPTION("Driver for Compaq Smart2 Array Controllers"); #define MAX_CTLR 8 #define CTLR_SHIFT 8 -static int nr_ctlr = 0; -static ctlr_info_t *hba[MAX_CTLR] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +static int nr_ctlr; +static ctlr_info_t *hba[MAX_CTLR]; -static int eisa[8] = { 0, 0 ,0 ,0, 0, 0 ,0 ,0 }; +static int eisa[8]; #define NR_PRODUCTS (sizeof(products)/sizeof(struct board_type)) @@ -103,7 +103,7 @@ static int * ida_blocksizes; static int * ida_hardsizes; static struct gendisk ida_gendisk[MAX_CTLR]; -static struct proc_dir_entry *proc_array = NULL; +static struct proc_dir_entry *proc_array; /* Debug... */ #define DBG(s) do { s } while(0) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index da1d6629d..329d10c9c 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -80,7 +80,7 @@ static int max_loop = 8; static struct loop_device *loop_dev; static int *loop_sizes; static int *loop_blksizes; -static devfs_handle_t devfs_handle = NULL; /* For the directory */ +static devfs_handle_t devfs_handle; /* For the directory */ #define FALSE 0 #define TRUE (!FALSE) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 436969bb4..955014bf1 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -55,7 +55,7 @@ static int nbd_sizes[MAX_NBD]; static u64 nbd_bytesizes[MAX_NBD]; static struct nbd_device nbd_dev[MAX_NBD]; -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; #define DEBUG( s ) /* #define DEBUG( s ) printk( s ) diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c index e2709ce97..65ab11859 100644 --- a/drivers/block/paride/pg.c +++ b/drivers/block/paride/pg.c @@ -289,7 +289,7 @@ void pg_init_units( void ) } } -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; int pg_init (void) /* preliminary initialisation */ diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c index 5cb91ae0a..51f67b903 100644 --- a/drivers/block/paride/pt.c +++ b/drivers/block/paride/pt.c @@ -293,7 +293,7 @@ void pt_init_units( void ) } } -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; int pt_init (void) /* preliminary initialisation */ diff --git a/drivers/block/rd.c b/drivers/block/rd.c index 2db08531a..6f583c3de 100644 --- a/drivers/block/rd.c +++ b/drivers/block/rd.c @@ -99,7 +99,7 @@ static unsigned long rd_length[NUM_RAMDISKS]; /* Size of RAM disks in bytes */ static int rd_hardsec[NUM_RAMDISKS]; /* Size of real blocks in bytes */ static int rd_blocksizes[NUM_RAMDISKS]; /* Size of 1024 byte blocks :) */ static int rd_kbsize[NUM_RAMDISKS]; /* Size in blocks of 1024 bytes */ -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; static struct inode *rd_inode[NUM_RAMDISKS]; /* Protected device inodes */ /* @@ -778,11 +778,11 @@ typedef unsigned long ulg; static uch *inbuf; static uch *window; -static unsigned insize = 0; /* valid bytes in inbuf */ -static unsigned inptr = 0; /* index of next byte to be processed in inbuf */ -static unsigned outcnt = 0; /* bytes in output buffer */ -static int exit_code = 0; -static long bytes_out = 0; +static unsigned insize; /* valid bytes in inbuf */ +static unsigned inptr; /* index of next byte to be processed in inbuf */ +static unsigned outcnt; /* bytes in output buffer */ +static int exit_code; +static long bytes_out; static struct file *crd_infp, *crd_outfp; #define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf()) diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 912402678..23fe03584 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -267,15 +267,15 @@ #include /* used to tell the module to turn on full debugging messages */ -static int debug = 0; +static int debug; /* used to keep tray locked at all times */ -static int keeplocked = 0; +static int keeplocked; /* default compatibility mode */ static int autoclose=1; -static int autoeject=0; +static int autoeject; static int lockdoor = 1; /* will we ever get to use this... sigh. */ -static int check_media_type = 0; +static int check_media_type; MODULE_PARM(debug, "i"); MODULE_PARM(autoclose, "i"); MODULE_PARM(autoeject, "i"); @@ -326,8 +326,8 @@ int cdrom_get_next_writable(kdev_t dev, long *next_writable); #ifdef CONFIG_SYSCTL static void cdrom_sysctl_register(void); #endif /* CONFIG_SYSCTL */ -static struct cdrom_device_info *topCdromPtr = NULL; -static devfs_handle_t devfs_handle = NULL; +static struct cdrom_device_info *topCdromPtr; +static devfs_handle_t devfs_handle; struct block_device_operations cdrom_fops = { @@ -346,12 +346,12 @@ struct block_device_operations cdrom_fops = int register_cdrom(struct cdrom_device_info *cdi) { - static char banner_printed = 0; + static char banner_printed; int major = MAJOR(cdi->dev); struct cdrom_device_ops *cdo = cdi->ops; int *change_capability = (int *)&cdo->capability; /* hack */ char vname[16]; - static unsigned int cdrom_counter = 0; + static unsigned int cdrom_counter; cdinfo(CD_OPEN, "entering register_cdrom\n"); @@ -2566,7 +2566,7 @@ static struct ctl_table_header *cdrom_sysctl_header; static void cdrom_sysctl_register(void) { - static int initialized = 0; + static int initialized; if (initialized == 1) return; diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c index 07e97a1d7..4cec5680d 100644 --- a/drivers/cdrom/sbpcd.c +++ b/drivers/cdrom/sbpcd.c @@ -561,9 +561,9 @@ static int sbpcd_debug = 0 & ((1< #include -static int acq_is_open=0; +static int acq_is_open; static spinlock_t acq_lock; /* diff --git a/drivers/char/console.c b/drivers/char/console.c index 8c9a8ba4a..ea44cace4 100644 --- a/drivers/char/console.c +++ b/drivers/char/console.c @@ -108,7 +108,7 @@ #include "console_macros.h" -struct consw *conswitchp = NULL; +const struct consw *conswitchp; /* A bitmap for codes <32. A bit of 1 indicates that the code * corresponding to that bit number invokes some special action @@ -136,7 +136,7 @@ static struct termios *console_termios_locked[MAX_NR_CONSOLES]; struct vc vc_cons [MAX_NR_CONSOLES]; #ifndef VT_SINGLE_DRIVER -static struct consw *con_driver_map[MAX_NR_CONSOLES]; +static const struct consw *con_driver_map[MAX_NR_CONSOLES]; #endif static int con_open(struct tty_struct *, struct file *); @@ -152,14 +152,14 @@ static void set_cursor(int currcons); static void hide_cursor(int currcons); static void unblank_screen_t(unsigned long dummy); -static int printable = 0; /* Is console ready for printing? */ +static int printable; /* Is console ready for printing? */ -int do_poke_blanked_console = 0; -int console_blanked = 0; +int do_poke_blanked_console; +int console_blanked; -static int vesa_blank_mode = 0; /* 0:none 1:suspendV 2:suspendH 3:powerdown */ +static int vesa_blank_mode; /* 0:none 1:suspendV 2:suspendH 3:powerdown */ static int blankinterval = 10*60*HZ; -static int vesa_off_interval = 0; +static int vesa_off_interval; /* * fg_console is the current virtual console, @@ -167,10 +167,10 @@ static int vesa_off_interval = 0; * want_console is the console we want to switch to, * kmsg_redirect is the console for kernel messages, */ -int fg_console = 0; -int last_console = 0; +int fg_console; +int last_console; int want_console = -1; -int kmsg_redirect = 0; +int kmsg_redirect; /* * For each existing display, we have a pointer to console currently visible @@ -178,7 +178,7 @@ int kmsg_redirect = 0; * appropriately. Unless the low-level driver supplies its own display_fg * variable, we use this one for the "master display". */ -static struct vc_data *master_display_fg = NULL; +static struct vc_data *master_display_fg; /* * Unfortunately, we need to delay tty echo when we're currently writing to the @@ -192,13 +192,13 @@ DECLARE_TASK_QUEUE(con_task_queue); /* * For the same reason, we defer scrollback to the console tasklet. */ -static int scrollback_delta = 0; +static int scrollback_delta; /* * Hook so that the power management routines can (un)blank * the console on our behalf. */ -int (*console_blank_hook)(int) = NULL; +int (*console_blank_hook)(int); static struct timer_list console_timer; @@ -216,7 +216,7 @@ static struct timer_list console_timer; #endif static int pm_con_request(struct pm_dev *dev, pm_request_t rqst, void *data); -static struct pm_dev *pm_con = NULL; +static struct pm_dev *pm_con; static inline unsigned short *screenpos(int currcons, int offset, int viewed) { @@ -415,9 +415,9 @@ void invert_screen(int currcons, int offset, int count, int viewed) /* used by selection: complement pointer position */ void complement_pos(int currcons, int offset) { - static unsigned short *p = NULL; - static unsigned short old = 0; - static unsigned short oldx = 0, oldy = 0; + static unsigned short *p; + static unsigned short old; + static unsigned short oldx, oldy; if (p) { scr_writew(old, p); @@ -2056,7 +2056,7 @@ void vt_console_print(struct console *co, const char * b, unsigned count) { int currcons = fg_console; unsigned char c; - static unsigned long printing = 0; + static unsigned long printing; const ushort *start; ushort cnt = 0; ushort myx; @@ -2480,7 +2480,7 @@ static void clear_buffer_attributes(int currcons) * and become default driver for newly opened ones. */ -void take_over_console(struct consw *csw, int first, int last, int deflt) +void take_over_console(const struct consw *csw, int first, int last, int deflt) { int i, j = -1; const char *desc; @@ -2528,7 +2528,7 @@ void take_over_console(struct consw *csw, int first, int last, int deflt) printk("to %s\n", desc); } -void give_up_console(struct consw *csw) +void give_up_console(const struct consw *csw) { int i; diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index d0e801180..e5bdb6ccf 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c @@ -770,7 +770,7 @@ static struct cyclades_card cy_card[NR_CARDS]; */ static struct cyclades_port cy_port[NR_PORTS]; -static int cy_next_channel = 0; /* next minor available */ +static int cy_next_channel; /* next minor available */ static struct tty_struct *serial_table[NR_PORTS]; static struct termios *serial_termios[NR_PORTS]; @@ -862,9 +862,9 @@ static int cy_chip_offset [] = /* PCI related definitions */ -static unsigned short cy_pci_nboard = 0; -static unsigned short cy_isa_nboard = 0; -static unsigned short cy_nboard = 0; +static unsigned short cy_pci_nboard; +static unsigned short cy_isa_nboard; +static unsigned short cy_nboard; #ifdef CONFIG_PCI static unsigned short cy_pci_dev_id[] = { PCI_DEVICE_ID_CYCLOM_Y_Lo, /* PCI < 1Mb */ diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c index 0ada290ac..535566b63 100644 --- a/drivers/char/dsp56k.c +++ b/drivers/char/dsp56k.c @@ -509,7 +509,7 @@ static struct file_operations dsp56k_fops = { /****** Init and module functions ******/ -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; int __init dsp56k_init(void) { diff --git a/drivers/char/epca.c b/drivers/char/epca.c index 1e122acba..8991f65bb 100644 --- a/drivers/char/epca.c +++ b/drivers/char/epca.c @@ -78,11 +78,11 @@ /* ----------------- Begin global definitions ------------------- */ static char mesg[100]; -static int pc_refcount, nbdevs = 0, num_cards = 0, liloconfig = 0; +static int pc_refcount, nbdevs, num_cards, liloconfig; static int digi_poller_inhibited = 1 ; -static int setup_error_code = 0; -static int invalid_lilo_config = 0; +static int setup_error_code; +static int invalid_lilo_config; /* ----------------------------------------------------------------------- MAXBOARDS is typically 12, but ISA and EISA cards are restricted to diff --git a/drivers/char/esp.c b/drivers/char/esp.c index e3cea9e5d..478b05aa5 100644 --- a/drivers/char/esp.c +++ b/drivers/char/esp.c @@ -70,9 +70,8 @@ #define NR_PRIMARY 8 /* maximum number of primary ports */ /* The following variables can be set by giving module options */ -static int irq[NR_PRIMARY] = {0,0,0,0,0,0,0,0}; /* IRQ for each base port */ -static unsigned int divisor[NR_PRIMARY] = {0,0,0,0,0,0,0,0}; - /* custom divisor for each port */ +static int irq[NR_PRIMARY]; /* IRQ for each base port */ +static unsigned int divisor[NR_PRIMARY]; /* custom divisor for each port */ static unsigned int dma = ESP_DMA_CHANNEL; /* DMA channel */ static unsigned int rx_trigger = ESP_RX_TRIGGER; static unsigned int tx_trigger = ESP_TX_TRIGGER; @@ -168,7 +167,7 @@ static struct termios *serial_termios_locked[NR_PORTS]; * buffer across all the serial ports, since it significantly saves * memory if large numbers of serial ports are open. */ -static unsigned char *tmp_buf = 0; +static unsigned char *tmp_buf; static DECLARE_MUTEX(tmp_buf_sem); static inline int serial_paranoia_check(struct esp_struct *info, diff --git a/drivers/char/ftape/lowlevel/fdc-io.c b/drivers/char/ftape/lowlevel/fdc-io.c index 12d1e1a6e..ea67cd9f4 100644 --- a/drivers/char/ftape/lowlevel/fdc-io.c +++ b/drivers/char/ftape/lowlevel/fdc-io.c @@ -50,10 +50,10 @@ /* Global vars. */ -int ftape_motor = 0; +int ftape_motor; volatile int ftape_current_cylinder = -1; volatile fdc_mode_enum fdc_mode = fdc_idle; -fdc_config_info fdc = {0}; +fdc_config_info fdc; DECLARE_WAIT_QUEUE_HEAD(ftape_wait_intr); unsigned int ft_fdc_base = CONFIG_FT_FDC_BASE; @@ -73,15 +73,15 @@ volatile __u8 fdc_head; /* FDC head from sector id */ volatile __u8 fdc_cyl; /* FDC track from sector id */ volatile __u8 fdc_sect; /* FDC sector from sector id */ static int fdc_data_rate = 500; /* data rate (Kbps) */ -static int fdc_rate_code = 0; /* data rate code (0 == 500 Kbps) */ +static int fdc_rate_code; /* data rate code (0 == 500 Kbps) */ static int fdc_seek_rate = 2; /* step rate (msec) */ static void (*do_ftape) (void); static int fdc_fifo_state; /* original fifo setting - fifo enabled */ static int fdc_fifo_thr; /* original fifo setting - threshold */ static int fdc_lock_state; /* original lock setting - locked */ -static int fdc_fifo_locked = 0; /* has fifo && lock set ? */ -static __u8 fdc_precomp = 0; /* default precomp. value (nsec) */ -static __u8 fdc_prec_code = 0; /* fdc precomp. select code */ +static int fdc_fifo_locked; /* has fifo && lock set ? */ +static __u8 fdc_precomp; /* default precomp. value (nsec) */ +static __u8 fdc_prec_code; /* fdc precomp. select code */ static char ftape_id[] = "ftape"; /* used by request irq and free irq */ @@ -188,7 +188,7 @@ int fdc_command(const __u8 * cmd_data, int cmd_len) int count = cmd_len; int retry = 0; #ifdef TESTING - static unsigned int last_time = 0; + static unsigned int last_time; unsigned int time; #endif TRACE_FUN(ft_t_any); @@ -387,7 +387,7 @@ int fdc_interrupt_wait(unsigned int time) { DECLARE_WAITQUEUE(wait,current); sigset_t old_sigmask; - static int resetting = 0; + static int resetting; long timeout; TRACE_FUN(ft_t_fdc_dma); @@ -868,7 +868,7 @@ int fdc_recalibrate(void) TRACE_EXIT 0; } -static int perpend_mode = 0; /* set if fdc is in perpendicular mode */ +static int perpend_mode; /* set if fdc is in perpendicular mode */ static int perpend_off(void) { @@ -1113,7 +1113,7 @@ static int fdc_fifo_enable(void) /* Determine fd controller type */ -static __u8 fdc_save_state[2] = {0, 0}; +static __u8 fdc_save_state[2]; int fdc_probe(void) { @@ -1283,7 +1283,7 @@ static int fdc_config_regs(unsigned int fdc_base, static int fdc_config(void) { - static int already_done = 0; + static int already_done; TRACE_FUN(ft_t_any); if (already_done) { diff --git a/drivers/char/ftape/lowlevel/fdc-isr.c b/drivers/char/ftape/lowlevel/fdc-isr.c index 4c3975add..3fdae227e 100644 --- a/drivers/char/ftape/lowlevel/fdc-isr.c +++ b/drivers/char/ftape/lowlevel/fdc-isr.c @@ -44,10 +44,10 @@ /* Global vars. */ -volatile int ft_expected_stray_interrupts = 0; -volatile int ft_interrupt_seen = 0; -volatile int ft_seek_completed = 0; -volatile int ft_hide_interrupt = 0; +volatile int ft_expected_stray_interrupts; +volatile int ft_interrupt_seen; +volatile int ft_seek_completed; +volatile int ft_hide_interrupt; /* Local vars. */ typedef enum { @@ -55,7 +55,7 @@ typedef enum { data_am_error = 0x04, data_crc_error = 0x08, no_data_error = 0x10, overrun_error = 0x20, } error_cause; -static int stop_read_ahead = 0; +static int stop_read_ahead; static void print_error_cause(int cause) @@ -730,7 +730,7 @@ static void continue_formatting(buffer_struct *buff) */ static void handle_fdc_busy(buffer_struct *buff) { - static int no_data_error_count = 0; + static int no_data_error_count; int retry = 0; error_cause cause; __u8 in[7]; @@ -1077,7 +1077,7 @@ static void handle_fdc_busy(buffer_struct *buff) */ void fdc_isr(void) { - static int isr_active = 0; + static int isr_active; #ifdef TESTING unsigned int t0 = ftape_timestamp(); #endif diff --git a/drivers/char/ftape/lowlevel/ftape-bsm.c b/drivers/char/ftape/lowlevel/ftape-bsm.c index 2fcc85e50..ad157a1c7 100644 --- a/drivers/char/ftape/lowlevel/ftape-bsm.c +++ b/drivers/char/ftape/lowlevel/ftape-bsm.c @@ -39,8 +39,8 @@ /* Local vars. */ -static __u8 *bad_sector_map = NULL; -static SectorCount *bsm_hash_ptr = NULL; +static __u8 *bad_sector_map; +static SectorCount *bsm_hash_ptr; typedef enum { forward, backward @@ -454,7 +454,7 @@ SectorMap ftape_get_bad_sector_entry(int segment_id) * For true random access it may have to be redesigned. */ static int last_reference = -1; - static SectorMap map = 0; + static SectorMap map; if (segment_id > last_reference) { /* Skip all sectors before segment_id diff --git a/drivers/char/ftape/lowlevel/ftape-format.c b/drivers/char/ftape/lowlevel/ftape-format.c index 015911918..41f43dffb 100644 --- a/drivers/char/ftape/lowlevel/ftape-format.c +++ b/drivers/char/ftape/lowlevel/ftape-format.c @@ -47,7 +47,7 @@ /* * first segment of the new buffer */ -static int switch_segment = 0; +static int switch_segment; /* * at most 256 segments fit into one 32 kb buffer. Even TR-1 cartridges have diff --git a/drivers/char/ftape/lowlevel/ftape-io.c b/drivers/char/ftape/lowlevel/ftape-io.c index 464b792d3..c13b8e3c8 100644 --- a/drivers/char/ftape/lowlevel/ftape-io.c +++ b/drivers/char/ftape/lowlevel/ftape-io.c @@ -50,14 +50,14 @@ */ /* NOTE: sectors start numbering at 1, all others at 0 ! */ ft_timeout_table ftape_timeout; -unsigned int ftape_tape_len = 0; +unsigned int ftape_tape_len; volatile qic117_cmd_t ftape_current_command; const struct qic117_command_table qic117_cmds[] = QIC117_COMMANDS; int ftape_might_be_off_track; /* Local vars. */ -static int diagnostic_mode = 0; +static int diagnostic_mode; static unsigned int ftape_udelay_count; static unsigned int ftape_udelay_time; @@ -232,7 +232,7 @@ static int ft_check_cmd_restrictions(qic117_cmd_t command) int ftape_command(qic117_cmd_t command) { int result = 0; - static int level = 0; + static int level; TRACE_FUN(ft_t_any); if ((unsigned int)command > NR_ITEMS(qic117_cmds)) { @@ -778,7 +778,7 @@ int ftape_set_data_rate(unsigned int new_rate /* Kbps */, unsigned int qic_std) int status; int result = 0; unsigned int data_rate = new_rate; - static int supported = 0; + static int supported; int rate_changed = 0; qic_model dummy_model; unsigned int dummy_qic_std, dummy_tape_len; diff --git a/drivers/char/ftape/lowlevel/ftape-rw.c b/drivers/char/ftape/lowlevel/ftape-rw.c index 2c14f468e..e6ac3b625 100644 --- a/drivers/char/ftape/lowlevel/ftape-rw.c +++ b/drivers/char/ftape/lowlevel/ftape-rw.c @@ -43,18 +43,18 @@ /* Global vars. */ -int ft_nr_buffers = 0; -buffer_struct *ft_buffer[FT_MAX_NR_BUFFERS] = {NULL, }; +int ft_nr_buffers; +buffer_struct *ft_buffer[FT_MAX_NR_BUFFERS]; static volatile int ft_head; static volatile int ft_tail; /* not volatile but need same type as head */ int fdc_setup_error; location_record ft_location = {-1, 0}; -volatile int ftape_tape_running = 0; +volatile int ftape_tape_running; /* Local vars. */ -static int overrun_count_offset = 0; -static int inhibit_correction = 0; +static int overrun_count_offset; +static int inhibit_correction; /* maxmimal allowed overshoot when fast seeking */ diff --git a/drivers/char/ftape/lowlevel/ftape-tracing.c b/drivers/char/ftape/lowlevel/ftape-tracing.c index 95e3df8e8..7fdc65674 100644 --- a/drivers/char/ftape/lowlevel/ftape-tracing.c +++ b/drivers/char/ftape/lowlevel/ftape-tracing.c @@ -43,11 +43,11 @@ * 8 + everything else */ ft_trace_t ftape_tracing = ft_t_info; /* Default level: information and up */ -int ftape_function_nest_level = 0; +int ftape_function_nest_level; /* Local vars. */ -static __u8 trace_id = 0; +static __u8 trace_id; static char spacing[] = "* "; void ftape_trace_call(const char *file, const char *name) diff --git a/drivers/char/ftape/lowlevel/ftape-write.c b/drivers/char/ftape/lowlevel/ftape-write.c index a0f095b9a..c4cb18779 100644 --- a/drivers/char/ftape/lowlevel/ftape-write.c +++ b/drivers/char/ftape/lowlevel/ftape-write.c @@ -47,7 +47,7 @@ /* Local vars. */ -static int last_write_failed = 0; +static int last_write_failed; void ftape_zap_write_buffers(void) { diff --git a/drivers/char/ftape/zftape/zftape-buffers.c b/drivers/char/ftape/zftape/zftape-buffers.c index bafc7e1a9..f3dace343 100644 --- a/drivers/char/ftape/zftape/zftape-buffers.c +++ b/drivers/char/ftape/zftape/zftape-buffers.c @@ -48,8 +48,8 @@ /* local varibales */ -static unsigned int used_memory = 0; -static unsigned int peak_memory = 0; +static unsigned int used_memory; +static unsigned int peak_memory; void zft_memory_stats(void) { diff --git a/drivers/char/ftape/zftape/zftape-ctl.c b/drivers/char/ftape/zftape/zftape-ctl.c index da2010ceb..6441ca929 100644 --- a/drivers/char/ftape/zftape/zftape-ctl.c +++ b/drivers/char/ftape/zftape/zftape-ctl.c @@ -49,16 +49,16 @@ /* Global vars. */ -int zft_write_protected = 0; /* this is when cartridge rdonly or O_RDONLY */ -int zft_header_read = 0; -int zft_offline = 0; -unsigned int zft_unit = 0; -int zft_resid = 0; -int zft_mt_compression = 0; +int zft_write_protected; /* this is when cartridge rdonly or O_RDONLY */ +int zft_header_read; +int zft_offline; +unsigned int zft_unit; +int zft_resid; +int zft_mt_compression; /* Local vars. */ -static int going_offline = 0; +static int going_offline; typedef int (mt_fun)(int *argptr); typedef int (*mt_funp)(int *argptr); diff --git a/drivers/char/ftape/zftape/zftape-read.c b/drivers/char/ftape/zftape/zftape-read.c index 91ed51423..756ee3239 100644 --- a/drivers/char/ftape/zftape/zftape-read.c +++ b/drivers/char/ftape/zftape/zftape-read.c @@ -45,11 +45,11 @@ /* Global vars. */ -int zft_just_before_eof = 0; +int zft_just_before_eof; /* Local vars. */ -static int buf_len_rd = 0; +static int buf_len_rd; void zft_zap_read_buffers(void) { @@ -194,7 +194,7 @@ static int check_read_access(int *req_len, int *req_clipped, const zft_position *pos) { - static __s64 remaining = 0; + static __s64 remaining; static int eod; TRACE_FUN(ft_t_flow); diff --git a/drivers/char/ftape/zftape/zftape-rw.c b/drivers/char/ftape/zftape/zftape-rw.c index 784068096..9e599530c 100644 --- a/drivers/char/ftape/zftape/zftape-rw.c +++ b/drivers/char/ftape/zftape/zftape-rw.c @@ -41,14 +41,14 @@ /* Global vars. */ -__u8 *zft_deblock_buf = NULL; -__u8 *zft_hseg_buf = NULL; +__u8 *zft_deblock_buf; +__u8 *zft_hseg_buf; int zft_deblock_segment = -1; zft_status_enum zft_io_state = zft_idle; -int zft_header_changed = 0; -int zft_bad_sector_map_changed = 0; -int zft_qic113 = 0; /* conform to old specs. and old zftape */ -int zft_use_compression = 0; +int zft_header_changed; +int zft_bad_sector_map_changed; +int zft_qic113; /* conform to old specs. and old zftape */ +int zft_use_compression; zft_position zft_pos = { -1, /* seg_pos */ 0, /* seg_byte_pos */ @@ -56,10 +56,10 @@ zft_position zft_pos = { 0 /* volume_pos */ }; unsigned int zft_blk_sz = CONFIG_ZFT_DFLT_BLK_SZ; -__s64 zft_capacity = 0; +__s64 zft_capacity; -unsigned int zft_written_segments = 0; -int zft_label_changed = 0; +unsigned int zft_written_segments; +int zft_label_changed; /* Local vars. */ @@ -165,8 +165,8 @@ int zft_calc_seg_byte_coord(int *seg_byte_pos, __s64 tape_pos) * Also, it might be in the future that the bad sector map gets * changed. -> reset the cache */ -static int seg_pos = 0; -static __s64 tape_pos = 0; +static int seg_pos; +static __s64 tape_pos; __s64 zft_get_capacity(void) { diff --git a/drivers/char/ftape/zftape/zftape-vtbl.c b/drivers/char/ftape/zftape/zftape-vtbl.c index cf0ef2325..e4804ea2e 100644 --- a/drivers/char/ftape/zftape/zftape-vtbl.c +++ b/drivers/char/ftape/zftape/zftape-vtbl.c @@ -48,8 +48,8 @@ * global variables */ int zft_qic_mode = 1; /* use the vtbl */ -int zft_old_ftape = 0; /* prevents old ftaped tapes to be overwritten */ -int zft_volume_table_changed = 0; /* for write_header_segments() */ +int zft_old_ftape; /* prevents old ftaped tapes to be overwritten */ +int zft_volume_table_changed; /* for write_header_segments() */ /* * private variables (only exported for inline functions) @@ -59,9 +59,9 @@ LIST_HEAD(zft_vtbl); /* We could also allocate these dynamically when extracting the volume table * sizeof(zft_volinfo) is about 32 or something close to that */ -static zft_volinfo tape_vtbl = { {NULL, NULL}, 0, }; -static zft_volinfo eot_vtbl = { {NULL, NULL}, 0, }; -static zft_volinfo *cur_vtbl = NULL; +static zft_volinfo tape_vtbl; +static zft_volinfo eot_vtbl; +static zft_volinfo *cur_vtbl; inline void zft_new_vtbl_entry(void) { diff --git a/drivers/char/ftape/zftape/zftape-write.c b/drivers/char/ftape/zftape/zftape-write.c index 03b126f49..8608c4dcc 100644 --- a/drivers/char/ftape/zftape/zftape-write.c +++ b/drivers/char/ftape/zftape/zftape-write.c @@ -48,8 +48,8 @@ /* Local vars. */ -static int last_write_failed = 0; -static int need_flush = 0; +static int last_write_failed; +static int need_flush; void zft_prevent_flush(void) { diff --git a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c index 6ceb5a152..78617055e 100644 --- a/drivers/char/generic_serial.c +++ b/drivers/char/generic_serial.c @@ -33,7 +33,7 @@ static char * tmp_buf; static DECLARE_MUTEX(tmp_buf_sem); -int gs_debug = 0; +int gs_debug; #ifdef DEBUG diff --git a/drivers/char/i810_rng.c b/drivers/char/i810_rng.c index f3a6f6bdf..422054ece 100644 --- a/drivers/char/i810_rng.c +++ b/drivers/char/i810_rng.c @@ -176,6 +176,9 @@ * Small miscellaneous bug fixes (prumpf) * Use pci table for PCI id list + Version 0.9.2: + * Simplify open blocking logic + */ @@ -199,7 +202,7 @@ /* * core module and version information */ -#define RNG_VERSION "0.9.1" +#define RNG_VERSION "0.9.2" #define RNG_MODULE_NAME "i810_rng" #define RNG_DRIVER_NAME RNG_MODULE_NAME " hardware driver " RNG_VERSION #define PFX RNG_MODULE_NAME ": " @@ -288,8 +291,6 @@ static spinlock_t rng_lock = SPIN_LOCK_UNLOCKED; /* hardware lock */ static struct timer_list rng_timer; /* kernel timer for RNG hardware reads and tests */ static struct pci_dev *rng_pdev; /* Firmware Hub PCI device found during PCI probe */ static struct semaphore rng_open_sem; /* Semaphore for serializing rng_open/release */ -static wait_queue_head_t rng_open_wait; /* Wait queue for serializing open/release */ -static int rng_open_mode; /* Open mode (we only allow reads) */ /* @@ -624,22 +625,17 @@ static int rng_dev_open (struct inode *inode, struct file *filp) int rc = -EINVAL; if ((filp->f_mode & FMODE_READ) == 0) - goto err_out_ret; + return rc; if (filp->f_mode & FMODE_WRITE) - goto err_out_ret; + return rc; /* wait for device to become free */ - down (&rng_open_sem); - while (rng_open_mode & filp->f_mode) { - if (filp->f_flags & O_NONBLOCK) { - up (&rng_open_sem); - return -EWOULDBLOCK; - } - up (&rng_open_sem); - interruptible_sleep_on (&rng_open_wait); - if (signal_pending (current)) + if (filp->f_flags & O_NONBLOCK) { + if (down_trylock (&rng_open_sem)) + return -EAGAIN; + } else { + if (down_interruptible (&rng_open_sem)) return -ERESTARTSYS; - down (&rng_open_sem); } if (rng_enable (1)) { @@ -647,26 +643,18 @@ static int rng_dev_open (struct inode *inode, struct file *filp) goto err_out; } - rng_open_mode |= filp->f_mode & (FMODE_READ | FMODE_WRITE); - up (&rng_open_sem); return 0; err_out: up (&rng_open_sem); -err_out_ret: return rc; } static int rng_dev_release (struct inode *inode, struct file *filp) { - down(&rng_open_sem); - rng_enable(0); - rng_open_mode &= (~filp->f_mode) & (FMODE_READ|FMODE_WRITE); - up (&rng_open_sem); - wake_up (&rng_open_wait); return 0; } @@ -824,7 +812,6 @@ static int __init rng_init (void) DPRINTK ("ENTER\n"); init_MUTEX (&rng_open_sem); - init_waitqueue_head (&rng_open_wait); pci_for_each_dev(pdev) { if (pci_match_device (rng_pci_tbl, pdev) != NULL) diff --git a/drivers/char/ip2/i2ellis.c b/drivers/char/ip2/i2ellis.c index 95af0a0f1..896396bad 100644 --- a/drivers/char/ip2/i2ellis.c +++ b/drivers/char/ip2/i2ellis.c @@ -51,9 +51,9 @@ static void ii2Nop(void); //* Static Data * //*************** -static int ii2Safe = 0; // Safe I/O address for delay routine +static int ii2Safe; // Safe I/O address for delay routine -static int iiDelayed = 0; // Set when the iiResetDelay function is +static int iiDelayed; // Set when the iiResetDelay function is // called. Cleared when ANY board is reset. static struct timer_list * pDelayTimer; // Used by iiDelayTimer static wait_queue_head_t pDelayWait; // Used by iiDelayTimer diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c index 6fbfe22df..a5e3adca6 100644 --- a/drivers/char/ip2main.c +++ b/drivers/char/ip2main.c @@ -295,13 +295,13 @@ static int ref_count; /* Here, then is a table of board pointers which the interrupt routine should * scan through to determine who it must service. */ -static unsigned short i2nBoards = 0; // Number of boards here +static unsigned short i2nBoards; // Number of boards here static i2eBordStrPtr i2BoardPtrTable[IP2_MAX_BOARDS]; static i2ChanStrPtr DevTable[IP2_MAX_PORTS]; //DevTableMem just used to save addresses for kfree -static void *DevTableMem[IP2_MAX_BOARDS] = {NULL,NULL,NULL,NULL}; +static void *DevTableMem[IP2_MAX_BOARDS]; static struct tty_struct * TtyTable[IP2_MAX_PORTS]; static struct termios * Termios[IP2_MAX_PORTS]; @@ -318,8 +318,8 @@ static struct file_operations ip2_ipl = { open: ip2_ipl_open, }; -static long irq_counter = 0; -static long bh_counter = 0; +static long irq_counter; +static long bh_counter; // Use immediate queue to service interrupts //#define USE_IQI // PCI&2.2 needs work @@ -330,15 +330,15 @@ static long bh_counter = 0; */ #define POLL_TIMEOUT (jiffies + 1) static struct timer_list PollTimer = { function: ip2_poll }; -static char TimerOn = 0; +static char TimerOn; #ifdef IP2DEBUG_TRACE /* Trace (debug) buffer data */ #define TRACEMAX 1000 static unsigned long tracebuf[TRACEMAX]; -static int tracestuff = 0; -static int tracestrip = 0; -static int tracewrap = 0; +static int tracestuff; +static int tracestrip; +static int tracewrap; #endif /**********/ @@ -372,13 +372,13 @@ static int tracewrap = 0; # endif /* LINUX_VERSION */ #endif /* MODULE */ -static int poll_only = 0; +static int poll_only; -static int Eisa_irq = 0; -static int Eisa_slot = 0; +static int Eisa_irq; +static int Eisa_slot; -static int iindx = 0; -static char rirqs[IP2_MAX_BOARDS] = {0,}; +static int iindx; +static char rirqs[IP2_MAX_BOARDS]; static int Valid_Irqs[] = { 3, 4, 5, 7, 10, 11, 12, 15, 0}; /******************************************************************************/ @@ -584,13 +584,13 @@ int __init old_ip2_init(void) { #ifdef CONFIG_DEVFS_FS - static devfs_handle_t devfs_handle = NULL; + static devfs_handle_t devfs_handle; int j, box; #endif int i; int err; int status = 0; - static int loaded = 0; + static int loaded; i2eBordStrPtr pB = NULL; int rc = -1; diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c index 71dd53691..0bcc63a43 100644 --- a/drivers/char/istallion.c +++ b/drivers/char/istallion.c @@ -142,7 +142,7 @@ static int stli_nrbrds = sizeof(stli_brdconf) / sizeof(stlconf_t); */ #define STLI_EISAPROBE 0 -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; /*****************************************************************************/ @@ -189,7 +189,7 @@ static int stli_refcount; * swapping!). All ports will share one buffer - since if the system * is already swapping a shared buffer won't make things any worse. */ -static char *stli_tmpwritebuf = (char *) NULL; +static char *stli_tmpwritebuf; static DECLARE_MUTEX(stli_tmpwritesem); #define STLI_TXBUFSIZE 4096 @@ -201,10 +201,10 @@ static DECLARE_MUTEX(stli_tmpwritesem); * with a large memcpy. Just use 1 buffer for all ports, since its * use it is only need for short periods of time by each port. */ -static char *stli_txcookbuf = (char *) NULL; -static int stli_txcooksize = 0; -static int stli_txcookrealsize = 0; -static struct tty_struct *stli_txcooktty = (struct tty_struct *) NULL; +static char *stli_txcookbuf; +static int stli_txcooksize; +static int stli_txcookrealsize; +static struct tty_struct *stli_txcooktty; /* * Define a local default termios struct. All ports will be created @@ -234,7 +234,7 @@ static stliport_t stli_dummyport; static stlibrd_t *stli_brds[STL_MAXBRDS]; -static int stli_shared = 0; +static int stli_shared; /* * Per board state flags. Used with the state field of the board struct. @@ -796,7 +796,7 @@ static struct timer_list stli_timerlist = { function: stli_poll }; -static int stli_timeron = 0; +static int stli_timeron; /* * Define the calculation for the timeout routine. diff --git a/drivers/char/joystick/gameport.c b/drivers/char/joystick/gameport.c index 5a5e1219b..15ef908a6 100644 --- a/drivers/char/joystick/gameport.c +++ b/drivers/char/joystick/gameport.c @@ -51,9 +51,9 @@ EXPORT_SYMBOL(gameport_close); EXPORT_SYMBOL(gameport_rescan); EXPORT_SYMBOL(gameport_cooked_read); -static struct gameport *gameport_list = NULL; -static struct gameport_dev *gameport_dev = NULL; -static int gameport_number = 0; +static struct gameport *gameport_list; +static struct gameport_dev *gameport_dev; +static int gameport_number; /* * gameport_measure_speed() measures the gameport i/o speed. diff --git a/drivers/char/joystick/ns558.c b/drivers/char/joystick/ns558.c index 9ea833113..573eac51b 100644 --- a/drivers/char/joystick/ns558.c +++ b/drivers/char/joystick/ns558.c @@ -57,7 +57,8 @@ struct ns558 { struct gameport gameport; }; -static struct ns558 *ns558 = NULL; +static struct ns558 *ns558; +static int have_pci_devices; /* * ns558_isa_probe() tries to find an isa gameport at the @@ -311,6 +312,15 @@ int __init ns558_init(void) #endif /* + * Probe for PCI ports. Always probe for PCI first, + * it is the least-invasive probe. + */ + + i = pci_module_init(&ns558_pci_driver); + if (i == 0) + have_pci_devices = 1; + +/* * Probe for ISA ports. */ @@ -329,14 +339,7 @@ int __init ns558_init(void) } #endif -/* - * Probe for PCI ports. - */ - - if (!ns558 && pci_module_init(&ns558_pci_driver)) - return -ENODEV; - - return 0; + return ns558 ? 0 : -ENODEV; } void __exit ns558_exit(void) @@ -365,7 +368,8 @@ void __exit ns558_exit(void) port = port->next; } - pci_unregister_driver(&ns558_pci_driver); + if (have_pci_devices) + pci_unregister_driver(&ns558_pci_driver); } module_init(ns558_init); diff --git a/drivers/char/joystick/serio.c b/drivers/char/joystick/serio.c index 9595f0a6c..7dc5cd5a1 100644 --- a/drivers/char/joystick/serio.c +++ b/drivers/char/joystick/serio.c @@ -44,9 +44,9 @@ EXPORT_SYMBOL(serio_open); EXPORT_SYMBOL(serio_close); EXPORT_SYMBOL(serio_rescan); -static struct serio *serio_list = NULL; -static struct serio_dev *serio_dev = NULL; -static int serio_number = 0; +static struct serio *serio_list; +static struct serio_dev *serio_dev; +static int serio_number; static void serio_find_dev(struct serio *serio) { diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index edb5caadf..996045c02 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -61,7 +61,7 @@ #define KBD_DEFLOCK 0 #endif -void (*kbd_ledfunc)(unsigned int led) = NULL; +void (*kbd_ledfunc)(unsigned int led); EXPORT_SYMBOL(handle_scancode); EXPORT_SYMBOL(kbd_ledfunc); @@ -83,24 +83,24 @@ int keyboard_wait_for_keypress(struct console *co) */ /* shift state counters.. */ -static unsigned char k_down[NR_SHIFT] = {0, }; +static unsigned char k_down[NR_SHIFT]; /* keyboard key bitmap */ -static unsigned long key_down[256/BITS_PER_LONG] = { 0, }; +static unsigned long key_down[256/BITS_PER_LONG]; -static int dead_key_next = 0; +static int dead_key_next; /* * In order to retrieve the shift_state (for the mouse server), either * the variable must be global, or a new procedure must be created to * return the value. I chose the former way. */ -int shift_state = 0; +int shift_state; static int npadch = -1; /* -1 or number assembled on pad */ -static unsigned char diacr = 0; -static char rep = 0; /* flag telling character repeat */ +static unsigned char diacr; +static char rep; /* flag telling character repeat */ struct kbd_struct kbd_table[MAX_NR_CONSOLES]; static struct tty_struct **ttytab; static struct kbd_struct * kbd = kbd_table; -static struct tty_struct * tty = NULL; +static struct tty_struct * tty; void compute_shiftstate(void); @@ -160,7 +160,7 @@ struct pt_regs * kbd_pt_regs; static int sysrq_pressed; #endif -static struct pm_dev *pm_kbd = NULL; +static struct pm_dev *pm_kbd; /* * Many other routines do put_queue, but I think either diff --git a/drivers/char/misc.c b/drivers/char/misc.c index 95dbdaab2..5a869954b 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c @@ -174,7 +174,7 @@ static struct file_operations misc_fops = { int misc_register(struct miscdevice * misc) { - static devfs_handle_t devfs_handle = NULL; + static devfs_handle_t devfs_handle; if (misc->next || misc->prev) return -EBUSY; diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index fbbec0fb1..1681ac603 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c @@ -170,10 +170,10 @@ static mxser_pciinfo mxser_pcibrds[] = {PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_C104, MXSER_BOARD_C104_PCI}, }; -static int ioaddr[MXSER_BOARDS] = {0, 0, 0, 0}; +static int ioaddr[MXSER_BOARDS]; static int ttymajor = MXSERMAJOR; static int calloutmajor = MXSERCUMAJOR; -static int verbose = 0; +static int verbose; /* Variables for insmod */ @@ -274,7 +274,7 @@ static int mxvar_diagflag; * buffer across all the serial ports, since it significantly saves * memory if large numbers of serial ports are open. */ -static unsigned char *mxvar_tmp_buf = 0; +static unsigned char *mxvar_tmp_buf; static struct semaphore mxvar_tmp_buf_sem; /* diff --git a/drivers/char/pc110pad.c b/drivers/char/pc110pad.c index 556d8630e..862994025 100644 --- a/drivers/char/pc110pad.c +++ b/drivers/char/pc110pad.c @@ -68,7 +68,7 @@ static struct pc110pad_params current_params; /* driver/filesystem interface management */ static wait_queue_head_t queue; static struct fasync_struct *asyncptr; -static int active=0; /* number of concurrent open()s */ +static int active; /* number of concurrent open()s */ static struct semaphore reader_lock; /** @@ -111,10 +111,10 @@ static void wake_readers(void) * up/down mouse events to be created by incrementing synthesize_tap. */ -static int button_pending=0; -static int recent_transition=0; -static int transition_count=0; -static int synthesize_tap=0; +static int button_pending; +static int recent_transition; +static int transition_count; +static int synthesize_tap; static void tap_timeout(unsigned long data); static struct timer_list tap_timer = { function: tap_timeout }; @@ -218,13 +218,13 @@ static void read_button(int *b) */ static int raw_data[3]; -static int raw_data_count=0; -static int raw_x=0, raw_y=0; /* most recent absolute co-ords read */ -static int raw_down=0; /* raw up/down state */ -static int debounced_down=0; /* up/down state after debounce processing */ +static int raw_data_count; +static int raw_x, raw_y; /* most recent absolute co-ords read */ +static int raw_down; /* raw up/down state */ +static int debounced_down; /* up/down state after debounce processing */ static enum { NO_BOUNCE, JUST_GONE_UP, JUST_GONE_DOWN } bounce=NO_BOUNCE; /* set just after an up/down transition */ -static int xy_pending=0; /* set if new data have not yet been read */ +static int xy_pending; /* set if new data have not yet been read */ /* * Timer goes off a short while after an up/down transition and copies @@ -425,7 +425,7 @@ static void read_raw_pad(int *down, int *debounced, int *x, int *y) * will make much sense in that case. */ static int read_bytes[3]; -static int read_byte_count=0; +static int read_byte_count; /** * sample_raw: diff --git a/drivers/char/pc_keyb.c b/drivers/char/pc_keyb.c index d9276b753..117ae4ec1 100644 --- a/drivers/char/pc_keyb.c +++ b/drivers/char/pc_keyb.c @@ -69,9 +69,9 @@ spinlock_t kbd_controller_lock = SPIN_LOCK_UNLOCKED; static unsigned char handle_kbd_event(void); /* used only by send_data - set by keyboard_interrupt */ -static volatile unsigned char reply_expected = 0; -static volatile unsigned char acknowledge = 0; -static volatile unsigned char resend = 0; +static volatile unsigned char reply_expected; +static volatile unsigned char acknowledge; +static volatile unsigned char resend; #if defined CONFIG_PSMOUSE @@ -84,9 +84,9 @@ static int __init psaux_init(void); #define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in */ static struct aux_queue *queue; /* Mouse data buffer. */ -static int aux_count = 0; +static int aux_count; /* used when we send commands to the mouse that expect an ACK. */ -static unsigned char mouse_reply_expected = 0; +static unsigned char mouse_reply_expected; #define AUX_INTS_OFF (KBD_MODE_KCC | KBD_MODE_DISABLE_MOUSE | KBD_MODE_SYS | KBD_MODE_KBD_INT) #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | KBD_MODE_KBD_INT) @@ -291,7 +291,7 @@ static int do_acknowledge(unsigned char scancode) int pckbd_translate(unsigned char scancode, unsigned char *keycode, char raw_mode) { - static int prev_scancode = 0; + static int prev_scancode; /* special prefix scancodes.. */ if (scancode == 0xe0 || scancode == 0xe1) { diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index 9b85db1d6..544d79e73 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c @@ -595,7 +595,7 @@ static struct file_operations pp_fops = { release: pp_release, }; -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; static int __init ppdev_init (void) { diff --git a/drivers/char/qpmouse.c b/drivers/char/qpmouse.c index bba9ddd31..922f56a0c 100644 --- a/drivers/char/qpmouse.c +++ b/drivers/char/qpmouse.c @@ -110,8 +110,8 @@ static int fasync_qp(int fd, struct file *filp, int on) #define QP_IRQ 12 -static int qp_present = 0; -static int qp_count = 0; +static int qp_present; +static int qp_count; static int qp_data = QP_DATA; static int qp_status = QP_STATUS; diff --git a/drivers/char/random.c b/drivers/char/random.c index 228c609da..bf1242e35 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -763,7 +763,7 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num) void add_keyboard_randomness(unsigned char scancode) { - static unsigned char last_scancode = 0; + static unsigned char last_scancode; /* ignore autorepeat (multiple key down w/o key up) */ if (scancode != last_scancode) { last_scancode = scancode; @@ -1998,8 +1998,8 @@ static __u32 twothirdsMD4Transform (__u32 const buf[4], __u32 const in[12]) __u32 secure_tcpv6_sequence_number(__u32 *saddr, __u32 *daddr, __u16 sport, __u16 dport) { - static __u32 rekey_time = 0; - static __u32 count = 0; + static __u32 rekey_time; + static __u32 count; static __u32 secret[12]; struct timeval tv; __u32 seq; @@ -2027,7 +2027,7 @@ __u32 secure_tcpv6_sequence_number(__u32 *saddr, __u32 *daddr, __u32 secure_ipv6_id(__u32 *daddr) { - static time_t rekey_time = 0; + static time_t rekey_time; static __u32 secret[12]; time_t t; @@ -2050,8 +2050,8 @@ __u32 secure_ipv6_id(__u32 *daddr) __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr, __u16 sport, __u16 dport) { - static __u32 rekey_time = 0; - static __u32 count = 0; + static __u32 rekey_time; + static __u32 count; static __u32 secret[12]; struct timeval tv; __u32 seq; @@ -2105,7 +2105,7 @@ __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr, */ __u32 secure_ip_id(__u32 daddr) { - static time_t rekey_time = 0; + static time_t rekey_time; static __u32 secret[12]; time_t t; @@ -2144,7 +2144,7 @@ __u32 secure_ip_id(__u32 daddr) #define COOKIEBITS 24 /* Upper bits store count */ #define COOKIEMASK (((__u32)1 << COOKIEBITS) - 1) -static int syncookie_init = 0; +static int syncookie_init; static __u32 syncookie_secret[2][16-3+HASH_BUFFER_SIZE]; __u32 secure_tcp_syn_cookie(__u32 saddr, __u32 daddr, __u16 sport, diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c index 93d1e1c46..7ff56f84f 100644 --- a/drivers/char/rio/rio_linux.c +++ b/drivers/char/rio/rio_linux.c @@ -211,7 +211,7 @@ void my_hd (void *addr, int len); static struct tty_driver rio_driver, rio_callout_driver; static struct tty_driver rio_driver2, rio_callout_driver2; -static struct tty_struct * rio_table[RIO_NPORTS] = { NULL, }; +static struct tty_struct * rio_table[RIO_NPORTS]; static struct termios ** rio_termios; static struct termios ** rio_termios_locked; @@ -223,9 +223,9 @@ struct rio_info *p; struct rio_port *rio_ports; int rio_refcount; -int rio_initialized = 0; -int rio_nports = 0; -int rio_debug = 0; +int rio_initialized; +int rio_nports; +int rio_debug; /* You can have the driver poll your card. diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c index 34e1dd51c..d00e3c4fe 100644 --- a/drivers/char/riscom8.c +++ b/drivers/char/riscom8.c @@ -82,13 +82,13 @@ DECLARE_TASK_QUEUE(tq_riscom); #define RISCOM_TYPE_NORMAL 1 #define RISCOM_TYPE_CALLOUT 2 -static struct riscom_board * IRQ_to_board[16] = { NULL, } ; +static struct riscom_board * IRQ_to_board[16]; static struct tty_driver riscom_driver, riscom_callout_driver; -static int riscom_refcount = 0; -static struct tty_struct * riscom_table[RC_NBOARD * RC_NPORT] = { NULL, }; -static struct termios * riscom_termios[RC_NBOARD * RC_NPORT] = { NULL, }; -static struct termios * riscom_termios_locked[RC_NBOARD * RC_NPORT] = { NULL, }; -static unsigned char * tmp_buf = NULL; +static int riscom_refcount; +static struct tty_struct * riscom_table[RC_NBOARD * RC_NPORT]; +static struct termios * riscom_termios[RC_NBOARD * RC_NPORT]; +static struct termios * riscom_termios_locked[RC_NBOARD * RC_NPORT]; +static unsigned char * tmp_buf; static DECLARE_MUTEX(tmp_buf_sem); static unsigned long baud_table[] = { @@ -103,9 +103,7 @@ static struct riscom_board rc_board[RC_NBOARD] = { { 0, RC_IOBASE4, 0, }, }; -static struct riscom_port rc_port[RC_NBOARD * RC_NPORT] = { - { 0, }, -}; +static struct riscom_port rc_port[RC_NBOARD * RC_NPORT]; /* RISCom/8 I/O ports addresses (without address translation) */ static unsigned short rc_ioport[] = { diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index 3d754212e..5cecdde40 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c @@ -154,26 +154,26 @@ static void rp_wait_until_sent(struct tty_struct *tty, int timeout); static void rp_flush_buffer(struct tty_struct *tty); static struct tty_driver rocket_driver, callout_driver; -static int rocket_refcount = 0; +static int rocket_refcount; -static int rp_num_ports_open = 0; +static int rp_num_ports_open; static struct timer_list rocket_timer; -unsigned long board1 = 0; -unsigned long board2 = 0; -unsigned long board3 = 0; -unsigned long board4 = 0; -unsigned long controller = 0; -unsigned long support_low_speed = 0; +unsigned long board1; +unsigned long board2; +unsigned long board3; +unsigned long board4; +unsigned long controller; +unsigned long support_low_speed; int rp_baud_base = 460800; static unsigned long rcktpt_io_addr[NUM_BOARDS]; static int max_board; #ifdef TIME_STAT -static unsigned long long time_stat = 0; -static unsigned long time_stat_short = 0; -static unsigned long time_stat_long = 0; -static unsigned long time_counter = 0; +static unsigned long long time_stat; +static unsigned long time_stat_short; +static unsigned long time_stat_long; +static unsigned long time_counter; #endif #if ((LINUX_VERSION_CODE > 0x020111) && defined(MODULE)) diff --git a/drivers/char/sbc60xxwdt.c b/drivers/char/sbc60xxwdt.c index 9eb56403e..0c3deed84 100644 --- a/drivers/char/sbc60xxwdt.c +++ b/drivers/char/sbc60xxwdt.c @@ -104,9 +104,9 @@ static void wdt_timer_ping(unsigned long); static struct timer_list timer; -static unsigned long next_heartbeat = 0; -static int wdt_is_open = 0; -static int wdt_expect_close = 0; +static unsigned long next_heartbeat; +static int wdt_is_open; +static int wdt_expect_close; /* * Whack the dog diff --git a/drivers/char/selection.c b/drivers/char/selection.c index f0f67c0cf..b804a61e1 100644 --- a/drivers/char/selection.c +++ b/drivers/char/selection.c @@ -36,11 +36,11 @@ extern void poke_blanked_console(void); /* Variables for selection control. */ /* Use a dynamic buffer, instead of static (Dec 1994) */ - int sel_cons = 0; /* must not be disallocated */ + int sel_cons; /* must not be disallocated */ static volatile int sel_start = -1; /* cleared by clear_selection */ static int sel_end; -static int sel_buffer_lth = 0; -static char *sel_buffer = NULL; +static int sel_buffer_lth; +static char *sel_buffer; /* clear_selection, highlight and highlight_pointer can be called from interrupt (via scrollback/front) */ diff --git a/drivers/char/serial.c b/drivers/char/serial.c index 7ee9b0211..85da92470 100644 --- a/drivers/char/serial.c +++ b/drivers/char/serial.c @@ -267,7 +267,7 @@ static struct rs_multiport_struct rs_multiport[NR_IRQS]; static int IRQ_timeout[NR_IRQS]; #ifdef CONFIG_SERIAL_CONSOLE static struct console sercons; -static int lsr_break_flag = 0; +static int lsr_break_flag; #endif #if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) static unsigned long break_pressed; /* break, really ... */ @@ -325,7 +325,7 @@ static struct serial_state rs_table[RS_TABLE_SIZE] = { #define NR_PCI_BOARDS 8 static struct pci_board_inst serial_pci_board[NR_PCI_BOARDS]; -static int serial_pci_board_idx = 0; +static int serial_pci_board_idx; #ifndef IS_PCI_REGION_IOPORT #define IS_PCI_REGION_IOPORT(dev, r) (pci_resource_flags((dev), (r)) & \ @@ -1060,7 +1060,7 @@ static void do_softint(void *private_) */ static void rs_timer(unsigned long dummy) { - static unsigned long last_strobe = 0; + static unsigned long last_strobe; struct async_struct *info; unsigned int i; unsigned long flags; diff --git a/drivers/char/softdog.c b/drivers/char/softdog.c index cb508cbe2..e3f68ba30 100644 --- a/drivers/char/softdog.c +++ b/drivers/char/softdog.c @@ -58,7 +58,7 @@ static void watchdog_fire(unsigned long); static struct timer_list watchdog_ticktock = { function: watchdog_fire, }; -static int timer_alive = 0; +static int timer_alive; /* diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index eab300d5f..6e3c6a99c 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c @@ -181,11 +181,11 @@ DECLARE_TASK_QUEUE(tq_specialix); #define SPECIALIX_TYPE_CALLOUT 2 static struct tty_driver specialix_driver, specialix_callout_driver; -static int specialix_refcount = 0; -static struct tty_struct * specialix_table[SX_NBOARD * SX_NPORT] = { NULL, }; -static struct termios * specialix_termios[SX_NBOARD * SX_NPORT] = { NULL, }; -static struct termios * specialix_termios_locked[SX_NBOARD * SX_NPORT] = { NULL, }; -static unsigned char * tmp_buf = NULL; +static int specialix_refcount; +static struct tty_struct * specialix_table[SX_NBOARD * SX_NPORT]; +static struct termios * specialix_termios[SX_NBOARD * SX_NPORT]; +static struct termios * specialix_termios_locked[SX_NBOARD * SX_NPORT]; +static unsigned char * tmp_buf; static DECLARE_MUTEX(tmp_buf_sem); static unsigned long baud_table[] = { @@ -200,9 +200,7 @@ static struct specialix_board sx_board[SX_NBOARD] = { { 0, SX_IOBASE4, 15, }, }; -static struct specialix_port sx_port[SX_NBOARD * SX_NPORT] = { - { 0, }, -}; +static struct specialix_port sx_port[SX_NBOARD * SX_NPORT]; #ifdef SPECIALIX_TIMER @@ -1013,7 +1011,7 @@ static void sx_change_speed(struct specialix_board *bp, struct specialix_port *p long tmp; unsigned char cor1 = 0, cor3 = 0; unsigned char mcor1 = 0, mcor2 = 0; - static int again=0; + static int again; if (!(tty = port->tty) || !tty->termios) return; diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c index a0faeada4..8907fdeab 100644 --- a/drivers/char/stallion.c +++ b/drivers/char/stallion.c @@ -146,7 +146,7 @@ static struct tty_driver stl_callout; static struct tty_struct *stl_ttys[STL_MAXDEVS]; static struct termios *stl_termios[STL_MAXDEVS]; static struct termios *stl_termioslocked[STL_MAXDEVS]; -static int stl_refcount = 0; +static int stl_refcount; /* * We will need to allocate a temporary write buffer for chars that @@ -192,7 +192,7 @@ static char stl_unwanted[SC26198_RXFIFOSIZE]; * shared with another Stallion board. */ static int stl_gotintrs[STL_MAXBRDS]; -static int stl_numintrs = 0; +static int stl_numintrs; /*****************************************************************************/ @@ -748,7 +748,7 @@ static struct file_operations stl_fsiomem = { /*****************************************************************************/ -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; #ifdef MODULE diff --git a/drivers/char/sx.c b/drivers/char/sx.c index e6336fc03..3dd5811d9 100644 --- a/drivers/char/sx.c +++ b/drivers/char/sx.c @@ -309,16 +309,16 @@ static int sx_init_drivers(void); static struct tty_driver sx_driver, sx_callout_driver; -static struct tty_struct * sx_table[SX_NPORTS] = { NULL, }; +static struct tty_struct * sx_table[SX_NPORTS]; static struct termios ** sx_termios; static struct termios ** sx_termios_locked; struct sx_board boards[SX_NBOARDS]; struct sx_port *sx_ports; int sx_refcount; -int sx_initialized = 0; -int sx_nports = 0; -int sx_debug = 0; +int sx_initialized; +int sx_nports; +int sx_debug; /* You can have the driver poll your card. @@ -330,7 +330,7 @@ int sx_debug = 0; everything will continue to work.... */ int sx_poll = 1; -int sx_slowpoll = 0; +int sx_slowpoll; /* The card limits the number of interrupts per second. At 115k2 "100" should be sufficient. @@ -2077,7 +2077,7 @@ static int sx_init_board (struct sx_board *board) void printheader(void) { - static int header_printed = 0; + static int header_printed; if (!header_printed) { printk (KERN_INFO "Specialix SX driver " diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 9650457c0..3c05aa042 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c @@ -34,7 +34,7 @@ extern struct list_head super_blocks; int sysrq_enabled = 1; /* Machine specific power off function */ -void (*sysrq_power_off)(void) = NULL; +void (*sysrq_power_off)(void); EXPORT_SYMBOL(sysrq_power_off); diff --git a/drivers/char/tpqic02.c b/drivers/char/tpqic02.c index 14a42682d..cf521edfe 100644 --- a/drivers/char/tpqic02.c +++ b/drivers/char/tpqic02.c @@ -116,7 +116,7 @@ static struct mtconfiginfo qic02_tape_dynconf = /* user settable */ { 0, 0, BOGUS_IRQ, 0, 0, TPQD_DEFAULT_FLAGS, }; -static struct qic02_ccb qic02_tape_ccb = { 0, }; /* private stuff */ +static struct qic02_ccb qic02_tape_ccb; /* private stuff */ #else @@ -127,7 +127,7 @@ unsigned long qic02_tape_debug = TPQD_DEFAULT_FLAGS; # endif #endif /* CONFIG_QIC02_DYNCONF */ -static volatile int ctlbits = 0; /* control reg bits for tape interface */ +static volatile int ctlbits; /* control reg bits for tape interface */ static wait_queue_head_t qic02_tape_transfer; /* sync rw with interrupts */ @@ -149,10 +149,10 @@ static flag status_zombie = YES; /* it's `zombie' until irq/dma allocated */ static volatile flag status_bytes_wr = NO; /* write FM at close or not */ static volatile flag status_bytes_rd = NO; /* (rd|wr) used for rewinding */ -static volatile unsigned long status_cmd_pending = 0; /* cmd in progress */ +static volatile unsigned long status_cmd_pending; /* cmd in progress */ static volatile flag status_expect_int = NO; /* ready for interrupts */ static volatile flag status_timer_on = NO; /* using time-out */ -static volatile int status_error = 0; /* int handler may detect error */ +static volatile int status_error; /* int handler may detect error */ static volatile flag status_eof_detected = NO; /* end of file */ static volatile flag status_eom_detected = NO; /* end of recorded media */ static volatile flag status_eot_detected = NO; /* end of tape */ @@ -161,7 +161,7 @@ static volatile flag doing_write = NO; static volatile unsigned long dma_bytes_todo; static volatile unsigned long dma_bytes_done; -static volatile unsigned dma_mode = 0; /* !=0 also means DMA in use */ +static volatile unsigned dma_mode; /* !=0 also means DMA in use */ static flag need_rewind = YES; static kdev_t current_tape_dev; @@ -208,7 +208,7 @@ static void qic02_release_resources(void); * must ensure that a large enough buffer is passed to the kernel, in order * to reduce tape repositioning wear and tear. */ -static unsigned long buffaddr = 0; /* physical address of buffer */ +static unsigned long buffaddr; /* physical address of buffer */ /* This translates minor numbers to the corresponding recording format: */ static const char *format_names[] = { diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 6b75609e0..30de22081 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -1414,7 +1414,7 @@ init_dev_done: if ((tty->driver.type == TTY_DRIVER_TYPE_SERIAL) && (tty->driver.subtype == SERIAL_TYPE_CALLOUT) && (tty->count == 1)) { - static int nr_warns = 0; + static int nr_warns; if (nr_warns < 5) { printk(KERN_WARNING "tty_io.c: " "process %d (%s) used obsolete /dev/%s - " diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c index 920873d9e..e6032c24d 100644 --- a/drivers/char/vc_screen.c +++ b/drivers/char/vc_screen.c @@ -459,7 +459,7 @@ static struct file_operations vcs_fops = { open: vcs_open, }; -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; void vcs_make_devfs (unsigned int index, int unregister) { diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 0e4872098..1bc175d16 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -36,7 +36,7 @@ #include #endif /* CONFIG_FB_COMPAT_XPMAC */ -char vt_dont_switch = 0; +char vt_dont_switch; extern struct tty_driver console_driver; #define VT_IS_IN_USE(i) (console_driver.table[i] && console_driver.table[i]->count) diff --git a/drivers/char/wdt285.c b/drivers/char/wdt285.c index bbfb5d992..4993e6cbe 100644 --- a/drivers/char/wdt285.c +++ b/drivers/char/wdt285.c @@ -43,7 +43,7 @@ #define FCLK (50*1000*1000) /* 50MHz */ static int soft_margin = TIMER_MARGIN; /* in seconds */ -static int timer_alive = 0; +static int timer_alive; #ifdef ONLY_TESTING /* diff --git a/drivers/char/wdt977.c b/drivers/char/wdt977.c index d9ea545a7..1767fbf3b 100644 --- a/drivers/char/wdt977.c +++ b/drivers/char/wdt977.c @@ -29,8 +29,8 @@ #define WATCHDOG_MINOR 130 static int timeout = 3; -static int timer_alive = 0; -static int testmode = 0; +static int timer_alive; +static int testmode; /* * Allow only one person to hold it open diff --git a/drivers/i2o/i2o_core.c b/drivers/i2o/i2o_core.c index d39e32529..87871fa15 100644 --- a/drivers/i2o/i2o_core.c +++ b/drivers/i2o/i2o_core.c @@ -183,7 +183,7 @@ static struct reply_info events[I2O_EVT_Q_LEN]; static int evt_in = 0; static int evt_out = 0; static int evt_q_len = 0; -#define MODINC(x,y) (x = x++ % y) +#define MODINC(x,y) ((x) = ((x) + 1) % (y)) /* * I2O configuration spinlock. This isnt a big deal for contention diff --git a/drivers/ide/Config.in b/drivers/ide/Config.in index d4687f703..2c71d637f 100644 --- a/drivers/ide/Config.in +++ b/drivers/ide/Config.in @@ -69,6 +69,7 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then dep_bool ' PROMISE PDC20246/PDC20262/PDC20267 support' CONFIG_BLK_DEV_PDC202XX $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' Special UDMA Feature' CONFIG_PDC202XX_BURST $CONFIG_BLK_DEV_PDC202XX dep_bool ' SiS5513 chipset support' CONFIG_BLK_DEV_SIS5513 $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_X86 + dep_bool ' SLC90E66 chipset support' CONFIG_BLK_DEV_SLC90E66 $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_X86 dep_bool ' Tekram TRM290 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_TRM290 $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' VIA82CXXX chipset support' CONFIG_BLK_DEV_VIA82CXXX $CONFIG_BLK_DEV_IDEDMA_PCI fi @@ -157,6 +158,7 @@ if [ "$CONFIG_IDE_CHIPSETS" = "y" -o \ "$CONFIG_BLK_DEV_PDC202XX" = "y" -o \ "$CONFIG_BLK_DEV_PIIX" = "y" -o \ "$CONFIG_BLK_DEV_SIS5513" = "y" -o \ + "$CONFIG_BLK_DEV_SLC90E66" = "y" -o \ "$CONFIG_BLK_DEV_SL82C105" = "y" -o \ "$CONFIG_BLK_DEV_VIA82CXXX" = "y" ]; then define_bool CONFIG_BLK_DEV_IDE_MODES y diff --git a/drivers/ide/Makefile b/drivers/ide/Makefile index 43fd39a8d..c4603e734 100644 --- a/drivers/ide/Makefile +++ b/drivers/ide/Makefile @@ -50,6 +50,7 @@ ide-obj-$(CONFIG_BLK_DEV_QD6580) += qd6580.o ide-obj-$(CONFIG_BLK_DEV_IDE_RAPIDE) += rapide.o ide-obj-$(CONFIG_BLK_DEV_RZ1000) += rz1000.o ide-obj-$(CONFIG_BLK_DEV_SIS5513) += sis5513.o +ide-obj-$(CONFIG_BLK_DEV_SLC90E66) += slc90e66.o ide-obj-$(CONFIG_BLK_DEV_SL82C105) += sl82c105.o ide-obj-$(CONFIG_BLK_DEV_TRM290) += trm290.o ide-obj-$(CONFIG_BLK_DEV_UMC8672) += umc8672.o diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.c index 41768bb90..813aecd3b 100644 --- a/drivers/ide/alim15x3.c +++ b/drivers/ide/alim15x3.c @@ -171,11 +171,11 @@ static int ali_get_info (char *buffer, char **addr, off_t offset, int count) ((reg5yh & 0x30)>>4) + 12 ); } } else { - p += sprintf(p, q, - (tmp = (reg5xh & 0x03)) ? (tmp << 3) : 4, - (tmp = ((reg5xh & 0x30)>>4)) ? (tmp << 3) : 4, - (tmp = (reg5yh & 0x03)) ? (tmp << 3) : 4, - (tmp = ((reg5yh & 0x30)>>4)) ? (tmp << 3) : 4 ); + int t1 = (tmp = (reg5xh & 0x03)) ? (tmp << 3) : 4; + int t2 = (tmp = ((reg5xh & 0x30)>>4)) ? (tmp << 3) : 4; + int t3 = (tmp = (reg5yh & 0x03)) ? (tmp << 3) : 4; + int t4 = (tmp = ((reg5yh & 0x30)>>4)) ? (tmp << 3) : 4; + p += sprintf(p, q, t1, t2, t3, t4); } #if 0 diff --git a/drivers/ide/buddha.c b/drivers/ide/buddha.c index 710b6654d..7ef6f645a 100644 --- a/drivers/ide/buddha.c +++ b/drivers/ide/buddha.c @@ -117,19 +117,15 @@ static int __init find_buddha(void) buddha_num_hwifs = 0; while ((z = zorro_find_device(ZORRO_WILDCARD, z))) { unsigned long board; - const char *name; - if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA) { + if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA) buddha_num_hwifs = BUDDHA_NUM_HWIFS; - name = "Buddha IDE Interface"; - } else if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL) { + else if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL) buddha_num_hwifs = CATWEASEL_NUM_HWIFS; - name = "Catweasel IDE Interface and Floppy Controller"; - } else + else continue; board = z->resource.start; if (!request_mem_region(board+BUDDHA_BASE1, 0x800, "IDE")) continue; - strcpy(z->name, name); buddha_board = ZTWO_VADDR(board); /* write to BUDDHA_IRQ_MR to enable the board IRQ */ *(char *)(buddha_board+BUDDHA_IRQ_MR) = 0; diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index ae9f62768..9d0fc8e74 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -64,8 +64,8 @@ static void idedisk_bswap_data (void *buffer, int wcount) u16 *p = buffer; while (wcount--) { - *p++ = *p << 8 | *p >> 8; - *p++ = *p << 8 | *p >> 8; + *p = *p << 8 | *p >> 8; p++; + *p = *p << 8 | *p >> 8; p++; } } diff --git a/drivers/ide/ide-features.c b/drivers/ide/ide-features.c index fa765d76f..2dfef8bee 100644 --- a/drivers/ide/ide-features.c +++ b/drivers/ide/ide-features.c @@ -224,7 +224,8 @@ int ide_ata66_check (ide_drive_t *drive, byte cmd, byte nsect, byte feature) #ifndef CONFIG_IDEDMA_IVB if ((drive->id->hw_config & 0x6000) == 0) { #else /* !CONFIG_IDEDMA_IVB */ - if ((drive->id->hw_config & 0x2000) == 0) { + if (((drive->id->hw_config & 0x2000) == 0) || + ((drive->id->hw_config & 0x4000) == 0)) { #endif /* CONFIG_IDEDMA_IVB */ printk("%s: Speed warnings UDMA 3/4/5 is not functional.\n", drive->name); return 1; @@ -260,7 +261,7 @@ byte eighty_ninty_three (ide_drive_t *drive) #ifndef CONFIG_IDEDMA_IVB (drive->id->hw_config & 0x4000) && #endif /* CONFIG_IDEDMA_IVB */ - (drive->id->hw_config & 0x2000)) ? 1 : 0); + (drive->id->hw_config & 0x6000)) ? 1 : 0); } /* diff --git a/drivers/ide/ide-pci.c b/drivers/ide/ide-pci.c index 561b1c3cf..3367d5c1f 100644 --- a/drivers/ide/ide-pci.c +++ b/drivers/ide/ide-pci.c @@ -72,6 +72,7 @@ #define DEVID_CS5530 ((ide_pci_devid_t){PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_IDE}) #define DEVID_AMD7403 ((ide_pci_devid_t){PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_COBRA_7403}) #define DEVID_AMD7409 ((ide_pci_devid_t){PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7409}) +#define DEVID_SLC90E66 ((ide_pci_devid_t){PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_1}) #define IDE_IGNORE ((void *)-1) @@ -253,6 +254,19 @@ extern void ide_init_sis5513(ide_hwif_t *); #define INIT_SIS5513 NULL #endif +#ifdef CONFIG_BLK_DEV_SLC90E66 +extern unsigned int pci_init_slc90e66(struct pci_dev *, const char *); +extern unsigned int ata66_slc90e66(ide_hwif_t *); +extern void ide_init_slc90e66(ide_hwif_t *); +#define PCI_SLC90E66 &pci_init_slc90e66 +#define ATA66_SLC90E66 &ata66_slc90e66 +#define INIT_SLC90E66 &ide_init_slc90e66 +#else +#define PCI_SLC90E66 NULL +#define ATA66_SLC90E66 NULL +#define INIT_SLC90E66 NULL +#endif + #ifdef CONFIG_BLK_DEV_SL82C105 extern void ide_init_sl82c105(ide_hwif_t *); extern void ide_dmacapable_sl82c105(ide_hwif_t *, unsigned long); @@ -351,6 +365,7 @@ static ide_pci_device_t ide_pci_chipsets[] __initdata = { {DEVID_CS5530, "CS5530", PCI_CS5530, NULL, INIT_CS5530, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, {DEVID_AMD7403, "AMD7403", NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, {DEVID_AMD7409, "AMD7409", PCI_AMD7409, ATA66_AMD7409, INIT_AMD7409, DMA_AMD7409, {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, ON_BOARD, 0 }, + {DEVID_SLC90E66,"SLC90E66", PCI_SLC90E66, ATA66_SLC90E66, INIT_SLC90E66, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, {IDE_PCI_DEVID_NULL, "PCI_IDE", NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }}; /* @@ -466,7 +481,7 @@ static int __init ide_setup_pci_baseregs (struct pci_dev *dev, const char *name) */ for (reg = 0; reg < 4; reg++) { struct resource *res = dev->resource + reg; - if (!(res->flags & PCI_BASE_ADDRESS_SPACE_IO)) + if ((res->flags & IORESOURCE_IO) == 0) continue; if (!res->start) { printk("%s: Missing I/O address #%d\n", name, reg); @@ -493,11 +508,16 @@ static void __init ide_setup_pci_device (struct pci_dev *dev, ide_pci_device_t * byte tmp = 0; ide_hwif_t *hwif, *mate = NULL; unsigned int class_rev; - int pci_class_ide; #ifdef CONFIG_IDEDMA_AUTO autodma = 1; #endif + +#if 1 /* what do do with this useful tool ??? */ + if (pci_enable_device(dev)) + return; +#endif + check_if_enabled: if (pci_read_config_word(dev, PCI_COMMAND, &pcicmd)) { printk("%s: error accessing PCI regs\n", d->name); @@ -539,8 +559,7 @@ check_if_enabled: * Can we trust the reported IRQ? */ pciirq = dev->irq; - pci_class_ide = ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE); - if (!pci_class_ide) { + if ((dev->class & ~(0xfa)) != ((PCI_CLASS_STORAGE_IDE << 8) | 5)) { printk("%s: not 100%% native mode: will probe irqs later\n", d->name); /* * This allows offboard ide-pci cards the enable a BIOS, @@ -550,17 +569,11 @@ check_if_enabled: */ pciirq = (d->init_chipset) ? d->init_chipset(dev, d->name) : ide_special_settings(dev, d->name); } else if (tried_config) { - printk(KERN_INFO "%s: will probe irqs later\n", d->name); + printk("%s: will probe irqs later\n", d->name); pciirq = 0; } else if (!pciirq) { - if (pci_class_ide) { - /* this is the normal path for most IDE devices */ - if (d->init_chipset) - pciirq = d->init_chipset(dev, d->name); - else - printk(KERN_INFO "%s standard IDE storage device detected\n", d->name); - } else - printk(KERN_WARNING "%s: bad irq (0): will probe later\n", d->name); + printk("%s: bad irq (%d): will probe later\n", d->name, pciirq); + pciirq = 0; } else { if (d->init_chipset) (void) d->init_chipset(dev, d->name); diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c index 4bb181241..f0bf8b3b2 100644 --- a/drivers/ide/ide-proc.c +++ b/drivers/ide/ide-proc.c @@ -113,6 +113,10 @@ int (*piix_display_info)(char *, char **, off_t, int) = NULL; extern byte sis_proc; int (*sis_display_info)(char *, char **, off_t, int) = NULL; #endif /* CONFIG_BLK_DEV_SIS5513 */ +#ifdef CONFIG_BLK_DEV_SLC90E66 +extern byte slc90e66_proc; +int (*slc90e66_display_info)(char *, char **, off_t, int) = NULL; +#endif /* CONFIG_BLK_DEV_SLC90E66 */ #ifdef CONFIG_BLK_DEV_VIA82CXXX extern byte via_proc; int (*via_display_info)(char *, char **, off_t, int) = NULL; @@ -841,6 +845,10 @@ void proc_ide_create(void) if ((sis_display_info) && (sis_proc)) create_proc_info_entry("sis", 0, proc_ide_root, sis_display_info); #endif /* CONFIG_BLK_DEV_SIS5513 */ +#ifdef CONFIG_BLK_DEV_SLC90E66 + if ((slc90e66_display_info) && (slc90e66_proc)) + create_proc_info_entry("slc90e66", 0, proc_ide_root, slc90e66_display_info); +#endif /* CONFIG_BLK_DEV_SLC90E66 */ #ifdef CONFIG_BLK_DEV_VIA82CXXX if ((via_display_info) && (via_proc)) create_proc_info_entry("via", 0, proc_ide_root, via_display_info); @@ -893,6 +901,10 @@ void proc_ide_destroy(void) if ((sis_display_info) && (sis_proc)) remove_proc_entry("ide/sis", 0); #endif /* CONFIG_BLK_DEV_SIS5513 */ +#ifdef CONFIG_BLK_DEV_SLC90E66 + if ((slc90e66_display_info) && (slc90e66_proc)) + remove_proc_entry("ide/slc90e66",0); +#endif /* CONFIG_BLK_DEV_SLC90E66 */ #ifdef CONFIG_BLK_DEV_VIA82CXXX if ((via_display_info) && (via_proc)) remove_proc_entry("ide/via",0); diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 5d00083c3..32205cccc 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -163,12 +163,12 @@ static const byte ide_hwif_to_major[] = { IDE0_MAJOR, IDE1_MAJOR, IDE2_MAJOR, IDE3_MAJOR, IDE4_MAJOR, IDE5_MAJOR, IDE6_MAJOR, IDE7_MAJOR, IDE8_MAJOR, IDE9_MAJOR }; -static int idebus_parameter = 0; /* holds the "idebus=" parameter */ -static int system_bus_speed = 0; /* holds what we think is VESA/PCI bus speed */ +static int idebus_parameter; /* holds the "idebus=" parameter */ +static int system_bus_speed; /* holds what we think is VESA/PCI bus speed */ static int initializing; /* set while initializing built-in drivers */ #ifdef CONFIG_BLK_DEV_IDEPCI -static int ide_scan_direction = 0; /* THIS was formerly 2.2.x pci=reverse */ +static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */ #endif /* CONFIG_BLK_DEV_IDEPCI */ #if defined(__mc68000__) || defined(CONFIG_APUS) @@ -176,14 +176,14 @@ static int ide_scan_direction = 0; /* THIS was formerly 2.2.x pci=reverse */ * ide_lock is used by the Atari code to obtain access to the IDE interrupt, * which is shared between several drivers. */ -static int ide_lock = 0; +static int ide_lock; #endif /* __mc68000__ || CONFIG_APUS */ /* * ide_modules keeps track of the available IDE chipset/probe/driver modules. */ -ide_module_t *ide_modules = NULL; -ide_module_t *ide_probe = NULL; +ide_module_t *ide_modules; +ide_module_t *ide_probe; /* * This is declared extern in ide.h, for access by other IDE modules: @@ -1509,7 +1509,7 @@ static void unexpected_intr (int irq, ide_hwgroup_t *hwgroup) stat = IN_BYTE(hwif->io_ports[IDE_STATUS_OFFSET]); if (!OK_STAT(stat, READY_STAT, BAD_STAT)) { /* Try to not flood the console with msgs */ - static unsigned long last_msgtime = 0, count = 0; + static unsigned long last_msgtime, count; ++count; if (0 < (signed long)(jiffies - (last_msgtime + HZ))) { last_msgtime = jiffies; @@ -3499,7 +3499,7 @@ EXPORT_SYMBOL(ide_spin_wait_hwgroup); /* * Probe module */ -devfs_handle_t ide_devfs_handle = NULL; +devfs_handle_t ide_devfs_handle; EXPORT_SYMBOL(ide_probe); EXPORT_SYMBOL(drive_is_flashcard); @@ -3561,7 +3561,7 @@ EXPORT_SYMBOL(system_bus_clock); */ int __init ide_init (void) { - static char banner_printed = 0; + static char banner_printed; int i; if (!banner_printed) { diff --git a/drivers/ide/slc90e66.c b/drivers/ide/slc90e66.c new file mode 100644 index 000000000..f8e6be4d0 --- /dev/null +++ b/drivers/ide/slc90e66.c @@ -0,0 +1,382 @@ +/* + * linux/drivers/ide/slc90e66.c Version 0.10 October 4, 2000 + * + * Copyright (C) 2000 Andre Hedrick + * May be copied or modified under the terms of the GNU General Public License + * + * 00:07.1 IDE interface: EFAR Microsystems: + * Unknown device 9130 (prog-if 8a [Master SecP PriP]) + * Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- + * VGASnoop- ParErr- Stepping- SERR- FastB2B- + * Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium + * >TAbort- SERR- +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ide_modes.h" + +#define SLC90E66_DEBUG_DRIVE_INFO 0 + +#define DISPLAY_SLC90E66_TIMINGS + +#if defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static int slc90e66_get_info(char *, char **, off_t, int); +extern int (*slc90e66_display_info)(char *, char **, off_t, int); /* ide-proc.c */ +extern char *ide_media_verbose(ide_drive_t *); +static struct pci_dev *bmide_dev; + +static int slc90e66_get_info (char *buffer, char **addr, off_t offset, int count) +{ + char *p = buffer; + u32 bibma = pci_resource_start(bmide_dev, 4); + u16 reg40 = 0, psitre = 0, reg42 = 0, ssitre = 0; + u8 c0 = 0, c1 = 0; + u8 reg44 = 0, reg47 = 0, reg48 = 0, reg4a = 0, reg4b = 0; + + pci_read_config_word(bmide_dev, 0x40, ®40); + pci_read_config_word(bmide_dev, 0x42, ®42); + pci_read_config_byte(bmide_dev, 0x44, ®44); + pci_read_config_byte(bmide_dev, 0x47, ®47); + pci_read_config_byte(bmide_dev, 0x48, ®48); + pci_read_config_byte(bmide_dev, 0x4a, ®4a); + pci_read_config_byte(bmide_dev, 0x4b, ®4b); + + psitre = (reg40 & 0x4000) ? 1 : 0; + ssitre = (reg42 & 0x4000) ? 1 : 0; + + /* + * at that point bibma+0x2 et bibma+0xa are byte registers + * to investigate: + */ + c0 = inb_p((unsigned short)bibma + 0x02); + c1 = inb_p((unsigned short)bibma + 0x0a); + + p += sprintf(p, " SLC90E66 Chipset.\n"); + p += sprintf(p, "--------------- Primary Channel ---------------- Secondary Channel -------------\n"); + p += sprintf(p, " %sabled %sabled\n", + (c0&0x80) ? "dis" : " en", + (c1&0x80) ? "dis" : " en"); + p += sprintf(p, "--------------- drive0 --------- drive1 -------- drive0 ---------- drive1 ------\n"); + p += sprintf(p, "DMA enabled: %s %s %s %s\n", + (c0&0x20) ? "yes" : "no ", + (c0&0x40) ? "yes" : "no ", + (c1&0x20) ? "yes" : "no ", + (c1&0x40) ? "yes" : "no " ); + p += sprintf(p, "UDMA enabled: %s %s %s %s\n", + (reg48&0x01) ? "yes" : "no ", + (reg48&0x02) ? "yes" : "no ", + (reg48&0x04) ? "yes" : "no ", + (reg48&0x08) ? "yes" : "no " ); + p += sprintf(p, "UDMA enabled: %s %s %s %s\n", + ((reg4a&0x04)==0x04) ? "4" : + ((reg4a&0x03)==0x03) ? "3" : + (reg4a&0x02) ? "2" : + (reg4a&0x01) ? "1" : + (reg4a&0x00) ? "0" : "X", + ((reg4a&0x40)==0x40) ? "4" : + ((reg4a&0x30)==0x30) ? "3" : + (reg4a&0x20) ? "2" : + (reg4a&0x10) ? "1" : + (reg4a&0x00) ? "0" : "X", + ((reg4b&0x04)==0x04) ? "4" : + ((reg4b&0x03)==0x03) ? "3" : + (reg4b&0x02) ? "2" : + (reg4b&0x01) ? "1" : + (reg4b&0x00) ? "0" : "X", + ((reg4b&0x40)==0x40) ? "4" : + ((reg4b&0x30)==0x30) ? "3" : + (reg4b&0x20) ? "2" : + (reg4b&0x10) ? "1" : + (reg4b&0x00) ? "0" : "X"); + + p += sprintf(p, "UDMA\n"); + p += sprintf(p, "DMA\n"); + p += sprintf(p, "PIO\n"); + +/* + * FIXME.... Add configuration junk data....blah blah...... + */ + + return p-buffer; /* => must be less than 4k! */ +} +#endif /* defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) */ + +/* + * Used to set Fifo configuration via kernel command line: + */ + +byte slc90e66_proc = 0; + +extern char *ide_xfer_verbose (byte xfer_rate); + +#ifdef CONFIG_BLK_DEV_IDEDMA +/* + * + */ +static byte slc90e66_dma_2_pio (byte xfer_rate) { + switch(xfer_rate) { + case XFER_UDMA_4: + case XFER_UDMA_3: + case XFER_UDMA_2: + case XFER_UDMA_1: + case XFER_UDMA_0: + case XFER_MW_DMA_2: + case XFER_PIO_4: + return 4; + case XFER_MW_DMA_1: + case XFER_PIO_3: + return 3; + case XFER_SW_DMA_2: + case XFER_PIO_2: + return 2; + case XFER_MW_DMA_0: + case XFER_SW_DMA_1: + case XFER_SW_DMA_0: + case XFER_PIO_1: + case XFER_PIO_0: + case XFER_PIO_SLOW: + default: + return 0; + } +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +/* + * Based on settings done by AMI BIOS + * (might be usefull if drive is not registered in CMOS for any reason). + */ +static void slc90e66_tune_drive (ide_drive_t *drive, byte pio) +{ + unsigned long flags; + u16 master_data; + byte slave_data; + int is_slave = (&HWIF(drive)->drives[1] == drive); + int master_port = HWIF(drive)->index ? 0x42 : 0x40; + int slave_port = 0x44; + /* ISP RTC */ + byte timings[][2] = { { 0, 0 }, + { 0, 0 }, + { 1, 0 }, + { 2, 1 }, + { 2, 3 }, }; + + pio = ide_get_best_pio_mode(drive, pio, 5, NULL); + pci_read_config_word(HWIF(drive)->pci_dev, master_port, &master_data); + if (is_slave) { + master_data = master_data | 0x4000; + if (pio > 1) + /* enable PPE, IE and TIME */ + master_data = master_data | 0x0070; + pci_read_config_byte(HWIF(drive)->pci_dev, slave_port, &slave_data); + slave_data = slave_data & (HWIF(drive)->index ? 0x0f : 0xf0); + slave_data = slave_data | ((timings[pio][0] << 2) | (timings[pio][1] + << (HWIF(drive)->index ? 4 : 0))); + } else { + master_data = master_data & 0xccf8; + if (pio > 1) + /* enable PPE, IE and TIME */ + master_data = master_data | 0x0007; + master_data = master_data | (timings[pio][0] << 12) | + (timings[pio][1] << 8); + } + save_flags(flags); + cli(); + pci_write_config_word(HWIF(drive)->pci_dev, master_port, master_data); + if (is_slave) + pci_write_config_byte(HWIF(drive)->pci_dev, slave_port, slave_data); + restore_flags(flags); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA +static int slc90e66_tune_chipset (ide_drive_t *drive, byte speed) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + byte maslave = hwif->channel ? 0x42 : 0x40; + int a_speed = 7 << (drive->dn * 4); + int u_flag = 1 << drive->dn; + int u_speed = 0; + int err = 0; + int sitre; + short reg4042, reg44, reg48, reg4a; + + pci_read_config_word(dev, maslave, ®4042); + sitre = (reg4042 & 0x4000) ? 1 : 0; + pci_read_config_word(dev, 0x44, ®44); + pci_read_config_word(dev, 0x48, ®48); + pci_read_config_word(dev, 0x4a, ®4a); + + switch(speed) { + case XFER_UDMA_4: u_speed = 4 << (drive->dn * 4); break; + case XFER_UDMA_3: u_speed = 3 << (drive->dn * 4); break; + case XFER_UDMA_2: u_speed = 2 << (drive->dn * 4); break; + case XFER_UDMA_1: u_speed = 1 << (drive->dn * 4); break; + case XFER_UDMA_0: u_speed = 0 << (drive->dn * 4); break; + case XFER_MW_DMA_2: + case XFER_MW_DMA_1: + case XFER_SW_DMA_2: break; + default: return -1; + } + + if (speed >= XFER_UDMA_0) { + if (!(reg48 & u_flag)) + pci_write_config_word(dev, 0x48, reg48|u_flag); + if ((reg4a & u_speed) != u_speed) { + pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); + pci_read_config_word(dev, 0x4a, ®4a); + pci_write_config_word(dev, 0x4a, reg4a|u_speed); + } + } + if (speed < XFER_UDMA_0) { + if (reg48 & u_flag) + pci_write_config_word(dev, 0x48, reg48 & ~u_flag); + if (reg4a & a_speed) + pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); + } + + slc90e66_tune_drive(drive, slc90e66_dma_2_pio(speed)); + +#if SLC90E66_DEBUG_DRIVE_INFO + printk("%s: %s drive%d\n", drive->name, ide_xfer_verbose(speed), drive->dn); +#endif /* SLC90E66_DEBUG_DRIVE_INFO */ + if (!drive->init_speed) + drive->init_speed = speed; + err = ide_config_drive_speed(drive, speed); + drive->current_speed = speed; + return err; +} + +static int slc90e66_config_drive_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + int ultra = 1; + byte speed = 0; + byte udma_66 = eighty_ninty_three(drive); + + if ((id->dma_ultra & 0x0010) && (ultra)) { + speed = (udma_66) ? XFER_UDMA_4 : XFER_UDMA_2; + } else if ((id->dma_ultra & 0x0008) && (ultra)) { + speed = (udma_66) ? XFER_UDMA_3 : XFER_UDMA_1; + } else if ((id->dma_ultra & 0x0004) && (ultra)) { + speed = XFER_UDMA_2; + } else if ((id->dma_ultra & 0x0002) && (ultra)) { + speed = XFER_UDMA_1; + } else if ((id->dma_ultra & 0x0001) && (ultra)) { + speed = XFER_UDMA_0; + } else if (id->dma_mword & 0x0004) { + speed = XFER_MW_DMA_2; + } else if (id->dma_mword & 0x0002) { + speed = XFER_MW_DMA_1; + } else if (id->dma_1word & 0x0004) { + speed = XFER_SW_DMA_2; + } else { + speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, 5, NULL); + } + + (void) slc90e66_tune_chipset(drive, speed); + + return ((int) ((id->dma_ultra >> 11) & 7) ? ide_dma_on : + ((id->dma_ultra >> 8) & 7) ? ide_dma_on : + ((id->dma_mword >> 8) & 7) ? ide_dma_on : + ((id->dma_1word >> 8) & 7) ? ide_dma_on : + ide_dma_off_quietly); +} + +static int slc90e66_dmaproc(ide_dma_action_t func, ide_drive_t *drive) +{ + switch (func) { + case ide_dma_check: + return ide_dmaproc((ide_dma_action_t) slc90e66_config_drive_for_dma(drive), drive); + default : + break; + } + /* Other cases are done by generic IDE-DMA code. */ + return ide_dmaproc(func, drive); +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +unsigned int __init pci_init_slc90e66 (struct pci_dev *dev, const char *name) +{ +#if defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) + if (!slc90e66_proc) { + slc90e66_proc = 1; + bmide_dev = dev; + slc90e66_display_info = &slc90e66_get_info; + } +#endif /* DISPLAY_SLC90E66_TIMINGS && CONFIG_PROC_FS */ + return 0; +} + +unsigned int __init ata66_slc90e66 (ide_hwif_t *hwif) +{ +#if 1 + byte reg47 = 0, ata66 = 0; + byte mask = hwif->channel ? 0x02 : 0x01; + + pci_read_config_byte(hwif->pci_dev, 0x47, ®47); + + ata66 = (reg47 & mask) ? 1 : 0; +#else + byte ata66 = 0; +#endif + return ata66; +} + +void __init ide_init_slc90e66 (ide_hwif_t *hwif) +{ + if (!hwif->irq) + hwif->irq = hwif->channel ? 15 : 14; + + hwif->tuneproc = &slc90e66_tune_drive; + hwif->drives[0].autotune = 1; + hwif->drives[1].autotune = 1; + + if (!hwif->dma_base) + return; + +#ifndef CONFIG_BLK_DEV_IDEDMA + hwif->autodma = 0; +#else /* CONFIG_BLK_DEV_IDEDMA */ + hwif->autodma = 1; + hwif->dmaproc = &slc90e66_dmaproc; + hwif->speedproc = &slc90e66_tune_chipset; +#endif /* !CONFIG_BLK_DEV_IDEDMA */ +} diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c index d10353855..8b4aa7244 100644 --- a/drivers/ieee1394/raw1394.c +++ b/drivers/ieee1394/raw1394.c @@ -42,13 +42,13 @@ #endif -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; LIST_HEAD(host_info_list); -static int host_count = 0; +static int host_count; spinlock_t host_info_lock = SPIN_LOCK_UNLOCKED; -static struct hpsb_highlevel *hl_handle = NULL; +static struct hpsb_highlevel *hl_handle; static atomic_t iso_buffer_size; static const int iso_buffer_max = 4 * 1024 * 1024; /* 4 MB */ diff --git a/drivers/input/input.c b/drivers/input/input.c index f3701965e..e121192a6 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -49,12 +49,12 @@ EXPORT_SYMBOL(input_event); #define INPUT_MAJOR 13 #define INPUT_DEVICES 256 -static struct input_dev *input_dev = NULL; -static struct input_handler *input_handler = NULL; -static struct input_handler *input_table[8] = { NULL, /* ... */ }; -static devfs_handle_t input_devfs_handle = NULL; -static int input_number = 0; -static long input_devices[NBITS(INPUT_DEVICES)] = { 0, /* ... */ }; +static struct input_dev *input_dev; +static struct input_handler *input_handler; +static struct input_handler *input_table[8]; +static devfs_handle_t input_devfs_handle; +static int input_number; +static long input_devices[NBITS(INPUT_DEVICES)]; void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) { diff --git a/drivers/isdn/isdn_common.c b/drivers/isdn/isdn_common.c index 5dffb2770..ba2c41eb5 100644 --- a/drivers/isdn/isdn_common.c +++ b/drivers/isdn/isdn_common.c @@ -46,7 +46,7 @@ /* Debugflags */ #undef ISDN_DEBUG_STATCALLB -isdn_dev *dev = (isdn_dev *) 0; +isdn_dev *dev; static char *isdn_revision = "$Revision: 1.111 $"; @@ -65,7 +65,7 @@ static char *isdn_audio_revision = ": none $"; extern char *isdn_v110_revision; #ifdef CONFIG_ISDN_DIVERSION -isdn_divert_if *divert_if = NULL; /* interface to diversion module */ +isdn_divert_if *divert_if; /* interface to diversion module */ #endif CONFIG_ISDN_DIVERSION @@ -2260,7 +2260,7 @@ isdn_getrev(const char *revision) #ifdef CONFIG_DEVFS_FS -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; static void isdn_register_devfs(int k) { diff --git a/drivers/isdn/sc/debug.c b/drivers/isdn/sc/debug.c index c5312cd83..b1bdf57af 100644 --- a/drivers/isdn/sc/debug.c +++ b/drivers/isdn/sc/debug.c @@ -70,6 +70,6 @@ inline void pullphone(char *dn, char *str) int i = 0; while(dn[i] != ',') - str[i] = dn[i++]; + str[i] = dn[i], i++; str[i] = 0x0; } diff --git a/drivers/md/md.c b/drivers/md/md.c index 430532e93..c89314c78 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -60,7 +60,7 @@ extern asmlinkage long sys_setsid(void); # define dprintk(x...) do { } while(0) #endif -static mdk_personality_t *pers[MAX_PERSONALITY] = {NULL, }; +static mdk_personality_t *pers[MAX_PERSONALITY]; /* * Current RAID-1,4,5 parallel reconstruction 'guaranteed speed limit' @@ -105,12 +105,12 @@ struct hd_struct md_hd_struct[MAX_MD_DEVS]; static int md_blocksizes[MAX_MD_DEVS]; static int md_hardsect_sizes[MAX_MD_DEVS]; static int md_maxreadahead[MAX_MD_DEVS]; -static mdk_thread_t *md_recovery_thread = NULL; +static mdk_thread_t *md_recovery_thread; -int md_size[MAX_MD_DEVS] = {0, }; +int md_size[MAX_MD_DEVS]; extern struct block_device_operations md_fops; -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; static struct gendisk md_gendisk= { @@ -136,7 +136,7 @@ static MD_LIST_HEAD(all_mddevs); * one! Eg. HSM uses several sub-devices to implement Logical * Volumes. All these sub-devices map to the same mddev. */ -dev_mapping_t mddev_map [MAX_MD_DEVS] = { {NULL, 0}, }; +dev_mapping_t mddev_map[MAX_MD_DEVS]; void add_mddev_mapping (mddev_t * mddev, kdev_t dev, void *data) { diff --git a/drivers/media/video/tda7432.c b/drivers/media/video/tda7432.c index 488091310..6b8c9063f 100644 --- a/drivers/media/video/tda7432.c +++ b/drivers/media/video/tda7432.c @@ -25,6 +25,10 @@ * Added I2C_DRIVERID_TDA7432 * added loudness insmod control * Revision: 0.1 - initial version + * + * Changes: + * Arnaldo Carvalho de Melo - 08/14/2000 + * - resource allocation fixes in tda7432_attach */ #include @@ -320,8 +324,10 @@ static int tda7432_attach(struct i2c_adapter *adap, int addr, client->addr = addr; client->data = t = kmalloc(sizeof *t,GFP_KERNEL); - if (!t) + if (!t) { + kfree(client); return -ENOMEM; + } memset(t,0,sizeof *t); do_tda7432_init(client); MOD_INC_USE_COUNT; diff --git a/drivers/media/video/tda8425.c b/drivers/media/video/tda8425.c index a1dec22eb..54f1935b6 100644 --- a/drivers/media/video/tda8425.c +++ b/drivers/media/video/tda8425.c @@ -13,6 +13,10 @@ * two stereo inputs, so if someone has this card, could they tell me if the * second one can be used for anything (i.e., does it have an external input * that you can't hear even if you set input to composite?) + * + * Changes: + * Arnaldo Carvalho de Melo - 08/14/2000 + * - resource allocation fixes in tda8425_attach */ #include @@ -148,8 +152,10 @@ static int tda8425_attach(struct i2c_adapter *adap, int addr, client->addr = addr; client->data = tda = kmalloc(sizeof *tda,GFP_KERNEL); - if (!tda) + if (!tda) { + kfree(client); return -ENOMEM; + } memset(tda,0,sizeof *tda); do_tda8425_init(client); MOD_INC_USE_COUNT; diff --git a/drivers/media/video/tda985x.c b/drivers/media/video/tda985x.c index 73fb9bd52..2bf161827 100644 --- a/drivers/media/video/tda985x.c +++ b/drivers/media/video/tda985x.c @@ -11,6 +11,9 @@ * Based on tda9855.c by Steve VanDeBogart (vandebo@uclink.berkeley.edu) * Which was based on tda8425.c by Greg Alexander (c) 1998 * + * Contributors: + * Arnaldo Carvalho de Melo + * * OPTIONS: * debug - set to 1 if you'd like to see debug messages * - set to 2 if you'd like to be flooded with debug messages @@ -22,6 +25,7 @@ * Fine tune sound * Get rest of capabilities into video_audio struct... * + * Revision 0.6 - resource allocation fixes in tda985x_attach (08/14/2000) * Revision 0.5 - cleaned up debugging messages, added debug level=2 * Revision: 0.4 - check for correct chip= insmod value * also cleaned up comments a bit @@ -350,8 +354,10 @@ static int tda985x_attach(struct i2c_adapter *adap, int addr, client->addr = addr; client->data = t = kmalloc(sizeof *t,GFP_KERNEL); - if (!t) + if (!t) { + kfree(client); return -ENOMEM; + } memset(t,0,sizeof *t); do_tda985x_init(client); MOD_INC_USE_COUNT; diff --git a/drivers/media/video/tda9875.c b/drivers/media/video/tda9875.c index 9f6ecd332..7bfc319a6 100644 --- a/drivers/media/video/tda9875.c +++ b/drivers/media/video/tda9875.c @@ -11,9 +11,13 @@ * Based on tda9855.c by Steve VanDeBogart (vandebo@uclink.berkeley.edu) * Which was based on tda8425.c by Greg Alexander (c) 1998 * + * Contributors: + * Arnaldo Carvalho de Melo (0.2) + * * OPTIONS: * debug - set to 1 if you'd like to see debug messages * + * Revision 0.2 - resource allocation fixes in tda9875_attach (08/14/2000) * Revision: 0.1 - original version */ @@ -232,8 +236,10 @@ static int tda9875_attach(struct i2c_adapter *adap, int addr, client->addr = addr; client->data = t = kmalloc(sizeof *t,GFP_KERNEL); - if (!t) + if (!t) { + kfree(client); return -ENOMEM; + } memset(t,0,sizeof *t); do_tda9875_init(client); MOD_INC_USE_COUNT; diff --git a/drivers/media/video/tea6300.c b/drivers/media/video/tea6300.c index f5949c94f..9dc13e610 100644 --- a/drivers/media/video/tea6300.c +++ b/drivers/media/video/tea6300.c @@ -15,6 +15,10 @@ * balance (different left,right values) and, if someone ever finds a card * with the support (or if you're careful with a soldering iron), fade * (front/back). + * + * Changes: + * Arnaldo Carvalho de Melo - 08/14/2000 + * - resource allocation fixes in tea6300_attach */ #include @@ -170,8 +174,10 @@ static int tea6300_attach(struct i2c_adapter *adap, int addr, client->addr = addr; client->data = tea = kmalloc(sizeof *tea,GFP_KERNEL); - if (!tea) + if (!tea) { + kfree(client); return -ENOMEM; + } memset(tea,0,sizeof *tea); do_tea6300_init(client); diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c index 32e15dd44..da7d27ac5 100644 --- a/drivers/net/3c515.c +++ b/drivers/net/3c515.c @@ -90,7 +90,7 @@ MODULE_PARM(max_interrupt_work, "i"); #define DRIVER_DEBUG 1 /* Some values here only for performance evaluation and path-coverage debugging. */ -static int rx_nocopy = 0, rx_copy = 0, queued_packet = 0; +static int rx_nocopy, rx_copy, queued_packet; /* Number of times to check to see if the Tx FIFO has space, used in some limited cases. */ @@ -364,7 +364,7 @@ int corkscrew_isapnp_phys_addr[3] = { 0, 0, 0 }; -static int nopnp = 0; +static int nopnp; #endif static int corkscrew_scan(struct net_device *dev); diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index c62617f55..1eefdfb71 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c @@ -222,7 +222,7 @@ MODULE_PARM(watchdog, "i"); /* Set iff a MII transceiver on any interface requires mdio preamble. This only set with the original DP83840 on older 3c905 boards, so the extra code size of a per-interface flag is not worthwhile. */ -static char mii_preamble_required = 0; +static char mii_preamble_required; #define PFX "3c59x: " @@ -740,12 +740,12 @@ static int flow_ctrl[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; /* #define dev_alloc_skb dev_alloc_skb_debug */ /* A list of all installed Vortex EISA devices, for removing the driver module. */ -static struct net_device *root_vortex_eisa_dev = NULL; +static struct net_device *root_vortex_eisa_dev; /* Variables to work-around the Compaq PCI BIOS32 problem. */ -static int compaq_ioaddr = 0, compaq_irq = 0, compaq_device_id = 0x5900; +static int compaq_ioaddr, compaq_irq, compaq_device_id = 0x5900; -static int vortex_cards_found = 0; +static int vortex_cards_found; static void vortex_suspend (struct pci_dev *pdev) { @@ -853,7 +853,7 @@ static int __devinit vortex_probe1(struct pci_dev *pdev, unsigned int eeprom[0x40], checksum = 0; /* EEPROM contents */ int i; struct net_device *dev; - static int printed_version = 0; + static int printed_version; int retval; struct vortex_chip_info * const vci = &vortex_info_tbl[chip_idx]; @@ -1616,7 +1616,7 @@ vortex_error(struct net_device *dev, int status) outw(AckIntr | RxEarly, ioaddr + EL3_CMD); } if (status & StatsFull) { /* Empty statistics. */ - static int DoneDidThat = 0; + static int DoneDidThat; if (vortex_debug > 4) printk(KERN_DEBUG "%s: Updating stats.\n", dev->name); update_stats(ioaddr, dev); @@ -2573,8 +2573,8 @@ static struct pci_driver vortex_driver = { }; -static int vortex_have_pci = 0; -static int vortex_have_eisa = 0; +static int vortex_have_pci; +static int vortex_have_eisa; static int __init vortex_init (void) diff --git a/drivers/net/Config.in b/drivers/net/Config.in index 54f641447..43c838d0a 100644 --- a/drivers/net/Config.in +++ b/drivers/net/Config.in @@ -52,6 +52,9 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then if [ "$CONFIG_SGI_IP27" = "y" ]; then bool ' SGI IOC3 Ethernet' CONFIG_SGI_IOC3_ETH fi + if [ "CONFIG_IA64_SGI_SN1" = "y" ]; then + bool ' SGI IOC3 Ethernet' CONFIG_SGI_IOC3_ETH + fi if [ "$CONFIG_SUPERH" = "y" ]; then tristate ' National DP83902AV support' CONFIG_STNIC fi diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c index a89bff2b8..498bd523f 100644 --- a/drivers/net/a2065.c +++ b/drivers/net/a2065.c @@ -749,7 +749,6 @@ static int __init a2065_probe(void) sizeof(struct lance_regs)); continue; } - strcpy(z->name, "A2065 Ethernet Card"); dev = init_etherdev(NULL, sizeof(struct lance_private)); diff --git a/drivers/net/aironet4500_card.c b/drivers/net/aironet4500_card.c index d6a9c505d..11b6e2773 100644 --- a/drivers/net/aironet4500_card.c +++ b/drivers/net/aironet4500_card.c @@ -60,7 +60,7 @@ static const char *awc_version = #include -static int reverse_probe =0 ; +static int reverse_probe; static int awc_pci_init(struct net_device * dev, struct pci_dev *pdev, @@ -70,7 +70,7 @@ static int awc_pci_init(struct net_device * dev, struct pci_dev *pdev, int awc4500_pci_probe(struct net_device *dev) { int cards_found = 0; - static int pci_index = 0; /* Static, for multiple probe calls. */ + static int pci_index; /* Static, for multiple probe calls. */ u8 pci_irq_line = 0; // int p; @@ -491,7 +491,7 @@ MODULE_PARM_DESC(io,"Aironet 4x00 ISA non-PNP ioports,required"); int awc4500_isa_probe(struct net_device *dev) { // int cards_found = 0; -// static int isa_index = 0; /* Static, for multiple probe calls. */ +// static int isa_index; /* Static, for multiple probe calls. */ int isa_irq_line = 0; int isa_ioaddr = 0; // int p; diff --git a/drivers/net/aironet4500_core.c b/drivers/net/aironet4500_core.c index b937af2b3..c5def9e39 100644 --- a/drivers/net/aironet4500_core.c +++ b/drivers/net/aironet4500_core.c @@ -45,8 +45,8 @@ int bap_sleep_after_setup = 1; int sleep_before_command = 1; int bap_sleep_before_write= 1; int sleep_in_command = 1; -int both_bap_lock =0; /* activated at awc_init in this */ -int bap_setup_spinlock =0; /* file if numcpu >1 */ +int both_bap_lock; /* activated at awc_init in this */ +int bap_setup_spinlock; /* file if numcpu >1 */ EXPORT_SYMBOL(bap_sleep); EXPORT_SYMBOL(bap_sleep_after_setup); @@ -1386,7 +1386,7 @@ awc_802_11_find_copy_path(struct net_device * dev, struct awc_fid * rx_buff){ */ -int parse_not_8023= 0; +int parse_not_8023; void awc_802_11_router_rx(struct net_device * dev,struct awc_fid * rx_buff){ @@ -2539,25 +2539,25 @@ bad_end: static const char *aironet4500_core_version = "aironet4500.c v0.1 1/1/99 Elmer Joandi, elmer@ylenurme.ee.\n"; -struct net_device * aironet4500_devices[MAX_AWCS] = {NULL,NULL,NULL,NULL}; +struct net_device * aironet4500_devices[MAX_AWCS]; -int awc_debug = 0; // 0xffffff; -static int p802_11_send = 0; // 1 +int awc_debug; // 0xffffff; +static int p802_11_send; // 1 -static int awc_process_tx_results = 0; +static int awc_process_tx_results; int tx_queue_len = 10; -int tx_rate = 0; +int tx_rate; int channel = 5; -//static int tx_full_rate = 0; +//static int tx_full_rate; int max_mtu = 2312; -int adhoc = 0; +int adhoc; int large_buff_mem = 1700 * 10; int small_buff_no = 20; -int awc_full_stats = 0; -char SSID[33] = {0}; -int master= 0; -int slave = 0; -int awc_simple_bridge = 0; +int awc_full_stats; +char SSID[33]; +int master; +int slave; +int awc_simple_bridge; // int debug =0; #if LINUX_VERSION_CODE >= 0x20100 @@ -3029,7 +3029,7 @@ void awc_tx_timeout (struct net_device *dev) } -long long last_tx_q_hack = 0; +long long last_tx_q_hack; int direction = 1; int awc_start_xmit(struct sk_buff *skb, struct net_device *dev) { @@ -3213,8 +3213,8 @@ awc_set_multicast_list(struct net_device *dev) { -int (* awc_proc_set_fun) (int) = NULL; -int (* awc_proc_unset_fun) (int) = NULL; +int (* awc_proc_set_fun) (int); +int (* awc_proc_unset_fun) (int); int awc_register_proc(int (*awc_proc_set_device)(int),int (*awc_proc_unset_device)(int)){ diff --git a/drivers/net/ariadne.c b/drivers/net/ariadne.c index f4a3835be..af06e74f6 100644 --- a/drivers/net/ariadne.c +++ b/drivers/net/ariadne.c @@ -168,7 +168,6 @@ static int __init ariadne_probe(void) release_mem_region(base_addr, sizeof(struct Am79C960)); continue; } - strcpy(z->name, "Ariadne Ethernet Card and Parallel Ports"); dev = init_etherdev(NULL, sizeof(struct ariadne_private)); diff --git a/drivers/net/ariadne2.c b/drivers/net/ariadne2.c index c736c0410..1ddb28c9e 100644 --- a/drivers/net/ariadne2.c +++ b/drivers/net/ariadne2.c @@ -95,7 +95,6 @@ int __init ariadne2_probe(struct net_device *dev) release_mem_region(ioaddr, NE_IO_EXTENT*2); return err; } - strcpy(z->name, "AriadNE2 Ethernet"); return 0; } return -ENODEV; diff --git a/drivers/net/arlan.c b/drivers/net/arlan.c index b1a4549de..dfa7c218b 100644 --- a/drivers/net/arlan.c +++ b/drivers/net/arlan.c @@ -11,7 +11,7 @@ static const char *arlan_version = "C.Jennigs 97 & Elmer.Joandi@ut.ee Oct'98, http://www.ylenurme.ee/~elmer/655/"; struct net_device *arlan_device[MAX_ARLANS]; -int last_arlan = 0; +int last_arlan; static int SID = SIDUNKNOWN; static int radioNodeId = radioNodeIdUNKNOWN; @@ -26,22 +26,22 @@ static int channelNumber = channelNumberUNKNOWN; static int channelSet = channelSetUNKNOWN; static int systemId = systemIdUNKNOWN; static int registrationMode = registrationModeUNKNOWN; -static int keyStart = 0; -static int tx_delay_ms = 0; +static int keyStart; +static int tx_delay_ms; static int retries = 5; static int async = 1; static int tx_queue_len = 1; -static int arlan_EEPROM_bad = 0; -int arlan_entry_and_exit_debug = 0; +static int arlan_EEPROM_bad; +int arlan_entry_and_exit_debug; #ifdef ARLAN_DEBUGING -static int arlan_entry_debug = 0; -static int arlan_exit_debug = 0; +static int arlan_entry_debug; +static int arlan_exit_debug; static int testMemory = testMemoryUNKNOWN; static int irq = irqUNKNOWN; static int txScrambled = 1; -static int mdebug = 0; +static int mdebug; #endif #if LINUX_VERSION_CODE > 0x20100 @@ -87,7 +87,7 @@ EXPORT_SYMBOL(last_arlan); #endif struct arlan_conf_stru arlan_conf[MAX_ARLANS]; -int arlans_found = 0; +int arlans_found; static int arlan_probe_here(struct net_device *dev, int ioaddr); static int arlan_open(struct net_device *dev); diff --git a/drivers/net/daynaport.c b/drivers/net/daynaport.c index f94b189fb..b7718aba5 100644 --- a/drivers/net/daynaport.c +++ b/drivers/net/daynaport.c @@ -25,7 +25,7 @@ static const char *version = "daynaport.c: v0.02 1999-05-17 Alan Cox (Alan.Cox@linux.org) and others\n"; -static int version_printed = 0; +static int version_printed; #include #include diff --git a/drivers/net/depca.c b/drivers/net/depca.c index 196c81126..eb78e1e0e 100644 --- a/drivers/net/depca.c +++ b/drivers/net/depca.c @@ -463,12 +463,12 @@ static u_char de1xx_irq[] __initdata = {2,3,4,5,7,9,0}; static u_char de2xx_irq[] __initdata = {5,9,10,11,15,0}; static u_char de422_irq[] __initdata = {5,9,10,11,0}; static u_char *depca_irq; -static int autoprobed = 0, loading_module = 0; +static int autoprobed, loading_module; #endif /* MODULE */ static char name[DEPCA_STRLEN]; -static int num_depcas = 0, num_eth = 0; -static int mem=0; /* For loadable module assignment +static int num_depcas, num_eth; +static int mem; /* For loadable module assignment use insmod mem=0x????? .... */ static char *adapter_name = '\0'; /* If no PROM when loadable module use insmod adapter_name=DE??? ... @@ -908,12 +908,12 @@ static void depca_interrupt (int irq, void *dev_id, struct pt_regs *regs) /* Any resources available? */ if ((TX_BUFFS_AVAIL >= 0) && netif_queue_stopped(dev)) { netif_wake_queue (dev); - - /* Unmask the DEPCA board interrupts and turn off the LED */ - nicsr = (nicsr & ~IM & ~LED); - outb (nicsr, DEPCA_NICSR); } + /* Unmask the DEPCA board interrupts and turn off the LED */ + nicsr = (nicsr & ~IM & ~LED); + outb (nicsr, DEPCA_NICSR); + spin_unlock (&lp->lock); } diff --git a/drivers/net/e2100.c b/drivers/net/e2100.c index ab425dfee..feea0ca03 100644 --- a/drivers/net/e2100.c +++ b/drivers/net/e2100.c @@ -390,10 +390,10 @@ static struct net_device dev_e21[MAX_E21_CARDS] = { }, }; -static int io[MAX_E21_CARDS] = { 0, }; -static int irq[MAX_E21_CARDS] = { 0, }; -static int mem[MAX_E21_CARDS] = { 0, }; -static int xcvr[MAX_E21_CARDS] = { 0, }; /* choose int. or ext. xcvr */ +static int io[MAX_E21_CARDS]; +static int irq[MAX_E21_CARDS]; +static int mem[MAX_E21_CARDS]; +static int xcvr[MAX_E21_CARDS]; /* choose int. or ext. xcvr */ MODULE_PARM(io, "1-" __MODULE_STRING(MAX_E21_CARDS) "i"); MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_E21_CARDS) "i"); diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c index af419c80e..6ba26b3b9 100644 --- a/drivers/net/eepro100.c +++ b/drivers/net/eepro100.c @@ -34,12 +34,12 @@ static const char *version = /* A few user-configurable values that apply to all boards. First set is undocumented and spelled per Intel recommendations. */ -static int congenb = 0; /* Enable congestion control in the DP83840. */ +static int congenb; /* Enable congestion control in the DP83840. */ static int txfifo = 8; /* Tx FIFO threshold in 4 byte units, 0-15 */ static int rxfifo = 8; /* Rx FIFO threshold, default 32 bytes. */ /* Tx/Rx DMA burst length, 0-127, 0 == no preemption, tx==128 -> disabled. */ static int txdmacount = 128; -static int rxdmacount = 0; +static int rxdmacount; /* Set the copy breakpoint for the copy-only-tiny-buffer Rx method. Lower values use more memory, but are faster. */ @@ -611,9 +611,9 @@ static int __devinit eepro100_init_one (struct pci_dev *pdev, unsigned long ioaddr; int irq; int acpi_idle_state = 0, pm; - static int cards_found = 0; + static int cards_found; - static int did_version = 0; /* Already printed version info. */ + static int did_version; /* Already printed version info. */ if (speedo_debug > 0 && did_version++ == 0) printk(version); diff --git a/drivers/net/es3210.c b/drivers/net/es3210.c index cabe97e14..daf757665 100644 --- a/drivers/net/es3210.c +++ b/drivers/net/es3210.c @@ -388,9 +388,9 @@ static struct net_device dev_es3210[MAX_ES_CARDS] = { }, }; -static int io[MAX_ES_CARDS] = { 0, }; -static int irq[MAX_ES_CARDS] = { 0, }; -static int mem[MAX_ES_CARDS] = { 0, }; +static int io[MAX_ES_CARDS]; +static int irq[MAX_ES_CARDS]; +static int mem[MAX_ES_CARDS]; MODULE_PARM(io, "1-" __MODULE_STRING(MAX_ES_CARDS) "i"); MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_ES_CARDS) "i"); diff --git a/drivers/net/hydra.c b/drivers/net/hydra.c index fd2c79235..e12f65a79 100644 --- a/drivers/net/hydra.c +++ b/drivers/net/hydra.c @@ -178,7 +178,6 @@ int __init hydra_probe(struct net_device *dev) release_mem_region(base_addr, 0x20); continue; } - strcpy(z->name, "Hydra Ethernet Card"); dev = init_etherdev(NULL, sizeof(struct hydra_private)); diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c index 57d57d339..834300c28 100644 --- a/drivers/net/irda/nsc-ircc.c +++ b/drivers/net/irda/nsc-ircc.c @@ -74,7 +74,7 @@ static char *driver_name = "nsc-ircc"; /* Module parameters */ static int qos_mtt_bits = 0x07; /* 1 ms or more */ -static int dongle_id = 0; +static int dongle_id; /* Use BIOS settions by default, but user may supply module parameters */ static unsigned int io[] = { ~0, ~0, ~0, ~0 }; diff --git a/drivers/net/lne390.c b/drivers/net/lne390.c index 6cfd71f15..c1674c550 100644 --- a/drivers/net/lne390.c +++ b/drivers/net/lne390.c @@ -382,9 +382,9 @@ static struct net_device dev_lne[MAX_LNE_CARDS] = { }, }; -static int io[MAX_LNE_CARDS] = { 0, }; -static int irq[MAX_LNE_CARDS] = { 0, }; -static int mem[MAX_LNE_CARDS] = { 0, }; +static int io[MAX_LNE_CARDS]; +static int irq[MAX_LNE_CARDS]; +static int mem[MAX_LNE_CARDS]; MODULE_PARM(io, "1-" __MODULE_STRING(MAX_LNE_CARDS) "i"); MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_LNE_CARDS) "i"); diff --git a/drivers/net/ne3210.c b/drivers/net/ne3210.c index 1fceea2fd..6c32ccb72 100644 --- a/drivers/net/ne3210.c +++ b/drivers/net/ne3210.c @@ -369,9 +369,9 @@ static struct net_device dev_ne3210[MAX_NE3210_CARDS] = { }, }; -static int io[MAX_NE3210_CARDS] = { 0, }; -static int irq[MAX_NE3210_CARDS] = { 0, }; -static int mem[MAX_NE3210_CARDS] = { 0, }; +static int io[MAX_NE3210_CARDS]; +static int irq[MAX_NE3210_CARDS]; +static int mem[MAX_NE3210_CARDS]; MODULE_PARM(io, "1-" __MODULE_STRING(MAX_NE3210_CARDS) "i"); MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_NE3210_CARDS) "i"); diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index 7f3f76ebf..1fd7d3445 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c @@ -117,7 +117,7 @@ static int irq_list[4] = { -1 }; static int max_interrupt_work = 32; /* Force full duplex modes? */ -static int full_duplex = 0; +static int full_duplex; /* To minimize the size of the driver source and make the driver more readable not all constants are symbolically defined. diff --git a/drivers/net/pcmcia/xircom_tulip_cb.c b/drivers/net/pcmcia/xircom_tulip_cb.c index aff697033..c5f5d34de 100644 --- a/drivers/net/pcmcia/xircom_tulip_cb.c +++ b/drivers/net/pcmcia/xircom_tulip_cb.c @@ -28,9 +28,9 @@ static int max_interrupt_work = 25; #define MAX_UNITS 8 /* Used to pass the full-duplex flag, etc. */ -static int full_duplex[MAX_UNITS] = {0, }; -static int options[MAX_UNITS] = {0, }; -static int mtu[MAX_UNITS] = {0, }; /* Jumbo MTU for interfaces. */ +static int full_duplex[MAX_UNITS]; +static int options[MAX_UNITS]; +static int mtu[MAX_UNITS]; /* Jumbo MTU for interfaces. */ /* The possible media types that can be set in options[] are: */ static const char * const medianame[] = { @@ -506,12 +506,12 @@ static struct net_device *tulip_probe1(struct pci_dev *pdev, struct net_device *dev, long ioaddr, int irq, int chip_idx, int board_idx) { - static int did_version = 0; /* Already printed version info. */ + static int did_version; /* Already printed version info. */ struct tulip_private *tp; /* See note below on the multiport cards. */ static unsigned char last_phys_addr[6] = {0x00, 'L', 'i', 'n', 'u', 'x'}; - static int last_irq = 0; - static int multiport_cnt = 0; /* For four-port boards w/one EEPROM */ + static int last_irq; + static int multiport_cnt; /* For four-port boards w/one EEPROM */ u8 chip_rev; int i; unsigned short sum; @@ -913,9 +913,9 @@ static const char * block_name[] = {"21140 non-MII", "21140 MII PHY", static void parse_eeprom(struct net_device *dev) { /* The last media info list parsed, for multiport boards. */ - static struct mediatable *last_mediatable = NULL; - static unsigned char *last_ee_data = NULL; - static int controller_index = 0; + static struct mediatable *last_mediatable; + static unsigned char *last_ee_data; + static int controller_index; struct tulip_private *tp = (struct tulip_private *)dev->priv; long ioaddr = dev->base_addr; unsigned char *ee_data = tp->eeprom; @@ -3074,7 +3074,7 @@ MODULE_DEVICE_TABLE(pci, tulip_pci_table); static int __devinit tulip_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) { struct net_device *dev; - static int board_idx = 0; + static int board_idx; printk(KERN_INFO "tulip_attach(%s)\n", pdev->slot_name); diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index 9be388cf8..976dd5781 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c @@ -42,7 +42,7 @@ static unsigned int pcnet32_portlist[] __initdata = {0x300, 0x320, 0x340, 0x360, static int pcnet32_debug = 1; static int tx_start = 1; /* Mapping -- 0:20, 1:64, 2:128, 3:~220 (depends on chip vers) */ -static struct net_device *pcnet32_dev = NULL; +static struct net_device *pcnet32_dev; static const int max_interrupt_work = 80; static const int rx_copybreak = 200; @@ -83,8 +83,8 @@ static unsigned char options_mapping[] = { }; #define MAX_UNITS 8 -static int options[MAX_UNITS] = {0, }; -static int full_duplex[MAX_UNITS] = {0, }; +static int options[MAX_UNITS]; +static int full_duplex[MAX_UNITS]; /* * Theory of Operation @@ -476,7 +476,7 @@ static int __init pcnet32_probe_vlbus(int cards_found) static int __init pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent) { - static int card_idx = 0; + static int card_idx; long ioaddr; int err = 0; diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index f59653eef..98b7db0f8 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c @@ -709,7 +709,7 @@ static struct file_operations ppp_device_fops = { #define PPP_MAJOR 108 -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; /* Called at boot time if ppp is compiled into the kernel, or at module load time (from init_module) if compiled as a module. */ diff --git a/drivers/net/pppox.c b/drivers/net/pppox.c index ac358ff21..50cdd2fee 100644 --- a/drivers/net/pppox.c +++ b/drivers/net/pppox.c @@ -142,8 +142,6 @@ struct net_proto_family pppox_proto_family = { pppox_create }; -extern int pppoe_init (void); - int __init pppox_init(void) { int err = 0; @@ -152,7 +150,6 @@ int __init pppox_init(void) if (err == 0) { printk(KERN_INFO "Registered PPPoX v0.5\n"); - pppoe_init(); } return err; diff --git a/drivers/net/rclanmtl.c b/drivers/net/rclanmtl.c index c1c79247e..2721cb05e 100644 --- a/drivers/net/rclanmtl.c +++ b/drivers/net/rclanmtl.c @@ -311,14 +311,7 @@ PAB, *PPAB; ** Indexed by a zero based (0-31) interface number. */ #define MAX_ADAPTERS 32 -static PPAB PCIAdapterBlock[MAX_ADAPTERS] = -{ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL -}; - +static PPAB PCIAdapterBlock[MAX_ADAPTERS]; /* ** typedef NICSTAT diff --git a/drivers/net/rclanmtl.h b/drivers/net/rclanmtl.h index 2e594440c..3e7e1ecb4 100644 --- a/drivers/net/rclanmtl.h +++ b/drivers/net/rclanmtl.h @@ -38,6 +38,7 @@ #define RCLANMTL_H /* Linux specific includes */ +#include #define kprintf printk #ifdef RC_LINUX_MODULE /* linux modules need non-library version of string functions */ #include @@ -68,12 +69,12 @@ #define WARM_REBOOT_CAPABLE 0x01 /* scalar data types */ -typedef unsigned char U8; -typedef unsigned char* PU8; -typedef unsigned short U16; -typedef unsigned short* PU16; -typedef unsigned long U32; -typedef unsigned long* PU32; +typedef __u8 U8; +typedef __u16 U16; +typedef __u32 U32; +typedef __u8* PU8; +typedef __u16* PU16; +typedef __u32* PU32; typedef unsigned long BF; typedef int RC_RETURN; diff --git a/drivers/net/rcpci45.c b/drivers/net/rcpci45.c index e4e2d1160..666078eec 100644 --- a/drivers/net/rcpci45.c +++ b/drivers/net/rcpci45.c @@ -135,14 +135,7 @@ DPA, *PDPA; #define MAX_ADAPTERS 32 -static PDPA PCIAdapters[MAX_ADAPTERS] = -{ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL -}; - +static PDPA PCIAdapters[MAX_ADAPTERS]; static int RCinit(struct net_device *dev); static int RCscan(void); @@ -163,7 +156,7 @@ static int RC_allocate_and_post_buffers(struct net_device *, int); /* A list of all installed RC devices, for removing the driver module. */ -static struct net_device *root_RCdev = NULL; +static struct net_device *root_RCdev; static int __init rcpci_init_module (void) { @@ -178,7 +171,7 @@ static int __init rcpci_init_module (void) static int RCscan(void) { int cards_found = 0; - static int pci_index = 0; + static int pci_index; if (!pcibios_present()) return cards_found; @@ -816,7 +809,7 @@ static void rc_timer(unsigned long data) struct net_device *dev = (struct net_device *)data; PDPA pDpa = (PDPA) (dev->priv); int init_status; - static int retry = 0; + static int retry; int post_buffers = MAX_NMBR_RCV_BUFFERS; int count = 0; int requested = 0; @@ -1111,7 +1104,7 @@ static int RCioctl(struct net_device *dev, struct ifreq *rq, int cmd) } RCUD_GETSPEED = &RCuser.RCUS_GETSPEED; RCGetLinkSpeed(pDpa->id, (PU32) &RCUD_GETSPEED->LinkSpeedCode, NULL); - printk("RC speed = 0x%ld\n", RCUD_GETSPEED->LinkSpeedCode); + printk("RC speed = 0x%u\n", RCUD_GETSPEED->LinkSpeedCode); break; case RCUC_SETIPANDMASK: printk("RC SETIPANDMASK\n"); diff --git a/drivers/net/skeleton.c b/drivers/net/skeleton.c index 8d6b193a2..9f79b8318 100644 --- a/drivers/net/skeleton.c +++ b/drivers/net/skeleton.c @@ -662,9 +662,9 @@ static struct net_device this_device = { 0, 0, 0, NULL, netcard_probe }; static int io = 0x300; -static int irq = 0; -static int dma = 0; -static int mem = 0; +static int irq; +static int dma; +static int mem; int init_module(void) { diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c index fb6d438d0..9a0315f0c 100644 --- a/drivers/net/tokenring/ibmtr.c +++ b/drivers/net/tokenring/ibmtr.c @@ -1861,8 +1861,8 @@ int ibmtr_change_mtu(struct net_device *dev, int mtu) { /* 3COM 3C619C supports 8 interrupts, 32 I/O ports */ static struct net_device* dev_ibmtr[IBMTR_MAX_ADAPTERS]; static int io[IBMTR_MAX_ADAPTERS] = {0xa20,0xa24}; -static int irq[IBMTR_MAX_ADAPTERS] = {0,0}; -static int mem[IBMTR_MAX_ADAPTERS] = {0,0}; +static int irq[IBMTR_MAX_ADAPTERS]; +static int mem[IBMTR_MAX_ADAPTERS]; MODULE_PARM(io, "1-" __MODULE_STRING(IBMTR_MAX_ADAPTERS) "i"); MODULE_PARM(irq, "1-" __MODULE_STRING(IBMTR_MAX_ADAPTERS) "i"); diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c index 83024732a..32a596d2a 100644 --- a/drivers/net/tokenring/smctr.c +++ b/drivers/net/tokenring/smctr.c @@ -5801,9 +5801,9 @@ static int smctr_wait_while_cbusy(struct net_device *dev) #ifdef MODULE static struct net_device* dev_smctr[SMCTR_MAX_ADAPTERS]; -static int io[SMCTR_MAX_ADAPTERS] = { 0, 0 }; -static int irq[SMCTR_MAX_ADAPTERS] = { 0, 0 }; -static int mem[SMCTR_MAX_ADAPTERS] = { 0, 0 }; +static int io[SMCTR_MAX_ADAPTERS]; +static int irq[SMCTR_MAX_ADAPTERS]; +static int mem[SMCTR_MAX_ADAPTERS]; MODULE_PARM(io, "1-" __MODULE_STRING(SMCTR_MAX_ADAPTERS) "i"); MODULE_PARM(irq, "1-" __MODULE_STRING(SMCTR_MAX_ADAPTERS) "i"); diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 22dd24ab2..19d4f8f5e 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c @@ -38,9 +38,9 @@ static int max_interrupt_work = 25; #define MAX_UNITS 8 /* Used to pass the full-duplex flag, etc. */ -static int full_duplex[MAX_UNITS] = {0, }; -static int options[MAX_UNITS] = {0, }; -static int mtu[MAX_UNITS] = {0, }; /* Jumbo MTU for interfaces. */ +static int full_duplex[MAX_UNITS]; +static int options[MAX_UNITS]; +static int mtu[MAX_UNITS]; /* Jumbo MTU for interfaces. */ /* The possible media types that can be set in options[] are: */ const char * const medianame[] = { @@ -924,18 +924,20 @@ static void set_rx_mode(struct net_device *dev) i++, mclist = mclist->next) set_bit(ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff, hash_table); - for (i = 0; i < 32; i++) - *setup_frm++ = *setup_frm++ = hash_table[i]; + for (i = 0; i < 32; i++) { + *setup_frm++ = hash_table[i]; + *setup_frm++ = hash_table[i]; + } setup_frm = &tp->setup_frame[13*6]; } else { /* We have <= 14 addresses so we can use the wonderful 16 address perfect filtering of the Tulip. */ for (i = 0, mclist = dev->mc_list; i < dev->mc_count; i++, mclist = mclist->next) { - eaddrs = (u16 *)mclist->dmi_addr; - *setup_frm++ = *setup_frm++ = *eaddrs++; - *setup_frm++ = *setup_frm++ = *eaddrs++; - *setup_frm++ = *setup_frm++ = *eaddrs++; + u16 *eaddrs = (u16 *)mclist->dmi_addr; + *setup_frm++ = eaddrs[0]; *setup_frm++ = eaddrs[0]; + *setup_frm++ = eaddrs[1]; *setup_frm++ = eaddrs[1]; + *setup_frm++ = eaddrs[2]; *setup_frm++ = eaddrs[2]; } /* Fill the unused entries with the broadcast address. */ memset(setup_frm, 0xff, (15-i)*12); @@ -944,9 +946,9 @@ static void set_rx_mode(struct net_device *dev) /* Fill the final entry with our physical address. */ eaddrs = (u16 *)dev->dev_addr; - *setup_frm++ = *setup_frm++ = eaddrs[0]; - *setup_frm++ = *setup_frm++ = eaddrs[1]; - *setup_frm++ = *setup_frm++ = eaddrs[2]; + *setup_frm++ = eaddrs[0]; *setup_frm++ = eaddrs[0]; + *setup_frm++ = eaddrs[1]; *setup_frm++ = eaddrs[1]; + *setup_frm++ = eaddrs[2]; *setup_frm++ = eaddrs[2]; spin_lock_irqsave(&tp->lock, flags); @@ -1010,12 +1012,12 @@ static void set_rx_mode(struct net_device *dev) static int __devinit tulip_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) { - static int did_version = 0; /* Already printed version info. */ + static int did_version; /* Already printed version info. */ struct tulip_private *tp; /* See note below on the multiport cards. */ static unsigned char last_phys_addr[6] = {0x00, 'L', 'i', 'n', 'u', 'x'}; - static int last_irq = 0; - static int multiport_cnt = 0; /* For four-port boards w/one EEPROM */ + static int last_irq; + static int multiport_cnt; /* For four-port boards w/one EEPROM */ u8 chip_rev; int i, irq; unsigned short sum; diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index 5ab238eb0..e4fa70c31 100644 --- a/drivers/net/wan/cosa.c +++ b/drivers/net/wan/cosa.c @@ -228,7 +228,7 @@ static int cosa_major = 117; /* Maybe the following should be allocated dynamically */ static struct cosa_data cosa_cards[MAX_CARDS]; -static int nr_cards = 0; +static int nr_cards; #ifdef COSA_ISA_AUTOPROBE static int io[MAX_CARDS+1] = { 0x220, 0x228, 0x210, 0x218, 0, }; @@ -365,7 +365,7 @@ static void debug_status_out(struct cosa_data *cosa, int status); /* ---------- Initialization stuff ---------- */ -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; #ifdef MODULE int init_module(void) @@ -1387,7 +1387,7 @@ static void cosa_kick(struct cosa_data *cosa) */ static int cosa_dma_able(struct channel_data *chan, char *buf, int len) { - static int count = 0; + static int count; unsigned long b = (unsigned long)buf; if (b+len >= MAX_DMA_ADDRESS) return 0; diff --git a/drivers/net/wan/sdlamain.c b/drivers/net/wan/sdlamain.c index 6d46b2e46..520b1341a 100644 --- a/drivers/net/wan/sdlamain.c +++ b/drivers/net/wan/sdlamain.c @@ -102,8 +102,8 @@ static char drvname[] = "wanpipe"; static char fullname[] = "WANPIPE(tm) Multiprotocol Driver"; static char copyright[] = "(c) 1995-1999 Sangoma Technologies Inc."; static int ncards = CONFIG_WANPIPE_CARDS; -static int active = 0; /* number of active cards */ -static sdla_t* card_array = NULL; /* adapter data space */ +static int active; /* number of active cards */ +static sdla_t* card_array; /* adapter data space */ /* Task queue element for creating a 'thread' */ static struct tq_struct sdla_tq = diff --git a/drivers/net/wd.c b/drivers/net/wd.c index 8ce05ba8d..92a614a39 100644 --- a/drivers/net/wd.c +++ b/drivers/net/wd.c @@ -447,10 +447,10 @@ static struct net_device dev_wd[MAX_WD_CARDS] = { }, }; -static int io[MAX_WD_CARDS] = { 0, }; -static int irq[MAX_WD_CARDS] = { 0, }; -static int mem[MAX_WD_CARDS] = { 0, }; -static int mem_end[MAX_WD_CARDS] = { 0, }; /* for non std. mem size */ +static int io[MAX_WD_CARDS]; +static int irq[MAX_WD_CARDS]; +static int mem[MAX_WD_CARDS]; +static int mem_end[MAX_WD_CARDS]; /* for non std. mem size */ MODULE_PARM(io, "1-" __MODULE_STRING(MAX_WD_CARDS) "i"); MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_WD_CARDS) "i"); diff --git a/drivers/parport/parport_mfc3.c b/drivers/parport/parport_mfc3.c index 054bb4d89..19045439e 100644 --- a/drivers/parport/parport_mfc3.c +++ b/drivers/parport/parport_mfc3.c @@ -343,7 +343,6 @@ int __init parport_mfc3_init(void) unsigned long piabase = z->resource.start+PIABASE; if (!request_mem_region(piabase, sizeof(struct pia), "PIA")) continue; - strcpy(z->name, "MultiFace III MC6821 PIA"); pp = (struct pia *)ZTWO_VADDR(piabase); if (pias < MAX_MFC) { pp->crb = 0; diff --git a/drivers/pci/gen-devlist.c b/drivers/pci/gen-devlist.c index 9b2c652ac..586ef3d2d 100644 --- a/drivers/pci/gen-devlist.c +++ b/drivers/pci/gen-devlist.c @@ -115,7 +115,7 @@ main(void) #undef VENDOR\n\ #undef DEVICE\n\ #undef ENDVENDOR\n", devf); - fputs("\n#undef CLASS", clsf); + fputs("\n#undef CLASS\n", clsf); fclose(devf); fclose(clsf); diff --git a/drivers/pci/pci.ids b/drivers/pci/pci.ids index 7723913ba..bfb9de0be 100644 --- a/drivers/pci/pci.ids +++ b/drivers/pci/pci.ids @@ -948,6 +948,10 @@ 1053 Young Micro Systems 1054 Hitachi, Ltd 1055 EFAR Microsystems + 9130 EIDE Controller + 9460 PCI to ISA Bridge + 9462 USB Universal Host Controller [OHCI] + 9463 Power Management Controller [Bridge] 1056 ICL # Motorola made a mistake and used 1507 instead of 1057 in some chips. # Please look at the 1507 entry as well when updating this. diff --git a/drivers/sbus/audio/audio.c b/drivers/sbus/audio/audio.c index 81c9014c1..9f2d52d5f 100644 --- a/drivers/sbus/audio/audio.c +++ b/drivers/sbus/audio/audio.c @@ -70,8 +70,8 @@ static int lis_del_from_elist( strevent_t **list, pid_t pid, short events ); static void lis_free_elist( strevent_t **list); static void kill_procs( struct strevent *elist, int sig, short e); -static struct sparcaudio_driver *drivers[SPARCAUDIO_MAX_DEVICES] = {NULL}; -static devfs_handle_t devfs_handle = NULL; +static struct sparcaudio_driver *drivers[SPARCAUDIO_MAX_DEVICES]; +static devfs_handle_t devfs_handle; /* This crap to be pulled off into a local include file */ #if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE < 0x20100 diff --git a/drivers/sbus/char/Makefile b/drivers/sbus/char/Makefile index 1679cb6d4..ad8b7e140 100644 --- a/drivers/sbus/char/Makefile +++ b/drivers/sbus/char/Makefile @@ -36,7 +36,7 @@ obj-$(CONFIG_SUN_AURORA) += aurora.o obj-$(CONFIG_TADPOLE_TS102_UCTRL) += uctrl.o obj-$(CONFIG_SUN_JSFLASH) += jsflash.o -O_OBJS := $(obj-y) +O_OBJS += $(obj-y) M_OBJS := $(obj-m) include $(TOPDIR)/Rules.make diff --git a/drivers/sbus/char/bpp.c b/drivers/sbus/char/bpp.c index 133246129..4579404e3 100644 --- a/drivers/sbus/char/bpp.c +++ b/drivers/sbus/char/bpp.c @@ -1015,7 +1015,7 @@ static inline void freeLptPort(int idx) #endif -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; #ifdef MODULE int init_module(void) diff --git a/drivers/sbus/char/sab82532.c b/drivers/sbus/char/sab82532.c index be1071c78..ae7ba7ac1 100644 --- a/drivers/sbus/char/sab82532.c +++ b/drivers/sbus/char/sab82532.c @@ -1,4 +1,4 @@ -/* $Id: sab82532.c,v 1.51 2000/09/04 19:41:26 ecd Exp $ +/* $Id: sab82532.c,v 1.52 2000/10/14 10:09:04 davem Exp $ * sab82532.c: ASYNC Driver for the SIEMENS SAB82532 DUSCC. * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -2133,7 +2133,7 @@ static void __init sab82532_kgdb_hook(int line) static inline void __init show_serial_version(void) { - char *revision = "$Revision: 1.51 $"; + char *revision = "$Revision: 1.52 $"; char *version, *p; version = strchr(revision, ' '); diff --git a/drivers/sbus/char/su.c b/drivers/sbus/char/su.c index 416bfd58a..1fd2d6fbf 100644 --- a/drivers/sbus/char/su.c +++ b/drivers/sbus/char/su.c @@ -1,4 +1,4 @@ -/* $Id: su.c,v 1.41 2000/09/04 19:41:27 ecd Exp $ +/* $Id: su.c,v 1.42 2000/10/14 10:09:04 davem Exp $ * su.c: Small serial driver for keyboard/mouse interface on sparc32/PCI * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -2219,7 +2219,7 @@ done: */ static __inline__ void __init show_su_version(void) { - char *revision = "$Revision: 1.41 $"; + char *revision = "$Revision: 1.42 $"; char *version, *p; version = strchr(revision, ' '); diff --git a/drivers/sbus/char/sunkbd.c b/drivers/sbus/char/sunkbd.c index 5540e734b..f34c12250 100644 --- a/drivers/sbus/char/sunkbd.c +++ b/drivers/sbus/char/sunkbd.c @@ -80,7 +80,7 @@ extern void reset_vc(unsigned int new_console); extern void scrollback(int); extern void scrollfront(int); -struct l1a_kbd_state l1a_state = { 0, 0 }; +struct l1a_kbd_state l1a_state; #ifndef CONFIG_PCI DECLARE_WAIT_QUEUE_HEAD(keypress_wait); @@ -101,30 +101,30 @@ static spinlock_t sunkbd_lock = SPIN_LOCK_UNLOCKED; */ /* shift state counters.. */ -static unsigned char k_down[NR_SHIFT] = {0, }; +static unsigned char k_down[NR_SHIFT]; /* keyboard key bitmap */ -static unsigned long key_down[256/BITS_PER_LONG] = { 0, }; +static unsigned long key_down[256/BITS_PER_LONG]; void push_kbd (int scan); -int kbd_redirected = 0; +int kbd_redirected; -static int dead_key_next = 0; +static int dead_key_next; /* * In order to retrieve the shift_state (for the mouse server), either * the variable must be global, or a new procedure must be created to * return the value. I chose the former way. */ #ifndef CONFIG_PCI -/*static*/ int shift_state = 0; +/*static*/ int shift_state; #endif static int npadch = -1; /* -1 or number assembled on pad */ -static unsigned char diacr = 0; -static char rep = 0; /* flag telling character repeat */ +static unsigned char diacr; +static char rep; /* flag telling character repeat */ struct kbd_struct kbd_table[MAX_NR_CONSOLES]; static struct tty_struct **ttytab; static struct kbd_struct * kbd = kbd_table; -static struct tty_struct * tty = NULL; -static int compose_led_on = 0; +static struct tty_struct * tty; +static int compose_led_on; static int kbd_delay_ticks = HZ / 5; static int kbd_rate_ticks = HZ / 20; diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c index 77b849ef0..73158f351 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c @@ -43,7 +43,7 @@ #include static struct file_operations vfc_fops; -static devfs_handle_t devfs_handle = NULL; /* For the directory */ +static devfs_handle_t devfs_handle; /* For the directory */ struct vfc_dev **vfc_dev_lst; static char vfcstr[]="vfc"; static unsigned char saa9051_init_array[VFC_SAA9051_NR] = { diff --git a/drivers/sbus/char/zs.c b/drivers/sbus/char/zs.c index aa6472d49..67ef24fd3 100644 --- a/drivers/sbus/char/zs.c +++ b/drivers/sbus/char/zs.c @@ -1,4 +1,4 @@ -/* $Id: zs.c,v 1.59 2000/08/29 07:01:55 davem Exp $ +/* $Id: zs.c,v 1.60 2000/10/14 10:09:04 davem Exp $ * zs.c: Zilog serial port driver for the Sparc. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -1913,7 +1913,7 @@ int zs_open(struct tty_struct *tty, struct file * filp) static void show_serial_version(void) { - char *revision = "$Revision: 1.59 $"; + char *revision = "$Revision: 1.60 $"; char *version, *p; version = strchr(revision, ' '); diff --git a/drivers/scsi/a2091.c b/drivers/scsi/a2091.c index b26a8677b..98ceaf3e9 100644 --- a/drivers/scsi/a2091.c +++ b/drivers/scsi/a2091.c @@ -205,7 +205,6 @@ int __init a2091_detect(Scsi_Host_Template *tpnt) address = z->resource.start; if (!request_mem_region(address, 256, "wd33c93")) continue; - strcpy(z->name, "A590/A2091 SCSI Host Adapter"); instance = scsi_register (tpnt, sizeof (struct WD33C93_hostdata)); instance->base = ZTWO_VADDR(address); diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index a02006cb3..667eedd3c 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -1280,7 +1280,8 @@ int aha152x_detect(Scsi_Host_Template * tpnt) scsi_unregister(shpnt); registered_count--; release_region(shpnt->io_port, IO_RANGE); - aha152x_host[shpnt->irq - IRQ_MIN] = shpnt = 0; + aha152x_host[shpnt->irq - IRQ_MIN] = 0; + shpnt = 0; continue; } HOSTDATA(shpnt)->swint = 0; diff --git a/drivers/scsi/amiga7xx.c b/drivers/scsi/amiga7xx.c index 217d79819..f2f457b79 100644 --- a/drivers/scsi/amiga7xx.c +++ b/drivers/scsi/amiga7xx.c @@ -72,8 +72,6 @@ int __init amiga7xx_detect(Scsi_Host_Template *tpnt) case ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS: address = 0xf40000; if (request_mem_region(address, 0x1000, "ncr53c710")) { - strcpy(z->name, - "Blizzard 603e+ Accelerator and SCSI Host Adapter"); address = ZTWO_VADDR(address); options = OPTION_MEMORY_MAPPED | OPTION_DEBUG_TEST1 | OPTION_INTFLY | OPTION_SYNCHRONOUS | @@ -89,8 +87,6 @@ int __init amiga7xx_detect(Scsi_Host_Template *tpnt) #ifdef CONFIG_WARPENGINE_SCSI case ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE_40xx: if (request_mem_region(address+0x40000, 0x1000, "ncr53c710")) { - strcpy(z->name, "Warp Engine 40xx Accelerator, SCSI Host " - "Adapter and RAM Expansion"); address = (unsigned long)ioremap(address, size); options = OPTION_MEMORY_MAPPED | OPTION_DEBUG_TEST1 | OPTION_INTFLY | OPTION_SYNCHRONOUS | @@ -107,7 +103,6 @@ int __init amiga7xx_detect(Scsi_Host_Template *tpnt) case ZORRO_PROD_CBM_A4091_1: case ZORRO_PROD_CBM_A4091_2: if (request_mem_region(address+0x800000, 0x1000, "ncr53c710")) { - strcpy(z->name, "A4091 SCSI Host Adapter"); address = (unsigned long)ioremap(address, size); options = OPTION_MEMORY_MAPPED | OPTION_DEBUG_TEST1 | OPTION_INTFLY | OPTION_SYNCHRONOUS | @@ -123,8 +118,6 @@ int __init amiga7xx_detect(Scsi_Host_Template *tpnt) #ifdef CONFIG_GVP_TURBO_SCSI case ZORRO_PROD_GVP_GFORCE_040_060: if (request_mem_region(address+0x40000, 0x1000, "ncr53c710")) { - strcpy(z->name, "GForce 040/060 Accelerator and SCSI Host " - "Adapter"); address = ZTWO_VADDR(address); options = OPTION_MEMORY_MAPPED | OPTION_DEBUG_TEST1 | OPTION_INTFLY | OPTION_SYNCHRONOUS | diff --git a/drivers/scsi/blz1230.c b/drivers/scsi/blz1230.c index a13a0ff25..6872d7ca6 100644 --- a/drivers/scsi/blz1230.c +++ b/drivers/scsi/blz1230.c @@ -95,7 +95,6 @@ int __init blz1230_esp_detect(Scsi_Host_Template *tpnt) sizeof(struct ESP_regs)); return 0; /* Bail out if address did not hold data */ } - strcpy(z->name, "Blizzard 1230 SCSI IV"); /* Do command transfer with programmed I/O */ esp->do_pio_cmds = 1; diff --git a/drivers/scsi/blz2060.c b/drivers/scsi/blz2060.c index 3daac0f2a..77e3e4f11 100644 --- a/drivers/scsi/blz2060.c +++ b/drivers/scsi/blz2060.c @@ -68,8 +68,6 @@ int __init blz2060_esp_detect(Scsi_Host_Template *tpnt) unsigned long board = z->resource.start; if (request_mem_region(board+BLZ2060_ESP_ADDR, sizeof(struct ESP_regs), "NCR53C9x")) { - strcpy(z->name, "Blizzard 2060 Accelerator"); - esp = esp_allocate(tpnt, (void *)board+BLZ2060_ESP_ADDR); /* Do command transfer with programmed I/O */ diff --git a/drivers/scsi/cyberstorm.c b/drivers/scsi/cyberstorm.c index 87a3e842d..33150121c 100644 --- a/drivers/scsi/cyberstorm.c +++ b/drivers/scsi/cyberstorm.c @@ -89,8 +89,6 @@ int __init cyber_esp_detect(Scsi_Host_Template *tpnt) sizeof(struct ESP_regs)); return 0; } - strcpy(z->name, "Cyberstorm SCSI Host Adapter"); - esp = esp_allocate(tpnt, (void *)board+CYBER_ESP_ADDR); /* Do command transfer with programmed I/O */ diff --git a/drivers/scsi/cyberstormII.c b/drivers/scsi/cyberstormII.c index cfd5ff6cb..a1d53b314 100644 --- a/drivers/scsi/cyberstormII.c +++ b/drivers/scsi/cyberstormII.c @@ -85,7 +85,6 @@ int __init cyberII_esp_detect(Scsi_Host_Template *tpnt) sizeof(struct ESP_regs)); return 0; /* Bail out if address did not hold data */ } - strcpy(z->name, "CyberStorm Mk II SCSI Host Adapter"); /* Do command transfer with programmed I/O */ esp->do_pio_cmds = 1; diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c index 0d0711878..a1f277e8d 100644 --- a/drivers/scsi/eata.c +++ b/drivers/scsi/eata.c @@ -689,12 +689,12 @@ static void do_interrupt_handler(int, void *, struct pt_regs *); static void flush_dev(Scsi_Device *, unsigned long, unsigned int, unsigned int); static int do_trace = FALSE; static int setup_done = FALSE; -static int link_statistics = 0; +static int link_statistics; static int tag_mode = TAG_MIXED; static int ext_tran = FALSE; static int rev_scan = TRUE; static int use_new_eh_code = TRUE; -static char *boot_options = NULL; +static char *boot_options; #if defined(CONFIG_SCSI_EATA_TAGGED_QUEUE) static int tagged_comm = TRUE; diff --git a/drivers/scsi/fastlane.c b/drivers/scsi/fastlane.c index 0126ac431..bb7f89990 100644 --- a/drivers/scsi/fastlane.c +++ b/drivers/scsi/fastlane.c @@ -100,8 +100,6 @@ int __init fastlane_esp_detect(Scsi_Host_Template *tpnt) sizeof(struct ESP_regs)); return 0; } - strcpy(z->name, "Fastlane Z3 SCSI Host Adapter"); - esp = esp_allocate(tpnt, (void *)board+FASTLANE_ESP_ADDR); /* Do command transfer with programmed I/O */ diff --git a/drivers/scsi/gvp11.c b/drivers/scsi/gvp11.c index 7eb632ba0..cd64662ee 100644 --- a/drivers/scsi/gvp11.c +++ b/drivers/scsi/gvp11.c @@ -230,7 +230,6 @@ int __init gvp11_detect(Scsi_Host_Template *tpnt) address = z->resource.start; if (!request_mem_region(address, 256, "wd33c93")) continue; - strcpy(z->name, "GVP Series II SCSI"); #ifdef CHECK_WD33C93 diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index a6f4f74ca..9329e6a76 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c @@ -430,12 +430,12 @@ static ide_startstop_t idescsi_issue_pc (ide_drive_t *drive, idescsi_pc_t *pc) if (drive->using_dma && rq->bh) dma_ok=!HWIF(drive)->dmaproc(test_bit (PC_WRITING, &pc->flags) ? ide_dma_write : ide_dma_read, drive); + SELECT_DRIVE(HWIF(drive), drive); if (IDE_CONTROL_REG) OUT_BYTE (drive->ctl,IDE_CONTROL_REG); OUT_BYTE (dma_ok,IDE_FEATURE_REG); OUT_BYTE (bcount >> 8,IDE_BCOUNTH_REG); OUT_BYTE (bcount & 0xff,IDE_BCOUNTL_REG); - OUT_BYTE (drive->select.all,IDE_SELECT_REG); if (dma_ok) { set_bit (PC_DMA_IN_PROGRESS, &pc->flags); diff --git a/drivers/scsi/oktagon_esp.c b/drivers/scsi/oktagon_esp.c index 2e22157f0..976a67dc6 100644 --- a/drivers/scsi/oktagon_esp.c +++ b/drivers/scsi/oktagon_esp.c @@ -124,7 +124,6 @@ int oktagon_esp_detect(Scsi_Host_Template *tpnt) unsigned long board = z->resource.start; if (request_mem_region(board+OKTAGON_ESP_ADDR, sizeof(struct ESP_regs), "NCR53C9x")) { - strcpy(z->name, "Oktagon 2008 SCSI Host Adapter"); /* * It is a SCSI controller. * Hardwire Host adapter to SCSI ID 7 diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 2e9fd7313..acd59036a 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -74,7 +74,7 @@ #undef USE_STATIC_SCSI_MEMORY -struct proc_dir_entry *proc_scsi = NULL; +struct proc_dir_entry *proc_scsi; #ifdef CONFIG_PROC_FS static int scsi_proc_info(char *buffer, char **start, off_t offset, int length); @@ -98,23 +98,23 @@ static void scsi_dump_status(int level); /* * Data declarations. */ -unsigned long scsi_pid = 0; -Scsi_Cmnd *last_cmnd = NULL; +unsigned long scsi_pid; +Scsi_Cmnd *last_cmnd; /* Command groups 3 and 4 are reserved and should never be used. */ const unsigned char scsi_command_size[8] = { 6, 10, 10, 12, 12, 12, 10, 10 }; -static unsigned long serial_number = 0; -static Scsi_Cmnd *scsi_bh_queue_head = NULL; -static Scsi_Cmnd *scsi_bh_queue_tail = NULL; +static unsigned long serial_number; +static Scsi_Cmnd *scsi_bh_queue_head; +static Scsi_Cmnd *scsi_bh_queue_tail; /* * Note - the initial logging level can be set here to log events at boot time. * After the system is up, you may enable logging via the /proc interface. */ -unsigned int scsi_logging_level = 0; +unsigned int scsi_logging_level; const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE] = { @@ -716,7 +716,7 @@ int scsi_dispatch_cmd(Scsi_Cmnd * SCpnt) return rtn; } -devfs_handle_t scsi_devfs_handle = NULL; +devfs_handle_t scsi_devfs_handle; /* * scsi_do_cmd sends all the commands out to the low-level driver. It @@ -2166,12 +2166,11 @@ static void scsi_unregister_host(Scsi_Host_Template * tpnt) while ((SHT = *SHTp) != NULL) { if (SHT == tpnt) { *SHTp = SHT->next; + remove_proc_entry(tpnt->proc_name, proc_scsi); break; } SHTp = &SHT->next; } - /* Rebuild the /proc/scsi directory entries */ - remove_proc_entry(tpnt->proc_name, proc_scsi); } MOD_DEC_USE_COUNT; } diff --git a/drivers/scsi/sym53c8xx_comm.h b/drivers/scsi/sym53c8xx_comm.h index 78f23f6d3..5e4b52c78 100644 --- a/drivers/scsi/sym53c8xx_comm.h +++ b/drivers/scsi/sym53c8xx_comm.h @@ -1546,10 +1546,10 @@ out: return retv; } -#undef SET_BIT 0 -#undef CLR_BIT 1 -#undef SET_CLK 2 -#undef CLR_CLK 3 +#undef SET_BIT +#undef CLR_BIT +#undef SET_CLK +#undef CLR_CLK /* * Try reading Symbios NVRAM. diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c index b1399d36d..5d943c645 100644 --- a/drivers/scsi/wd7000.c +++ b/drivers/scsi/wd7000.c @@ -951,7 +951,7 @@ static int mail_out (Adapter *host, Scb *scbptr) break; } else - ogmb = (++ogmb) % OGMB_CNT; + ogmb = (ogmb + 1) % OGMB_CNT; } restore_flags (flags); diff --git a/drivers/sound/sound_core.c b/drivers/sound/sound_core.c index dd174bfa6..50a045c1c 100644 --- a/drivers/sound/sound_core.c +++ b/drivers/sound/sound_core.c @@ -152,7 +152,7 @@ spinlock_t sound_loader_lock = SPIN_LOCK_UNLOCKED; * list. Acquires locks as needed */ -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; static int sound_insert_unit(struct sound_unit **list, struct file_operations *fops, int index, int low, int top, const char *name, umode_t mode) { diff --git a/drivers/sound/trident.c b/drivers/sound/trident.c index 7ca4666e4..ac0da7cfa 100644 --- a/drivers/sound/trident.c +++ b/drivers/sound/trident.c @@ -306,7 +306,7 @@ static int attr2mask [] = { DSP_BIND_I2S, DSP_BIND_CENTER_LFE, DSP_BIND_SURR, DSP_BIND_SPDIF }; -static struct trident_card *devs = NULL; +static struct trident_card *devs; static void ali_ac97_set(struct ac97_codec *codec, u8 reg, u16 val); static u16 ali_ac97_get(struct ac97_codec *codec, u8 reg); diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c index 53452e878..584b3615c 100644 --- a/drivers/telephony/ixj.c +++ b/drivers/telephony/ixj.c @@ -67,6 +67,14 @@ static char ixj_c_revision[] = "$Revision: 3.31 $"; #include #include +#ifdef CONFIG_PCMCIA +#include +#include +#include +#include +#include +#endif + #ifdef CONFIG_ISAPNP #include #endif @@ -5876,8 +5884,8 @@ static void ixj_detach(dev_link_t * link) } /* Unlink device structure, free bits */ *linkp = link->next; - kfree_s(link->priv, sizeof(ixj_info_t)); - kfree_s(link, sizeof(struct dev_link_t)); + kfree(link->priv); + kfree(link); } #define CS_CHECK(fn, args...) \ @@ -6039,7 +6047,7 @@ int ixj_event(event_t event, int priority, event_callback_args_t * args) case CS_EVENT_CARD_REMOVAL: link->state &= ~DEV_PRESENT; if (link->state & DEV_CONFIG) { - link->release.expires = RUN_AT(HZ / 20); + link->release.expires = jiffies + (HZ / 20); link->state |= DEV_RELEASE_PENDING; add_timer(&link->release); } diff --git a/drivers/usb/usb-ohci.c b/drivers/usb/usb-ohci.c index 4fb391a8b..0d2957ca9 100644 --- a/drivers/usb/usb-ohci.c +++ b/drivers/usb/usb-ohci.c @@ -64,6 +64,8 @@ #define OHCI_USE_NPS // force NoPowerSwitching mode // #define OHCI_VERBOSE_DEBUG /* not always helpful */ +#define OHCI_MEM_SLAB +// #define OHCI_MEM_FLAGS SLAB_POISON /* no redzones; see mm/slab.c */ #include "usb-ohci.h" @@ -95,13 +97,13 @@ static spinlock_t usb_ed_lock = SPIN_LOCK_UNLOCKED; /* free HCD-private data associated with this URB */ -static void urb_free_priv (urb_priv_t * urb_priv) +static void urb_free_priv (struct ohci *hc, urb_priv_t * urb_priv) { int i; for (i = 0; i < urb_priv->length; i++) { if (urb_priv->td [i]) { - OHCI_FREE (urb_priv->td [i]); + td_free (hc, urb_priv->td [i]); } } @@ -129,7 +131,7 @@ static void urb_rm_priv_locked (urb_t * urb) } } - urb_free_priv (urb_priv); + urb_free_priv ((struct ohci *)urb->dev->bus, urb_priv); usb_dec_dev_use (urb->dev); urb->dev = NULL; } @@ -531,16 +533,16 @@ static int sohci_submit_urb (urb_t * urb) /* allocate the TDs */ for (i = 0; i < size; i++) { - OHCI_ALLOC (urb_priv->td[i], sizeof (td_t)); + urb_priv->td[i] = td_alloc (ohci); if (!urb_priv->td[i]) { - urb_free_priv (urb_priv); + urb_free_priv (ohci, urb_priv); usb_dec_dev_use (urb->dev); return -ENOMEM; } } if (ed->state == ED_NEW || (ed->state & ED_DEL)) { - urb_free_priv (urb_priv); + urb_free_priv (ohci, urb_priv); usb_dec_dev_use (urb->dev); return -EINVAL; } @@ -561,7 +563,7 @@ static int sohci_submit_urb (urb_t * urb) bustime = usb_check_bandwidth (urb->dev, urb); } if (bustime < 0) { - urb_free_priv (urb_priv); + urb_free_priv (ohci, urb_priv); usb_dec_dev_use (urb->dev); return bustime; } @@ -683,7 +685,11 @@ static int sohci_alloc_dev (struct usb_device *usb_dev) { struct ohci_device * dev; - dev = kmalloc (sizeof (*dev), GFP_KERNEL); + /* FIXME: ED allocation with pci_consistent memory + * must know the controller ... either pass it in here, + * or decouple ED allocation from dev allocation. + */ + dev = dev_alloc (NULL); if (!dev) return -ENOMEM; @@ -772,7 +778,9 @@ static int sohci_free_dev (struct usb_device * usb_dev) } } } - kfree (dev); + + /* free device, and associated EDs */ + dev_free (dev); return 0; } @@ -1077,7 +1085,8 @@ static ed_t * ep_add_ed (struct usb_device * usb_dev, unsigned int pipe, int int if (ed->state == ED_NEW) { ed->hwINFO = cpu_to_le32 (OHCI_ED_SKIP); /* skip ed */ - OHCI_ALLOC (td, sizeof (*td)); /* dummy td; end of td list for ed */ + /* dummy td; end of td list for ed */ + td = td_alloc (ohci); if (!td) { /* out of memory */ spin_unlock_irqrestore (&usb_ed_lock, flags); @@ -1425,7 +1434,7 @@ static void dl_del_list (ohci_t * ohci, unsigned int frame) if (ed->state & ED_DEL) { /* set by sohci_free_dev */ struct ohci_device * dev = usb_to_ohci (ohci->dev[edINFO & 0x7F]); - OHCI_FREE (tdTailP); /* free dummy td */ + td_free (ohci, tdTailP); /* free dummy td */ ed->hwINFO = cpu_to_le32 (OHCI_ED_SKIP); ed->state = ED_NEW; /* if all eds are removed wake up sohci_free_dev */ @@ -1443,7 +1452,7 @@ static void dl_del_list (ohci_t * ohci, unsigned int frame) if (tdHeadP == tdTailP) { if (ed->state == ED_OPER) ep_unlink(ohci, ed); - OHCI_FREE (tdTailP); + td_free (ohci, tdTailP); ed->hwINFO = cpu_to_le32 (OHCI_ED_SKIP); ed->state = ED_NEW; --(usb_to_ohci (ohci->dev[edINFO & 0x7F]))->ed_cnt; @@ -2536,15 +2545,23 @@ static struct pmu_sleep_notifier ohci_sleep_notifier = { }; #endif /* CONFIG_PMAC_PBOOK */ + /*-------------------------------------------------------------------------*/ static int __init ohci_hcd_init (void) { - int ret = pci_module_init (&ohci_pci_driver); + int ret; + + if ((ret = ohci_mem_init ()) < 0) + return ret; + + if ((ret = pci_module_init (&ohci_pci_driver)) < 0) { + ohci_mem_cleanup (); + return ret; + } #ifdef CONFIG_PMAC_PBOOK - if (ret >= 0) - pmu_register_sleep_notifier (&ohci_sleep_notifier); + pmu_register_sleep_notifier (&ohci_sleep_notifier); #endif return ret; } @@ -2557,6 +2574,7 @@ static void __exit ohci_hcd_cleanup (void) pmu_unregister_sleep_notifier (&ohci_sleep_notifier); #endif pci_unregister_driver (&ohci_pci_driver); + ohci_mem_cleanup (); } module_init (ohci_hcd_init); diff --git a/drivers/usb/usb-ohci.h b/drivers/usb/usb-ohci.h index 086db1a12..349e4cda4 100644 --- a/drivers/usb/usb-ohci.h +++ b/drivers/usb/usb-ohci.h @@ -30,10 +30,6 @@ static int cc_to_error[16] = { }; -struct ed; -struct td; -/* for ED and TD structures */ - /* ED States */ #define ED_NEW 0x00 @@ -406,12 +402,100 @@ static int rh_submit_urb(urb_t * urb); static int rh_unlink_urb(urb_t * urb); static int rh_init_int_timer(urb_t * urb); -#ifdef OHCI_VERBOSE_DEBUG -#define OHCI_FREE(x) kfree(x); printk("OHCI FREE: %d: %4x\n", -- __ohci_free_cnt, (unsigned int) x) -#define OHCI_ALLOC(x,size) (x) = kmalloc(size, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); printk("OHCI ALLO: %d: %4x\n", ++ __ohci_free_cnt,(unsigned int) x) -static int __ohci_free_cnt = 0; +/*-------------------------------------------------------------------------*/ + +#define ALLOC_FLAGS (in_interrupt () ? GFP_ATOMIC : GFP_KERNEL) + +#ifdef OHCI_MEM_SLAB +#define __alloc(t,c) kmem_cache_alloc(c,ALLOC_FLAGS) +#define __free(c,x) kmem_cache_free(c,x) +static kmem_cache_t *td_cache, *ed_cache; + +/* + * WARNING: do NOT use this with "forced slab debug"; it won't respect + * our hardware alignment requirement. + */ +#ifndef OHCI_MEM_FLAGS +#define OHCI_MEM_FLAGS 0 +#endif + +static int ohci_mem_init (void) +{ + /* redzoning (or forced debug!) breaks alignment */ + int flags = (OHCI_MEM_FLAGS) & ~SLAB_RED_ZONE; + + /* TDs accessed by controllers and host */ + td_cache = kmem_cache_create ("ohci_td", sizeof (struct td), 0, + flags | SLAB_HWCACHE_ALIGN, NULL, NULL); + if (!td_cache) { + dbg ("no TD cache?"); + return -ENOMEM; + } + + /* EDs are accessed by controllers and host; dev part is host-only */ + ed_cache = kmem_cache_create ("ohci_ed", sizeof (struct ohci_device), 0, + flags | SLAB_HWCACHE_ALIGN, NULL, NULL); + if (!ed_cache) { + dbg ("no ED cache?"); + kmem_cache_destroy (td_cache); + td_cache = 0; + return -ENOMEM; + } + dbg ("slab flags 0x%x", flags); + return 0; +} + +static void ohci_mem_cleanup (void) +{ + if (ed_cache && kmem_cache_destroy (ed_cache)) + err ("ed_cache remained"); + ed_cache = 0; + + if (td_cache && kmem_cache_destroy (td_cache)) + err ("td_cache remained"); + td_cache = 0; +} + #else -#define OHCI_FREE(x) kfree(x) -#define OHCI_ALLOC(x,size) (x) = kmalloc(size, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL) +#define __alloc(t,c) kmalloc(sizeof(t),ALLOC_FLAGS) +#define __free(dev,x) kfree(x) +#define td_cache 0 +#define ed_cache 0 + +static inline int ohci_mem_init (void) { return 0; } +static inline void ohci_mem_cleanup (void) { return; } + +/* FIXME: pci_consistent version */ + #endif - + + +/* TDs ... */ +static inline struct td * +td_alloc (struct ohci *hc) +{ + struct td *td = (struct td *) __alloc (struct td, td_cache); + return td; +} + +static inline void +td_free (struct ohci *hc, struct td *td) +{ + __free (td_cache, td); +} + + +/* DEV + EDs ... only the EDs need to be consistent */ +static inline struct ohci_device * +dev_alloc (struct ohci *hc) +{ + struct ohci_device *dev = (struct ohci_device *) + __alloc (struct ohci_device, ed_cache); + return dev; +} + +static inline void +dev_free (struct ohci_device *dev) +{ + __free (ed_cache, dev); +} diff --git a/drivers/usb/usb-uhci.c b/drivers/usb/usb-uhci.c index 3c37f3edf..4834f25cf 100644 --- a/drivers/usb/usb-uhci.c +++ b/drivers/usb/usb-uhci.c @@ -2579,11 +2579,13 @@ _static int process_urb (uhci_t *s, struct list_head *p) if (urb->complete) { dbg("process_transfer: calling completion"); - urb->dev=NULL; + if (urb->status!=-EINPROGRESS) + urb->dev=NULL; urb->complete ((struct urb *) urb); } else - urb->dev=NULL; + if (urb->status!=-EINPROGRESS) + urb->dev=NULL; } usb_dec_dev_use (usb_dev); diff --git a/drivers/video/clgenfb.c b/drivers/video/clgenfb.c index e38198485..57626f05c 100644 --- a/drivers/video/clgenfb.c +++ b/drivers/video/clgenfb.c @@ -997,10 +997,10 @@ static int clgen_decode_var (const struct fb_var_screeninfo *var, void *par, vsync *= 2; vback *= 2; } else if (_par->var.vmode & FB_VMODE_INTERLACED) { - yres = ++yres / 2; - vfront = ++vfront / 2; - vsync = ++vsync / 2; - vback = ++vback / 2; + yres = (yres + 1) / 2; + vfront = (vfront + 1) / 2; + vsync = (vsync + 1) / 2; + vback = (vback + 1) / 2; } _par->HorizRes = xres; _par->HorizTotal = (xres + hfront + hsync + hback) / 8 - 5; diff --git a/drivers/video/controlfb.c b/drivers/video/controlfb.c index 1e06548b3..fe64ab9a1 100644 --- a/drivers/video/controlfb.c +++ b/drivers/video/controlfb.c @@ -1190,7 +1190,7 @@ static void control_set_dispsw(struct display *disp, int cmode, struct fb_info_c } } -static void control_init_info(struct fb_info *info, struct fb_info_control *p) +static void __init control_init_info(struct fb_info *info, struct fb_info_control *p) { strcpy(info->modename, "control"); info->node = -1; /* ??? danj */ diff --git a/drivers/video/cyberfb.c b/drivers/video/cyberfb.c index bd7618def..5c4af6bf0 100644 --- a/drivers/video/cyberfb.c +++ b/drivers/video/cyberfb.c @@ -1070,7 +1070,6 @@ int __init cyberfb_init(void) release_mem_region(CyberRegs_phys, 0x10000); continue; } - strcpy(z->name, "CyberVision64 Graphics Board"); DPRINTK("board_addr=%08lx\n", board_addr); DPRINTK("board_size=%08lx\n", board_size); diff --git a/drivers/video/dnfb.c b/drivers/video/dnfb.c index 2deaeca27..f7a5ffba3 100644 --- a/drivers/video/dnfb.c +++ b/drivers/video/dnfb.c @@ -296,7 +296,7 @@ static void dn_fb_set_disp(int con, struct fb_info *info) { } -unsigned long dnfb_init(unsigned long mem_start) { +unsigned long __init dnfb_init(unsigned long mem_start) { int err; diff --git a/drivers/video/dummycon.c b/drivers/video/dummycon.c index ee14ed409..3e08ebcb2 100644 --- a/drivers/video/dummycon.c +++ b/drivers/video/dummycon.c @@ -53,7 +53,7 @@ static int dummycon_dummy(void) * Most of the operations are dummies. */ -struct consw dummy_con = { +const struct consw dummy_con = { con_startup: dummycon_startup, con_init: dummycon_init, con_deinit: DUMMY, diff --git a/drivers/video/fbcon.c b/drivers/video/fbcon.c index c559afcca..2f2c9a384 100644 --- a/drivers/video/fbcon.c +++ b/drivers/video/fbcon.c @@ -2384,7 +2384,7 @@ static int __init fbcon_show_logo( void ) * The console `switch' structure for the frame buffer based console */ -struct consw fb_con = { +const struct consw fb_con = { con_startup: fbcon_startup, con_init: fbcon_init, con_deinit: fbcon_deinit, diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 015b8b946..7b3d49822 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -618,7 +618,7 @@ int GET_FB_IDX(kdev_t rdev) int fbidx = MINOR(rdev); if (fbidx >= 32) { int newfbidx = fbidx >> 5; - static int warned = 0; + static int warned; if (!(warned & (1< #include #include +#include #include #include #include @@ -44,6 +45,7 @@ #include #include +static spinlock_t mda_lock = SPIN_LOCK_UNLOCKED; /* description of the hardware layout */ @@ -80,7 +82,6 @@ MODULE_PARM(mda_first_vc, "1-255i"); MODULE_PARM(mda_last_vc, "1-255i"); #endif - /* MDA register values */ @@ -110,23 +111,24 @@ static void write_mda_b(unsigned int val, unsigned char reg) { unsigned long flags; - save_flags(flags); cli(); + spin_lock_irqsave(&mda_lock, flags); outb_p(reg, mda_index_port); outb_p(val, mda_value_port); - restore_flags(flags); + spin_unlock_irqrestore(&mda_lock, flags); } static void write_mda_w(unsigned int val, unsigned char reg) { unsigned long flags; - save_flags(flags); cli(); + spin_lock_irqsave(&mda_lock, flags); outb_p(reg, mda_index_port); outb_p(val >> 8, mda_value_port); outb_p(reg+1, mda_index_port); outb_p(val & 0xff, mda_value_port); + spin_unlock_irqrestore(&mda_lock, flags); restore_flags(flags); } @@ -134,15 +136,14 @@ static int test_mda_b(unsigned char val, unsigned char reg) { unsigned long flags; - save_flags(flags); cli(); + spin_lock_irqsave(&mda_lock, flags); outb_p(reg, mda_index_port); outb (val, mda_value_port); udelay(20); val = (inb_p(mda_value_port) == val); - restore_flags(flags); - + spin_unlock_irqrestore(&mda_lock, flags); return val; } @@ -422,7 +423,8 @@ static u8 mdacon_build_attr(struct vc_data *c, u8 color, u8 intensity, static void mdacon_invert_region(struct vc_data *c, u16 *p, int count) { for (; count > 0; count--) { - scr_writew(scr_readw(p) ^ 0x0800, p++); + scr_writew(scr_readw(p) ^ 0x0800, p); + p++; } } @@ -585,7 +587,7 @@ static int mdacon_scroll(struct vc_data *c, int t, int b, int dir, int lines) * The console `switch' structure for the MDA based console */ -struct consw mda_con = { +const struct consw mda_con = { con_startup: mdacon_startup, con_init: mdacon_init, con_deinit: mdacon_deinit, diff --git a/drivers/video/newport_con.c b/drivers/video/newport_con.c index da99d78a1..4e056d2ea 100644 --- a/drivers/video/newport_con.c +++ b/drivers/video/newport_con.c @@ -574,7 +574,7 @@ static int newport_dummy(struct vc_data *c) #define DUMMY (void *) newport_dummy -struct consw newport_con = { +const struct consw newport_con = { con_startup: newport_startup, con_init: newport_init, con_deinit: DUMMY, diff --git a/drivers/video/offb.c b/drivers/video/offb.c index 81b08345e..1a1b7a3db 100644 --- a/drivers/video/offb.c +++ b/drivers/video/offb.c @@ -369,7 +369,7 @@ static void __init offb_init_nodriver(struct device_node *dp) } -static void offb_init_fb(const char *name, const char *full_name, +static void __init offb_init_fb(const char *name, const char *full_name, int width, int height, int depth, int pitch, unsigned long address, struct device_node *dp) diff --git a/drivers/video/promcon.c b/drivers/video/promcon.c index 9715ae881..9c7277b70 100644 --- a/drivers/video/promcon.c +++ b/drivers/video/promcon.c @@ -566,7 +566,7 @@ static int promcon_dummy(void) #define DUMMY (void *) promcon_dummy -struct consw prom_con = { +const struct consw prom_con = { con_startup: promcon_startup, con_init: promcon_init, con_deinit: promcon_deinit, diff --git a/drivers/video/q40fb.c b/drivers/video/q40fb.c index 2b798e05d..a5c68f070 100644 --- a/drivers/video/q40fb.c +++ b/drivers/video/q40fb.c @@ -313,7 +313,7 @@ static void q40fb_set_disp(int con, struct fb_info *info) #endif } -int q40fb_init(void) +int __init q40fb_init(void) { if ( !MACH_IS_Q40) diff --git a/drivers/video/retz3fb.c b/drivers/video/retz3fb.c index ef39926ab..13e843c3d 100644 --- a/drivers/video/retz3fb.c +++ b/drivers/video/retz3fb.c @@ -1391,7 +1391,6 @@ int __init retz3fb_init(void) release_mem_region(board_addr, 0x00c00000); continue; } - strcpy(z->name, "Retina Z3 Graphics "); if (!(zinfo = kmalloc(sizeof(struct retz3_fb_info), GFP_KERNEL))) return -ENOMEM; diff --git a/drivers/video/sisfb.c b/drivers/video/sisfb.c index 85c8f1730..c2d460b99 100644 --- a/drivers/video/sisfb.c +++ b/drivers/video/sisfb.c @@ -3313,7 +3313,7 @@ static struct fb_ops sisfb_ops = { fb_mmap: sisfb_mmap, }; -int sisfb_setup(char *options) +int __init sisfb_setup(char *options) { char *this_opt; diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c index fa19c744d..11e803273 100644 --- a/drivers/video/vesafb.c +++ b/drivers/video/vesafb.c @@ -448,7 +448,7 @@ static struct fb_ops vesafb_ops = { fb_pan_display: vesafb_pan_display, }; -int vesafb_setup(char *options) +int __init vesafb_setup(char *options) { char *this_opt; diff --git a/drivers/video/vgacon.c b/drivers/video/vgacon.c index 5ebfec7b0..8a7e0a0ff 100644 --- a/drivers/video/vgacon.c +++ b/drivers/video/vgacon.c @@ -1037,7 +1037,7 @@ static int vgacon_dummy(struct vc_data *c) #define DUMMY (void *) vgacon_dummy -struct consw vga_con = { +const struct consw vga_con = { con_startup: vgacon_startup, con_init: vgacon_init, con_deinit: vgacon_deinit, diff --git a/drivers/video/virgefb.c b/drivers/video/virgefb.c index 6be952607..ed7bad2b1 100644 --- a/drivers/video/virgefb.c +++ b/drivers/video/virgefb.c @@ -1139,7 +1139,6 @@ int __init virgefb_init(void) release_mem_region(CyberRegs_phys, 0x10000); continue; } - strcpy(z->name, "CyberVision64-3D Graphics Board"); if (board_addr < 0x01000000) { /* diff --git a/drivers/zorro/Config.in b/drivers/zorro/Config.in new file mode 100644 index 000000000..dc91f84b4 --- /dev/null +++ b/drivers/zorro/Config.in @@ -0,0 +1,7 @@ +# +# Zorro configuration +# + +if [ "$CONFIG_ZORRO" = "y" ]; then + bool 'Zorro device name database' CONFIG_ZORRO_NAMES +fi diff --git a/drivers/zorro/Makefile b/drivers/zorro/Makefile index 8e14649b2..363e699ea 100644 --- a/drivers/zorro/Makefile +++ b/drivers/zorro/Makefile @@ -23,3 +23,11 @@ endif L_OBJS += names.o include $(TOPDIR)/Rules.make + +names.o: names.c devlist.h + +devlist.h: zorro.ids gen-devlist + ./gen-devlist + * + * Based on the PCI version: + * + * (c) 1999--2000 Martin Mares + */ + +#include +#include + +#define MAX_NAME_SIZE 63 + +static void +pq(FILE *f, const char *c) +{ + while (*c) { + if (*c == '"') + fprintf(f, "\\\""); + else + fputc(*c, f); + c++; + } +} + +int +main(void) +{ + char line[1024], *c, *bra, manuf[8]; + int manufs = 0; + int mode = 0; + int lino = 0; + int manuf_len = 0; + FILE *devf; + + devf = fopen("devlist.h", "w"); + if (!devf) { + fprintf(stderr, "Cannot create output file!\n"); + return 1; + } + + while (fgets(line, sizeof(line)-1, stdin)) { + lino++; + if ((c = strchr(line, '\n'))) + *c = 0; + if (!line[0] || line[0] == '#') + continue; + if (line[0] == '\t') { + switch (mode) { + case 1: + if (strlen(line) > 5 && line[5] == ' ') { + c = line + 5; + while (*c == ' ') + *c++ = 0; + if (manuf_len + strlen(c) + 1 > MAX_NAME_SIZE) { + /* Too long, try cutting off long description */ + bra = strchr(c, '['); + if (bra && bra > c && bra[-1] == ' ') + bra[-1] = 0; + if (manuf_len + strlen(c) + 1 > MAX_NAME_SIZE) { + fprintf(stderr, "Line %d: Product name too long\n", lino); + return 1; + } + } + fprintf(devf, "\tPRODUCT(%s,%s,\"", manuf, line+1); + pq(devf, c); + fputs("\")\n", devf); + } else goto err; + break; + default: + goto err; + } + } else if (strlen(line) > 4 && line[4] == ' ') { + c = line + 4; + while (*c == ' ') + *c++ = 0; + if (manufs) + fputs("ENDMANUF()\n\n", devf); + manufs++; + strcpy(manuf, line); + manuf_len = strlen(c); + if (manuf_len + 24 > MAX_NAME_SIZE) { + fprintf(stderr, "Line %d: manufacturer name too long\n", lino); + return 1; + } + fprintf(devf, "MANUF(%s,\"", manuf); + pq(devf, c); + fputs("\")\n", devf); + mode = 1; + } else { + err: + fprintf(stderr, "Line %d: Syntax error in mode %d: %s\n", lino, mode, line); + return 1; + } + } + fputs("ENDMANUF()\n\ +\n\ +#undef MANUF\n\ +#undef PRODUCT\n\ +#undef ENDMANUF\n", devf); + + fclose(devf); + + return 0; +} diff --git a/drivers/zorro/names.c b/drivers/zorro/names.c dissimilarity index 95% index 2277bcc2b..27bdf7b0a 100644 --- a/drivers/zorro/names.c +++ b/drivers/zorro/names.c @@ -1,83 +1,108 @@ -/* - * $Id: zorro.c,v 1.1.2.1 1998/06/07 23:21:02 geert Exp $ - * - * Zorro Expansion Device Names - * - * Copyright (C) 1999-2000 Geert Uytterhoeven - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - */ - -#include -#include -#include -#include - - - /* - * Just for reference, these are the boards we have a driver for in the - * kernel: - * - * ZORRO_PROD_AMERISTAR_A2065 - * ZORRO_PROD_BSC_FRAMEMASTER_II - * ZORRO_PROD_BSC_MULTIFACE_III - * ZORRO_PROD_BSC_OKTAGON_2008 - * ZORRO_PROD_CBM_A2065_1 - * ZORRO_PROD_CBM_A2065_2 - * ZORRO_PROD_CBM_A4091_1 - * ZORRO_PROD_CBM_A4091_2 - * ZORRO_PROD_CBM_A590_A2091_1 - * ZORRO_PROD_CBM_A590_A2091_2 - * ZORRO_PROD_GVP_A1291 - * ZORRO_PROD_GVP_A530_SCSI - * ZORRO_PROD_GVP_COMBO_030_R3_SCSI - * ZORRO_PROD_GVP_COMBO_030_R4_SCSI - * ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_RAM - * ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_REG - * ZORRO_PROD_GVP_GFORCE_030_SCSI - * ZORRO_PROD_GVP_GFORCE_040_060 - * ZORRO_PROD_GVP_GFORCE_040_1 - * ZORRO_PROD_GVP_GFORCE_040_SCSI_1 - * ZORRO_PROD_GVP_IO_EXTENDER - * ZORRO_PROD_GVP_SERIES_II - * ZORRO_PROD_HELFRICH_PICCOLO_RAM - * ZORRO_PROD_HELFRICH_PICCOLO_REG - * ZORRO_PROD_HELFRICH_RAINBOW_II - * ZORRO_PROD_HELFRICH_SD64_RAM - * ZORRO_PROD_HELFRICH_SD64_REG - * ZORRO_PROD_HYDRA_SYSTEMS_AMIGANET - * ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA - * ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL - * ZORRO_PROD_MACROSYSTEMS_RETINA_Z3 - * ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE_40xx - * ZORRO_PROD_PHASE5_BLIZZARD_1220_CYBERSTORM - * ZORRO_PROD_PHASE5_BLIZZARD_1230_II_FASTLANE_Z3_CYBERSCSI_CYBERSTORM060 - * ZORRO_PROD_PHASE5_BLIZZARD_1230_IV_1260 - * ZORRO_PROD_PHASE5_BLIZZARD_2060 - * ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS - * ZORRO_PROD_PHASE5_CYBERSTORM_MK_II - * ZORRO_PROD_PHASE5_CYBERVISION64 - * ZORRO_PROD_PHASE5_CYBERVISION64_3D - * ZORRO_PROD_VILLAGE_TRONIC_ARIADNE - * ZORRO_PROD_VILLAGE_TRONIC_ARIADNE2 - * ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM - * ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_REG - * ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3 - * - * And I guess these are automagically supported as well :-) - * - * ZORRO_PROD_CBM_A560_RAM - * ZORRO_PROD_CBM_A590_A2052_A2058_A2091 - */ - -void __init zorro_namedevice(struct zorro_dev *dev) -{ - /* - * Nah, we're not that stupid to put name databases in the kernel ;-) - * That's why we have zorroutils... - */ - sprintf(dev->name, "Zorro device %08x", dev->id); -} - +/* + * Zorro Device Name Tables + * + * Copyright (C) 1999--2000 Geert Uytterhoeven + * + * Based on the PCI version: + * + * Copyright 1992--1999 Drew Eckhardt, Frederic Potter, + * David Mosberger-Tang, Martin Mares + */ + +#include +#include +#include +#include + + +#ifdef CONFIG_ZORRO_NAMES + +struct zorro_prod_info { + __u16 prod; + unsigned short seen; + const char *name; +}; + +struct zorro_manuf_info { + __u16 manuf; + unsigned short nr; + const char *name; + struct zorro_prod_info *prods; +}; + +/* + * This is ridiculous, but we want the strings in + * the .init section so that they don't take up + * real memory.. Parse the same file multiple times + * to get all the info. + */ +#define MANUF( manuf, name ) static const char __manufstr_##manuf[] __initdata = name; +#define ENDMANUF() +#define PRODUCT( manuf, prod, name ) static const char __prodstr_##manuf##prod[] __initdata = name; +#include "devlist.h" + + +#define MANUF( manuf, name ) static struct zorro_prod_info __prods_##manuf[] __initdata = { +#define ENDMANUF() }; +#define PRODUCT( manuf, prod, name ) { 0x##prod, 0, __prodstr_##manuf##prod }, +#include "devlist.h" + +static const struct zorro_manuf_info __initdata zorro_manuf_list[] = { +#define MANUF( manuf, name ) { 0x##manuf, sizeof(__prods_##manuf) / sizeof(struct zorro_prod_info), __manufstr_##manuf, __prods_##manuf }, +#define ENDMANUF() +#define PRODUCT( manuf, prod, name ) +#include "devlist.h" +}; + +#define MANUFS (sizeof(zorro_manuf_list)/sizeof(struct zorro_manuf_info)) + +void __init zorro_name_device(struct zorro_dev *dev) +{ + const struct zorro_manuf_info *manuf_p = zorro_manuf_list; + int i = MANUFS; + char *name = dev->name; + + do { + if (manuf_p->manuf == ZORRO_MANUF(dev->id)) + goto match_manuf; + manuf_p++; + } while (--i); + + /* Couldn't find either the manufacturer nor the product */ + sprintf(name, "Zorro device %08x", dev->id); + return; + + match_manuf: { + struct zorro_prod_info *prod_p = manuf_p->prods; + int i = manuf_p->nr; + + while (i > 0) { + if (prod_p->prod == + ((ZORRO_PROD(dev->id)<<8) | ZORRO_EPC(dev->id))) + goto match_prod; + prod_p++; + i--; + } + + /* Ok, found the manufacturer, but unknown product */ + sprintf(name, "Zorro device %08x (%s)", dev->id, manuf_p->name); + return; + + /* Full match */ + match_prod: { + char *n = name + sprintf(name, "%s %s", manuf_p->name, prod_p->name); + int nr = prod_p->seen + 1; + prod_p->seen = nr; + if (nr > 1) + sprintf(n, " (#%d)", nr); + } + } +} + +#else + +void __init zorro_name_device(struct zorro_dev *dev) +{ +} + +#endif diff --git a/drivers/zorro/zorro.c b/drivers/zorro/zorro.c index 10ac2eec3..114a27ebb 100644 --- a/drivers/zorro/zorro.c +++ b/drivers/zorro/zorro.c @@ -20,8 +20,6 @@ #include -extern void zorro_namedevice(struct zorro_dev *dev); - /* * Zorro Expansion Devices */ @@ -36,13 +34,15 @@ struct zorro_dev zorro_autocon[ZORRO_NUM_AUTO]; */ static struct resource zorro_res[4] = { + /* Zorro II regions (on Zorro II/III) */ { "Zorro II exp", 0x00e80000, 0x00efffff }, { "Zorro II mem", 0x00200000, 0x009fffff }, + /* Zorro III regions (on Zorro III only) */ { "Zorro III exp", 0xff000000, 0xffffffff }, { "Zorro III cfg", 0x40000000, 0x7fffffff } }; -static u_int __init zorro_num_res = 0; +static u_int zorro_num_res __initdata = 0; /* @@ -56,8 +56,9 @@ struct zorro_dev *zorro_find_device(zorro_id id, struct zorro_dev *from) if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO)) return NULL; - dev = from ? from+1 : &zorro_autocon[0]; - for (; dev < zorro_autocon+zorro_num_autocon; dev++) + for (dev = from ? from+1 : &zorro_autocon[0]; + dev < zorro_autocon+zorro_num_autocon; + dev++) if (id == ZORRO_WILDCARD || id == dev->id) return dev; return NULL; @@ -146,10 +147,13 @@ void __init zorro_init(void) unsigned long magic = dev->resource.start+0x8000; dev->id |= *(u16 *)ZTWO_VADDR(magic) & GVP_PRODMASK; } + sprintf(dev->name, "Zorro device %08x", dev->id); + zorro_name_device(dev); dev->resource.name = dev->name; - zorro_namedevice(dev); if (request_resource(zorro_find_parent_resource(dev), &dev->resource)) - printk("zorro_init: cannot request resource for board %d\n", i); + printk(KERN_ERR "Zorro: Address space collision on device %s " + "[%lx:%lx]\n", + dev->name, dev->resource.start, dev->resource.end); } /* Mark all available Zorro II memory */ diff --git a/drivers/zorro/zorro.ids b/drivers/zorro/zorro.ids new file mode 100644 index 000000000..aec74bbba --- /dev/null +++ b/drivers/zorro/zorro.ids @@ -0,0 +1,469 @@ +# +# List of Zorro IDs +# +# Maintained by Geert Uytterhoeven +# If you have any new entries, please send them to the maintainer. +# +# $Id: zorro.ids,v 1.16 2000/09/28 18:45:47 geert Exp $ +# + +# Manufacturers and Products. Please keep sorted. + +# Syntax: +# manufacturer manufacturer_name +# product product_name <-- single tab + +00d3 Pacific Peripherals + 0000 SE 2000 A500 [HD Controller] + 0a00 [SCSI Host Adapter] +00dd Kupke + 0000 Golem RAM Box 2MB [RAM Expansion] +0100 MacroSystems USA +# The Stormbringer is actually made by Memphis + 0000 Stormbringer [Accelerator] + 1300 Warp Engine [Accelerator, SCSI Host Adapter and RAM Expansion] +0200 3-State + 0200 Megamix 2000 [RAM Expansion] +0201 Commodore Braunschweig + 0100 A2088 XT/A2286 AT [ISA Bus Bridge] + 0200 A2286 AT [ISA Bus Bridge] + 5400 A4091 [SCSI Host Adapter] + 6700 A2386-SX [ISA Bus Bridge] +0202 Commodore West Chester + 0100 A2090/A2090A [SCSI Host Adapter] + 0200 A590/A2091 [SCSI Host Adapter] + 0300 A590/A2091 [SCSI Host Adapter] + 0400 A2090B 2090 Autoboot [SCSI Host Adapter] + 0900 A2060 [ArcNet Card] + 0a00 A590/A2052/A2058/A2091 [RAM Expansion] + 2000 A560 [RAM Expansion] + 4500 A2232 Prototype [Multi I/O] + 4600 A2232 [Multi I/O] + 5000 A2620 68020 [Accelerator and RAM Expansion] + 5100 A2630 68030 [Accelerator and RAM Expansion] + 5400 A4091 [SCSI Host Adapter] + 5a00 A2065 [Ethernet Card]] + 6000 Romulator Card + 6100 A3000 Test Fixture [Miscellaneous Expansion Card] + 6700 A2386-SX [ISA Bus Bridge] + 7000 A2065 [Ethernet Card] +0203 Commodore West Chester + 0300 A2090/A2090A Combitec/MacroSystem [SCSI Host Adapter] +02f4 Progressive Peripherals & Systems + 0200 EXP8000 [RAM Expansion] + 6900 A2000 68040 [Accelerator] + 9600 68040 [Accelerator] +02ff Kolff Computer Supplies + 0000 KCS Power PC [ISA Bus Bridge] +03ec Cardco Ltd. + 0400 Kronos 2000 [SCSI Host Adapter]] + 0c00 A1000 [SCSI Host Adapter] + 0e00 Escort [SCSI Host Adapter] + f500 A2410 HiRes [Graphics Card] +03ed A-Squared + 0100 Live! 2000 [Video Card] +03ee Comspec Communications + 0100 AX2000 [RAM Expansion] +03f1 Anakin Research + 0100 Easyl Drawing Tablet Interface +03f2 Microbotics + 0000 StarBoard II [RAM Expansion] + 0200 StarDrive [SCSI Host Adapter] + 0300 8-Up (Rev A) [RAM Expansion] + 0400 8-Up (Rev Z) [RAM Expansion] + 2000 Delta [RAM Expansion] + 4000 8-Star [RAM Expansion] + 4100 8-Star [Miscellaneous Expansion Card] + 4400 VXL RAM*32 [RAM Expansion] + 4500 VXL-30 [Accelerator] + 6000 Delta [Miscellaneous Expansion Card] + 8100 MBX 1200/1200z [RAM Expansion] + 9600 Hardframe 2000 [SCSI Host Adapter] + 9e00 Hardframe 2000 [SCSI Host Adapter] + c100 MBX 1200/1200z [Miscellaneous Expansion Card] +03f4 Access Associates Alegra +03f6 Expansion Technologies/Pacific Cypress +03ff ASDG + 0100 [RAM Expansion] + 0200 [RAM Expansion] + fe00 EB-920 Lan Rover [Ethernet Card] + ff00 GPIB/Dual IEEE-488/Twin-X [Multi I/O] +0404 Ronin/Imtronics + 3900 Hurricane 2800 [Accelerator and RAM Expansion] + 5700 Hurricane 2800 [Accelerator and RAM Expansion] +0406 Commodore/University of Lowell + 0000 A2410 HiRes [Graphics Card] +041d Ameristar + 0100 A2065 [Ethernet Card] + 0900 A560 [ArcNet Card] + 0a00 A4066 [Ethernet Card] + 2000 1600-GX [Graphics Card] +0420 Supra + 0100 SupraDrive 4x4 [SCSI Host Adapter] + 0200 1000 [RAM Expansion] + 0300 2000 DMA [SCSI Host Adapter] + 0500 500 [SCSI Host Adapter and RAM Expansion] + 0800 500 [SCSI Host Adapter] + 0900 500XP/2000 [RAM Expansion] + 0a00 500RX/2000 [RAM Expansion] + 0b00 2400zi [Modem] + 0c00 500XP/SupraDrive WordSync [SCSI Host Adapter] + 0d00 SupraDrive WordSync II [SCSI Host Adapter] + 1000 2400zi+ [Modem] +0422 Computer Systems Assosiates + 1100 Magnum 40 [Accelerator and SCSI Host Adapter] + 1500 12 Gauge [SCSI Host Adapter] +0439 Marc Michael Groth +0502 M-Tech + 0300 AT500 [RAM Expansion] +06e1 Great Valley Products + 0800 Impact Series I [SCSI Host Adapter and RAM Expansion] + 2000 Impact Vision 24 [Graphics Card] +07da ByteBox + 0000 A500 +07db Hacker Test Board +07dc DKB/Power Computing + 0900 SecureKey + 0e00 DKM 3128 [RAM Expansion] + 0f00 Rapid Fire [SCSI Host Adapter] + 1000 DKM 1202 [FPU and RAM Expansion] + 1200 Cobra/Viper II 68EC030 [Accelerator] + 1700 WildFire 060 [Accelerator] + ff00 WildFire 060 [Accelerator] +07e1 Great Valley Products + 0100 Impact Series I (4K) [SCSI Host Adapter] + 0200 Impact Series I (16K/2) [SCSI Host Adapter] + 0300 Impact Series I (16K/2) [SCSI Host Adapter] + 0800 Impact 3001 [IDE Interface] + 0900 Impact 3001 [RAM Expansion] + 0a00 Impact Series II [RAM Expansion] + 0b20 GForce 040 [Accelerator] + 0b30 GForce 040 [Accelerator and SCSI Host Adapter] + 0b40 A1291 [SCSI Host Adapter] + 0b60 Combo 030 R4 [Accelerator] + 0b70 Combo 030 R4 [Accelerator and SCSI Host Adapter] + 0b78 Phone Pak + 0b98 IO-Extender [Multi I/O] + 0ba0 GForce 030 [Accelerator] + 0bb0 GForce 030 [Accelerator and SCSI Host Adapter] + 0bc0 A530 [Accelerator] + 0bd0 A530 [Accelerator and SCSI Host Adapter] + 0be0 Combo 030 R3 [Accelerator] + 0bf0 Combo 030 R3 [Accelerator and SCSI Host Adapter] + 0bf8 Series-II [SCSI Host Adapter] + 0d00 Impact 3001 [IDE Interface] + 1600 GForce 040/060 [Accelerator and SCSI Host Adapter] + 2000 Impact Vision 24 [Graphics Card] + 4400 Rembrandt [Graphics Card] + ff00 GForce 040 [Accelerator] +07e5 California Access/Synergy + 0100 Malibu [SCSI Host Adapter] +07e6 Xetec + 0100 FastCard [SCSI Host Adapter] + 0200 FastCard [RAM Expansion] + 0300 FastCard Plus [SCSI Host Adapter] +07ea Progressive Peripherals & Systems + 0000 Mercury [Accelerator] + 0100 A3000 68040 [Accelerator] + 6900 A2000 68040 [Accelerator] + 9600 Zeus [Accelerator, SCSI Host Adapter and RAM Expansion] + bb00 A500 68040 [Accelerator] +# The AteoBus and Pixel64 are actually made by Ateo Concepts + fc00 AteoBus [Expansion Bus Bridge] + fe00 Pixel64 [Graphics Card] + ff00 Pixel64 RAM [Graphics Card] +07ec Xebec +07f2 Spirit Technology + 0100 Insider IN1000 [RAM Expansion] + 0200 Insider IN500 [RAM Expansion] + 0300 SIN500 [RAM Expansion] + 0400 HDA 506 [HD Controller] + 0500 AX-S [Miscellaneous Expansion Card] + 0600 OctaByte [RAM Expansion] + 0800 Inmate [SCSI Host Adapter and RAM Expansion] +07f3 Spirit Technology +07fe BSC/Alfadata + 0300 ALF 3 [SCSI Host Adapter] +0801 BSC/Alfadata + 0100 ALF 2 [SCSI Host Adapter] + 0200 ALF 2 [SCSI Host Adapter] + 0300 ALF 3 [SCSI Host Adapter] + 0400 Oktagon 500 [SCSI Host Adapter] + 0600 Tandem AT-2008/508 [IDE Interface] + 0800 Oktagon 2008 [RAM Expansion] + 1000 MultiFace I [Multi I/O] + 2000 FrameMaster II [Graphics Card] + 4000 ISDN MasterCard [ISDN Interface] +0802 Cardco Ltd. + 0400 Kronos 2000 [SCSI Host Adapter] + 0c00 A1000 [SCSI Host Adapter] +0804 Jochheim + 0100 [RAM Expansion] + 2000 [RAM Expansion] +0807 Checkpoint Technologies + 0000 Serial Solution [Multi Serial] +0810 Edotronik + 0100 IEEE-488 Interface Card + 0200 CBM-8032 Card + 0300 [Multi Serial] + 0400 24Bit Realtime Video Digitizer + 0500 32Bit Parallel I/O Interface + 0600 PIC Prototyping Card + 0700 16 Channel ADC Interface + 0800 VME-Bus Controller + 0900 DSP96000 Realtime Data Acquisition DSP Card +0813 NES Inc. + 0000 [RAM Expansion] +0817 ICD + 0100 Advantage 2000 [SCSI Host Adapter] + 0300 Advantage [IDE Interface] + 0400 Advantage 2080 [RAM Expansion] +0819 Kupke + 0100 Omti [HD Controller] + 0200 Golem SCSI-II [SCSI Host Adapter] + 0300 Golem Box + 0400 030/882 [Accelerator] + 0500 Golem [SCSI Host Adapter] +081d Great Valley Products + 0900 A2000-RAM8/2 [Miscellaneous Expansion Card] + 0a00 Impact Series II [RAM Expansion] +081e Interworks Network +0820 Hardital Synthesis + 1400 TQM 68030+68882 [Accelerator] +0828 Applied Engineering + 1000 DL2000 [Modem] + e000 RAM Works [RAM Expansion] +082c BSC/Alfadata + 0400 Oktagon 500 [SCSI Host Adapter] + 0500 Oktagon 2008 [SCSI Host Adapter] + 0600 Tandem AT-2008/508 [IDE Interface] + 0700 Alpha 1200 [RAM Expansion] + 0800 Oktagon 2008 [RAM Expansion] + 1000 MultiFace I [Multi I/O] + 1100 MultiFace II [Multi I/O] + 1200 MultiFace III [Multi I/O] + 2000 FrameMaster II [Graphics Card] + 2100 Graffiti RAM [Graphics Card] + 2200 Graffiti [Graphics Card] + 4000 ISDN MasterCard [ISDN Interface] + 4100 ISDN MasterCard II [ISDN Interface] +0835 Phoenix + 2100 ST506 [HD Controller] + 2200 [SCSI Host Adapter] + be00 [RAM Expansion] +0836 Advanced Storage Systems + 0100 Nexus [SCSI Host Adapter] + 0800 Nexus [RAM Expansion] +0838 Impulse + 0000 FireCracker 24 (NTSC) [Graphics Card] + 0100 FireCracker 24 (PAL) [Graphics Card] +0840 IVS + 0200 GrandSlam PIC 2 [RAM Expansion] + 0400 GrandSlam PIC 1 [RAM Expansion] + 1000 OverDrive [HD Controller] + 3000 TrumpCard Classic [SCSI Host Adapter] + 3400 TrumpCard Pro/GrandSlam [SCSI Host Adapter] + 4000 Meta-4 [RAM Expansion] + bf00 Wavetools [Audio Card] + f300 Vector [SCSI Host Adapter] + f400 Vector [SCSI Host Adapter] +0841 Vector + e300 Connection [Multi I/O] +0845 XPert ProDev + 0100 Visiona RAM [Graphics Card] + 0200 Visiona [Graphics Card] + 0300 Merlin RAM [Graphics Card] + 0400 Merlin [Graphics Card] + c900 Merlin [Graphics Card] +0849 Hydra Systems + 0100 Amiganet [Ethernet Card] +084f Sunrize Industries + 0100 AD1012 [Audio Card] + 0200 AD516 [Audio Card] + 0300 DD512 [Audio Card] +0850 Triceratops + 0100 [Multi I/O] +0851 Applied Magic Inc. + 0100 DMI Resolver [Graphics Card] + 0200 Vivid 24 [Graphics Card] + 0600 Digital Broadcaster [Video Card] +085e GFX-Base + 0000 GDA-1 VRAM [Graphics Card] + 0100 GDA-1 [Graphics Card] +0860 RocTec + 0100 RH 800C [HD Controller] + 0200 RH 800C [RAM Expansion] +0861 Kato +# The Rainbow II and III are actually made by Ingenieurbüro Helfrich + 2000 Rainbow II [Graphics Card] + 2100 Rainbow III [Graphics Card] + 8000 Melody MPEG [Audio Card] +0862 Atlantis +0864 Protar +0865 ACS +0866 Software Results Enterprises + 0100 Golden Gate 2 Bus+ [ISA Bus Bridge] +086a Unknown + 0100 Horizon [Graphics Card] + 0200 Blackbox [Graphics Card] + 0300 Voyager [Graphics Card] +086d Masoboshi + 0300 MasterCard SC201 [RAM Expansion] + 0400 MasterCard MC702 [SCSI Host Adapter and IDE Interface] + 0700 MVD 819 +086f Mainhattan-Data/A-Team + 0100 [IDE Interface] +0877 Village Tronic + 0100 Domino RAM [Graphics Card] + 0200 Domino [Graphics Card] + 0300 Domino 16M Prototype [Graphics Card] + 0b00 Picasso II/II+ RAM [Graphics Card] + 0c00 Picasso II/II+ [Graphics Card] + 0d00 Picasso II/II+ (Segmented Mode) [Graphics Card] + 1500 Picasso IV Z2 RAM [Graphics Card] + 1600 Picasso IV Z2 RAM [Graphics Card] + 1700 Picasso IV Z2 [Graphics Card] + 1800 Picasso IV Z3 [Graphics Card] + c900 Ariadne [Ethernet Card and Parallel Ports] + ca00 Ariadne II [Ethernet Card] +087b Utilities Unlimited + 1500 Emplant Deluxe [Macintosh Emulator] + 2000 Emplant Deluxe [Macintosh Emulator] +0880 Amitrix + 0100 [Multi I/O] + 0200 CD-RAM [RAM Expansion] +0885 ArMax + 0000 OmniBus [Graphics Card] +088d ZEUS Electronic Development + 0300 [ISDN Interface] + 0400 Spider [Video Card] +088f NewTek + 0000 VideoToaster [Video Card] +0890 M-Tech Germany + 0100 AT500 [IDE Interface] + 0300 68030 [Accelerator] + 0600 68020i [Accelerator] + 2000 A1200 T68030 RTC [Accelerator] + 2100 Viper Mk V/E-Matrix 530 [Accelerator and RAM Expansion] + 2200 8MB [RAM Expansion] + 2400 Viper Mk V/E-Matrix 530 [SCSI Host Adapter and IDE Interface] +0891 Great Valley Products + 0100 EGS 28/24 Spectrum RAM [Graphics Card] + 0200 EGS 28/24 Spectrum [Graphics Card] +0892 Apollo + 0100 A1200 [FPU and RAM Expansion] +0893 Ingenieurbüro Helfrich + 0500 Piccolo RAM [Graphics Card] + 0600 Piccolo [Graphics Card] + 0700 PeggyPlus MPEG [Video Card] + 0800 VideoCruncher [Video Card] + 0a00 Piccolo SD64 RAM [Graphics Card] + 0b00 Piccolo SD64 [Graphics Card] +089b MacroSystems USA + 1300 Warp Engine 40xx [Accelerator, SCSI Host Adapter and RAM Expansion] +089e ElBox Computer + 0600 1200/4 [RAM Expansion] + 1900 PowerFlyer [IDE Interface] +0a00 Harms Professional + 1000 030 Plus [Accelerator] + d000 3500 Professional [Accelerator and RAM Expansion] +0a50 Micronik + 0a00 RCA 120 [RAM Expansion] +0f0f Micronik + 0100 Z3i A1200 [Zorro III Extender and SCSI Host Adapter] +1000 MegaMicro + 0300 SCRAM 500 [SCSI Host Adapter] + 0400 SCRAM 500 [RAM Expansion] +1028 Ronin/Imtronics + 3900 Hurricane 2800 [Accelerator and RAM Expansion] + 5700 Hurricane 2800 [Accelerator and RAM Expansion] +102f Ateo Concepts + fc00 AteoBus [Expansion Bus Bridge] + fe00 Pixel64 [Graphics Card] + ff00 Pixel64 RAM [Graphics Card] +1212 Individual Computers + 0000 Buddha [IDE Interface] + 1700 X-Surf [Ethernet Card] + 2a00 Catweasel [IDE Interface and Floppy Controller] +1248 Kupke + 0100 Golem HD 3000 [HD Controller] +1267 RBM-Computertechnik + 0100 IOBlix [Multi I/O] +1388 ITH + 0100 ISDN-Master II [ISDN Interface] +1389 VMC + 0100 ISDN Blaster Z2 [ISDN Interface] + 0200 HyperCom 4 [Multi I/O] + 0600 HyperCom 4+ [Multi I/O] +157c Information + 6400 ISDN Engine I [ISDN Interface] +2017 Vortex + 0700 Golden Gate 80386SX [ISA Bus Bridge] + 0800 Golden Gate [RAM Expansion] + 0900 Golden Gate 80486 [ISA Bus Bridge] +2062 Expansion Systems + 0100 DataFlyer 4000SX [SCSI Host Adapter] + 0200 DataFlyer 4000SX [RAM Expansion] +2100 ReadySoft + 0100 AMax II/IV [Macintosh Emulator] +2140 Phase 5 + 0100 Blizzard [RAM Expansion] + 0200 Blizzard [Accelerator] + 0600 Blizzard 1220-IV [Accelerator] + 0a00 FastLane Z3 [RAM Expansion] + 0b00 Blizzard 1230-II/Fastlane Z3/CyberSCSI/CyberStorm060 [Accelerator and/or SCSI Host Adapter] + 0c00 Blizzard 1220/CyberStorm [Accelerator and SCSI Host Adapter] + 0d00 Blizzard 1230 [Accelerator] + 1100 Blizzard 1230-IV/1260 [Accelerator] + 1800 Blizzard 2060 [Accelerator] + 1900 CyberStorm Mk II [Flash ROM] + 2200 CyberVision64 [Graphics Card] + 3200 CyberVision64-3D Prototype [Graphics Card] + 4300 CyberVision64-3D [Graphics Card] + 6400 CyberStorm Mk III [Accelerator and SCSI Host Adapter] + 6e00 Blizzard 603e+ [Accelerator and SCSI Host Adapter] +2169 DPS + 0100 Personal Animation Recorder [Video Card] +2200 Apollo + 0000 A620 68020 [Accelerator] + 0100 A620 68020 [Accelerator] +2222 Apollo + 2200 AT-Apollo + 2300 1230/1240/1260/2030/4040/4060 [Accelerator] +38a5 Petsoff LP + 0000 Delfina [Audio Card] + 0100 Delfina Lite [Audio Card] + 0200 Delfina Plus [Audio Card] +3ff7 Uwe Gerlach + d400 RAM/ROM [Miscellaneous Expansion Card] +4231 ACT + 0100 Prelude [Audio Card] +4754 MacroSystems Germany + 0300 Maestro [Audio Card] + 0400 VLab [Video Card] + 0500 Maestro Pro [Audio Card] + 0600 Retina [Graphics Card] + 0800 MultiEvolution [SCSI Host Adapter] + 0c00 Toccata [Audio Card] + 0d00 Toccata Pro [Audio Card] + 1000 Retina Z3 [Graphics Card] + 1200 VLab Motion [Video Card] + 1300 Altais [Graphics Card] + fd00 Falcon '040 [Accelerator] +6766 Combitec +8000 SKI Peripherals + 0800 MAST Fireball [SCSI Host Adapter] + 8000 [SCSI Host Adapter and Dual Serial Card] +a9ad Reis-Ware + 1100 Scan King [Scanner Interface] +aa01 Cameron + 1000 Personal A4 [Scanner Interface] +aa11 Reis-Ware + 1100 Handyscanner [Scanner Interface] +b5a8 Phoenix + 2100 ST506 [HD Controller] + 2200 [SCSI Host Adapter] + be00 [RAM Expansion] +c008 Combitec + 2a00 [HD Controller] + 2b00 SRAM [RAM Expansion] diff --git a/fs/attr.c b/fs/attr.c index c4849d324..cb88697e6 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -110,6 +110,9 @@ int notify_change(struct dentry * dentry, struct iattr * attr) time_t now = CURRENT_TIME; unsigned int ia_valid = attr->ia_valid; + if (!inode) + BUG(); + attr->ia_ctime = now; if (!(ia_valid & ATTR_ATIME_SET)) attr->ia_atime = now; @@ -117,7 +120,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr) attr->ia_mtime = now; lock_kernel(); - if (inode && inode->i_op && inode->i_op->setattr) + if (inode->i_op && inode->i_op->setattr) error = inode->i_op->setattr(dentry, attr); else { error = inode_change_ok(inode, attr); diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index 9ebea1ca7..1a0532420 100644 --- a/fs/bfs/dir.c +++ b/fs/bfs/dir.c @@ -1,7 +1,7 @@ /* * fs/bfs/dir.c * BFS directory operations. - * Copyright (C) 1999 Tigran Aivazian + * Copyright (C) 1999,2000 Tigran Aivazian */ #include diff --git a/fs/bfs/file.c b/fs/bfs/file.c index 1da12e6ae..f0ee10a15 100644 --- a/fs/bfs/file.c +++ b/fs/bfs/file.c @@ -1,7 +1,7 @@ /* * fs/bfs/file.c * BFS file operations. - * Copyright (C) 1999 Tigran Aivazian + * Copyright (C) 1999,2000 Tigran Aivazian */ #include @@ -26,7 +26,7 @@ struct file_operations bfs_file_operations = { static int bfs_move_block(unsigned long from, unsigned long to, kdev_t dev) { - struct buffer_head *bh, *new = NULL; + struct buffer_head *bh, *new; bh = bread(dev, from, BFS_BSIZE); if (!bh) @@ -56,11 +56,12 @@ static int bfs_move_blocks(kdev_t dev, unsigned long start, unsigned long end, static int bfs_get_block(struct inode * inode, long block, struct buffer_head * bh_result, int create) { - long phys, next_free_block; + long phys; int err; - struct super_block *s = inode->i_sb; + struct super_block *sb = inode->i_sb; + struct buffer_head *sbh = sb->su_sbh; - if (block < 0 || block > s->su_blocks) + if (block < 0 || block > sb->su_blocks) return -EIO; phys = inode->iu_sblock + block; @@ -90,24 +91,25 @@ static int bfs_get_block(struct inode * inode, long block, /* if the last data block for this file is the last allocated block, we can extend the file trivially, without moving it anywhere */ - if (inode->iu_eblock == s->su_lf_eblk) { + if (inode->iu_eblock == sb->su_lf_eblk) { dprintf("c=%d, b=%08lx, phys=%08lx (simple extension)\n", create, block, phys); bh_result->b_dev = inode->i_dev; bh_result->b_blocknr = phys; bh_result->b_state |= (1UL << BH_Mapped); - s->su_lf_eblk = inode->iu_eblock = inode->iu_sblock + block; + sb->su_freeb -= phys - inode->iu_eblock; + sb->su_lf_eblk = inode->iu_eblock = phys; mark_inode_dirty(inode); - mark_buffer_dirty(s->su_sbh); + mark_buffer_dirty(sbh); err = 0; goto out; } /* Ok, we have to move this entire file to the next free block */ - next_free_block = s->su_lf_eblk + 1; + phys = sb->su_lf_eblk + 1; if (inode->iu_sblock) { /* if data starts on block 0 then there is no data */ err = bfs_move_blocks(inode->i_dev, inode->iu_sblock, - inode->iu_eblock, next_free_block); + inode->iu_eblock, phys); if (err) { dprintf("failed to move ino=%08lx -> fs corruption\n", inode->i_ino); goto out; @@ -115,12 +117,18 @@ static int bfs_get_block(struct inode * inode, long block, } else err = 0; - inode->iu_sblock = next_free_block; - s->su_lf_eblk = inode->iu_eblock = next_free_block + block; + dprintf("c=%d, b=%08lx, phys=%08lx (moved)\n", create, block, phys); + inode->iu_sblock = phys; + phys += block; + sb->su_lf_eblk = inode->iu_eblock = phys; + + /* this assumes nothing can write the inode back while we are here + * and thus update inode->i_blocks! (XXX)*/ + sb->su_freeb -= inode->iu_eblock - inode->iu_sblock + 1 - inode->i_blocks; mark_inode_dirty(inode); - mark_buffer_dirty(s->su_sbh); + mark_buffer_dirty(sbh); bh_result->b_dev = inode->i_dev; - bh_result->b_blocknr = inode->iu_sblock + block; + bh_result->b_blocknr = phys; bh_result->b_state |= (1UL << BH_Mapped); out: unlock_kernel(); @@ -153,8 +161,7 @@ struct address_space_operations bfs_aops = { sync_page: block_sync_page, prepare_write: bfs_prepare_write, commit_write: generic_commit_write, - bmap: bfs_bmap + bmap: bfs_bmap, }; -struct inode_operations bfs_file_inops = { -}; +struct inode_operations bfs_file_inops; diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index fe1396497..b3827a7ae 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c @@ -1,7 +1,7 @@ /* * fs/bfs/inode.c * BFS superblock and inode operations. - * Copyright (C) 1999 Tigran Aivazian + * Copyright (C) 1999,2000 Tigran Aivazian * From fs/minix, Copyright (C) 1991, 1992 Linus Torvalds. */ @@ -325,7 +325,7 @@ out: return NULL; } -static DECLARE_FSTYPE_DEV( bfs_fs_type, "bfs", bfs_read_super); +static DECLARE_FSTYPE_DEV(bfs_fs_type, "bfs", bfs_read_super); static int __init init_bfs_fs(void) { diff --git a/fs/coda/dir.c b/fs/coda/dir.c index 1629be782..e1ab9e896 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c @@ -58,7 +58,7 @@ static int coda_venus_readdir(struct file *filp, void *dirent, filldir_t filldir); int coda_fsync(struct file *, struct dentry *dentry, int datasync); -int coda_hasmknod = 0; +int coda_hasmknod; struct dentry_operations coda_dentry_operations = { diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index 486e42185..ef05ac2fb 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c @@ -54,7 +54,7 @@ extern struct file_system_type coda_fs_type; /* statistics */ -int coda_hard = 0; /* allows signals during upcalls */ +int coda_hard; /* allows signals during upcalls */ unsigned long coda_timeout = 30; /* .. secs, then signals will dequeue */ @@ -376,7 +376,7 @@ static struct file_operations coda_psdev_fops = { release: coda_psdev_release, }; -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; static int init_coda_psdev(void) { diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index a0cf6ba97..4b34da094 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c @@ -95,7 +95,7 @@ static struct inode *get_cramfs_inode(struct super_block *sb, struct cramfs_inod static unsigned char read_buffers[READ_BUFFERS][BUFFER_SIZE]; static unsigned buffer_blocknr[READ_BUFFERS]; static struct super_block * buffer_dev[READ_BUFFERS]; -static int next_buffer = 0; +static int next_buffer; /* * Returns a pointer to a buffer containing at least LEN bytes of diff --git a/fs/devfs/base.c b/fs/devfs/base.c index 3ffb8275e..264992d3f 100644 --- a/fs/devfs/base.c +++ b/fs/devfs/base.c @@ -654,7 +654,7 @@ struct devfs_entry }; /* The root of the device tree */ -static struct devfs_entry *root_entry = NULL; +static struct devfs_entry *root_entry; struct devfsd_buf_entry { diff --git a/fs/devfs/util.c b/fs/devfs/util.c index 9f71763b1..05b681b6c 100644 --- a/fs/devfs/util.c +++ b/fs/devfs/util.c @@ -114,8 +114,8 @@ void devfs_register_tape (devfs_handle_t de) int pos; devfs_handle_t parent, slave; char name[16], dest[64]; - static unsigned int tape_counter = 0; - static devfs_handle_t tape_dir = NULL; + static unsigned int tape_counter; + static devfs_handle_t tape_dir; if (tape_dir == NULL) tape_dir = devfs_mk_dir (NULL, "tapes", NULL); parent = devfs_get_parent (de); diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c index e4234cb45..10169c62c 100644 --- a/fs/ext2/namei.c +++ b/fs/ext2/namei.c @@ -183,25 +183,22 @@ static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry) return NULL; } +#define S_SHIFT 12 +static unsigned char ext2_type_by_mode[S_IFMT >> S_SHIFT] = { + [S_IFREG >> S_SHIFT] EXT2_FT_REG_FILE, + [S_IFDIR >> S_SHIFT] EXT2_FT_DIR, + [S_IFCHR >> S_SHIFT] EXT2_FT_CHRDEV, + [S_IFBLK >> S_SHIFT] EXT2_FT_BLKDEV, + [S_IFIFO >> S_SHIFT] EXT2_FT_FIFO, + [S_IFSOCK >> S_SHIFT] EXT2_FT_SOCK, + [S_IFLNK >> S_SHIFT] EXT2_FT_SYMLINK, +}; + static inline void ext2_set_de_type(struct super_block *sb, struct ext2_dir_entry_2 *de, umode_t mode) { - if (!EXT2_HAS_INCOMPAT_FEATURE(sb, EXT2_FEATURE_INCOMPAT_FILETYPE)) - return; - if (S_ISREG(mode)) - de->file_type = EXT2_FT_REG_FILE; - else if (S_ISDIR(mode)) - de->file_type = EXT2_FT_DIR; - else if (S_ISLNK(mode)) - de->file_type = EXT2_FT_SYMLINK; - else if (S_ISSOCK(mode)) - de->file_type = EXT2_FT_SOCK; - else if (S_ISFIFO(mode)) - de->file_type = EXT2_FT_FIFO; - else if (S_ISCHR(mode)) - de->file_type = EXT2_FT_CHRDEV; - else if (S_ISBLK(mode)) - de->file_type = EXT2_FT_BLKDEV; + if (EXT2_HAS_INCOMPAT_FEATURE(sb, EXT2_FEATURE_INCOMPAT_FILETYPE)) + de->file_type = ext2_type_by_mode[(mode & S_IFMT)>>S_SHIFT]; } /* diff --git a/fs/fat/cvf.c b/fs/fat/cvf.c index 5bfbaeb64..91462e135 100644 --- a/fs/fat/cvf.c +++ b/fs/fat/cvf.c @@ -98,8 +98,8 @@ struct cvf_format bigblock_cvf = { NULL }; -struct cvf_format *cvf_formats[MAX_CVF_FORMATS]={NULL,NULL,NULL}; -int cvf_format_use_count[MAX_CVF_FORMATS]={0,0,0}; +struct cvf_format *cvf_formats[MAX_CVF_FORMATS]; +int cvf_format_use_count[MAX_CVF_FORMATS]; int register_cvf_format(struct cvf_format*cvf_format) { int i,j; diff --git a/fs/hfs/trans.c b/fs/hfs/trans.c index fe8d02ad6..2e5127703 100644 --- a/fs/hfs/trans.c +++ b/fs/hfs/trans.c @@ -514,7 +514,7 @@ void hfs_latin2mac(struct hfs_name *out, const char *in, int len) int hi, lo; unsigned char code, c, *count; unsigned char *p = out->Name; - static int map_initialized = 0; + static int map_initialized; if (!map_initialized) { int i; diff --git a/fs/inode.c b/fs/inode.c index ba0a3546f..96e3664e5 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -547,7 +547,7 @@ static void clean_inode(struct inode *inode) struct inode * get_empty_inode(void) { - static unsigned long last_ino = 0; + static unsigned long last_ino; struct inode * inode; inode = alloc_inode(); diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c index 820bc4c7b..249e7514d 100644 --- a/fs/lockd/clntlock.c +++ b/fs/lockd/clntlock.c @@ -41,7 +41,7 @@ struct nlm_wait { u32 b_status; /* grant callback status */ }; -static struct nlm_wait * nlm_blocked = NULL; +static struct nlm_wait * nlm_blocked; /* * Block on a lock diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c index 283d66e97..9fcbad317 100644 --- a/fs/lockd/mon.c +++ b/fs/lockd/mon.c @@ -24,7 +24,7 @@ extern struct rpc_program nsm_program; /* * Local NSM state */ -u32 nsm_local_state = 0; +u32 nsm_local_state; /* * Common procedure for SM_MON/SM_UNMON calls diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index eae976616..c0c96854d 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @@ -40,7 +40,7 @@ static void nlmsvc_notify_blocked(struct file_lock *); /* * The list of blocked locks to retry */ -static struct nlm_block * nlm_blocked = NULL; +static struct nlm_block * nlm_blocked; /* * Insert a blocked lock into the global list diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index ec4540f12..3f6b770aa 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -796,7 +796,7 @@ static int nfs_rmdir(struct inode *dir_i, struct dentry *dentry) static int nfs_sillyrename(struct inode *dir_i, struct dentry *dentry) { struct dentry *dir = dentry->d_parent; - static unsigned int sillycounter = 0; + static unsigned int sillycounter; const int i_inosize = sizeof(dir_i->i_ino)*2; const int countersize = sizeof(sillycounter)*2; const int slen = strlen(".nfs") + i_inosize + countersize; diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c index a8b61c2e7..7fef7da99 100644 --- a/fs/nfs/nfs2xdr.c +++ b/fs/nfs/nfs2xdr.c @@ -104,7 +104,8 @@ xdr_decode_string2(u32 *p, char **string, unsigned int *len, static inline u32* xdr_decode_time(u32 *p, u64 *timep) { - *timep = ((u64)ntohl(*p++) << 32) + (u64)ntohl(*p++); + u64 tmp = (u64)ntohl(*p++) << 32; + *timep = tmp + (u64)ntohl(*p++); return p; } diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index ef8580c02..f6260a552 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c @@ -143,7 +143,8 @@ xdr_encode_time(u32 *p, time_t time) static inline u32 * xdr_decode_time3(u32 *p, u64 *timep) { - *timep = ((u64)ntohl(*p++) << 32) + (u64)ntohl(*p++); + u64 tmp = (u64)ntohl(*p++) << 32; + *timep = tmp + (u64)ntohl(*p++); return p; } @@ -184,7 +185,8 @@ xdr_decode_fattr(u32 *p, struct nfs_fattr *fattr) p = xdr_decode_hyper(p, &fattr->size); p = xdr_decode_hyper(p, &fattr->du.nfs3.used); /* Turn remote device info into Linux-specific dev_t */ - fattr->rdev = (ntohl(*p++) << MINORBITS) | (ntohl(*p++) & MINORMASK); + fattr->rdev = ntohl(*p++) << MINORBITS; + fattr->rdev |= ntohl(*p++) & MINORMASK; p = xdr_decode_hyper(p, &fattr->fsid); p = xdr_decode_hyper(p, &fattr->fileid); p = xdr_decode_time3(p, &fattr->atime); diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 6575040d9..7c1aad253 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -54,7 +54,7 @@ static void nfs_readpage_result(struct rpc_task *task); # define IS_SWAPFILE(inode) (0) #endif -static kmem_cache_t *nfs_rdata_cachep = NULL; +static kmem_cache_t *nfs_rdata_cachep; static __inline__ struct nfs_read_data *nfs_readdata_alloc(void) { diff --git a/fs/nfs/write.c b/fs/nfs/write.c index a5bda60ba..bf7a4abe4 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -102,8 +102,8 @@ static void nfs_commit_done(struct rpc_task *); # define IS_SWAPFILE(inode) (0) #endif -static kmem_cache_t *nfs_page_cachep = NULL; -static kmem_cache_t *nfs_wdata_cachep = NULL; +static kmem_cache_t *nfs_page_cachep; +static kmem_cache_t *nfs_wdata_cachep; static __inline__ struct nfs_page *nfs_page_alloc(void) { @@ -1207,7 +1207,7 @@ nfs_writeback_done(struct rpc_task *task) /* We can't handle that yet but we check for it nevertheless */ if (resp->count < argp->count && task->tk_status >= 0) { - static unsigned long complain = 0; + static unsigned long complain; if (time_before(complain, jiffies)) { printk(KERN_WARNING "NFS: Server wrote less than requested.\n"); @@ -1227,7 +1227,7 @@ nfs_writeback_done(struct rpc_task *task) * NFS_FILE_SYNC. We therefore implement this checking * as a dprintk() in order to avoid filling syslog. */ - static unsigned long complain = 0; + static unsigned long complain; if (time_before(complain, jiffies)) { dprintk("NFS: faulty NFSv3 server %s:" diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c index 425778412..8a061ebcb 100644 --- a/fs/nfsd/nfscache.c +++ b/fs/nfsd/nfscache.c @@ -38,7 +38,7 @@ static struct nfscache_head * hash_list; static struct svc_cacherep * lru_head; static struct svc_cacherep * lru_tail; static struct svc_cacherep * nfscache; -static int cache_initialized = 0; +static int cache_initialized; static int cache_disabled = 1; static int nfsd_cache_append(struct svc_rqst *rqstp, struct svc_buf *data); @@ -215,7 +215,7 @@ nfsd_cache_lookup(struct svc_rqst *rqstp, int type) /* This should not happen */ if (rp == NULL) { - static int complaints = 0; + static int complaints; printk(KERN_WARNING "nfsd: all repcache entries locked!\n"); if (++complaints > 5) { diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index 672d66bf8..7bf572e34 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@ -25,8 +25,8 @@ /* #define NFSD_DEBUG_VERBOSE 1 */ -static int nfsd_nr_verified = 0; -static int nfsd_nr_put = 0; +static int nfsd_nr_verified; +static int nfsd_nr_put; struct nfsd_getdents_callback { diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index a796885e3..f01f1de86 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -74,8 +74,8 @@ struct raparms { p_rawin; }; -static struct raparms * raparml = NULL; -static struct raparms * raparm_cache = NULL; +static struct raparms * raparml; +static struct raparms * raparm_cache; /* * Look up one component of a pathname. @@ -714,7 +714,7 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, } if (err >= 0 && stable) { - static unsigned long last_ino = 0; + static unsigned long last_ino; static kdev_t last_dev = NODEV; /* diff --git a/fs/nls/nls_base.c b/fs/nls/nls_base.c index 3ea51cdfa..e98d8490c 100644 --- a/fs/nls/nls_base.c +++ b/fs/nls/nls_base.c @@ -20,7 +20,7 @@ #endif #include -static struct nls_table *tables = (struct nls_table *) NULL; +static struct nls_table *tables; static spinlock_t nls_lock = SPIN_LOCK_UNLOCKED; /* diff --git a/fs/nls/nls_big5.c b/fs/nls/nls_big5.c index 847904ba1..250098337 100644 --- a/fs/nls/nls_big5.c +++ b/fs/nls/nls_big5.c @@ -8,7 +8,7 @@ #include #include -static struct nls_table *p_nls = NULL; +static struct nls_table *p_nls; static struct nls_table table = { "big5", diff --git a/fs/nls/nls_euc-jp.c b/fs/nls/nls_euc-jp.c index 98b380e59..196a07698 100644 --- a/fs/nls/nls_euc-jp.c +++ b/fs/nls/nls_euc-jp.c @@ -8,7 +8,7 @@ #include #include -static struct nls_table *p_nls = NULL; +static struct nls_table *p_nls; #define SS2 (0x8E) /* Single Shift 2 */ diff --git a/fs/nls/nls_euc-kr.c b/fs/nls/nls_euc-kr.c index 5219c2371..f015c21bf 100644 --- a/fs/nls/nls_euc-kr.c +++ b/fs/nls/nls_euc-kr.c @@ -8,7 +8,7 @@ #include #include -static struct nls_table *p_nls = NULL; +static struct nls_table *p_nls; static struct nls_table table = { "euc-kr", diff --git a/fs/nls/nls_gb2312.c b/fs/nls/nls_gb2312.c index 542a10e97..06c184a27 100644 --- a/fs/nls/nls_gb2312.c +++ b/fs/nls/nls_gb2312.c @@ -8,7 +8,7 @@ #include #include -static struct nls_table *p_nls = NULL; +static struct nls_table *p_nls; static struct nls_table table = { "gb2312", diff --git a/fs/nls/nls_sjis.c b/fs/nls/nls_sjis.c index ec6fb598f..463ee02a5 100644 --- a/fs/nls/nls_sjis.c +++ b/fs/nls/nls_sjis.c @@ -8,7 +8,7 @@ #include #include -static struct nls_table *p_nls = NULL; +static struct nls_table *p_nls; static struct nls_table table = { "sjis", diff --git a/fs/ntfs/fs.c b/fs/ntfs/fs.c index c99e81e6a..f9ffb0a40 100644 --- a/fs/ntfs/fs.c +++ b/fs/ntfs/fs.c @@ -416,8 +416,7 @@ static struct file_operations ntfs_file_operations_nommap = { #endif }; -static struct inode_operations ntfs_inode_operations_nobmap = { -}; +static struct inode_operations ntfs_inode_operations_nobmap; #ifdef CONFIG_NTFS_RW static int @@ -577,8 +576,7 @@ static struct file_operations ntfs_file_operations = { #endif }; -static struct inode_operations ntfs_inode_operations = { -}; +static struct inode_operations ntfs_inode_operations; static struct file_operations ntfs_dir_operations = { read: generic_read_dir, diff --git a/fs/partitions/check.c b/fs/partitions/check.c index 1dfc4ad3e..9cee2ab15 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c @@ -338,8 +338,8 @@ static void devfs_register_disc (struct gendisk *dev, int minor) devfs_handle_t dir, slave; unsigned int devfs_flags = DEVFS_FL_DEFAULT; char dirname[64], symlink[16]; - static unsigned int disc_counter = 0; - static devfs_handle_t devfs_handle = NULL; + static unsigned int disc_counter; + static devfs_handle_t devfs_handle; if (dev->part[minor].de) return; if ( dev->flags && (dev->flags[devnum] & GENHD_FL_REMOVABLE) ) diff --git a/fs/proc/base.c b/fs/proc/base.c index 7625e4d5a..a1f7efe0f 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -347,6 +347,10 @@ static ssize_t mem_read(struct file * file, char * buf, return copied; } +#define mem_write NULL + +#ifndef mem_write +/* This is a security hazard */ static ssize_t mem_write(struct file * file, const char * buf, size_t count, loff_t *ppos) { @@ -385,6 +389,7 @@ static ssize_t mem_write(struct file * file, const char * buf, free_page((unsigned long) page); return copied; } +#endif static struct file_operations proc_mem_operations = { read: mem_read, diff --git a/fs/super.c b/fs/super.c index fb5c5895c..4f2e3908a 100644 --- a/fs/super.c +++ b/fs/super.c @@ -884,24 +884,27 @@ static struct super_block *get_sb_single(struct file_system_type *fs_type, return sb; } -static struct block_device *kill_super(struct super_block *sb, int umount_root) +static void kill_super(struct super_block *sb, int umount_root) { struct block_device *bdev; kdev_t dev; struct dentry *root = sb->s_root; + struct file_system_type *fs = sb->s_type; + struct super_operations *sop = sb->s_op; + sb->s_root = NULL; /* Need to clean after the sucker */ - if (sb->s_type->fs_flags & FS_LITTER) + if (fs->fs_flags & FS_LITTER) d_genocide(root); - if (sb->s_type->fs_flags & (FS_SINGLE|FS_LITTER)) + if (fs->fs_flags & (FS_SINGLE|FS_LITTER)) shrink_dcache_parent(root); dput(root); lock_super(sb); - if (sb->s_op) { - if (sb->s_op->write_super && sb->s_dirt) - sb->s_op->write_super(sb); - if (sb->s_op->put_super) - sb->s_op->put_super(sb); + if (sop) { + if (sop->write_super && sb->s_dirt) + sop->write_super(sb); + if (sop->put_super) + sop->put_super(sb); } /* Forget any remaining inodes */ @@ -914,7 +917,7 @@ static struct block_device *kill_super(struct super_block *sb, int umount_root) sb->s_dev = 0; /* Free the superblock */ bdev = sb->s_bdev; sb->s_bdev = NULL; - put_filesystem(sb->s_type); + put_filesystem(fs); sb->s_type = NULL; unlock_super(sb); if (umount_root) { @@ -928,7 +931,6 @@ static struct block_device *kill_super(struct super_block *sb, int umount_root) bdput(bdev); } else put_unnamed_dev(dev); - return bdev; } /* diff --git a/fs/umsdos/inode.c b/fs/umsdos/inode.c index 4aebe9bda..4b661b5af 100644 --- a/fs/umsdos/inode.c +++ b/fs/umsdos/inode.c @@ -22,8 +22,8 @@ extern struct dentry_operations umsdos_dentry_operations; -struct dentry *saved_root = NULL; /* Original root if changed */ -struct inode *pseudo_root = NULL; /* Useful to simulate the pseudo DOS */ +struct dentry *saved_root; /* Original root if changed */ +struct inode *pseudo_root; /* Useful to simulate the pseudo DOS */ /* directory. See UMSDOS_readdir_x() */ static struct dentry *check_pseudo_root(struct super_block *); diff --git a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h index dc23ef74d..dd09a2eec 100644 --- a/include/asm-alpha/pgalloc.h +++ b/include/asm-alpha/pgalloc.h @@ -80,7 +80,7 @@ ev5_flush_tlb_current(struct mm_struct *mm) __load_new_mm_context(mm); } -extern inline void +static inline void flush_tlb_other(struct mm_struct *mm) { mm->context = 0; @@ -234,27 +234,13 @@ extern struct pgtable_cache_struct { #define pte_quicklist (quicklists.pte_cache) #define pgtable_cache_size (quicklists.pgtable_cache_sz) -extern __inline__ pgd_t *get_pgd_slow(void) -{ - pgd_t *ret = (pgd_t *)__get_free_page(GFP_KERNEL), *init; - - if (ret) { - init = pgd_offset(&init_mm, 0UL); - memset (ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t)); - memcpy (ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD, - (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); - - pgd_val(ret[PTRS_PER_PGD]) - = pte_val(mk_pte(virt_to_page(ret), PAGE_KERNEL)); - } - return ret; -} +extern pgd_t *get_pgd_slow(void); -extern __inline__ pgd_t *get_pgd_fast(void) +static inline pgd_t *get_pgd_fast(void) { unsigned long *ret; - if((ret = pgd_quicklist) != NULL) { + if ((ret = pgd_quicklist) != NULL) { pgd_quicklist = (unsigned long *)(*ret); ret[0] = ret[1]; pgtable_cache_size--; @@ -263,25 +249,25 @@ extern __inline__ pgd_t *get_pgd_fast(void) return (pgd_t *)ret; } -extern __inline__ void free_pgd_fast(pgd_t *pgd) +static inline void free_pgd_fast(pgd_t *pgd) { *(unsigned long *)pgd = (unsigned long) pgd_quicklist; pgd_quicklist = (unsigned long *) pgd; pgtable_cache_size++; } -extern __inline__ void free_pgd_slow(pgd_t *pgd) +static inline void free_pgd_slow(pgd_t *pgd) { free_page((unsigned long)pgd); } extern pmd_t *get_pmd_slow(pgd_t *pgd, unsigned long address_premasked); -extern __inline__ pmd_t *get_pmd_fast(void) +static inline pmd_t *get_pmd_fast(void) { unsigned long *ret; - if((ret = (unsigned long *)pte_quicklist) != NULL) { + if ((ret = (unsigned long *)pte_quicklist) != NULL) { pte_quicklist = (unsigned long *)(*ret); ret[0] = ret[1]; pgtable_cache_size--; @@ -289,25 +275,25 @@ extern __inline__ pmd_t *get_pmd_fast(void) return (pmd_t *)ret; } -extern __inline__ void free_pmd_fast(pmd_t *pmd) +static inline void free_pmd_fast(pmd_t *pmd) { *(unsigned long *)pmd = (unsigned long) pte_quicklist; pte_quicklist = (unsigned long *) pmd; pgtable_cache_size++; } -extern __inline__ void free_pmd_slow(pmd_t *pmd) +static inline void free_pmd_slow(pmd_t *pmd) { free_page((unsigned long)pmd); } extern pte_t *get_pte_slow(pmd_t *pmd, unsigned long address_preadjusted); -extern __inline__ pte_t *get_pte_fast(void) +static inline pte_t *get_pte_fast(void) { unsigned long *ret; - if((ret = (unsigned long *)pte_quicklist) != NULL) { + if ((ret = (unsigned long *)pte_quicklist) != NULL) { pte_quicklist = (unsigned long *)(*ret); ret[0] = ret[1]; pgtable_cache_size--; @@ -315,14 +301,14 @@ extern __inline__ pte_t *get_pte_fast(void) return (pte_t *)ret; } -extern __inline__ void free_pte_fast(pte_t *pte) +static inline void free_pte_fast(pte_t *pte) { *(unsigned long *)pte = (unsigned long) pte_quicklist; pte_quicklist = (unsigned long *) pte; pgtable_cache_size++; } -extern __inline__ void free_pte_slow(pte_t *pte) +static inline void free_pte_slow(pte_t *pte) { free_page((unsigned long)pte); } @@ -337,7 +323,7 @@ extern void __bad_pmd(pgd_t *pgd); #define pgd_free(pgd) free_pgd_fast(pgd) #define pgd_alloc() get_pgd_fast() -extern inline pte_t * pte_alloc(pmd_t *pmd, unsigned long address) +static inline pte_t * pte_alloc(pmd_t *pmd, unsigned long address) { address = (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1); if (pmd_none(*pmd)) { @@ -355,7 +341,7 @@ extern inline pte_t * pte_alloc(pmd_t *pmd, unsigned long address) return (pte_t *) pmd_page(*pmd) + address; } -extern inline pmd_t * pmd_alloc(pgd_t *pgd, unsigned long address) +static inline pmd_t * pmd_alloc(pgd_t *pgd, unsigned long address) { address = (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1); if (pgd_none(*pgd)) { @@ -378,20 +364,4 @@ extern inline pmd_t * pmd_alloc(pgd_t *pgd, unsigned long address) extern int do_check_pgt_cache(int, int); -extern inline void set_pgdir(unsigned long address, pgd_t entry) -{ - struct task_struct * p; - pgd_t *pgd; - - read_lock(&tasklist_lock); - for_each_task(p) { - if (!p->mm) - continue; - *pgd_offset(p->mm,address) = entry; - } - read_unlock(&tasklist_lock); - for (pgd = (pgd_t *)pgd_quicklist; pgd; pgd = (pgd_t *)*(unsigned long *)pgd) - pgd[(address >> PGDIR_SHIFT) & (PTRS_PER_PAGE - 1)] = entry; -} - #endif /* _ALPHA_PGALLOC_H */ diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h index d68e18332..5c4373d3b 100644 --- a/include/asm-alpha/pgtable.h +++ b/include/asm-alpha/pgtable.h @@ -33,22 +33,23 @@ /* * Entries per page directory level: the Alpha is three-level, with * all levels having a one-page page table. - * - * The PGD is special: the last entry is reserved for self-mapping. */ #define PTRS_PER_PTE (1UL << (PAGE_SHIFT-3)) #define PTRS_PER_PMD (1UL << (PAGE_SHIFT-3)) -#define PTRS_PER_PGD ((1UL << (PAGE_SHIFT-3))-1) +#define PTRS_PER_PGD (1UL << (PAGE_SHIFT-3)) #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) #define FIRST_USER_PGD_NR 0 /* Number of pointers that fit on a page: this will go away. */ #define PTRS_PER_PAGE (1UL << (PAGE_SHIFT-3)) -#define CONSOLE_REMAP_START 0xFFFFFE0000000000 -#define VMALLOC_START (CONSOLE_REMAP_START + PMD_SIZE) +#ifdef CONFIG_ALPHA_LARGE_VMALLOC +#define VMALLOC_START 0xfffffe0000000000 +#else +#define VMALLOC_START (-2*PGDIR_SIZE) +#endif #define VMALLOC_VMADDR(x) ((unsigned long)(x)) -#define VMALLOC_END (~0UL) +#define VMALLOC_END (-PGDIR_SIZE) /* * OSF/1 PAL-code-imposed page table bits @@ -260,7 +261,7 @@ extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= __ACCESS_BITS; retu #define pgd_offset_k(address) pgd_offset(&init_mm, address) /* to find an entry in a page-table-directory. */ -#define pgd_index(address) ((address >> PGDIR_SHIFT) & PTRS_PER_PGD) +#define pgd_index(address) ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)) #define __pgd_offset(address) pgd_index(address) #define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address)) @@ -319,4 +320,6 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) extern void paging_init(void); +#include + #endif /* _ALPHA_PGTABLE_H */ diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index a18b26035..09c7421cc 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h @@ -185,6 +185,8 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; #define io_remap_page_range remap_page_range +#include + #endif /* !__ASSEMBLY__ */ #endif /* _ASMARM_PGTABLE_H */ diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h new file mode 100644 index 000000000..07c393d2e --- /dev/null +++ b/include/asm-generic/pgtable.h @@ -0,0 +1,41 @@ +#ifndef _ASM_GENERIC_PGTABLE_H +#define _ASM_GENERIC_PGTABLE_H + +static inline int ptep_test_and_clear_young(pte_t *ptep) +{ + pte_t pte = *ptep; + if (!pte_young(pte)) + return 0; + set_pte(ptep, pte_mkold(pte)); + return 1; +} + +static inline int ptep_test_and_clear_dirty(pte_t *ptep) +{ + pte_t pte = *ptep; + if (!pte_dirty(pte)) + return 0; + set_pte(ptep, pte_mkclean(pte)); + return 1; +} + +static inline pte_t ptep_get_and_clear(pte_t *ptep) +{ + pte_t pte = *ptep; + pte_clear(ptep); + return pte; +} + +static inline void ptep_clear_wrprotect(pte_t *ptep) +{ + pte_t old_pte = *ptep; + set_pte(ptep, pte_wrprotect(old_pte)); +} + +static inline void ptep_mkdirty(pte_t *ptep) +{ + pte_t old_pte = *ptep; + set_pte(ptep, pte_mkdirty(old_pte)); +} + +#endif /* _ASM_GENERIC_PGTABLE_H */ diff --git a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h index 008a3d47d..c60710120 100644 --- a/include/asm-i386/bugs.h +++ b/include/asm-i386/bugs.h @@ -426,5 +426,5 @@ static void __init check_bugs(void) check_pentium_f00f(); #endif check_cyrix_coma(); - system_utsname.machine[1] = '0' + boot_cpu_data.x86; + system_utsname.machine[1] = '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86); } diff --git a/include/asm-i386/cache.h b/include/asm-i386/cache.h index de4a7a87c..615911e5b 100644 --- a/include/asm-i386/cache.h +++ b/include/asm-i386/cache.h @@ -6,7 +6,8 @@ #include -/* bytes per L1 cache line */ -#define L1_CACHE_BYTES CONFIG_X86_L1_CACHE_BYTES +/* L1 cache line size */ +#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) +#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) #endif diff --git a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h index 04a41eb58..641fa495a 100644 --- a/include/asm-i386/floppy.h +++ b/include/asm-i386/floppy.h @@ -45,11 +45,11 @@ #define FLOPPY_CAN_FALLBACK_ON_NODMA -static int virtual_dma_count=0; -static int virtual_dma_residue=0; -static char *virtual_dma_addr=0; -static int virtual_dma_mode=0; -static int doing_pdma=0; +static int virtual_dma_count; +static int virtual_dma_residue; +static char *virtual_dma_addr; +static int virtual_dma_mode; +static int doing_pdma; static void floppy_hardint(int irq, void *dev_id, struct pt_regs * regs) { diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h index 03b2ba400..8272b8f29 100644 --- a/include/asm-i386/page.h +++ b/include/asm-i386/page.h @@ -37,20 +37,20 @@ * These are used to make use of C type-checking.. */ #if CONFIG_X86_PAE -typedef struct { unsigned long long pte; } pte_t; +typedef struct { unsigned long pte_low, pte_high; } pte_t; typedef struct { unsigned long long pmd; } pmd_t; typedef struct { unsigned long long pgd; } pgd_t; -#define PTE_MASK (~(unsigned long long) (PAGE_SIZE-1)) +#define pte_val(x) ((x).pte_low | ((unsigned long long)(x).pte_high << 32)) #else -typedef struct { unsigned long pte; } pte_t; +typedef struct { unsigned long pte_low; } pte_t; typedef struct { unsigned long pmd; } pmd_t; typedef struct { unsigned long pgd; } pgd_t; -#define PTE_MASK PAGE_MASK +#define pte_val(x) ((x).pte_low) #endif +#define PTE_MASK PAGE_MASK typedef struct { unsigned long pgprot; } pgprot_t; -#define pte_val(x) ((x).pte) #define pmd_val(x) ((x).pmd) #define pgd_val(x) ((x).pgd) #define pgprot_val(x) ((x).pgprot) diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-i386/pgtable-2level.h index dbb12f801..bb5c2077e 100644 --- a/include/asm-i386/pgtable-2level.h +++ b/include/asm-i386/pgtable-2level.h @@ -18,7 +18,7 @@ #define PTRS_PER_PTE 1024 #define pte_ERROR(e) \ - printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) + printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, (e).pte_low) #define pmd_ERROR(e) \ printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e)) #define pgd_ERROR(e) \ @@ -54,5 +54,10 @@ extern inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address) { return (pmd_t *) dir; } +#define ptep_get_and_clear(xp) __pte(xchg(&(xp)->pte_low, 0)) +#define pte_same(a, b) ((a).pte_low == (b).pte_low) +#define pte_page(x) (mem_map+((unsigned long)(((x).pte_low >> PAGE_SHIFT)))) +#define pte_none(x) (!(x).pte_low) +#define __mk_pte(page_nr,pgprot) __pte(((page_nr) << PAGE_SHIFT) | pgprot_val(pgprot)) #endif /* _I386_PGTABLE_2LEVEL_H */ diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h index 5ee848ef3..aac1e3121 100644 --- a/include/asm-i386/pgtable-3level.h +++ b/include/asm-i386/pgtable-3level.h @@ -27,7 +27,7 @@ #define PTRS_PER_PTE 512 #define pte_ERROR(e) \ - printk("%s:%d: bad pte %p(%016Lx).\n", __FILE__, __LINE__, &(e), pte_val(e)) + printk("%s:%d: bad pte %p(%08lx%08lx).\n", __FILE__, __LINE__, &(e), (e).pte_high, (e).pte_low) #define pmd_ERROR(e) \ printk("%s:%d: bad pmd %p(%016Lx).\n", __FILE__, __LINE__, &(e), pmd_val(e)) #define pgd_ERROR(e) \ @@ -45,8 +45,18 @@ extern inline int pgd_bad(pgd_t pgd) { return 0; } extern inline int pgd_present(pgd_t pgd) { return !pgd_none(pgd); } -#define set_pte(pteptr,pteval) \ - set_64bit((unsigned long long *)(pteptr),pte_val(pteval)) +/* Rules for using set_pte: the pte being assigned *must* be + * either not present or in a state where the hardware will + * not attempt to update the pte. In places where this is + * not possible, use pte_get_and_clear to obtain the old pte + * value and then use set_pte to update it. -ben + */ +static inline void set_pte(pte_t *ptep, pte_t pte) +{ + ptep->pte_high = pte.pte_high; + smp_wmb(); + ptep->pte_low = pte.pte_low; +} #define set_pmd(pmdptr,pmdval) \ set_64bit((unsigned long long *)(pmdptr),pmd_val(pmdval)) #define set_pgd(pgdptr,pgdval) \ @@ -76,4 +86,33 @@ extern inline void pgd_clear (pgd_t * pgd) #define pmd_offset(dir, address) ((pmd_t *) pgd_page(*(dir)) + \ __pmd_offset(address)) +static inline pte_t ptep_get_and_clear(pte_t *ptep) +{ + pte_t res; + + /* xchg acts as a barrier before the setting of the high bits */ + res.pte_low = xchg(&ptep->pte_low, 0); + res.pte_high = ptep->pte_high; + ptep->pte_high = 0; + + return res; +} + +static inline int pte_same(pte_t a, pte_t b) +{ + return a.pte_low == b.pte_low && a.pte_high == b.pte_high; +} + +#define pte_page(x) (mem_map+(((x).pte_low >> PAGE_SHIFT) | ((x).pte_high << (32 - PAGE_SHIFT)))) +#define pte_none(x) (!(x).pte_low && !(x).pte_high) + +static inline pte_t __mk_pte(unsigned long page_nr, pgprot_t pgprot) +{ + pte_t pte; + + pte.pte_high = page_nr >> (32 - PAGE_SHIFT); + pte.pte_low = (page_nr << PAGE_SHIFT) | pgprot_val(pgprot); + return pte; +} + #endif /* _I386_PGTABLE_3LEVEL_H */ diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index 4de265da0..5460e6ccc 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h @@ -17,6 +17,10 @@ #include #include +#ifndef _I386_BITOPS_H +#include +#endif + extern pgd_t swapper_pg_dir[1024]; extern void paging_init(void); @@ -145,6 +149,16 @@ extern unsigned long empty_zero_page[1024]; * the page directory entry points directly to a 4MB-aligned block of * memory. */ +#define _PAGE_BIT_PRESENT 0 +#define _PAGE_BIT_RW 1 +#define _PAGE_BIT_USER 2 +#define _PAGE_BIT_PWT 3 +#define _PAGE_BIT_PCD 4 +#define _PAGE_BIT_ACCESSED 5 +#define _PAGE_BIT_DIRTY 6 +#define _PAGE_BIT_PSE 7 /* 4 MB (or 2MB) page, Pentium+, if present.. */ +#define _PAGE_BIT_GLOBAL 8 /* Global TLB entry PPro+ */ + #define _PAGE_PRESENT 0x001 #define _PAGE_RW 0x002 #define _PAGE_USER 0x004 @@ -231,8 +245,7 @@ extern unsigned long pg0[1024]; extern void __handle_bad_pmd(pmd_t * pmd); extern void __handle_bad_pmd_kernel(pmd_t * pmd); -#define pte_none(x) (!pte_val(x)) -#define pte_present(x) (pte_val(x) & (_PAGE_PRESENT | _PAGE_PROTNONE)) +#define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE)) #define pte_clear(xp) do { set_pte(xp, __pte(0)); } while (0) #define pmd_none(x) (!pmd_val(x)) @@ -246,49 +259,49 @@ extern void __handle_bad_pmd_kernel(pmd_t * pmd); */ #define page_address(page) ((page)->virtual) #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) -#define pte_page(x) (mem_map+((unsigned long)((pte_val(x) >> PAGE_SHIFT)))) /* * The following only work if pte_present() is true. * Undefined behaviour if not.. */ -extern inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; } -extern inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_USER; } -extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } -extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } -extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } - -extern inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } -extern inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } -extern inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } -extern inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; } -extern inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); return pte; } -extern inline pte_t pte_mkread(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; } -extern inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; } -extern inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } -extern inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } -extern inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; } +static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_USER; } +static inline int pte_exec(pte_t pte) { return (pte).pte_low & _PAGE_USER; } +static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_DIRTY; } +static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; } +static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_RW; } + +static inline pte_t pte_rdprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_USER; return pte; } +static inline pte_t pte_exprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_USER; return pte; } +static inline pte_t pte_mkclean(pte_t pte) { (pte).pte_low &= ~_PAGE_DIRTY; return pte; } +static inline pte_t pte_mkold(pte_t pte) { (pte).pte_low &= ~_PAGE_ACCESSED; return pte; } +static inline pte_t pte_wrprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_RW; return pte; } +static inline pte_t pte_mkread(pte_t pte) { (pte).pte_low |= _PAGE_USER; return pte; } +static inline pte_t pte_mkexec(pte_t pte) { (pte).pte_low |= _PAGE_USER; return pte; } +static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte_low |= _PAGE_DIRTY; return pte; } +static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte_low |= _PAGE_ACCESSED; return pte; } +static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; } + +static inline int ptep_test_and_clear_dirty(pte_t *ptep) { return test_and_clear_bit(_PAGE_BIT_DIRTY, ptep); } +static inline int ptep_test_and_clear_young(pte_t *ptep) { return test_and_clear_bit(_PAGE_BIT_ACCESSED, ptep); } +static inline void ptep_clear_wrprotect(pte_t *ptep) { clear_bit(_PAGE_BIT_RW, ptep); } +static inline void ptep_mkdirty(pte_t *ptep) { set_bit(_PAGE_BIT_RW, ptep); } /* * Conversion functions: convert a page and protection to a page entry, * and a page entry and page directory to the page they refer to. */ -#define mk_pte(page,pgprot) \ -({ \ - pte_t __pte; \ - \ - set_pte(&__pte, __pte(((page)-mem_map) * \ - (unsigned long long)PAGE_SIZE + pgprot_val(pgprot))); \ - __pte; \ -}) +#define mk_pte(page, pgprot) __mk_pte((page) - mem_map, (pgprot)) /* This takes a physical page address that is used by the remapping functions */ -#define mk_pte_phys(physpage, pgprot) \ -({ pte_t __pte; set_pte(&__pte, __pte(physpage + pgprot_val(pgprot))); __pte; }) +#define mk_pte_phys(physpage, pgprot) __mk_pte((physpage) >> PAGE_SHIFT, pgprot) -extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) -{ set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; } +static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) +{ + pte.pte_low &= _PAGE_CHG_MASK; + pte.pte_low |= pgprot_val(newprot); + return pte; +} #define page_pte(page) page_pte_prot(page, __pgprot(0)) @@ -324,7 +337,7 @@ extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) #define SWP_TYPE(x) (((x).val >> 1) & 0x3f) #define SWP_OFFSET(x) ((x).val >> 8) #define SWP_ENTRY(type, offset) ((swp_entry_t) { ((type) << 1) | ((offset) << 8) }) -#define pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) +#define pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_low }) #define swp_entry_to_pte(x) ((pte_t) { (x).val }) #define module_map vmalloc diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h index 98b4787e5..6fbed9cc1 100644 --- a/include/asm-ia64/pgtable.h +++ b/include/asm-ia64/pgtable.h @@ -437,6 +437,8 @@ do { \ extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)]; #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) +#include + # endif /* !__ASSEMBLY__ */ #endif /* _ASM_IA64_PGTABLE_H */ diff --git a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h index bedaecc4e..2e128ff48 100644 --- a/include/asm-m68k/pgtable.h +++ b/include/asm-m68k/pgtable.h @@ -399,4 +399,6 @@ extern inline void update_mmu_cache(struct vm_area_struct * vma, #define io_remap_page_range remap_page_range +#include + #endif /* _M68K_PGTABLE_H */ diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index f11b734bc..ddf041e4a 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h @@ -714,6 +714,8 @@ extern inline void set_context(unsigned long val) : : "r" (val)); } +#include + #endif /* !defined (_LANGUAGE_ASSEMBLY) */ #define io_remap_page_range remap_page_range diff --git a/include/asm-mips64/pgtable.h b/include/asm-mips64/pgtable.h index b959ab03a..8714bacd6 100644 --- a/include/asm-mips64/pgtable.h +++ b/include/asm-mips64/pgtable.h @@ -767,6 +767,8 @@ extern inline void set_context(unsigned long val) : : "r" (val)); } +#include + #endif /* !defined (_LANGUAGE_ASSEMBLY) */ #endif /* _ASM_PGTABLE_H */ diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index c5a90fba0..27c89e13e 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h @@ -488,6 +488,7 @@ extern void kernel_set_cachemode (unsigned long address, unsigned long size, #define io_remap_page_range remap_page_range +#include #endif __ASSEMBLY__ #endif /* _PPC_PGTABLE_H */ diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h index d6509ea2f..ae4f3b505 100644 --- a/include/asm-s390/pgtable.h +++ b/include/asm-s390/pgtable.h @@ -408,6 +408,8 @@ extern inline void update_mmu_cache(struct vm_area_struct * vma, #define module_map vmalloc #define module_unmap vfree +#include + #endif /* !__ASSEMBLY__ */ /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h index f84b7904a..323b7eb7c 100644 --- a/include/asm-sh/pgtable.h +++ b/include/asm-sh/pgtable.h @@ -257,6 +257,8 @@ extern void update_mmu_cache(struct vm_area_struct * vma, #define module_map vmalloc #define module_unmap vfree +#include + #endif /* !__ASSEMBLY__ */ /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ diff --git a/include/asm-sparc/pgalloc.h b/include/asm-sparc/pgalloc.h index 66e4aab80..167387e5b 100644 --- a/include/asm-sparc/pgalloc.h +++ b/include/asm-sparc/pgalloc.h @@ -1,4 +1,4 @@ -/* $Id: pgalloc.h,v 1.10 2000/10/13 01:40:26 davem Exp $ */ +/* $Id: pgalloc.h,v 1.11 2000/10/16 14:32:49 anton Exp $ */ #ifndef _SPARC_PGALLOC_H #define _SPARC_PGALLOC_H @@ -139,8 +139,4 @@ BTFIXUPDEF_CALL(pgd_t *, pgd_alloc, void) #define pgd_free(pgd) BTFIXUP_CALL(pgd_free)(pgd) #define pgd_alloc() BTFIXUP_CALL(pgd_alloc)() -#error Anton, you need to do set_pgdir things now as on ix86, see i386/mm/fault.c - -#define set_pgdir(address,entry) BTFIXUP_CALL(set_pgdir)(address,entry) - #endif /* _SPARC64_PGALLOC_H */ diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h index 8562fc287..202ebe6d9 100644 --- a/include/asm-sparc/pgtable.h +++ b/include/asm-sparc/pgtable.h @@ -1,4 +1,4 @@ -/* $Id: pgtable.h,v 1.102 2000/08/14 00:46:13 anton Exp $ */ +/* $Id: pgtable.h,v 1.103 2000/10/16 14:32:49 anton Exp $ */ #ifndef _SPARC_PGTABLE_H #define _SPARC_PGTABLE_H @@ -321,8 +321,10 @@ BTFIXUPDEF_CALL_CONST(pte_t, mk_pte_io, unsigned long, pgprot_t, int) #define mk_pte_io(page,pgprot,space) BTFIXUP_CALL(mk_pte_io)(page,pgprot,space) BTFIXUPDEF_CALL(void, pgd_set, pgd_t *, pmd_t *) +BTFIXUPDEF_CALL(void, pmd_set, pmd_t *, pte_t *) #define pgd_set(pgdp,pmdp) BTFIXUP_CALL(pgd_set)(pgdp,pmdp) +#define pmd_set(pmdp,ptep) BTFIXUP_CALL(pmd_set)(pmdp,ptep) BTFIXUPDEF_INT(pte_modify_mask) @@ -455,6 +457,8 @@ extern unsigned long *sparc_valid_addr_bitmap; extern int io_remap_page_range(unsigned long from, unsigned long to, unsigned long size, pgprot_t prot, int space); +#include + #endif /* !(__ASSEMBLY__) */ /* We provide our own get_unmapped_area to cope with VA holes for userland */ diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index 070fb31db..6eb90b44c 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h @@ -295,6 +295,8 @@ extern unsigned long *sparc64_valid_addr_bitmap; extern int io_remap_page_range(unsigned long from, unsigned long offset, unsigned long size, pgprot_t prot, int space); +#include + #endif /* !(__ASSEMBLY__) */ /* We provide our own get_unmapped_area to cope with VA holes for userland */ diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 359905839..6560f2901 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h @@ -8,6 +8,7 @@ #include #include #include +#include /* * simple boot-time physical memory area allocator. @@ -43,16 +44,16 @@ extern void * __init __alloc_bootmem (unsigned long size, unsigned long align, u __alloc_bootmem((x), PAGE_SIZE, 0) extern unsigned long __init free_all_bootmem (void); -extern unsigned long __init init_bootmem_node (int nid, unsigned long freepfn, unsigned long startpfn, unsigned long endpfn); -extern void __init reserve_bootmem_node (int nid, unsigned long physaddr, unsigned long size); -extern void __init free_bootmem_node (int nid, unsigned long addr, unsigned long size); -extern unsigned long __init free_all_bootmem_node (int nid); -extern void * __init __alloc_bootmem_node (int nid, unsigned long size, unsigned long align, unsigned long goal); -#define alloc_bootmem_node(nid, x) \ - __alloc_bootmem_node((nid), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) -#define alloc_bootmem_pages_node(nid, x) \ - __alloc_bootmem_node((nid), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) -#define alloc_bootmem_low_pages_node(nid, x) \ - __alloc_bootmem_node((nid), (x), PAGE_SIZE, 0) +extern unsigned long __init init_bootmem_node (pg_data_t *pgdat, unsigned long freepfn, unsigned long startpfn, unsigned long endpfn); +extern void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size); +extern void __init free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size); +extern unsigned long __init free_all_bootmem_node (pg_data_t *pgdat); +extern void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal); +#define alloc_bootmem_node(pgdat, x) \ + __alloc_bootmem_node((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) +#define alloc_bootmem_pages_node(pgdat, x) \ + __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) +#define alloc_bootmem_low_pages_node(pgdat, x) \ + __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, 0) #endif /* _LINUX_BOOTMEM_H */ diff --git a/include/linux/byteorder/big_endian.h b/include/linux/byteorder/big_endian.h index ebd81c013..b84efd74c 100644 --- a/include/linux/byteorder/big_endian.h +++ b/include/linux/byteorder/big_endian.h @@ -14,12 +14,12 @@ #define __constant_ntohl(x) ((__u32)(x)) #define __constant_htons(x) ((__u16)(x)) #define __constant_ntohs(x) ((__u16)(x)) -#define __constant_cpu_to_le64(x) ___swab64((x)) -#define __constant_le64_to_cpu(x) ___swab64((x)) -#define __constant_cpu_to_le32(x) ___swab32((x)) -#define __constant_le32_to_cpu(x) ___swab32((x)) -#define __constant_cpu_to_le16(x) ___swab16((x)) -#define __constant_le16_to_cpu(x) ___swab16((x)) +#define __constant_cpu_to_le64(x) ___constant_swab64((x)) +#define __constant_le64_to_cpu(x) ___constant_swab64((x)) +#define __constant_cpu_to_le32(x) ___constant_swab32((x)) +#define __constant_le32_to_cpu(x) ___constant_swab32((x)) +#define __constant_cpu_to_le16(x) ___constant_swab16((x)) +#define __constant_le16_to_cpu(x) ___constant_swab16((x)) #define __constant_cpu_to_be64(x) ((__u64)(x)) #define __constant_be64_to_cpu(x) ((__u64)(x)) #define __constant_cpu_to_be32(x) ((__u32)(x)) diff --git a/include/linux/byteorder/little_endian.h b/include/linux/byteorder/little_endian.h index 5a5412403..143166362 100644 --- a/include/linux/byteorder/little_endian.h +++ b/include/linux/byteorder/little_endian.h @@ -10,22 +10,22 @@ #include -#define __constant_htonl(x) ___swab32((x)) -#define __constant_ntohl(x) ___swab32((x)) -#define __constant_htons(x) ___swab16((x)) -#define __constant_ntohs(x) ___swab16((x)) +#define __constant_htonl(x) ___constant_swab32((x)) +#define __constant_ntohl(x) ___constant_swab32((x)) +#define __constant_htons(x) ___constant_swab16((x)) +#define __constant_ntohs(x) ___constant_swab16((x)) #define __constant_cpu_to_le64(x) ((__u64)(x)) #define __constant_le64_to_cpu(x) ((__u64)(x)) #define __constant_cpu_to_le32(x) ((__u32)(x)) #define __constant_le32_to_cpu(x) ((__u32)(x)) #define __constant_cpu_to_le16(x) ((__u16)(x)) #define __constant_le16_to_cpu(x) ((__u16)(x)) -#define __constant_cpu_to_be64(x) ___swab64((x)) -#define __constant_be64_to_cpu(x) ___swab64((x)) -#define __constant_cpu_to_be32(x) ___swab32((x)) -#define __constant_be32_to_cpu(x) ___swab32((x)) -#define __constant_cpu_to_be16(x) ___swab16((x)) -#define __constant_be16_to_cpu(x) ___swab16((x)) +#define __constant_cpu_to_be64(x) ___constant_swab64((x)) +#define __constant_be64_to_cpu(x) ___constant_swab64((x)) +#define __constant_cpu_to_be32(x) ___constant_swab32((x)) +#define __constant_be32_to_cpu(x) ___constant_swab32((x)) +#define __constant_cpu_to_be16(x) ___constant_swab16((x)) +#define __constant_be16_to_cpu(x) ___constant_swab16((x)) #define __cpu_to_le64(x) ((__u64)(x)) #define __le64_to_cpu(x) ((__u64)(x)) #define __cpu_to_le32(x) ((__u32)(x)) diff --git a/include/linux/byteorder/pdp_endian.h b/include/linux/byteorder/pdp_endian.h index 90f8c7433..618631cbc 100644 --- a/include/linux/byteorder/pdp_endian.h +++ b/include/linux/byteorder/pdp_endian.h @@ -30,22 +30,22 @@ #include #include -#define __constant_htonl(x) ___swahb32((x)) -#define __constant_ntohl(x) ___swahb32((x)) -#define __constant_htons(x) ___swab16((x)) -#define __constant_ntohs(x) ___swab16((x)) +#define __constant_htonl(x) ___constant_swahb32((x)) +#define __constant_ntohl(x) ___constant_swahb32((x)) +#define __constant_htons(x) ___constant_swab16((x)) +#define __constant_ntohs(x) ___constant_swab16((x)) #define __constant_cpu_to_le64(x) I DON'T KNOW #define __constant_le64_to_cpu(x) I DON'T KNOW -#define __constant_cpu_to_le32(x) ___swahw32((x)) -#define __constant_le32_to_cpu(x) ___swahw32((x)) +#define __constant_cpu_to_le32(x) ___constant_swahw32((x)) +#define __constant_le32_to_cpu(x) ___constant_swahw32((x)) #define __constant_cpu_to_le16(x) ((__u16)(x) #define __constant_le16_to_cpu(x) ((__u16)(x) #define __constant_cpu_to_be64(x) I DON'T KNOW #define __constant_be64_to_cpu(x) I DON'T KNOW -#define __constant_cpu_to_be32(x) ___swahb32((x)) -#define __constant_be32_to_cpu(x) ___swahb32((x)) -#define __constant_cpu_to_be16(x) ___swab16((x)) -#define __constant_be16_to_cpu(x) ___swab16((x)) +#define __constant_cpu_to_be32(x) ___constant_swahb32((x)) +#define __constant_be32_to_cpu(x) ___constant_swahb32((x)) +#define __constant_cpu_to_be16(x) ___constant_swab16((x)) +#define __constant_be16_to_cpu(x) ___constant_swab16((x)) #define __cpu_to_le64(x) I DON'T KNOW #define __le64_to_cpu(x) I DON'T KNOW #define __cpu_to_le32(x) ___swahw32((x)) diff --git a/include/linux/byteorder/swab.h b/include/linux/byteorder/swab.h index 23f1be7d7..f75dccef4 100644 --- a/include/linux/byteorder/swab.h +++ b/include/linux/byteorder/swab.h @@ -19,16 +19,48 @@ * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way. */ #define ___swab16(x) \ +({ \ + __u16 __x = (x); \ + ((__u16)( \ + (((__u16)(__x) & (__u16)0x00ffU) << 8) | \ + (((__u16)(__x) & (__u16)0xff00U) >> 8) )); \ +}) + +#define ___swab32(x) \ +({ \ + __u32 __x = (x); \ + ((__u32)( \ + (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | \ + (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | \ + (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | \ + (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); \ +}) + +#define ___swab64(x) \ +({ \ + __u64 __x = (x); \ + ((__u64)( \ + (__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | \ + (__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | \ + (__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | \ + (__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) | \ + (__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) | \ + (__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | \ + (__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | \ + (__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); \ +}) + +#define ___constant_swab16(x) \ ((__u16)( \ (((__u16)(x) & (__u16)0x00ffU) << 8) | \ (((__u16)(x) & (__u16)0xff00U) >> 8) )) -#define ___swab32(x) \ +#define ___constant_swab32(x) \ ((__u32)( \ (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \ (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \ (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \ (((__u32)(x) & (__u32)0xff000000UL) >> 24) )) -#define ___swab64(x) \ +#define ___constant_swab64(x) \ ((__u64)( \ (__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \ (__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \ diff --git a/include/linux/byteorder/swabb.h b/include/linux/byteorder/swabb.h index 782db2e8e..a10ef3086 100644 --- a/include/linux/byteorder/swabb.h +++ b/include/linux/byteorder/swabb.h @@ -25,12 +25,26 @@ * */ - #define ___swahw32(x) \ +({ \ + __u32 __x = (x); \ + ((__u32)( \ + (((__u32)(__x) & (__u32)0x0000ffffUL) << 16) | \ + (((__u32)(__x) & (__u32)0xffff0000UL) >> 16) )); \ +}) +#define ___swahb32(x) \ +({ \ + __u32 __x = (x); \ + ((__u32)( \ + (((__u32)(__x) & (__u32)0x00ff00ffUL) << 8) | \ + (((__u32)(__x) & (__u32)0xff00ff00UL) >> 8) )) \ +}) + +#define ___constant_swahw32(x) \ ((__u32)( \ (((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \ (((__u32)(x) & (__u32)0xffff0000UL) >> 16) )) -#define ___swahb32(x) \ +#define ___constant_swahb32(x) \ ((__u32)( \ (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \ (((__u32)(x) & (__u32)0xff00ff00UL) >> 8) )) diff --git a/include/linux/console.h b/include/linux/console.h index f8da31cbd..288f83b96 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -50,16 +50,16 @@ struct consw { unsigned long (*con_getxy)(struct vc_data *, unsigned long, int *, int *); }; -extern struct consw *conswitchp; +extern const struct consw *conswitchp; -extern struct consw dummy_con; /* dummy console buffer */ -extern struct consw fb_con; /* frame buffer based console */ -extern struct consw vga_con; /* VGA text console */ -extern struct consw newport_con; /* SGI Newport console */ -extern struct consw prom_con; /* SPARC PROM console */ +extern const struct consw dummy_con; /* dummy console buffer */ +extern const struct consw fb_con; /* frame buffer based console */ +extern const struct consw vga_con; /* VGA text console */ +extern const struct consw newport_con; /* SGI Newport console */ +extern const struct consw prom_con; /* SPARC PROM console */ -void take_over_console(struct consw *sw, int first, int last, int deflt); -void give_up_console(struct consw *sw); +void take_over_console(const struct consw *sw, int first, int last, int deflt); +void give_up_console(const struct consw *sw); /* scroll */ #define SM_UP (1) diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index 0f664086a..4dc4750ac 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h @@ -16,7 +16,7 @@ struct vc_data { unsigned int vc_cols; /* [#] Console size */ unsigned int vc_rows; unsigned int vc_size_row; /* Bytes per row */ - struct consw *vc_sw; + const struct consw *vc_sw; unsigned short *vc_screenbuf; /* In-memory character/attribute buffer */ unsigned int vc_screenbuf_size; unsigned char vc_attr; /* Current attributes */ diff --git a/include/linux/ide.h b/include/linux/ide.h index e00d44760..23866ce79 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -212,6 +212,9 @@ typedef unsigned char byte; /* used everywhere */ (drive)->quirk_list = hwif->quirkproc(drive); \ } +#define IDE_DEBUG(lineno) \ + printk("%s,%s,line=%d\n", __FILE__, __FUNCTION__, (lineno)) + /* * Check for an interrupt and acknowledge the interrupt status */ diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 59075b070..41e7d92cc 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -151,8 +151,6 @@ extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, int (*done)(struct netlink_callback*)); -extern void netlink_proto_init(struct net_proto *pro); - #endif /* __KERNEL__ */ #endif /* __LINUX_NETLINK_H */ diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index fd85e20b4..db9260ee5 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -414,6 +414,12 @@ #define PCI_DEVICE_ID_WINBOND2_89C940 0x0940 #define PCI_DEVICE_ID_WINBOND2_89C940F 0x5a5a +#define PCI_VENDOR_ID_EFAR 0x1055 +#define PCI_DEVICE_ID_EFAR_SLC90E66_1 0x9130 +#define PCI_DEVICE_ID_EFAR_SLC90E66_0 0x9460 +#define PCI_DEVICE_ID_EFAR_SLC90E66_2 0x9462 +#define PCI_DEVICE_ID_EFAR_SLC90E66_3 0x9463 + #define PCI_VENDOR_ID_MOTOROLA 0x1057 #define PCI_VENDOR_ID_MOTOROLA_OOPS 0x1507 #define PCI_DEVICE_ID_MOTOROLA_MPC105 0x0001 diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 66451acdb..80feae4c7 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h @@ -35,7 +35,6 @@ void (*kd_mksound)(unsigned int hz, unsigned int ticks); /* console.c */ struct console_font_op; -struct consw; int vc_allocate(unsigned int console); int vc_cons_allocated(unsigned int console); diff --git a/include/linux/zorro.h b/include/linux/zorro.h dissimilarity index 84% index 9e7c07889..aabaea588 100644 --- a/include/linux/zorro.h +++ b/include/linux/zorro.h @@ -1,757 +1,213 @@ -/* - * linux/zorro.h -- Amiga AutoConfig (Zorro) Bus Definitions - * - * Copyright (C) 1995-2000 Geert Uytterhoeven - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - */ - -#ifndef _LINUX_ZORRO_H -#define _LINUX_ZORRO_H - -#ifndef __ASSEMBLY__ - - /* - * Known Zorro Boards - * - * Each Zorro board has a 32-bit ID of the form - * - * mmmmmmmmmmmmmmmmppppppppeeeeeeee - * - * with - * - * mmmmmmmmmmmmmmmm 16-bit Manufacturer ID (assigned by CBM (sigh)) - * pppppppp 8-bit Product ID (assigned by manufacturer) - * eeeeeeee 8-bit Extended Product ID (currently only used - * for some GVP boards) - */ - - -#define ZORRO_MANUF(id) ((id) >> 16) -#define ZORRO_PROD(id) (((id) >> 8) & 0xff) -#define ZORRO_EPC(id) ((id) & 0xff) - -#define ZORRO_ID(manuf, prod, epc) \ - ((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc)) - -typedef __u32 zorro_id; - - -#define ZORRO_WILDCARD (0xffffffff) /* not official */ - - -#define ZORRO_MANUF_PACIFIC_PERIPHERALS 0x00D3 -#define ZORRO_PROD_PACIFIC_PERIPHERALS_SE_2000_A500 ZORRO_ID(PACIFIC_PERIPHERALS, 0x00, 0) -#define ZORRO_PROD_PACIFIC_PERIPHERALS_SCSI ZORRO_ID(PACIFIC_PERIPHERALS, 0x0A, 0) - -#define ZORRO_MANUF_MACROSYSTEMS_USA_2 0x0100 -#define ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE ZORRO_ID(MACROSYSTEMS_USA_2, 0x13, 0) - -#define ZORRO_MANUF_KUPKE_1 0x00DD -#define ZORRO_PROD_KUPKE_GOLEM_RAM_BOX_2MB ZORRO_ID(KUPKE_1, 0x00, 0) - -#define ZORRO_MANUF_MEMPHIS 0x0100 -#define ZORRO_PROD_MEMPHIS_STORMBRINGER ZORRO_ID(MEMPHIS, 0x00, 0) - -#define ZORRO_MANUF_3_STATE 0x0200 -#define ZORRO_PROD_3_STATE_MEGAMIX_2000 ZORRO_ID(3_STATE, 0x02, 0) - -#define ZORRO_MANUF_COMMODORE_BRAUNSCHWEIG 0x0201 -#define ZORRO_PROD_CBM_A2088_A2286 ZORRO_ID(COMMODORE_BRAUNSCHWEIG, 0x01, 0) -#define ZORRO_PROD_CBM_A2286 ZORRO_ID(COMMODORE_BRAUNSCHWEIG, 0x02, 0) -#define ZORRO_PROD_CBM_A4091_1 ZORRO_ID(COMMODORE_BRAUNSCHWEIG, 0x54, 0) -#define ZORRO_PROD_CBM_A2386SX_1 ZORRO_ID(COMMODORE_BRAUNSCHWEIG, 0x67, 0) - -#define ZORRO_MANUF_COMMODORE_WEST_CHESTER_1 0x0202 -#define ZORRO_PROD_CBM_A2090A ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x01, 0) -#define ZORRO_PROD_CBM_A590_A2091_1 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x02, 0) -#define ZORRO_PROD_CBM_A590_A2091_2 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x03, 0) -#define ZORRO_PROD_CBM_A2090B ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x04, 0) -#define ZORRO_PROD_CBM_A2060 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x09, 0) -#define ZORRO_PROD_CBM_A590_A2052_A2058_A2091 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x0A, 0) -#define ZORRO_PROD_CBM_A560_RAM ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x20, 0) -#define ZORRO_PROD_CBM_A2232_PROTOTYPE ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x45, 0) -#define ZORRO_PROD_CBM_A2232 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x46, 0) -#define ZORRO_PROD_CBM_A2620 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x50, 0) -#define ZORRO_PROD_CBM_A2630 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x51, 0) -#define ZORRO_PROD_CBM_A4091_2 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x54, 0) -#define ZORRO_PROD_CBM_A2065_1 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x5A, 0) -#define ZORRO_PROD_CBM_ROMULATOR ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x60, 0) -#define ZORRO_PROD_CBM_A3000_TEST_FIXTURE ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x61, 0) -#define ZORRO_PROD_CBM_A2386SX_2 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x67, 0) -#define ZORRO_PROD_CBM_A2065_2 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x70, 0) - -#define ZORRO_MANUF_COMMODORE_WEST_CHESTER_2 0x0203 -#define ZORRO_PROD_CBM_A2090A_CM ZORRO_ID(COMMODORE_WEST_CHESTER_2, 0x03, 0) - -#define ZORRO_MANUF_PROGRESSIVE_PERIPHERALS_AND_SYSTEMS_2 0x02F4 -#define ZORRO_PROD_PPS_EXP8000 ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS_2, 0x02, 0) - -#define ZORRO_MANUF_KOLFF_COMPUTER_SUPPLIES 0x02FF -#define ZORRO_PROD_KCS_POWER_PC_BOARD ZORRO_ID(KOLFF_COMPUTER_SUPPLIES, 0x00, 0) - -#define ZORRO_MANUF_CARDCO_1 0x03EC -#define ZORRO_PROD_CARDCO_KRONOS_2000_1 ZORRO_ID(CARDCO_1, 0x04, 0) -#define ZORRO_PROD_CARDCO_A1000_1 ZORRO_ID(CARDCO_1, 0x0C, 0) -#define ZORRO_PROD_CARDCO_ESCORT ZORRO_ID(CARDCO_1, 0x0E, 0) -#define ZORRO_PROD_CARDCO_A2410 ZORRO_ID(CARDCO_1, 0xF5, 0) - -#define ZORRO_MANUF_A_SQUARED 0x03ED -#define ZORRO_PROD_A_SQUARED_LIVE_2000 ZORRO_ID(A_SQUARED, 0x01, 0) - -#define ZORRO_MANUF_COMSPEC_COMMUNICATIONS 0x03EE -#define ZORRO_PROD_COMSPEC_COMMUNICATIONS_AX2000 ZORRO_ID(COMSPEC_COMMUNICATIONS, 0x01, 0) - -#define ZORRO_MANUF_ANAKIN_RESEARCH 0x03F1 -#define ZORRO_PROD_ANAKIN_RESEARCH_EASYL ZORRO_ID(ANAKIN_RESEARCH, 0x01, 0) - -#define ZORRO_MANUF_MICROBOTICS 0x03F2 -#define ZORRO_PROD_MICROBOTICS_STARBOARD_II ZORRO_ID(MICROBOTICS, 0x00, 0) -#define ZORRO_PROD_MICROBOTICS_STARDRIVE ZORRO_ID(MICROBOTICS, 0x02, 0) -#define ZORRO_PROD_MICROBOTICS_8_UP_A ZORRO_ID(MICROBOTICS, 0x03, 0) -#define ZORRO_PROD_MICROBOTICS_8_UP_Z ZORRO_ID(MICROBOTICS, 0x04, 0) -#define ZORRO_PROD_MICROBOTICS_DELTA_RAM ZORRO_ID(MICROBOTICS, 0x20, 0) -#define ZORRO_PROD_MICROBOTICS_8_STAR_RAM ZORRO_ID(MICROBOTICS, 0x40, 0) -#define ZORRO_PROD_MICROBOTICS_8_STAR ZORRO_ID(MICROBOTICS, 0x41, 0) -#define ZORRO_PROD_MICROBOTICS_VXL_RAM_32 ZORRO_ID(MICROBOTICS, 0x44, 0) -#define ZORRO_PROD_MICROBOTICS_VXL_68030 ZORRO_ID(MICROBOTICS, 0x45, 0) -#define ZORRO_PROD_MICROBOTICS_DELTA ZORRO_ID(MICROBOTICS, 0x60, 0) -#define ZORRO_PROD_MICROBOTICS_MBX_1200_1200Z_RAM ZORRO_ID(MICROBOTICS, 0x81, 0) -#define ZORRO_PROD_MICROBOTICS_HARDFRAME_2000_1 ZORRO_ID(MICROBOTICS, 0x96, 0) -#define ZORRO_PROD_MICROBOTICS_HARDFRAME_2000_2 ZORRO_ID(MICROBOTICS, 0x9E, 0) -#define ZORRO_PROD_MICROBOTICS_MBX_1200_1200Z ZORRO_ID(MICROBOTICS, 0xC1, 0) - -#define ZORRO_MANUF_ACCESS_ASSOCIATES_ALEGRA 0x03F4 - -#define ZORRO_MANUF_EXPANSION_TECHNOLOGIES 0x03F6 - -#define ZORRO_MANUF_ASDG 0x03FF -#define ZORRO_PROD_ASDG_MEMORY_1 ZORRO_ID(ASDG, 0x01, 0) -#define ZORRO_PROD_ASDG_MEMORY_2 ZORRO_ID(ASDG, 0x02, 0) -#define ZORRO_PROD_ASDG_EB920_LAN_ROVER ZORRO_ID(ASDG, 0xFE, 0) -#define ZORRO_PROD_ASDG_GPIB_DUALIEEE488_TWIN_X ZORRO_ID(ASDG, 0xFF, 0) - -#define ZORRO_MANUF_IMTRONICS_1 0x0404 -#define ZORRO_PROD_IMTRONICS_HURRICANE_2800_1 ZORRO_ID(IMTRONICS_1, 0x39, 0) -#define ZORRO_PROD_IMTRONICS_HURRICANE_2800_2 ZORRO_ID(IMTRONICS_1, 0x57, 0) - -#define ZORRO_MANUF_CBM_UNIVERSITY_OF_LOWELL 0x0406 -#define ZORRO_PROD_CBM_A2410 ZORRO_ID(CBM_UNIVERSITY_OF_LOWELL, 0x00, 0) - -#define ZORRO_MANUF_AMERISTAR 0x041D -#define ZORRO_PROD_AMERISTAR_A2065 ZORRO_ID(AMERISTAR, 0x01, 0) -#define ZORRO_PROD_AMERISTAR_A560 ZORRO_ID(AMERISTAR, 0x09, 0) -#define ZORRO_PROD_AMERISTAR_A4066 ZORRO_ID(AMERISTAR, 0x0A, 0) - -#define ZORRO_MANUF_SUPRA 0x0420 -#define ZORRO_PROD_SUPRA_SUPRADRIVE_4x4 ZORRO_ID(SUPRA, 0x01, 0) -#define ZORRO_PROD_SUPRA_1000_RAM ZORRO_ID(SUPRA, 0x02, 0) -#define ZORRO_PROD_SUPRA_2000_DMA ZORRO_ID(SUPRA, 0x03, 0) -#define ZORRO_PROD_SUPRA_500 ZORRO_ID(SUPRA, 0x05, 0) -#define ZORRO_PROD_SUPRA_500_SCSI ZORRO_ID(SUPRA, 0x08, 0) -#define ZORRO_PROD_SUPRA_500XP_2000_RAM ZORRO_ID(SUPRA, 0x09, 0) -#define ZORRO_PROD_SUPRA_500RX_2000_RAM ZORRO_ID(SUPRA, 0x0A, 0) -#define ZORRO_PROD_SUPRA_2400ZI ZORRO_ID(SUPRA, 0x0B, 0) -#define ZORRO_PROD_SUPRA_500XP_SUPRADRIVE_WORDSYNC ZORRO_ID(SUPRA, 0x0C, 0) -#define ZORRO_PROD_SUPRA_SUPRADRIVE_WORDSYNC_II ZORRO_ID(SUPRA, 0x0D, 0) -#define ZORRO_PROD_SUPRA_2400ZIPLUS ZORRO_ID(SUPRA, 0x10, 0) - -#define ZORRO_MANUF_COMPUTER_SYSTEMS_ASSOCIATES 0x0422 -#define ZORRO_PROD_CSA_MAGNUM ZORRO_ID(COMPUTER_SYSTEMS_ASSOCIATES, 0x11, 0) -#define ZORRO_PROD_CSA_12_GAUGE ZORRO_ID(COMPUTER_SYSTEMS_ASSOCIATES, 0x15, 0) - -#define ZORRO_MANUF_MARC_MICHAEL_GROTH 0x0439 - -#define ZORRO_MANUF_M_TECH 0x0502 -#define ZORRO_PROD_MTEC_AT500_1 ZORRO_ID(M_TECH, 0x03, 0) - -#define ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_1 0x06E1 -#define ZORRO_PROD_GVP_IMPACT_SERIES_I ZORRO_ID(GREAT_VALLEY_PRODUCTS_1, 0x08, 0) - -#define ZORRO_MANUF_BYTEBOX 0x07DA -#define ZORRO_PROD_BYTEBOX_A500 ZORRO_ID(BYTEBOX, 0x00, 0) - -#define ZORRO_MANUF_DKB_POWER_COMPUTING 0x07DC -#define ZORRO_PROD_DKB_POWER_COMPUTING_SECUREKEY ZORRO_ID(DKB_POWER_COMPUTING, 0x09, 0) -#define ZORRO_PROD_DKB_POWER_COMPUTING_DKM_3128 ZORRO_ID(DKB_POWER_COMPUTING, 0x0E, 0) -#define ZORRO_PROD_DKB_POWER_COMPUTING_RAPID_FIRE ZORRO_ID(DKB_POWER_COMPUTING, 0x0F, 0) -#define ZORRO_PROD_DKB_POWER_COMPUTING_DKM_1202 ZORRO_ID(DKB_POWER_COMPUTING, 0x10, 0) -#define ZORRO_PROD_DKB_POWER_COMPUTING_COBRA_VIPER_II_68EC030 ZORRO_ID(DKB_POWER_COMPUTING, 0x12, 0) -#define ZORRO_PROD_DKB_POWER_COMPUTING_WILDFIRE_060_1 ZORRO_ID(DKB_POWER_COMPUTING, 0x17, 0) -#define ZORRO_PROD_DKB_POWER_COMPUTING_WILDFIRE_060_2 ZORRO_ID(DKB_POWER_COMPUTING, 0xFF, 0) - -#define ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_2 0x07E1 -#define ZORRO_PROD_GVP_IMPACT_SERIES_I_4K ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x01, 0) -#define ZORRO_PROD_GVP_IMPACT_SERIES_I_16K_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x02, 0) -#define ZORRO_PROD_GVP_IMPACT_SERIES_I_16K_3 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x03, 0) -#define ZORRO_PROD_GVP_IMPACT_3001_IDE_1 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x08, 0) -#define ZORRO_PROD_GVP_IMPACT_3001_RAM ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x09, 0) -#define ZORRO_PROD_GVP_IMPACT_SERIES_II_RAM_1 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0A, 0) -#define ZORRO_PROD_GVP_EPC_BASE ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0) -#define ZORRO_PROD_GVP_GFORCE_040_1 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x20) -#define ZORRO_PROD_GVP_GFORCE_040_SCSI_1 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x30) -#define ZORRO_PROD_GVP_A1291 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x40) -#define ZORRO_PROD_GVP_COMBO_030_R4 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x60) -#define ZORRO_PROD_GVP_COMBO_030_R4_SCSI ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x70) -#define ZORRO_PROD_GVP_PHONEPAK ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x78) -#define ZORRO_PROD_GVP_IO_EXTENDER ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x98) -#define ZORRO_PROD_GVP_GFORCE_030 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xa0) -#define ZORRO_PROD_GVP_GFORCE_030_SCSI ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xb0) -#define ZORRO_PROD_GVP_A530 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xc0) -#define ZORRO_PROD_GVP_A530_SCSI ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xd0) -#define ZORRO_PROD_GVP_COMBO_030_R3 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xe0) -#define ZORRO_PROD_GVP_COMBO_030_R3_SCSI ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xf0) -#define ZORRO_PROD_GVP_SERIES_II ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xf8) -#define ZORRO_PROD_GVP_IMPACT_3001_IDE_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0D, 0) -/*#define ZORRO_PROD_GVP_A2000_030 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0D, 0)*/ -/*#define ZORRO_PROD_GVP_GFORCE_040_SCSI_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0D, 0)*/ -#define ZORRO_PROD_GVP_GFORCE_040_060 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x16, 0) -#define ZORRO_PROD_GVP_IMPACT_VISION_24 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x20, 0) -#define ZORRO_PROD_GVP_GFORCE_040_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0xFF, 0) - -#define ZORRO_MANUF_CALIFORNIA_ACCESS_SYNERGY 0x07E5 -#define ZORRO_PROD_CALIFORNIA_ACCESS_SYNERGY_MALIBU ZORRO_ID(CALIFORNIA_ACCESS_SYNERGY, 0x01, 0) - -#define ZORRO_MANUF_XETEC 0x07E6 -#define ZORRO_PROD_XETEC_FASTCARD ZORRO_ID(XETEC, 0x01, 0) -#define ZORRO_PROD_XETEC_FASTCARD_RAM ZORRO_ID(XETEC, 0x02, 0) -#define ZORRO_PROD_XETEC_FASTCARD_PLUS ZORRO_ID(XETEC, 0x03, 0) - -#define ZORRO_MANUF_PROGRESSIVE_PERIPHERALS_AND_SYSTEMS 0x07EA -#define ZORRO_PROD_PPS_MERCURY ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0x00, 0) -#define ZORRO_PROD_PPS_A3000_68040 ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0x01, 0) -#define ZORRO_PROD_PPS_A2000_68040 ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0x69, 0) -#define ZORRO_PROD_PPS_ZEUS ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0x96, 0) -#define ZORRO_PROD_PPS_A500_68040 ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0xBB, 0) - -#define ZORRO_MANUF_XEBEC 0x07EC - -#define ZORRO_MANUF_SPIRIT_TECHNOLOGY 0x07F2 -#define ZORRO_PROD_SPIRIT_TECHNOLOGY_INSIDER_IN1000 ZORRO_ID(SPIRIT_TECHNOLOGY, 0x01, 0) -#define ZORRO_PROD_SPIRIT_TECHNOLOGY_INSIDER_IN500 ZORRO_ID(SPIRIT_TECHNOLOGY, 0x02, 0) -#define ZORRO_PROD_SPIRIT_TECHNOLOGY_SIN500 ZORRO_ID(SPIRIT_TECHNOLOGY, 0x03, 0) -#define ZORRO_PROD_SPIRIT_TECHNOLOGY_HDA_506 ZORRO_ID(SPIRIT_TECHNOLOGY, 0x04, 0) -#define ZORRO_PROD_SPIRIT_TECHNOLOGY_AX_S ZORRO_ID(SPIRIT_TECHNOLOGY, 0x05, 0) -#define ZORRO_PROD_SPIRIT_TECHNOLOGY_OCTABYTE ZORRO_ID(SPIRIT_TECHNOLOGY, 0x06, 0) -#define ZORRO_PROD_SPIRIT_TECHNOLOGY_INMATE ZORRO_ID(SPIRIT_TECHNOLOGY, 0x08, 0) - -#define ZORRO_MANUF_SPIRIT_TECHNOLOGY_2 0x07F3 - -#define ZORRO_MANUF_BSC_ALFADATA_1 0x07FE -#define ZORRO_PROD_BSC_ALF_3_1 ZORRO_ID(BSC_ALFADATA_1, 0x03, 0) - -#define ZORRO_MANUF_BSC_ALFADATA_2 0x0801 -#define ZORRO_PROD_BSC_ALF_2_1 ZORRO_ID(BSC_ALFADATA_2, 0x01, 0) -#define ZORRO_PROD_BSC_ALF_2_2 ZORRO_ID(BSC_ALFADATA_2, 0x02, 0) -#define ZORRO_PROD_BSC_ALF_3_2 ZORRO_ID(BSC_ALFADATA_2, 0x03, 0) - -#define ZORRO_MANUF_CARDCO_2 0x0802 -#define ZORRO_PROD_CARDCO_KRONOS_2000_2 ZORRO_ID(CARDCO_2, 0x04, 0) -#define ZORRO_PROD_CARDCO_A1000_2 ZORRO_ID(CARDCO_2, 0x0C, 0) - -#define ZORRO_MANUF_JOCHHEIM 0x0804 -#define ZORRO_PROD_JOCHHEIM_RAM ZORRO_ID(JOCHHEIM, 0x01, 0) - -#define ZORRO_MANUF_CHECKPOINT_TECHNOLOGIES 0x0807 -#define ZORRO_PROD_CHECKPOINT_TECHNOLOGIES_SERIAL_SOLUTION ZORRO_ID(CHECKPOINT_TECHNOLOGIES, 0x00, 0) - -#define ZORRO_MANUF_EDOTRONIK 0x0810 -#define ZORRO_PROD_EDOTRONIK_IEEE_488 ZORRO_ID(EDOTRONIK, 0x01, 0) -#define ZORRO_PROD_EDOTRONIK_8032 ZORRO_ID(EDOTRONIK, 0x02, 0) -#define ZORRO_PROD_EDOTRONIK_MULTISERIAL ZORRO_ID(EDOTRONIK, 0x03, 0) -#define ZORRO_PROD_EDOTRONIK_VIDEODIGITIZER ZORRO_ID(EDOTRONIK, 0x04, 0) -#define ZORRO_PROD_EDOTRONIK_PARALLEL_IO ZORRO_ID(EDOTRONIK, 0x05, 0) -#define ZORRO_PROD_EDOTRONIK_PIC_PROTOYPING ZORRO_ID(EDOTRONIK, 0x06, 0) -#define ZORRO_PROD_EDOTRONIK_ADC ZORRO_ID(EDOTRONIK, 0x07, 0) -#define ZORRO_PROD_EDOTRONIK_VME ZORRO_ID(EDOTRONIK, 0x08, 0) -#define ZORRO_PROD_EDOTRONIK_DSP96000 ZORRO_ID(EDOTRONIK, 0x09, 0) - -#define ZORRO_MANUF_NES_INC 0x0813 -#define ZORRO_PROD_NES_INC_RAM ZORRO_ID(NES_INC, 0x00, 0) - -#define ZORRO_MANUF_ICD 0x0817 -#define ZORRO_PROD_ICD_ADVANTAGE_2000_SCSI ZORRO_ID(ICD, 0x01, 0) -#define ZORRO_PROD_ICD_ADVANTAGE_IDE ZORRO_ID(ICD, 0x03, 0) -#define ZORRO_PROD_ICD_ADVANTAGE_2080_RAM ZORRO_ID(ICD, 0x04, 0) - -#define ZORRO_MANUF_KUPKE_2 0x0819 -#define ZORRO_PROD_KUPKE_OMTI ZORRO_ID(KUPKE_2, 0x01, 0) -#define ZORRO_PROD_KUPKE_SCSI_II ZORRO_ID(KUPKE_2, 0x02, 0) -#define ZORRO_PROD_KUPKE_GOLEM_BOX ZORRO_ID(KUPKE_2, 0x03, 0) -#define ZORRO_PROD_KUPKE_030_882 ZORRO_ID(KUPKE_2, 0x04, 0) -#define ZORRO_PROD_KUPKE_SCSI_AT ZORRO_ID(KUPKE_2, 0x05, 0) - -#define ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_3 0x081D -#define ZORRO_PROD_GVP_A2000_RAM8 ZORRO_ID(GREAT_VALLEY_PRODUCTS_3, 0x09, 0) -#define ZORRO_PROD_GVP_IMPACT_SERIES_II_RAM_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_3, 0x0A, 0) - -#define ZORRO_MANUF_INTERWORKS_NETWORK 0x081E - -#define ZORRO_MANUF_HARDITAL_SYNTHESIS 0x0820 -#define ZORRO_PROD_HARDITAL_SYNTHESIS_TQM_68030_68882 ZORRO_ID(HARDITAL_SYNTHESIS, 0x14, 0) - -#define ZORRO_MANUF_APPLIED_ENGINEERING 0x0828 -#define ZORRO_PROD_APPLIED_ENGINEERING_DL2000 ZORRO_ID(APPLIED_ENGINEERING, 0x10, 0) -#define ZORRO_PROD_APPLIED_ENGINEERING_RAM_WORKS ZORRO_ID(APPLIED_ENGINEERING, 0xE0, 0) - -#define ZORRO_MANUF_BSC_ALFADATA_3 0x082C -#define ZORRO_PROD_BSC_OKTAGON_2008 ZORRO_ID(BSC_ALFADATA_3, 0x05, 0) -#define ZORRO_PROD_BSC_TANDEM_AT_2008_508 ZORRO_ID(BSC_ALFADATA_3, 0x06, 0) -#define ZORRO_PROD_BSC_ALFA_RAM_1200 ZORRO_ID(BSC_ALFADATA_3, 0x07, 0) -#define ZORRO_PROD_BSC_OKTAGON_2008_RAM ZORRO_ID(BSC_ALFADATA_3, 0x08, 0) -#define ZORRO_PROD_BSC_MULTIFACE_I ZORRO_ID(BSC_ALFADATA_3, 0x10, 0) -#define ZORRO_PROD_BSC_MULTIFACE_II ZORRO_ID(BSC_ALFADATA_3, 0x11, 0) -#define ZORRO_PROD_BSC_MULTIFACE_III ZORRO_ID(BSC_ALFADATA_3, 0x12, 0) -#define ZORRO_PROD_BSC_FRAMEMASTER_II ZORRO_ID(BSC_ALFADATA_3, 0x20, 0) -#define ZORRO_PROD_BSC_GRAFFITI_RAM ZORRO_ID(BSC_ALFADATA_3, 0x21, 0) -#define ZORRO_PROD_BSC_GRAFFITI_REG ZORRO_ID(BSC_ALFADATA_3, 0x22, 0) -#define ZORRO_PROD_BSC_ISDN_MASTERCARD ZORRO_ID(BSC_ALFADATA_3, 0x40, 0) -#define ZORRO_PROD_BSC_ISDN_MASTERCARD_II ZORRO_ID(BSC_ALFADATA_3, 0x41, 0) - -#define ZORRO_MANUF_PHOENIX 0x0835 -#define ZORRO_PROD_PHOENIX_ST506 ZORRO_ID(PHOENIX, 0x21, 0) -#define ZORRO_PROD_PHOENIX_SCSI ZORRO_ID(PHOENIX, 0x22, 0) -#define ZORRO_PROD_PHOENIX_RAM ZORRO_ID(PHOENIX, 0xBE, 0) - -#define ZORRO_MANUF_ADVANCED_STORAGE_SYSTEMS 0x0836 -#define ZORRO_PROD_ADVANCED_STORAGE_SYSTEMS_NEXUS ZORRO_ID(ADVANCED_STORAGE_SYSTEMS, 0x01, 0) -#define ZORRO_PROD_ADVANCED_STORAGE_SYSTEMS_NEXUS_RAM ZORRO_ID(ADVANCED_STORAGE_SYSTEMS, 0x08, 0) - -#define ZORRO_MANUF_IMPULSE 0x0838 -#define ZORRO_PROD_IMPULSE_FIRECRACKER_24 ZORRO_ID(IMPULSE, 0x00, 0) - -#define ZORRO_MANUF_IVS 0x0840 -#define ZORRO_PROD_IVS_GRANDSLAM_PIC_2 ZORRO_ID(IVS, 0x02, 0) -#define ZORRO_PROD_IVS_GRANDSLAM_PIC_1 ZORRO_ID(IVS, 0x04, 0) -#define ZORRO_PROD_IVS_OVERDRIVE ZORRO_ID(IVS, 0x10, 0) -#define ZORRO_PROD_IVS_TRUMPCARD_CLASSIC ZORRO_ID(IVS, 0x30, 0) -#define ZORRO_PROD_IVS_TRUMPCARD_PRO_GRANDSLAM ZORRO_ID(IVS, 0x34, 0) -#define ZORRO_PROD_IVS_META_4 ZORRO_ID(IVS, 0x40, 0) -#define ZORRO_PROD_IVS_WAVETOOLS ZORRO_ID(IVS, 0xBF, 0) -#define ZORRO_PROD_IVS_VECTOR_1 ZORRO_ID(IVS, 0xF3, 0) -#define ZORRO_PROD_IVS_VECTOR_2 ZORRO_ID(IVS, 0xF4, 0) - -#define ZORRO_MANUF_VECTOR_1 0x0841 -#define ZORRO_PROD_VECTOR_CONNECTION_1 ZORRO_ID(VECTOR_1, 0xE3, 0) - -#define ZORRO_MANUF_XPERT_PRODEV 0x0845 -#define ZORRO_PROD_XPERT_PRODEV_VISIONA_RAM ZORRO_ID(XPERT_PRODEV, 0x01, 0) -#define ZORRO_PROD_XPERT_PRODEV_VISIONA_REG ZORRO_ID(XPERT_PRODEV, 0x02, 0) -#define ZORRO_PROD_XPERT_PRODEV_MERLIN_RAM ZORRO_ID(XPERT_PRODEV, 0x03, 0) -#define ZORRO_PROD_XPERT_PRODEV_MERLIN_REG_1 ZORRO_ID(XPERT_PRODEV, 0x04, 0) -#define ZORRO_PROD_XPERT_PRODEV_MERLIN_REG_2 ZORRO_ID(XPERT_PRODEV, 0xC9, 0) - -#define ZORRO_MANUF_HYDRA_SYSTEMS 0x0849 -#define ZORRO_PROD_HYDRA_SYSTEMS_AMIGANET ZORRO_ID(HYDRA_SYSTEMS, 0x01, 0) - -#define ZORRO_MANUF_SUNRIZE_INDUSTRIES 0x084F -#define ZORRO_PROD_SUNRIZE_INDUSTRIES_AD1012 ZORRO_ID(SUNRIZE_INDUSTRIES, 0x01, 0) -#define ZORRO_PROD_SUNRIZE_INDUSTRIES_AD516 ZORRO_ID(SUNRIZE_INDUSTRIES, 0x02, 0) -#define ZORRO_PROD_SUNRIZE_INDUSTRIES_DD512 ZORRO_ID(SUNRIZE_INDUSTRIES, 0x03, 0) - -#define ZORRO_MANUF_TRICERATOPS 0x0850 -#define ZORRO_PROD_TRICERATOPS_MULTI_IO ZORRO_ID(TRICERATOPS, 0x01, 0) - -#define ZORRO_MANUF_APPLIED_MAGIC 0x0851 -#define ZORRO_PROD_APPLIED_MAGIC_DMI_RESOLVER ZORRO_ID(APPLIED_MAGIC, 0x01, 0) -#define ZORRO_PROD_APPLIED_MAGIC_DIGITAL_BROADCASTER ZORRO_ID(APPLIED_MAGIC, 0x06, 0) - -#define ZORRO_MANUF_GFX_BASE 0x085E -#define ZORRO_PROD_GFX_BASE_GDA_1_VRAM ZORRO_ID(GFX_BASE, 0x00, 0) -#define ZORRO_PROD_GFX_BASE_GDA_1 ZORRO_ID(GFX_BASE, 0x01, 0) - -#define ZORRO_MANUF_ROCTEC 0x0860 -#define ZORRO_PROD_ROCTEC_RH_800C ZORRO_ID(ROCTEC, 0x01, 0) -#define ZORRO_PROD_ROCTEC_RH_800C_RAM ZORRO_ID(ROCTEC, 0x01, 0) - -#define ZORRO_MANUF_KATO 0x0861 -#define ZORRO_PROD_KATO_MELODY ZORRO_ID(KATO, 0x80, 0) -/* ID clash!! */ -#define ZORRO_MANUF_HELFRICH_1 0x0861 -#define ZORRO_PROD_HELFRICH_RAINBOW_II ZORRO_ID(HELFRICH_1, 0x20, 0) -#define ZORRO_PROD_HELFRICH_RAINBOW_III ZORRO_ID(HELFRICH_1, 0x21, 0) - -#define ZORRO_MANUF_ATLANTIS 0x0862 - -#define ZORRO_MANUF_PROTAR 0x0864 - -#define ZORRO_MANUF_ACS 0x0865 - -#define ZORRO_MANUF_SOFTWARE_RESULTS_ENTERPRISES 0x0866 -#define ZORRO_PROD_SOFTWARE_RESULTS_ENTERPRISES_GOLDEN_GATE_2_BUS_PLUS ZORRO_ID(SOFTWARE_RESULTS_ENTERPRISES, 0x01, 0) - -#define ZORRO_MANUF_MASOBOSHI 0x086D -#define ZORRO_PROD_MASOBOSHI_MASTER_CARD_SC201 ZORRO_ID(MASOBOSHI, 0x03, 0) -#define ZORRO_PROD_MASOBOSHI_MASTER_CARD_MC702 ZORRO_ID(MASOBOSHI, 0x04, 0) -#define ZORRO_PROD_MASOBOSHI_MVD_819 ZORRO_ID(MASOBOSHI, 0x07, 0) - -#define ZORRO_MANUF_MAINHATTAN_DATA 0x086F -#define ZORRO_PROD_MAINHATTAN_DATA_IDE ZORRO_ID(MAINHATTAN_DATA, 0x01, 0) - -#define ZORRO_MANUF_VILLAGE_TRONIC 0x0877 -#define ZORRO_PROD_VILLAGE_TRONIC_DOMINO_RAM ZORRO_ID(VILLAGE_TRONIC, 0x01, 0) -#define ZORRO_PROD_VILLAGE_TRONIC_DOMINO_REG ZORRO_ID(VILLAGE_TRONIC, 0x02, 0) -#define ZORRO_PROD_VILLAGE_TRONIC_DOMINO_16M_PROTOTYPE ZORRO_ID(VILLAGE_TRONIC, 0x03, 0) -#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM ZORRO_ID(VILLAGE_TRONIC, 0x0B, 0) -#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_REG ZORRO_ID(VILLAGE_TRONIC, 0x0C, 0) -#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_SEGMENTED_MODE ZORRO_ID(VILLAGE_TRONIC, 0x0D, 0) -#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_MEM1 ZORRO_ID(VILLAGE_TRONIC, 0x15, 0) -#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_MEM2 ZORRO_ID(VILLAGE_TRONIC, 0x16, 0) -#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_REG ZORRO_ID(VILLAGE_TRONIC, 0x17, 0) -#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3 ZORRO_ID(VILLAGE_TRONIC, 0x18, 0) -#define ZORRO_PROD_VILLAGE_TRONIC_ARIADNE ZORRO_ID(VILLAGE_TRONIC, 0xC9, 0) -#define ZORRO_PROD_VILLAGE_TRONIC_ARIADNE2 ZORRO_ID(VILLAGE_TRONIC, 0xCA, 0) - -#define ZORRO_MANUF_UTILITIES_UNLIMITED 0x087B -#define ZORRO_PROD_UTILITIES_UNLIMITED_EMPLANT_DELUXE ZORRO_ID(UTILITIES_UNLIMITED, 0x15, 0) -#define ZORRO_PROD_UTILITIES_UNLIMITED_EMPLANT_DELUXE2 ZORRO_ID(UTILITIES_UNLIMITED, 0x20, 0) - -#define ZORRO_MANUF_AMITRIX 0x0880 -#define ZORRO_PROD_AMITRIX_MULTI_IO ZORRO_ID(AMITRIX, 0x01, 0) -#define ZORRO_PROD_AMITRIX_CD_RAM ZORRO_ID(AMITRIX, 0x02, 0) - -#define ZORRO_MANUF_ARMAX 0x0885 -#define ZORRO_PROD_ARMAX_OMNIBUS ZORRO_ID(ARMAX, 0x00, 0) - -#define ZORRO_MANUF_ZEUS 0x088D -#define ZORRO_PROD_ZEUS_SPIDER ZORRO_ID(ZEUS, 0x04, 0) - -#define ZORRO_MANUF_NEWTEK 0x088F -#define ZORRO_PROD_NEWTEK_VIDEOTOASTER ZORRO_ID(NEWTEK, 0x00, 0) - -#define ZORRO_MANUF_M_TECH_GERMANY 0x0890 -#define ZORRO_PROD_MTEC_AT500_2 ZORRO_ID(M_TECH_GERMANY, 0x01, 0) -#define ZORRO_PROD_MTEC_68030 ZORRO_ID(M_TECH_GERMANY, 0x03, 0) -#define ZORRO_PROD_MTEC_68020I ZORRO_ID(M_TECH_GERMANY, 0x06, 0) -#define ZORRO_PROD_MTEC_A1200_T68030_RTC ZORRO_ID(M_TECH_GERMANY, 0x20, 0) -#define ZORRO_PROD_MTEC_VIPER_MK_V_E_MATRIX_530 ZORRO_ID(M_TECH_GERMANY, 0x21, 0) -#define ZORRO_PROD_MTEC_8_MB_RAM ZORRO_ID(M_TECH_GERMANY, 0x22, 0) -#define ZORRO_PROD_MTEC_VIPER_MK_V_E_MATRIX_530_SCSI_IDE ZORRO_ID(M_TECH_GERMANY, 0x24, 0) - -#define ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_4 0x0891 -#define ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_RAM ZORRO_ID(GREAT_VALLEY_PRODUCTS_4, 0x01, 0) -#define ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_REG ZORRO_ID(GREAT_VALLEY_PRODUCTS_4, 0x02, 0) - -#define ZORRO_MANUF_APOLLO_1 0x0892 -#define ZORRO_PROD_APOLLO_A1200 ZORRO_ID(APOLLO_1, 0x01, 0) - -#define ZORRO_MANUF_HELFRICH_2 0x0893 -#define ZORRO_PROD_HELFRICH_PICCOLO_RAM ZORRO_ID(HELFRICH_2, 0x05, 0) -#define ZORRO_PROD_HELFRICH_PICCOLO_REG ZORRO_ID(HELFRICH_2, 0x06, 0) -#define ZORRO_PROD_HELFRICH_PEGGY_PLUS_MPEG ZORRO_ID(HELFRICH_2, 0x07, 0) -#define ZORRO_PROD_HELFRICH_VIDEOCRUNCHER ZORRO_ID(HELFRICH_2, 0x08, 0) -#define ZORRO_PROD_HELFRICH_SD64_RAM ZORRO_ID(HELFRICH_2, 0x0A, 0) -#define ZORRO_PROD_HELFRICH_SD64_REG ZORRO_ID(HELFRICH_2, 0x0B, 0) - -#define ZORRO_MANUF_MACROSYSTEMS_USA 0x089B -#define ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE_40xx ZORRO_ID(MACROSYSTEMS_USA, 0x13, 0) - -#define ZORRO_MANUF_ELBOX_COMPUTER 0x089E -#define ZORRO_PROD_ELBOX_COMPUTER_1200_4 ZORRO_ID(ELBOX_COMPUTER, 0x06, 0) - -#define ZORRO_MANUF_HARMS_PROFESSIONAL 0x0A00 -#define ZORRO_PROD_HARMS_PROFESSIONAL_030_PLUS ZORRO_ID(HARMS_PROFESSIONAL, 0x10, 0) -#define ZORRO_PROD_HARMS_PROFESSIONAL_3500 ZORRO_ID(HARMS_PROFESSIONAL, 0xD0, 0) - -#define ZORRO_MANUF_MICRONIK 0x0A50 -#define ZORRO_PROD_MICRONIK_RCA_120 ZORRO_ID(MICRONIK, 0x0A, 0) - -#define ZORRO_MANUF_MICRONIK2 0x0F0F -#define ZORRO_PROD_MICRONIK2_Z3I ZORRO_ID(MICRONIK2, 0x01, 0) - -#define ZORRO_MANUF_MEGAMICRO 0x1000 -#define ZORRO_PROD_MEGAMICRO_SCRAM_500 ZORRO_ID(MEGAMICRO, 0x03, 0) -#define ZORRO_PROD_MEGAMICRO_SCRAM_500_RAM ZORRO_ID(MEGAMICRO, 0x04, 0) - -#define ZORRO_MANUF_IMTRONICS_2 0x1028 -#define ZORRO_PROD_IMTRONICS_HURRICANE_2800_3 ZORRO_ID(IMTRONICS_2, 0x39, 0) -#define ZORRO_PROD_IMTRONICS_HURRICANE_2800_4 ZORRO_ID(IMTRONICS_2, 0x57, 0) - -/* unofficial ID */ -#define ZORRO_MANUF_INDIVIDUAL_COMPUTERS 0x1212 -#define ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA ZORRO_ID(INDIVIDUAL_COMPUTERS, 0x00, 0) -#define ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL ZORRO_ID(INDIVIDUAL_COMPUTERS, 0x2A, 0) - -#define ZORRO_MANUF_KUPKE_3 0x1248 -#define ZORRO_PROD_KUPKE_GOLEM_HD_3000 ZORRO_ID(KUPKE_3, 0x01, 0) - -#define ZORRO_MANUF_ITH 0x1388 -#define ZORRO_PROD_ITH_ISDN_MASTER_II ZORRO_ID(ITH, 0x01, 0) - -#define ZORRO_MANUF_VMC 0x1389 -#define ZORRO_PROD_VMC_ISDN_BLASTER_Z2 ZORRO_ID(VMC, 0x01, 0) -#define ZORRO_PROD_VMC_HYPERCOM_4 ZORRO_ID(VMC, 0x02, 0) - -#define ZORRO_MANUF_INFORMATION 0x157C -#define ZORRO_PROD_INFORMATION_ISDN_ENGINE_I ZORRO_ID(INFORMATION, 0x64, 0) - -#define ZORRO_MANUF_VORTEX 0x2017 -#define ZORRO_PROD_VORTEX_GOLDEN_GATE_80386SX ZORRO_ID(VORTEX, 0x07, 0) -#define ZORRO_PROD_VORTEX_GOLDEN_GATE_RAM ZORRO_ID(VORTEX, 0x08, 0) -#define ZORRO_PROD_VORTEX_GOLDEN_GATE_80486 ZORRO_ID(VORTEX, 0x09, 0) - -#define ZORRO_MANUF_EXPANSION_SYSTEMS 0x2062 -#define ZORRO_PROD_EXPANSION_SYSTEMS_DATAFLYER_4000SX ZORRO_ID(EXPANSION_SYSTEMS, 0x01, 0) -#define ZORRO_PROD_EXPANSION_SYSTEMS_DATAFLYER_4000SX_RAM ZORRO_ID(EXPANSION_SYSTEMS, 0x02, 0) - -#define ZORRO_MANUF_READYSOFT 0x2100 -#define ZORRO_PROD_READYSOFT_AMAX_II_IV ZORRO_ID(READYSOFT, 0x01, 0) - -#define ZORRO_MANUF_PHASE5 0x2140 -#define ZORRO_PROD_PHASE5_BLIZZARD_RAM ZORRO_ID(PHASE5, 0x01, 0) -#define ZORRO_PROD_PHASE5_BLIZZARD ZORRO_ID(PHASE5, 0x02, 0) -#define ZORRO_PROD_PHASE5_BLIZZARD_1220_IV ZORRO_ID(PHASE5, 0x06, 0) -#define ZORRO_PROD_PHASE5_FASTLANE_Z3_RAM ZORRO_ID(PHASE5, 0x0A, 0) -#define ZORRO_PROD_PHASE5_BLIZZARD_1230_II_FASTLANE_Z3_CYBERSCSI_CYBERSTORM060 ZORRO_ID(PHASE5, 0x0B, 0) -#define ZORRO_PROD_PHASE5_BLIZZARD_1220_CYBERSTORM ZORRO_ID(PHASE5, 0x0C, 0) -#define ZORRO_PROD_PHASE5_BLIZZARD_1230 ZORRO_ID(PHASE5, 0x0D, 0) -#define ZORRO_PROD_PHASE5_BLIZZARD_1230_IV_1260 ZORRO_ID(PHASE5, 0x11, 0) -#define ZORRO_PROD_PHASE5_BLIZZARD_2060 ZORRO_ID(PHASE5, 0x18, 0) -#define ZORRO_PROD_PHASE5_CYBERSTORM_MK_II ZORRO_ID(PHASE5, 0x19, 0) -#define ZORRO_PROD_PHASE5_CYBERVISION64 ZORRO_ID(PHASE5, 0x22, 0) -#define ZORRO_PROD_PHASE5_CYBERVISION64_3D_PROTOTYPE ZORRO_ID(PHASE5, 0x32, 0) -#define ZORRO_PROD_PHASE5_CYBERVISION64_3D ZORRO_ID(PHASE5, 0x43, 0) -#define ZORRO_PROD_PHASE5_CYBERSTORM_MK_III ZORRO_ID(PHASE5, 0x64, 0) -#define ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS ZORRO_ID(PHASE5, 0x6e, 0) - -#define ZORRO_MANUF_DPS 0x2169 -#define ZORRO_PROD_DPS_PERSONAL_ANIMATION_RECORDER ZORRO_ID(DPS, 0x01, 0) - -#define ZORRO_MANUF_APOLLO_2 0x2200 -#define ZORRO_PROD_APOLLO_A620_68020_1 ZORRO_ID(APOLLO_2, 0x00, 0) -#define ZORRO_PROD_APOLLO_A620_68020_2 ZORRO_ID(APOLLO_2, 0x01, 0) - -#define ZORRO_MANUF_APOLLO_3 0x2222 -#define ZORRO_PROD_APOLLO_AT_APOLLO ZORRO_ID(APOLLO_3, 0x22, 0) -#define ZORRO_PROD_APOLLO_1230_1240_1260_2030_4040_4060 ZORRO_ID(APOLLO_3, 0x23, 0) - -#define ZORRO_MANUF_PETSOFF_LP 0x38A5 -#define ZORRO_PROD_PETSOFF_LP_DELFINA ZORRO_ID(PETSOFF_LP, 0x00, 0) -#define ZORRO_PROD_PETSOFF_LP_DELFINA_LITE ZORRO_ID(PETSOFF_LP, 0x01, 0) - -#define ZORRO_MANUF_UWE_GERLACH 0x3FF7 -#define ZORRO_PROD_UWE_GERLACH_RAM_ROM ZORRO_ID(UWE_GERLACH, 0xd4, 0) - -#define ZORRO_MANUF_ACT 0x4231 -#define ZORRO_PROD_ACT_PRELUDE ZORRO_ID(ACT, 0x01, 0) - -#define ZORRO_MANUF_MACROSYSTEMS_GERMANY 0x4754 -#define ZORRO_PROD_MACROSYSTEMS_MAESTRO ZORRO_ID(MACROSYSTEMS_GERMANY, 0x03, 0) -#define ZORRO_PROD_MACROSYSTEMS_VLAB ZORRO_ID(MACROSYSTEMS_GERMANY, 0x04, 0) -#define ZORRO_PROD_MACROSYSTEMS_MAESTRO_PRO ZORRO_ID(MACROSYSTEMS_GERMANY, 0x05, 0) -#define ZORRO_PROD_MACROSYSTEMS_RETINA ZORRO_ID(MACROSYSTEMS_GERMANY, 0x06, 0) -#define ZORRO_PROD_MACROSYSTEMS_MULTI_EVOLUTION ZORRO_ID(MACROSYSTEMS_GERMANY, 0x08, 0) -#define ZORRO_PROD_MACROSYSTEMS_TOCCATA ZORRO_ID(MACROSYSTEMS_GERMANY, 0x0C, 0) -#define ZORRO_PROD_MACROSYSTEMS_RETINA_Z3 ZORRO_ID(MACROSYSTEMS_GERMANY, 0x10, 0) -#define ZORRO_PROD_MACROSYSTEMS_VLAB_MOTION ZORRO_ID(MACROSYSTEMS_GERMANY, 0x12, 0) -#define ZORRO_PROD_MACROSYSTEMS_ALTAIS ZORRO_ID(MACROSYSTEMS_GERMANY, 0x13, 0) -#define ZORRO_PROD_MACROSYSTEMS_FALCON_040 ZORRO_ID(MACROSYSTEMS_GERMANY, 0xFD, 0) - -#define ZORRO_MANUF_COMBITEC 0x6766 - -#define ZORRO_MANUF_SKI_PERIPHERALS 0x8000 -#define ZORRO_PROD_SKI_PERIPHERALS_MAST_FIREBALL ZORRO_ID(SKI_PERIPHERALS, 0x08, 0) -#define ZORRO_PROD_SKI_PERIPHERALS_SCSI_DUAL_SERIAL ZORRO_ID(SKI_PERIPHERALS, 0x80, 0) - -#define ZORRO_MANUF_REIS_WARE_2 0xA9AD -#define ZORRO_PROD_REIS_WARE_SCAN_KING ZORRO_ID(REIS_WARE_2, 0x11, 0) - -#define ZORRO_MANUF_CAMERON 0xAA01 -#define ZORRO_PROD_CAMERON_PERSONAL_A4 ZORRO_ID(CAMERON, 0x10, 0) - -#define ZORRO_MANUF_REIS_WARE 0xAA11 -#define ZORRO_PROD_REIS_WARE_HANDYSCANNER ZORRO_ID(REIS_WARE, 0x11, 0) - -#define ZORRO_MANUF_PHOENIX_2 0xB5A8 -#define ZORRO_PROD_PHOENIX_ST506_2 ZORRO_ID(PHOENIX_2, 0x21, 0) -#define ZORRO_PROD_PHOENIX_SCSI_2 ZORRO_ID(PHOENIX_2, 0x22, 0) -#define ZORRO_PROD_PHOENIX_RAM_2 ZORRO_ID(PHOENIX_2, 0xBE, 0) - -#define ZORRO_MANUF_COMBITEC_2 0xC008 -#define ZORRO_PROD_COMBITEC_HD ZORRO_ID(COMBITEC_2, 0x2A, 0) -#define ZORRO_PROD_COMBITEC_SRAM ZORRO_ID(COMBITEC_2, 0x2B, 0) - - - /* - * Test and illegal Manufacturer IDs. - */ - -#define ZORRO_MANUF_HACKER 0x07DB -#define ZORRO_PROD_GENERAL_PROTOTYPE ZORRO_ID(HACKER, 0x00, 0) -#define ZORRO_PROD_HACKER_SCSI ZORRO_ID(HACKER, 0x01, 0) -#define ZORRO_PROD_RESOURCE_MANAGEMENT_FORCE_QUICKNET_QN2000 ZORRO_ID(HACKER, 0x02, 0) -#define ZORRO_PROD_VECTOR_CONNECTION_2 ZORRO_ID(HACKER, 0xE0, 0) -#define ZORRO_PROD_VECTOR_CONNECTION_3 ZORRO_ID(HACKER, 0xE1, 0) -#define ZORRO_PROD_VECTOR_CONNECTION_4 ZORRO_ID(HACKER, 0xE2, 0) -#define ZORRO_PROD_VECTOR_CONNECTION_5 ZORRO_ID(HACKER, 0xE3, 0) - - - /* - * GVP identifies most of its products through the 'extended product code' - * (epc). The epc has to be ANDed with the GVP_PRODMASK before the - * identification. - */ - -#define GVP_PRODMASK (0xf8) -#define GVP_SCSICLKMASK (0x01) - -enum GVP_flags { - GVP_IO = 0x01, - GVP_ACCEL = 0x02, - GVP_SCSI = 0x04, - GVP_24BITDMA = 0x08, - GVP_25BITDMA = 0x10, - GVP_NOBANK = 0x20, - GVP_14MHZ = 0x40, -}; - - -struct Node { - struct Node *ln_Succ; /* Pointer to next (successor) */ - struct Node *ln_Pred; /* Pointer to previous (predecessor) */ - __u8 ln_Type; - __s8 ln_Pri; /* Priority, for sorting */ - __s8 *ln_Name; /* ID string, null terminated */ -} __attribute__ ((packed)); - -struct ExpansionRom { - /* -First 16 bytes of the expansion ROM */ - __u8 er_Type; /* Board type, size and flags */ - __u8 er_Product; /* Product number, assigned by manufacturer */ - __u8 er_Flags; /* Flags */ - __u8 er_Reserved03; /* Must be zero ($ff inverted) */ - __u16 er_Manufacturer; /* Unique ID, ASSIGNED BY COMMODORE-AMIGA! */ - __u32 er_SerialNumber; /* Available for use by manufacturer */ - __u16 er_InitDiagVec; /* Offset to optional "DiagArea" structure */ - __u8 er_Reserved0c; - __u8 er_Reserved0d; - __u8 er_Reserved0e; - __u8 er_Reserved0f; -} __attribute__ ((packed)); - -/* er_Type board type bits */ -#define ERT_TYPEMASK 0xc0 -#define ERT_ZORROII 0xc0 -#define ERT_ZORROIII 0x80 - -/* other bits defined in er_Type */ -#define ERTB_MEMLIST 5 /* Link RAM into free memory list */ -#define ERTF_MEMLIST (1<<5) - -struct ConfigDev { - struct Node cd_Node; - __u8 cd_Flags; /* (read/write) */ - __u8 cd_Pad; /* reserved */ - struct ExpansionRom cd_Rom; /* copy of board's expansion ROM */ - void *cd_BoardAddr; /* where in memory the board was placed */ - __u32 cd_BoardSize; /* size of board in bytes */ - __u16 cd_SlotAddr; /* which slot number (PRIVATE) */ - __u16 cd_SlotSize; /* number of slots (PRIVATE) */ - void *cd_Driver; /* pointer to node of driver */ - struct ConfigDev *cd_NextCD; /* linked list of drivers to config */ - __u32 cd_Unused[4]; /* for whatever the driver wants */ -} __attribute__ ((packed)); - -#else /* __ASSEMBLY__ */ - -LN_Succ = 0 -LN_Pred = LN_Succ+4 -LN_Type = LN_Pred+4 -LN_Pri = LN_Type+1 -LN_Name = LN_Pri+1 -LN_sizeof = LN_Name+4 - -ER_Type = 0 -ER_Product = ER_Type+1 -ER_Flags = ER_Product+1 -ER_Reserved03 = ER_Flags+1 -ER_Manufacturer = ER_Reserved03+1 -ER_SerialNumber = ER_Manufacturer+2 -ER_InitDiagVec = ER_SerialNumber+4 -ER_Reserved0c = ER_InitDiagVec+2 -ER_Reserved0d = ER_Reserved0c+1 -ER_Reserved0e = ER_Reserved0d+1 -ER_Reserved0f = ER_Reserved0e+1 -ER_sizeof = ER_Reserved0f+1 - -CD_Node = 0 -CD_Flags = CD_Node+LN_sizeof -CD_Pad = CD_Flags+1 -CD_Rom = CD_Pad+1 -CD_BoardAddr = CD_Rom+ER_sizeof -CD_BoardSize = CD_BoardAddr+4 -CD_SlotAddr = CD_BoardSize+4 -CD_SlotSize = CD_SlotAddr+2 -CD_Driver = CD_SlotSize+2 -CD_NextCD = CD_Driver+4 -CD_Unused = CD_NextCD+4 -CD_sizeof = CD_Unused+(4*4) - -#endif /* __ASSEMBLY__ */ - -#ifndef __ASSEMBLY__ - -#define ZORRO_NUM_AUTO 16 - -#ifdef __KERNEL__ - -#include - -struct zorro_dev { - struct ExpansionRom rom; - zorro_id id; - u16 slotaddr; - u16 slotsize; - char name[48]; - struct resource resource; -}; - -extern unsigned int zorro_num_autocon; /* # of autoconfig devices found */ -extern struct zorro_dev zorro_autocon[ZORRO_NUM_AUTO]; - - - /* - * Zorro Functions - */ - -extern void zorro_init(void); - -extern struct zorro_dev *zorro_find_device(zorro_id id, - struct zorro_dev *from); - -#define zorro_request_device(z, name) \ - request_mem_region((z)->resource.start, \ - (z)->resource.end-(z)->resource.start+1, (name)) -#define zorro_check_device(z) \ - check_mem_region((z)->resource.start, \ - (z)->resource.end-(z)->resource.start+1) -#define zorro_release_device(z) \ - release_mem_region((z)->resource.start, \ - (z)->resource.end-(z)->resource.start+1) - - - /* - * Bitmask indicating portions of available Zorro II RAM that are unused - * by the system. Every bit represents a 64K chunk, for a maximum of 8MB - * (128 chunks, physical 0x00200000-0x009fffff). - * - * If you want to use (= allocate) portions of this RAM, you should clear - * the corresponding bits. - */ - -extern __u32 zorro_unused_z2ram[4]; - -#define Z2RAM_START (0x00200000) -#define Z2RAM_END (0x00a00000) -#define Z2RAM_SIZE (0x00800000) -#define Z2RAM_CHUNKSIZE (0x00010000) -#define Z2RAM_CHUNKMASK (0x0000ffff) -#define Z2RAM_CHUNKSHIFT (16) - - -#endif /* !__ASSEMBLY__ */ -#endif /* __KERNEL__ */ - -#endif /* _LINUX_ZORRO_H */ +/* + * linux/zorro.h -- Amiga AutoConfig (Zorro) Bus Definitions + * + * Copyright (C) 1995--2000 Geert Uytterhoeven + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive + * for more details. + */ + +#ifndef _LINUX_ZORRO_H +#define _LINUX_ZORRO_H + +#ifndef __ASSEMBLY__ + + /* + * Each Zorro board has a 32-bit ID of the form + * + * mmmmmmmmmmmmmmmmppppppppeeeeeeee + * + * with + * + * mmmmmmmmmmmmmmmm 16-bit Manufacturer ID (assigned by CBM (sigh)) + * pppppppp 8-bit Product ID (assigned by manufacturer) + * eeeeeeee 8-bit Extended Product ID (currently only used + * for some GVP boards) + */ + + +#define ZORRO_MANUF(id) ((id) >> 16) +#define ZORRO_PROD(id) (((id) >> 8) & 0xff) +#define ZORRO_EPC(id) ((id) & 0xff) + +#define ZORRO_ID(manuf, prod, epc) \ + ((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc)) + +typedef __u32 zorro_id; + + +#define ZORRO_WILDCARD (0xffffffff) /* not official */ + +/* Include the ID list */ +#include + + + /* + * GVP identifies most of its products through the 'extended product code' + * (epc). The epc has to be ANDed with the GVP_PRODMASK before the + * identification. + */ + +#define GVP_PRODMASK (0xf8) +#define GVP_SCSICLKMASK (0x01) + +enum GVP_flags { + GVP_IO = 0x01, + GVP_ACCEL = 0x02, + GVP_SCSI = 0x04, + GVP_24BITDMA = 0x08, + GVP_25BITDMA = 0x10, + GVP_NOBANK = 0x20, + GVP_14MHZ = 0x40, +}; + + +struct Node { + struct Node *ln_Succ; /* Pointer to next (successor) */ + struct Node *ln_Pred; /* Pointer to previous (predecessor) */ + __u8 ln_Type; + __s8 ln_Pri; /* Priority, for sorting */ + __s8 *ln_Name; /* ID string, null terminated */ +} __attribute__ ((packed)); + +struct ExpansionRom { + /* -First 16 bytes of the expansion ROM */ + __u8 er_Type; /* Board type, size and flags */ + __u8 er_Product; /* Product number, assigned by manufacturer */ + __u8 er_Flags; /* Flags */ + __u8 er_Reserved03; /* Must be zero ($ff inverted) */ + __u16 er_Manufacturer; /* Unique ID, ASSIGNED BY COMMODORE-AMIGA! */ + __u32 er_SerialNumber; /* Available for use by manufacturer */ + __u16 er_InitDiagVec; /* Offset to optional "DiagArea" structure */ + __u8 er_Reserved0c; + __u8 er_Reserved0d; + __u8 er_Reserved0e; + __u8 er_Reserved0f; +} __attribute__ ((packed)); + +/* er_Type board type bits */ +#define ERT_TYPEMASK 0xc0 +#define ERT_ZORROII 0xc0 +#define ERT_ZORROIII 0x80 + +/* other bits defined in er_Type */ +#define ERTB_MEMLIST 5 /* Link RAM into free memory list */ +#define ERTF_MEMLIST (1<<5) + +struct ConfigDev { + struct Node cd_Node; + __u8 cd_Flags; /* (read/write) */ + __u8 cd_Pad; /* reserved */ + struct ExpansionRom cd_Rom; /* copy of board's expansion ROM */ + void *cd_BoardAddr; /* where in memory the board was placed */ + __u32 cd_BoardSize; /* size of board in bytes */ + __u16 cd_SlotAddr; /* which slot number (PRIVATE) */ + __u16 cd_SlotSize; /* number of slots (PRIVATE) */ + void *cd_Driver; /* pointer to node of driver */ + struct ConfigDev *cd_NextCD; /* linked list of drivers to config */ + __u32 cd_Unused[4]; /* for whatever the driver wants */ +} __attribute__ ((packed)); + +#else /* __ASSEMBLY__ */ + +LN_Succ = 0 +LN_Pred = LN_Succ+4 +LN_Type = LN_Pred+4 +LN_Pri = LN_Type+1 +LN_Name = LN_Pri+1 +LN_sizeof = LN_Name+4 + +ER_Type = 0 +ER_Product = ER_Type+1 +ER_Flags = ER_Product+1 +ER_Reserved03 = ER_Flags+1 +ER_Manufacturer = ER_Reserved03+1 +ER_SerialNumber = ER_Manufacturer+2 +ER_InitDiagVec = ER_SerialNumber+4 +ER_Reserved0c = ER_InitDiagVec+2 +ER_Reserved0d = ER_Reserved0c+1 +ER_Reserved0e = ER_Reserved0d+1 +ER_Reserved0f = ER_Reserved0e+1 +ER_sizeof = ER_Reserved0f+1 + +CD_Node = 0 +CD_Flags = CD_Node+LN_sizeof +CD_Pad = CD_Flags+1 +CD_Rom = CD_Pad+1 +CD_BoardAddr = CD_Rom+ER_sizeof +CD_BoardSize = CD_BoardAddr+4 +CD_SlotAddr = CD_BoardSize+4 +CD_SlotSize = CD_SlotAddr+2 +CD_Driver = CD_SlotSize+2 +CD_NextCD = CD_Driver+4 +CD_Unused = CD_NextCD+4 +CD_sizeof = CD_Unused+(4*4) + +#endif /* __ASSEMBLY__ */ + +#ifndef __ASSEMBLY__ + +#define ZORRO_NUM_AUTO 16 + +#ifdef __KERNEL__ + +#include + +struct zorro_dev { + struct ExpansionRom rom; + zorro_id id; + u16 slotaddr; + u16 slotsize; + char name[64]; + struct resource resource; +}; + +extern unsigned int zorro_num_autocon; /* # of autoconfig devices found */ +extern struct zorro_dev zorro_autocon[ZORRO_NUM_AUTO]; + + + /* + * Zorro Functions + */ + +extern void zorro_init(void); +extern void zorro_name_device(struct zorro_dev *dev); + +extern struct zorro_dev *zorro_find_device(zorro_id id, + struct zorro_dev *from); + +#define zorro_request_device(z, name) \ + request_mem_region((z)->resource.start, \ + (z)->resource.end-(z)->resource.start+1, (name)) +#define zorro_check_device(z) \ + check_mem_region((z)->resource.start, \ + (z)->resource.end-(z)->resource.start+1) +#define zorro_release_device(z) \ + release_mem_region((z)->resource.start, \ + (z)->resource.end-(z)->resource.start+1) + + + /* + * Bitmask indicating portions of available Zorro II RAM that are unused + * by the system. Every bit represents a 64K chunk, for a maximum of 8MB + * (128 chunks, physical 0x00200000-0x009fffff). + * + * If you want to use (= allocate) portions of this RAM, you should clear + * the corresponding bits. + */ + +extern __u32 zorro_unused_z2ram[4]; + +#define Z2RAM_START (0x00200000) +#define Z2RAM_END (0x00a00000) +#define Z2RAM_SIZE (0x00800000) +#define Z2RAM_CHUNKSIZE (0x00010000) +#define Z2RAM_CHUNKMASK (0x0000ffff) +#define Z2RAM_CHUNKSHIFT (16) + + +#endif /* !__ASSEMBLY__ */ +#endif /* __KERNEL__ */ + +#endif /* _LINUX_ZORRO_H */ diff --git a/include/linux/zorro.h b/include/linux/zorro_ids.h similarity index 83% copy from include/linux/zorro.h copy to include/linux/zorro_ids.h index 9e7c07889..0a09d97bc 100644 --- a/include/linux/zorro.h +++ b/include/linux/zorro_ids.h @@ -1,46 +1,9 @@ /* - * linux/zorro.h -- Amiga AutoConfig (Zorro) Bus Definitions + * Zorro board IDs * - * Copyright (C) 1995-2000 Geert Uytterhoeven - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. + * Please keep sorted. */ -#ifndef _LINUX_ZORRO_H -#define _LINUX_ZORRO_H - -#ifndef __ASSEMBLY__ - - /* - * Known Zorro Boards - * - * Each Zorro board has a 32-bit ID of the form - * - * mmmmmmmmmmmmmmmmppppppppeeeeeeee - * - * with - * - * mmmmmmmmmmmmmmmm 16-bit Manufacturer ID (assigned by CBM (sigh)) - * pppppppp 8-bit Product ID (assigned by manufacturer) - * eeeeeeee 8-bit Extended Product ID (currently only used - * for some GVP boards) - */ - - -#define ZORRO_MANUF(id) ((id) >> 16) -#define ZORRO_PROD(id) (((id) >> 8) & 0xff) -#define ZORRO_EPC(id) ((id) & 0xff) - -#define ZORRO_ID(manuf, prod, epc) \ - ((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc)) - -typedef __u32 zorro_id; - - -#define ZORRO_WILDCARD (0xffffffff) /* not official */ - #define ZORRO_MANUF_PACIFIC_PERIPHERALS 0x00D3 #define ZORRO_PROD_PACIFIC_PERIPHERALS_SE_2000_A500 ZORRO_ID(PACIFIC_PERIPHERALS, 0x00, 0) @@ -586,172 +549,3 @@ typedef __u32 zorro_id; #define ZORRO_PROD_VECTOR_CONNECTION_3 ZORRO_ID(HACKER, 0xE1, 0) #define ZORRO_PROD_VECTOR_CONNECTION_4 ZORRO_ID(HACKER, 0xE2, 0) #define ZORRO_PROD_VECTOR_CONNECTION_5 ZORRO_ID(HACKER, 0xE3, 0) - - - /* - * GVP identifies most of its products through the 'extended product code' - * (epc). The epc has to be ANDed with the GVP_PRODMASK before the - * identification. - */ - -#define GVP_PRODMASK (0xf8) -#define GVP_SCSICLKMASK (0x01) - -enum GVP_flags { - GVP_IO = 0x01, - GVP_ACCEL = 0x02, - GVP_SCSI = 0x04, - GVP_24BITDMA = 0x08, - GVP_25BITDMA = 0x10, - GVP_NOBANK = 0x20, - GVP_14MHZ = 0x40, -}; - - -struct Node { - struct Node *ln_Succ; /* Pointer to next (successor) */ - struct Node *ln_Pred; /* Pointer to previous (predecessor) */ - __u8 ln_Type; - __s8 ln_Pri; /* Priority, for sorting */ - __s8 *ln_Name; /* ID string, null terminated */ -} __attribute__ ((packed)); - -struct ExpansionRom { - /* -First 16 bytes of the expansion ROM */ - __u8 er_Type; /* Board type, size and flags */ - __u8 er_Product; /* Product number, assigned by manufacturer */ - __u8 er_Flags; /* Flags */ - __u8 er_Reserved03; /* Must be zero ($ff inverted) */ - __u16 er_Manufacturer; /* Unique ID, ASSIGNED BY COMMODORE-AMIGA! */ - __u32 er_SerialNumber; /* Available for use by manufacturer */ - __u16 er_InitDiagVec; /* Offset to optional "DiagArea" structure */ - __u8 er_Reserved0c; - __u8 er_Reserved0d; - __u8 er_Reserved0e; - __u8 er_Reserved0f; -} __attribute__ ((packed)); - -/* er_Type board type bits */ -#define ERT_TYPEMASK 0xc0 -#define ERT_ZORROII 0xc0 -#define ERT_ZORROIII 0x80 - -/* other bits defined in er_Type */ -#define ERTB_MEMLIST 5 /* Link RAM into free memory list */ -#define ERTF_MEMLIST (1<<5) - -struct ConfigDev { - struct Node cd_Node; - __u8 cd_Flags; /* (read/write) */ - __u8 cd_Pad; /* reserved */ - struct ExpansionRom cd_Rom; /* copy of board's expansion ROM */ - void *cd_BoardAddr; /* where in memory the board was placed */ - __u32 cd_BoardSize; /* size of board in bytes */ - __u16 cd_SlotAddr; /* which slot number (PRIVATE) */ - __u16 cd_SlotSize; /* number of slots (PRIVATE) */ - void *cd_Driver; /* pointer to node of driver */ - struct ConfigDev *cd_NextCD; /* linked list of drivers to config */ - __u32 cd_Unused[4]; /* for whatever the driver wants */ -} __attribute__ ((packed)); - -#else /* __ASSEMBLY__ */ - -LN_Succ = 0 -LN_Pred = LN_Succ+4 -LN_Type = LN_Pred+4 -LN_Pri = LN_Type+1 -LN_Name = LN_Pri+1 -LN_sizeof = LN_Name+4 - -ER_Type = 0 -ER_Product = ER_Type+1 -ER_Flags = ER_Product+1 -ER_Reserved03 = ER_Flags+1 -ER_Manufacturer = ER_Reserved03+1 -ER_SerialNumber = ER_Manufacturer+2 -ER_InitDiagVec = ER_SerialNumber+4 -ER_Reserved0c = ER_InitDiagVec+2 -ER_Reserved0d = ER_Reserved0c+1 -ER_Reserved0e = ER_Reserved0d+1 -ER_Reserved0f = ER_Reserved0e+1 -ER_sizeof = ER_Reserved0f+1 - -CD_Node = 0 -CD_Flags = CD_Node+LN_sizeof -CD_Pad = CD_Flags+1 -CD_Rom = CD_Pad+1 -CD_BoardAddr = CD_Rom+ER_sizeof -CD_BoardSize = CD_BoardAddr+4 -CD_SlotAddr = CD_BoardSize+4 -CD_SlotSize = CD_SlotAddr+2 -CD_Driver = CD_SlotSize+2 -CD_NextCD = CD_Driver+4 -CD_Unused = CD_NextCD+4 -CD_sizeof = CD_Unused+(4*4) - -#endif /* __ASSEMBLY__ */ - -#ifndef __ASSEMBLY__ - -#define ZORRO_NUM_AUTO 16 - -#ifdef __KERNEL__ - -#include - -struct zorro_dev { - struct ExpansionRom rom; - zorro_id id; - u16 slotaddr; - u16 slotsize; - char name[48]; - struct resource resource; -}; - -extern unsigned int zorro_num_autocon; /* # of autoconfig devices found */ -extern struct zorro_dev zorro_autocon[ZORRO_NUM_AUTO]; - - - /* - * Zorro Functions - */ - -extern void zorro_init(void); - -extern struct zorro_dev *zorro_find_device(zorro_id id, - struct zorro_dev *from); - -#define zorro_request_device(z, name) \ - request_mem_region((z)->resource.start, \ - (z)->resource.end-(z)->resource.start+1, (name)) -#define zorro_check_device(z) \ - check_mem_region((z)->resource.start, \ - (z)->resource.end-(z)->resource.start+1) -#define zorro_release_device(z) \ - release_mem_region((z)->resource.start, \ - (z)->resource.end-(z)->resource.start+1) - - - /* - * Bitmask indicating portions of available Zorro II RAM that are unused - * by the system. Every bit represents a 64K chunk, for a maximum of 8MB - * (128 chunks, physical 0x00200000-0x009fffff). - * - * If you want to use (= allocate) portions of this RAM, you should clear - * the corresponding bits. - */ - -extern __u32 zorro_unused_z2ram[4]; - -#define Z2RAM_START (0x00200000) -#define Z2RAM_END (0x00a00000) -#define Z2RAM_SIZE (0x00800000) -#define Z2RAM_CHUNKSIZE (0x00010000) -#define Z2RAM_CHUNKMASK (0x0000ffff) -#define Z2RAM_CHUNKSHIFT (16) - - -#endif /* !__ASSEMBLY__ */ -#endif /* __KERNEL__ */ - -#endif /* _LINUX_ZORRO_H */ diff --git a/include/net/atalkcall.h b/include/net/atalkcall.h deleted file mode 100644 index 726e33cd9..000000000 --- a/include/net/atalkcall.h +++ /dev/null @@ -1,2 +0,0 @@ -/* Separate to keep compilation of protocols.c simpler */ -extern void atalk_proto_init(struct net_proto *pro); diff --git a/include/net/ax25.h b/include/net/ax25.h index f0c547d0b..50d4aa889 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h @@ -253,8 +253,6 @@ extern void ax25_ds_heartbeat_expiry(ax25_cb *); extern void ax25_ds_t3timer_expiry(ax25_cb *); extern void ax25_ds_idletimer_expiry(ax25_cb *); -#include - /* ax25_iface.c */ extern int ax25_protocol_register(unsigned int, int (*)(struct sk_buff *, ax25_cb *)); extern void ax25_protocol_release(unsigned int); diff --git a/include/net/ax25call.h b/include/net/ax25call.h deleted file mode 100644 index 68b8a70c0..000000000 --- a/include/net/ax25call.h +++ /dev/null @@ -1,2 +0,0 @@ -/* Separate to keep compilation of protocols.c simpler */ -extern void ax25_proto_init(struct net_proto *pro); diff --git a/include/net/decnet_call.h b/include/net/decnet_call.h deleted file mode 100644 index 90a30561e..000000000 --- a/include/net/decnet_call.h +++ /dev/null @@ -1,2 +0,0 @@ -/* Separate to keep compilation of protocols.c simpler */ -extern void decnet_proto_init(struct net_proto *pro); diff --git a/include/net/divert.h b/include/net/divert.h index c0d14663f..624bc55ed 100644 --- a/include/net/divert.h +++ b/include/net/divert.h @@ -9,6 +9,8 @@ #ifndef _LINUX_DIVERT_H #define _LINUX_DIVERT_H +#include + #define MAX_DIVERT_PORTS 8 /* Max number of ports to divert (tcp, udp) */ /* Divertable protocols */ @@ -18,22 +20,6 @@ #define DIVERT_PROTO_TCP 0x0004 #define DIVERT_PROTO_UDP 0x0008 -#ifdef __KERNEL__ - #define S16 s16 - #define U16 u16 - #define S32 s32 - #define U32 u32 - #define S64 s64 - #define U64 u64 -#else - #define S16 __s16 - #define U16 __u16 - #define S32 __s32 - #define U32 __u32 - #define S64 __s64 - #define U64 __u64 -#endif - /* * This is an Ethernet Frame Diverter option block */ @@ -41,10 +27,10 @@ struct divert_blk { int divert; /* are we active */ unsigned int protos; /* protocols */ - U16 tcp_dst[MAX_DIVERT_PORTS]; /* specific tcp dst ports to divert */ - U16 tcp_src[MAX_DIVERT_PORTS]; /* specific tcp src ports to divert */ - U16 udp_dst[MAX_DIVERT_PORTS]; /* specific udp dst ports to divert */ - U16 udp_src[MAX_DIVERT_PORTS]; /* specific udp src ports to divert */ + u16 tcp_dst[MAX_DIVERT_PORTS]; /* specific tcp dst ports to divert */ + u16 tcp_src[MAX_DIVERT_PORTS]; /* specific tcp src ports to divert */ + u16 udp_dst[MAX_DIVERT_PORTS]; /* specific udp dst ports to divert */ + u16 udp_src[MAX_DIVERT_PORTS]; /* specific udp src ports to divert */ }; /* @@ -54,12 +40,12 @@ struct divert_blk typedef union _divert_cf_arg { - S16 int16; - U16 uint16; - S32 int32; - U32 uint32; - S64 int64; - U64 uint64; + s16 int16; + u16 uint16; + s32 int32; + u32 uint32; + s64 int64; + u64 uint64; void *ptr; } divert_cf_arg; diff --git a/include/net/ipx.h b/include/net/ipx.h index 667098922..84e7cdb1d 100644 --- a/include/net/ipx.h +++ b/include/net/ipx.h @@ -41,8 +41,6 @@ struct ipxhdr ipx_address ipx_source __attribute__ ((packed)); }; -#include - typedef struct ipx_interface { /* IPX address */ __u32 if_netnum; diff --git a/include/net/ipxcall.h b/include/net/ipxcall.h deleted file mode 100644 index eb5bd2bd2..000000000 --- a/include/net/ipxcall.h +++ /dev/null @@ -1,2 +0,0 @@ -/* Separate to keep compilation of protocols.c simpler */ -extern void ipx_proto_init(struct net_proto *pro); diff --git a/include/net/lapbcall.h b/include/net/lapbcall.h deleted file mode 100644 index 825e7f2c7..000000000 --- a/include/net/lapbcall.h +++ /dev/null @@ -1,2 +0,0 @@ -/* Separate to keep compilation of protocols.c simpler */ -extern void lapb_proto_init(struct net_proto *pro); diff --git a/include/net/llccall.h b/include/net/llccall.h deleted file mode 100644 index 07013ba31..000000000 --- a/include/net/llccall.h +++ /dev/null @@ -1,3 +0,0 @@ -/* Separate to keep compilation of protocols.c simpler */ -extern void llc_init(struct net_proto *pro); - diff --git a/include/net/netbeuicall.h b/include/net/netbeuicall.h deleted file mode 100644 index 5176f82bf..000000000 --- a/include/net/netbeuicall.h +++ /dev/null @@ -1,2 +0,0 @@ -/* Separate to keep compilation of protocols.c simpler */ -extern void netbeui_proto_init(struct net_proto *pro); diff --git a/include/net/netrom.h b/include/net/netrom.h index 11aefe5fa..21c9f8b86 100644 --- a/include/net/netrom.h +++ b/include/net/netrom.h @@ -121,8 +121,6 @@ extern void nr_destroy_socket(struct sock *); extern int nr_rx_ip(struct sk_buff *, struct net_device *); extern int nr_init(struct net_device *); -#include - /* nr_in.c */ extern int nr_process_rx_frame(struct sock *, struct sk_buff *); diff --git a/include/net/nrcall.h b/include/net/nrcall.h deleted file mode 100644 index 09ee699d8..000000000 --- a/include/net/nrcall.h +++ /dev/null @@ -1,2 +0,0 @@ -/* Separate to keep compilation of protocols.c simpler */ -extern void nr_proto_init(struct net_proto *pro); diff --git a/include/net/p8022call.h b/include/net/p8022call.h deleted file mode 100644 index 14f0c2cee..000000000 --- a/include/net/p8022call.h +++ /dev/null @@ -1,2 +0,0 @@ -/* Separate to keep compilation of Space.c simpler */ -extern void p8022_proto_init(struct net_proto *); diff --git a/include/net/psnapcall.h b/include/net/psnapcall.h deleted file mode 100644 index 9da5763c5..000000000 --- a/include/net/psnapcall.h +++ /dev/null @@ -1,2 +0,0 @@ -/* Separate to keep compilation of Space.c simpler */ -extern void snap_proto_init(struct net_proto *); diff --git a/include/net/rose.h b/include/net/rose.h index da19fb64f..f1f893e27 100644 --- a/include/net/rose.h +++ b/include/net/rose.h @@ -163,8 +163,6 @@ extern void rose_destroy_socket(struct sock *); extern int rose_rx_ip(struct sk_buff *, struct net_device *); extern int rose_init(struct net_device *); -#include - /* rose_in.c */ extern int rose_process_rx_frame(struct sock *, struct sk_buff *); diff --git a/include/net/rosecall.h b/include/net/rosecall.h deleted file mode 100644 index 5bbe69cce..000000000 --- a/include/net/rosecall.h +++ /dev/null @@ -1,2 +0,0 @@ -/* Separate to keep compilation of protocols.c simpler */ -extern void rose_proto_init(struct net_proto *pro); diff --git a/include/net/spxcall.h b/include/net/spxcall.h deleted file mode 100644 index 0461fbbe1..000000000 --- a/include/net/spxcall.h +++ /dev/null @@ -1,2 +0,0 @@ -/* Separate to keep compilation of protocols.c simpler */ -extern void spx_proto_init(struct net_proto *pro); diff --git a/include/net/x25.h b/include/net/x25.h index fb8346f81..fc3d83ee4 100644 --- a/include/net/x25.h +++ b/include/net/x25.h @@ -154,8 +154,6 @@ extern void x25_destroy_socket(struct sock *); extern int x25_rx_call_request(struct sk_buff *, struct x25_neigh *, unsigned int); extern void x25_kill_by_neigh(struct x25_neigh *); -#include - /* x25_dev.c */ extern void x25_send_frame(struct sk_buff *, struct x25_neigh *); extern int x25_lapb_receive_frame(struct sk_buff *, struct net_device *, struct packet_type *); diff --git a/include/net/x25call.h b/include/net/x25call.h deleted file mode 100644 index 7c478a1d9..000000000 --- a/include/net/x25call.h +++ /dev/null @@ -1,2 +0,0 @@ -/* Separate to keep compilation of protocols.c simpler */ -extern void x25_proto_init(struct net_proto *pro); diff --git a/kernel/module.c b/kernel/module.c index 5e5fbfe1b..15efa305c 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -28,22 +28,13 @@ extern const struct exception_table_entry __stop___ex_table[]; static struct module kernel_module = { - sizeof(struct module), /* size_of_struct */ - NULL, /* next */ - "", /* name */ - 0, /* size */ - {ATOMIC_INIT(1)}, /* usecount */ - MOD_RUNNING, /* flags */ - 0, /* nsyms -- to filled in in init_modules */ - 0, /* ndeps */ - __start___ksymtab, /* syms */ - NULL, /* deps */ - NULL, /* refs */ - NULL, /* init */ - NULL, /* cleanup */ - __start___ex_table, /* ex_table_start */ - __stop___ex_table, /* ex_table_end */ - /* Rest are NULL */ + size_of_struct: sizeof(struct module), + name: "", + uc: {ATOMIC_INIT(1)}, + flags: MOD_RUNNING, + syms: __start___ksymtab, + ex_table_start: __start___ex_table, + ex_table_end: __stop___ex_table }; struct module *module_list = &kernel_module; diff --git a/kernel/panic.c b/kernel/panic.c index d6e37fbf7..ac246f745 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -22,7 +22,7 @@ extern void unblank_console(void); int panic_timeout; -struct notifier_block *panic_notifier_list = NULL; +struct notifier_block *panic_notifier_list; static int __init panic_setup(char *str) { diff --git a/kernel/printk.c b/kernel/printk.c index af3d57bfd..7b967e30f 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -45,7 +45,7 @@ int default_console_loglevel = DEFAULT_CONSOLE_LOGLEVEL; spinlock_t console_lock = SPIN_LOCK_UNLOCKED; -struct console *console_drivers = NULL; +struct console *console_drivers; static char log_buf[LOG_BUF_LEN]; static unsigned long log_start; static unsigned long logged_chars; diff --git a/kernel/sys.c b/kernel/sys.c index e4950d2e3..38eb5dee9 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -47,7 +47,7 @@ int C_A_D = 1; * and the like. */ -static struct notifier_block *reboot_notifier_list = NULL; +static struct notifier_block *reboot_notifier_list; rwlock_t notifier_lock = RW_LOCK_UNLOCKED; /** diff --git a/kernel/time.c b/kernel/time.c index 843ac0cbb..ffad77ad6 100644 --- a/kernel/time.c +++ b/kernel/time.c @@ -34,7 +34,7 @@ * The timezone where the local system is located. Used as a default by some * programs who obtain this value by using gettimeofday. */ -struct timezone sys_tz = { 0, 0}; +struct timezone sys_tz; static void do_normal_gettime(struct timeval * tm) { @@ -218,7 +218,7 @@ long pps_errcnt; /* calibration errors */ long pps_stbcnt; /* stability limit exceeded */ /* hook for a loadable hardpps kernel module */ -void (*hardpps_ptr)(struct timeval *) = (void (*)(struct timeval *))0; +void (*hardpps_ptr)(struct timeval *); /* adjtimex mainly allows reading (and writing, if superuser) of * kernel time-keeping variables. used by xntpd. diff --git a/kernel/timer.c b/kernel/timer.c index 0dd0a7331..e67783a30 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -164,7 +164,7 @@ static inline void internal_add_timer(struct timer_list *timer) spinlock_t timerlist_lock = SPIN_LOCK_UNLOCKED; #ifdef CONFIG_SMP -volatile struct timer_list * volatile running_timer = NULL; +volatile struct timer_list * volatile running_timer; #define timer_enter(t) do { running_timer = t; mb(); } while (0) #define timer_exit() do { running_timer = NULL; } while (0) #define timer_is_running(t) (running_timer == t) diff --git a/mm/bootmem.c b/mm/bootmem.c index 0a8d37ba2..e9e9ef7bc 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c @@ -41,11 +41,15 @@ unsigned long __init bootmem_bootmap_pages (unsigned long pages) /* * Called once to set up the allocator itself. */ -static unsigned long __init init_bootmem_core (bootmem_data_t *bdata, +static unsigned long __init init_bootmem_core (pg_data_t *pgdat, unsigned long mapstart, unsigned long start, unsigned long end) { + bootmem_data_t *bdata = pgdat->bdata; unsigned long mapsize = ((end - start)+7)/8; + pgdat->node_next = pgdat_list; + pgdat_list = pgdat; + mapsize = (mapsize + (sizeof(long) - 1UL)) & ~(sizeof(long) - 1UL); bdata->node_bootmem_map = phys_to_virt(mapstart << PAGE_SHIFT); bdata->node_boot_start = (start << PAGE_SHIFT); @@ -172,10 +176,6 @@ restart_scan: preferred = 0; goto restart_scan; } - /* - * Whoops, we cannot satisfy the allocation request. - */ - BUG(); found: if (start >= eidx) BUG(); @@ -221,15 +221,15 @@ found: return ret; } -static unsigned long __init free_all_bootmem_core(int nid, bootmem_data_t *bdata) +static unsigned long __init free_all_bootmem_core(pg_data_t *pgdat) { - struct page * page; + struct page *page = pgdat->node_mem_map; + bootmem_data_t *bdata = pgdat->bdata; unsigned long i, count, total = 0; unsigned long idx; if (!bdata->node_bootmem_map) BUG(); - page = NODE_MEM_MAP(nid); count = 0; idx = bdata->node_low_pfn - (bdata->node_boot_start >> PAGE_SHIFT); for (i = 0; i < idx; i++, page++) { @@ -260,59 +260,78 @@ static unsigned long __init free_all_bootmem_core(int nid, bootmem_data_t *bdata return total; } -unsigned long __init init_bootmem_node (int nid, unsigned long freepfn, unsigned long startpfn, unsigned long endpfn) +unsigned long __init init_bootmem_node (pg_data_t *pgdat, unsigned long freepfn, unsigned long startpfn, unsigned long endpfn) { - return(init_bootmem_core(NODE_DATA(nid)->bdata, freepfn, startpfn, endpfn)); + return(init_bootmem_core(pgdat, freepfn, startpfn, endpfn)); } -void __init reserve_bootmem_node (int nid, unsigned long physaddr, unsigned long size) +void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size) { - reserve_bootmem_core(NODE_DATA(nid)->bdata, physaddr, size); + reserve_bootmem_core(pgdat->bdata, physaddr, size); } -void __init free_bootmem_node (int nid, unsigned long physaddr, unsigned long size) +void __init free_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size) { - return(free_bootmem_core(NODE_DATA(nid)->bdata, physaddr, size)); + return(free_bootmem_core(pgdat->bdata, physaddr, size)); } -unsigned long __init free_all_bootmem_node (int nid) +unsigned long __init free_all_bootmem_node (pg_data_t *pgdat) { - return(free_all_bootmem_core(nid, NODE_DATA(nid)->bdata)); + return(free_all_bootmem_core(pgdat)); } unsigned long __init init_bootmem (unsigned long start, unsigned long pages) { max_low_pfn = pages; min_low_pfn = start; - return(init_bootmem_core(NODE_DATA(0)->bdata, start, 0, pages)); + return(init_bootmem_core(&contig_page_data, start, 0, pages)); } void __init reserve_bootmem (unsigned long addr, unsigned long size) { - reserve_bootmem_core(NODE_DATA(0)->bdata, addr, size); + reserve_bootmem_core(contig_page_data.bdata, addr, size); } void __init free_bootmem (unsigned long addr, unsigned long size) { - return(free_bootmem_core(NODE_DATA(0)->bdata, addr, size)); + return(free_bootmem_core(contig_page_data.bdata, addr, size)); } unsigned long __init free_all_bootmem (void) { - return(free_all_bootmem_core(0, NODE_DATA(0)->bdata)); + return(free_all_bootmem_core(&contig_page_data)); } void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal) { + pg_data_t *pgdat = pgdat_list; + void *ptr; + + while (pgdat) { + if ((ptr = __alloc_bootmem_core(pgdat->bdata, size, + align, goal))) + return(ptr); + pgdat = pgdat->node_next; + } /* - * In the discontigmem case, all non-node specific allocations come - * from the first node, node 0. + * Whoops, we cannot satisfy the allocation request. */ - return(__alloc_bootmem_core(NODE_DATA(0)->bdata, size, align, goal)); + BUG(); + return NULL; } -void * __init __alloc_bootmem_node (int nid, unsigned long size, unsigned long align, unsigned long goal) +void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal) { - return(__alloc_bootmem_core(NODE_DATA(nid)->bdata, size, align, goal)); + void *ptr; + + ptr = __alloc_bootmem_core(pgdat->bdata, size, align, goal); + if (ptr) + return (ptr); + + /* + * Whoops, we cannot satisfy the allocation request. + */ + BUG(); + return NULL; } diff --git a/mm/filemap.c b/mm/filemap.c index 68937481c..2a1248eff 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1475,39 +1475,47 @@ int filemap_swapout(struct page * page, struct file * file) return retval; } +/* Called with mm->page_table_lock held to protect against other + * threads/the swapper from ripping pte's out from under us. + */ static inline int filemap_sync_pte(pte_t * ptep, struct vm_area_struct *vma, unsigned long address, unsigned int flags) { unsigned long pgoff; - pte_t pte = *ptep; + pte_t pte; struct page *page; int error; + pte = *ptep; + if (!(flags & MS_INVALIDATE)) { if (!pte_present(pte)) - return 0; - if (!pte_dirty(pte)) - return 0; + goto out; + if (!ptep_test_and_clear_dirty(ptep)) + goto out; flush_page_to_ram(pte_page(pte)); flush_cache_page(vma, address); - set_pte(ptep, pte_mkclean(pte)); flush_tlb_page(vma, address); page = pte_page(pte); page_cache_get(page); } else { if (pte_none(pte)) - return 0; + goto out; flush_cache_page(vma, address); - pte_clear(ptep); + + pte = ptep_get_and_clear(ptep); flush_tlb_page(vma, address); + if (!pte_present(pte)) { + spin_unlock(&vma->vm_mm->page_table_lock); swap_free(pte_to_swp_entry(pte)); - return 0; + spin_lock(&vma->vm_mm->page_table_lock); + goto out; } page = pte_page(pte); if (!pte_dirty(pte) || flags == MS_INVALIDATE) { page_cache_free(page); - return 0; + goto out; } } pgoff = (address - vma->vm_start) >> PAGE_CACHE_SHIFT; @@ -1516,11 +1524,18 @@ static inline int filemap_sync_pte(pte_t * ptep, struct vm_area_struct *vma, printk("weirdness: pgoff=%lu index=%lu address=%lu vm_start=%lu vm_pgoff=%lu\n", pgoff, page->index, address, vma->vm_start, vma->vm_pgoff); } + + spin_unlock(&vma->vm_mm->page_table_lock); lock_page(page); error = filemap_write_page(vma->vm_file, page, 1); UnlockPage(page); page_cache_free(page); + + spin_lock(&vma->vm_mm->page_table_lock); return error; + +out: + return 0; } static inline int filemap_sync_pte_range(pmd_t * pmd, @@ -1590,6 +1605,11 @@ int filemap_sync(struct vm_area_struct * vma, unsigned long address, unsigned long end = address + size; int error = 0; + /* Aquire the lock early; it may be possible to avoid dropping + * and reaquiring it repeatedly. + */ + spin_lock(&vma->vm_mm->page_table_lock); + dir = pgd_offset(vma->vm_mm, address); flush_cache_range(vma->vm_mm, end - size, end); if (address >= end) @@ -1600,6 +1620,9 @@ int filemap_sync(struct vm_area_struct * vma, unsigned long address, dir++; } while (address && (address < end)); flush_tlb_range(vma->vm_mm, end - size, end); + + spin_unlock(&vma->vm_mm->page_table_lock); + return error; } diff --git a/mm/highmem.c b/mm/highmem.c index 2b7d17fa7..d83d9bb87 100644 --- a/mm/highmem.c +++ b/mm/highmem.c @@ -130,10 +130,9 @@ static void flush_all_zero_pkmaps(void) if (pkmap_count[i] != 1) continue; pkmap_count[i] = 0; - pte = pkmap_page_table[i]; + pte = ptep_get_and_clear(pkmap_page_table+i); if (pte_none(pte)) BUG(); - pte_clear(pkmap_page_table+i); page = pte_page(pte); page->virtual = NULL; } diff --git a/mm/memory.c b/mm/memory.c index f1d2e13c9..4fb133461 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -215,30 +215,30 @@ skip_copy_pte_range: address = (address + PMD_SIZE) & PMD_MASK; /* copy_one_pte */ if (pte_none(pte)) - goto cont_copy_pte_range; + goto cont_copy_pte_range_noset; if (!pte_present(pte)) { swap_duplicate(pte_to_swp_entry(pte)); - set_pte(dst_pte, pte); goto cont_copy_pte_range; } ptepage = pte_page(pte); if ((!VALID_PAGE(ptepage)) || - PageReserved(ptepage)) { - set_pte(dst_pte, pte); + PageReserved(ptepage)) goto cont_copy_pte_range; - } + /* If it's a COW mapping, write protect it both in the parent and the child */ if (cow) { - pte = pte_wrprotect(pte); - set_pte(src_pte, pte); + ptep_clear_wrprotect(src_pte); + pte = *src_pte; } + /* If it's a shared mapping, mark it clean in the child */ if (vma->vm_flags & VM_SHARED) pte = pte_mkclean(pte); - set_pte(dst_pte, pte_mkold(pte)); + pte = pte_mkold(pte); get_page(ptepage); - -cont_copy_pte_range: address += PAGE_SIZE; + +cont_copy_pte_range: set_pte(dst_pte, pte); +cont_copy_pte_range_noset: address += PAGE_SIZE; if (address >= end) goto out; src_pte++; @@ -306,10 +306,9 @@ static inline int zap_pte_range(struct mm_struct *mm, pmd_t * pmd, unsigned long pte_t page; if (!size) break; - page = *pte; + page = ptep_get_and_clear(pte); pte++; size--; - pte_clear(pte-1); if (pte_none(page)) continue; freed += free_pte(page); @@ -642,7 +641,7 @@ static inline void zeromap_pte_range(pte_t * pte, unsigned long address, end = PMD_SIZE; do { pte_t zero_pte = pte_wrprotect(mk_pte(ZERO_PAGE(address), prot)); - pte_t oldpage = *pte; + pte_t oldpage = ptep_get_and_clear(pte); set_pte(pte, zero_pte); forget_pte(oldpage); address += PAGE_SIZE; @@ -712,8 +711,8 @@ static inline void remap_pte_range(pte_t * pte, unsigned long address, unsigned end = PMD_SIZE; do { struct page *page; - pte_t oldpage = *pte; - pte_clear(pte); + pte_t oldpage; + oldpage = ptep_get_and_clear(pte); page = virt_to_page(__va(phys_addr)); if ((!VALID_PAGE(page)) || PageReserved(page)) @@ -746,6 +745,7 @@ static inline int remap_pmd_range(pmd_t * pmd, unsigned long address, unsigned l return 0; } +/* Note: this is only safe if the mm semaphore is held when called. */ int remap_page_range(unsigned long from, unsigned long phys_addr, unsigned long size, pgprot_t prot) { int error = 0; @@ -867,7 +867,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma, /* * Re-check the pte - we dropped the lock */ - if (pte_val(*page_table) == pte_val(pte)) { + if (pte_same(*page_table, pte)) { if (PageReserved(old_page)) ++mm->rss; break_cow(vma, old_page, new_page, address, page_table); @@ -1214,7 +1214,7 @@ static inline int handle_pte_fault(struct mm_struct *mm, * didn't change from under us.. */ spin_lock(&mm->page_table_lock); - if (pte_val(entry) == pte_val(*pte)) { + if (pte_same(entry, *pte)) { if (write_access) { if (!pte_write(entry)) return do_wp_page(mm, vma, address, pte, entry); diff --git a/mm/mprotect.c b/mm/mprotect.c index b62536c7f..7b61abb3e 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -30,9 +30,16 @@ static inline void change_pte_range(pmd_t * pmd, unsigned long address, if (end > PMD_SIZE) end = PMD_SIZE; do { - pte_t entry = *pte; - if (pte_present(entry)) + if (pte_present(*pte)) { + pte_t entry; + + /* Avoid an SMP race with hardware updated dirty/clean + * bits by wiping the pte and then setting the new pte + * into place. + */ + entry = ptep_get_and_clear(pte); set_pte(pte, pte_modify(entry, newprot)); + } address += PAGE_SIZE; pte++; } while (address && (address < end)); diff --git a/mm/mremap.c b/mm/mremap.c index ebc27b744..719ca1ec1 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -63,14 +63,14 @@ static inline int copy_one_pte(struct mm_struct *mm, pte_t * src, pte_t * dst) pte_t pte; spin_lock(&mm->page_table_lock); - pte = *src; - if (!pte_none(pte)) { - error++; - if (dst) { - pte_clear(src); - set_pte(dst, pte); - error--; + if (!pte_none(*src)) { + pte = ptep_get_and_clear(src); + if (!dst) { + /* No dest? We must put it back. */ + dst = src; + error++; } + set_pte(dst, pte); } spin_unlock(&mm->page_table_lock); return error; diff --git a/mm/numa.c b/mm/numa.c index 60f8350a0..47cb72ec6 100644 --- a/mm/numa.c +++ b/mm/numa.c @@ -78,7 +78,7 @@ void __init free_area_init_node(int nid, pg_data_t *pgdat, struct page *pmap, for (i = 0; i < MAX_NR_ZONES; i++) size += zones_size[i]; size = LONG_ALIGN((size + 7) >> 3); - pgdat->valid_addr_bitmap = (unsigned long *)alloc_bootmem_node(nid, size); + pgdat->valid_addr_bitmap = (unsigned long *)alloc_bootmem_node(pgdat, size); memset(pgdat->valid_addr_bitmap, 0, size); } diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 0a8aa7cf8..90c077439 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -261,7 +261,7 @@ static struct page * __alloc_pages_limit(zonelist_t *zonelist, water_mark = z->pages_high; } - if (z->free_pages + z->inactive_clean_pages >= water_mark) { + if (z->free_pages + z->inactive_clean_pages > water_mark) { struct page *page = NULL; /* If possible, reclaim a page directly. */ if (direct_reclaim && z->free_pages < z->pages_min + 8) @@ -287,7 +287,7 @@ struct page * __alloc_pages(zonelist_t *zonelist, unsigned long order) zone_t **zone; int direct_reclaim = 0; unsigned int gfp_mask = zonelist->gfp_mask; - struct page * page = NULL; + struct page * page; /* * Allocations put pressure on the VM subsystem. @@ -510,17 +510,17 @@ try_again: * happen when the OOM killer selects this task for * instant execution... */ - if (direct_reclaim) + if (direct_reclaim) { page = reclaim_page(z); - if (page) - return page; + if (page) + return page; + } /* XXX: is pages_min/4 a good amount to reserve for this? */ if (z->free_pages < z->pages_min / 4 && !(current->flags & PF_MEMALLOC)) continue; - if (!page) - page = rmqueue(z, order); + page = rmqueue(z, order); if (page) return page; } @@ -779,9 +779,6 @@ void __init free_area_init_core(int nid, pg_data_t *pgdat, struct page **gmap, unsigned long totalpages, offset, realtotalpages; unsigned int cumulative = 0; - pgdat->node_next = pgdat_list; - pgdat_list = pgdat; - totalpages = 0; for (i = 0; i < MAX_NR_ZONES; i++) { unsigned long size = zones_size[i]; @@ -806,7 +803,7 @@ void __init free_area_init_core(int nid, pg_data_t *pgdat, struct page **gmap, */ map_size = (totalpages + 1)*sizeof(struct page); if (lmem_map == (struct page *)0) { - lmem_map = (struct page *) alloc_bootmem_node(nid, map_size); + lmem_map = (struct page *) alloc_bootmem_node(pgdat, map_size); lmem_map = (struct page *)(PAGE_OFFSET + MAP_ALIGN((unsigned long)lmem_map - PAGE_OFFSET)); } @@ -898,7 +895,7 @@ void __init free_area_init_core(int nid, pg_data_t *pgdat, struct page **gmap, bitmap_size = (bitmap_size + 7) >> 3; bitmap_size = LONG_ALIGN(bitmap_size); zone->free_area[i].map = - (unsigned int *) alloc_bootmem_node(nid, bitmap_size); + (unsigned int *) alloc_bootmem_node(pgdat, bitmap_size); } } build_zonelists(pgdat); diff --git a/mm/swapfile.c b/mm/swapfile.c index 4cad5deab..688e2fcdd 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -223,10 +223,10 @@ static inline void unuse_pte(struct vm_area_struct * vma, unsigned long address, if (pte_page(pte) != page) return; /* We will be removing the swap cache in a moment, so... */ - set_pte(dir, pte_mkdirty(pte)); + ptep_mkdirty(dir); return; } - if (pte_val(pte) != entry.val) + if (pte_to_swp_entry(pte).val != entry.val) return; set_pte(dir, pte_mkdirty(mk_pte(page, vma->vm_page_prot))); swap_free(entry); diff --git a/mm/vmalloc.c b/mm/vmalloc.c index f94f88018..15261612e 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -34,8 +34,8 @@ static inline void free_area_pte(pmd_t * pmd, unsigned long address, unsigned lo if (end > PMD_SIZE) end = PMD_SIZE; do { - pte_t page = *pte; - pte_clear(pte); + pte_t page; + page = ptep_get_and_clear(pte); address += PAGE_SIZE; pte++; if (pte_none(page)) diff --git a/mm/vmscan.c b/mm/vmscan.c index 26fd18455..ccbe6de9e 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -55,8 +55,7 @@ static int try_to_swap_out(struct mm_struct * mm, struct vm_area_struct* vma, un onlist = PageActive(page); /* Don't look at this pte if it's been accessed recently. */ - if (pte_young(pte)) { - set_pte(page_table, pte_mkold(pte)); + if (ptep_test_and_clear_young(page_table)) { if (onlist) { /* * Transfer the "accessed" bit from the page @@ -99,6 +98,10 @@ static int try_to_swap_out(struct mm_struct * mm, struct vm_area_struct* vma, un if (PageSwapCache(page)) { entry.val = page->index; swap_duplicate(entry); + if (pte_dirty(pte)) + BUG(); + if (pte_write(pte)) + BUG(); set_pte(page_table, swp_entry_to_pte(entry)); drop_pte: UnlockPage(page); @@ -109,6 +112,13 @@ drop_pte: goto out_failed; } + /* From this point on, the odds are that we're going to + * nuke this pte, so read and clear the pte. This hook + * is needed on CPUs which update the accessed and dirty + * bits in hardware. + */ + pte = ptep_get_and_clear(page_table); + /* * Is it a clean page? Then it must be recoverable * by just paging it in again, and we can just drop @@ -124,7 +134,6 @@ drop_pte: */ if (!pte_dirty(pte)) { flush_cache_page(vma, address); - pte_clear(page_table); goto drop_pte; } @@ -134,7 +143,7 @@ drop_pte: * locks etc. */ if (!(gfp_mask & __GFP_IO)) - goto out_unlock; + goto out_unlock_restore; /* * Don't do any of the expensive stuff if @@ -143,7 +152,7 @@ drop_pte: if (page->zone->free_pages + page->zone->inactive_clean_pages + page->zone->inactive_dirty_pages > page->zone->pages_high + inactive_target) - goto out_unlock; + goto out_unlock_restore; /* * Ok, it's really dirty. That means that @@ -169,7 +178,7 @@ drop_pte: int error; struct file *file = vma->vm_file; if (file) get_file(file); - pte_clear(page_table); + mm->rss--; flush_tlb_page(vma, address); spin_unlock(&mm->page_table_lock); @@ -191,7 +200,7 @@ drop_pte: */ entry = get_swap_page(); if (!entry.val) - goto out_unlock; /* No swap space left */ + goto out_unlock_restore; /* No swap space left */ if (!(page = prepare_highmem_swapout(page))) goto out_swap_free; @@ -215,10 +224,12 @@ out_free_success: page_cache_release(page); return 1; out_swap_free: + set_pte(page_table, pte); swap_free(entry); out_failed: return 0; -out_unlock: +out_unlock_restore: + set_pte(page_table, pte); UnlockPage(page); return 0; } diff --git a/net/802/llc_macinit.c b/net/802/llc_macinit.c index 792bfd5e8..987d8a5c4 100644 --- a/net/802/llc_macinit.c +++ b/net/802/llc_macinit.c @@ -204,24 +204,11 @@ EXPORT_SYMBOL(llc_cancel_timers); #define ALL_TYPES_8022 0 -void __init llc_init(struct net_proto *proto) +static int __init llc_init(void) { printk(KERN_NOTICE "IEEE 802.2 LLC for Linux 2.1 (c) 1996 Tim Alpaerts\n"); - return; -} - -#ifdef MODULE - - -int init_module(void) -{ - llc_init(NULL); return 0; } -void cleanup_module(void) -{ - -} -#endif +module_init(llc_init); diff --git a/net/802/p8022.c b/net/802/p8022.c index 9be3100dd..41a755e88 100644 --- a/net/802/p8022.c +++ b/net/802/p8022.c @@ -90,12 +90,15 @@ static struct packet_type p8022_packet_type = EXPORT_SYMBOL(register_8022_client); EXPORT_SYMBOL(unregister_8022_client); -void __init p8022_proto_init(struct net_proto *pro) +static int __init p8022_init(void) { p8022_packet_type.type=htons(ETH_P_802_2); dev_add_pack(&p8022_packet_type); + return 0; } +module_init(p8022_init); + struct datalink_proto *register_8022_client(unsigned char type, int (*rcvfunc)(struct sk_buff *, struct net_device *, struct packet_type *)) { struct datalink_proto *proto; diff --git a/net/802/psnap.c b/net/802/psnap.c index 3c493d7d9..907ac1b54 100644 --- a/net/802/psnap.c +++ b/net/802/psnap.c @@ -89,12 +89,14 @@ static void snap_datalink_header(struct datalink_proto *dl, struct sk_buff *skb, EXPORT_SYMBOL(register_snap_client); EXPORT_SYMBOL(unregister_snap_client); -void __init snap_proto_init(struct net_proto *pro) +static int __init snap_init(void) { snap_dl=register_8022_client(0xAA, snap_rcv); if(snap_dl==NULL) printk("SNAP - unable to register with 802.2\n"); + return 0; } +module_init(snap_init); /* * Register SNAP clients. We don't yet use this for IP. diff --git a/net/802/tr.c b/net/802/tr.c index 097929257..73c938486 100644 --- a/net/802/tr.c +++ b/net/802/tr.c @@ -540,7 +540,7 @@ static int rif_get_info(char *buffer,char **start, off_t offset, int length) * too much for this. */ -void __init rif_init(struct net_proto *unused) +static int __init rif_init(void) { rif_timer.expires = RIF_TIMEOUT; rif_timer.data = 0L; @@ -549,4 +549,7 @@ void __init rif_init(struct net_proto *unused) add_timer(&rif_timer); proc_net_create("tr_rif",0,rif_get_info); + return 0; } + +module_init(rif_init); diff --git a/net/Makefile b/net/Makefile index 44f47fabc..fcccc4e6d 100644 --- a/net/Makefile +++ b/net/Makefile @@ -46,7 +46,7 @@ subdir-$(CONFIG_DECNET) += decnet subdir-$(CONFIG_ECONET) += econet -obj-y := socket.o protocols.o $(join $(subdir-y), $(patsubst %,/%.o,$(notdir $(subdir-y)))) +obj-y := socket.o $(join $(subdir-y), $(patsubst %,/%.o,$(notdir $(subdir-y)))) ifeq ($(CONFIG_NET),y) obj-$(CONFIG_MODULES) += netsyms.o obj-$(CONFIG_SYSCTL) += sysctl_net.o diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 260a5e530..e7784dabd 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c @@ -2120,7 +2120,7 @@ EXPORT_SYMBOL(atalk_find_dev_addr); /* Called by proto.c on kernel start up */ -void __init atalk_proto_init(struct net_proto *pro) +static int __init atalk_init(void) { (void) sock_register(&atalk_family_ops); if((ddp_dl = register_snap_client(ddp_snap_id, atalk_rcv)) == NULL) @@ -2148,16 +2148,11 @@ void __init atalk_proto_init(struct net_proto *pro) #endif /* CONFIG_SYSCTL */ printk(KERN_INFO "NET4: AppleTalk 0.18 for Linux NET4.0\n"); + return 0; } +module_init(atalk_init); #ifdef MODULE - -int init_module(void) -{ - atalk_proto_init(NULL); - return (0); -} - /* * Note on MOD_{INC,DEC}_USE_COUNT: * @@ -2171,7 +2166,7 @@ int init_module(void) * sockets be closed from user space. */ -void cleanup_module(void) +static void __exit atalk_exit(void) { #ifdef CONFIG_SYSCTL atalk_unregister_sysctl(); @@ -2195,6 +2190,7 @@ void cleanup_module(void) return; } - +module_exit(atalk_exit); #endif /* MODULE */ + #endif /* CONFIG_ATALK || CONFIG_ATALK_MODULE */ diff --git a/net/atm/pvc.c b/net/atm/pvc.c index fc71c2435..ff28ed551 100644 --- a/net/atm/pvc.c +++ b/net/atm/pvc.c @@ -123,7 +123,7 @@ static struct net_proto_family pvc_family_ops = { */ -void __init atmpvc_proto_init(struct net_proto *pro) +static int __init atmpvc_init(void) { int error; @@ -139,4 +139,7 @@ void __init atmpvc_proto_init(struct net_proto *pro) error = atm_proc_init(); if (error) printk("atm_proc_init fails with %d\n",error); #endif + return 0; } + +module_init(atmpvc_init); diff --git a/net/atm/svc.c b/net/atm/svc.c index bffe7aac5..7984cb22a 100644 --- a/net/atm/svc.c +++ b/net/atm/svc.c @@ -442,10 +442,13 @@ static struct net_proto_family svc_family_ops = { * Initialize the ATM SVC protocol family */ -void __init atmsvc_proto_init(struct net_proto *pro) +static int __init atmsvc_init(void) { if (sock_register(&svc_family_ops) < 0) { printk(KERN_ERR "ATMSVC: can't register"); - return; + return -1; } + return 0; } + +module_init(atmsvc_init); diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index 02874c103..8e34e42e2 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -101,6 +101,7 @@ * ax25_connect() and ax25_sendmsg() * Joerg(DL1BKE) Added support for SO_BINDTODEVICE * Arnaldo C. Melo s/suser/capable(CAP_NET_ADMIN)/, some more cleanups + * Michal Ostrowski Module initialization cleanup. */ #include @@ -137,6 +138,8 @@ #include #include + + ax25_cb *volatile ax25_list = NULL; static struct proto_ops ax25_proto_ops; @@ -1844,7 +1847,7 @@ EXPORT_SYMBOL(asc2ax); EXPORT_SYMBOL(null_ax25_address); EXPORT_SYMBOL(ax25_display_timer); -void __init ax25_proto_init(struct net_proto *pro) +static int __init ax25_init(void) { sock_register(&ax25_family_ops); ax25_packet_type.type = htons(ETH_P_AX25); @@ -1861,20 +1864,16 @@ void __init ax25_proto_init(struct net_proto *pro) #endif printk(KERN_INFO "NET4: G4KLX/GW4PTS AX.25 for Linux. Version 0.37 for Linux NET4.0\n"); + return 0; } +module_init(ax25_init); + #ifdef MODULE MODULE_AUTHOR("Jonathan Naylor G4KLX "); MODULE_DESCRIPTION("The amateur radio AX.25 link layer protocol"); -int init_module(void) -{ - ax25_proto_init(NULL); - - return 0; -} - -void cleanup_module(void) +static void __exit ax25_exit(void) { #ifdef CONFIG_PROC_FS proc_net_remove("ax25_route"); @@ -1895,6 +1894,7 @@ void cleanup_module(void) sock_unregister(PF_AX25); } -#endif +module_exit(ax25_exit); +#endif /* MODULE */ #endif diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c index cf590db04..6b24a1416 100644 --- a/net/core/dev_mcast.c +++ b/net/core/dev_mcast.c @@ -13,6 +13,7 @@ * rather than any time but... * Alan Cox : IFF_ALLMULTI support. * Alan Cox : New format set_multicast_list() calls. + * Gleb Natapov : Remove dev_mc_lock. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -59,16 +60,14 @@ * Device mc lists are changed by bh at least if IPv6 is enabled, * so that it must be bh protected. * - * We protect all mc lists with global rw lock - * and block accesses to device mc filters with dev->xmit_lock. + * We block accesses to device mc filters with dev->xmit_lock. */ -static rwlock_t dev_mc_lock = RW_LOCK_UNLOCKED; /* * Update the multicast list into the physical NIC controller. */ -void dev_mc_upload(struct net_device *dev) +static void __dev_mc_upload(struct net_device *dev) { /* Don't do anything till we up the interface * [dev_open will call this function so the list will @@ -87,13 +86,14 @@ void dev_mc_upload(struct net_device *dev) !netif_device_present(dev)) return; - read_lock_bh(&dev_mc_lock); - spin_lock(&dev->xmit_lock); - dev->xmit_lock_owner = smp_processor_id(); dev->set_multicast_list(dev); - dev->xmit_lock_owner = -1; - spin_unlock(&dev->xmit_lock); - read_unlock_bh(&dev_mc_lock); +} + +void dev_mc_upload(struct net_device *dev) +{ + spin_lock_bh(&dev->xmit_lock); + __dev_mc_upload(dev); + spin_unlock_bh(&dev->xmit_lock); } /* @@ -105,7 +105,8 @@ int dev_mc_delete(struct net_device *dev, void *addr, int alen, int glbl) int err = 0; struct dev_mc_list *dmi, **dmip; - write_lock_bh(&dev_mc_lock); + spin_lock_bh(&dev->xmit_lock); + for (dmip = &dev->mc_list; (dmi = *dmip) != NULL; dmip = &dmi->next) { /* * Find the entry we want to delete. The device could @@ -127,7 +128,6 @@ int dev_mc_delete(struct net_device *dev, void *addr, int alen, int glbl) */ *dmip = dmi->next; dev->mc_count--; - write_unlock_bh(&dev_mc_lock); kfree(dmi); @@ -135,13 +135,15 @@ int dev_mc_delete(struct net_device *dev, void *addr, int alen, int glbl) * We have altered the list, so the card * loaded filter is now wrong. Fix it */ - dev_mc_upload(dev); + __dev_mc_upload(dev); + + spin_unlock_bh(&dev->xmit_lock); return 0; } } err = -ENOENT; done: - write_unlock_bh(&dev_mc_lock); + spin_unlock_bh(&dev->xmit_lock); return err; } @@ -156,7 +158,7 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl) dmi1 = (struct dev_mc_list *)kmalloc(sizeof(*dmi), GFP_ATOMIC); - write_lock_bh(&dev_mc_lock); + spin_lock_bh(&dev->xmit_lock); for (dmi = dev->mc_list; dmi != NULL; dmi = dmi->next) { if (memcmp(dmi->dmi_addr, addr, dmi->dmi_addrlen) == 0 && dmi->dmi_addrlen == alen) { @@ -172,7 +174,7 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl) } if ((dmi = dmi1) == NULL) { - write_unlock_bh(&dev_mc_lock); + spin_unlock_bh(&dev->xmit_lock); return -ENOMEM; } memcpy(dmi->dmi_addr, addr, alen); @@ -182,12 +184,14 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl) dmi->dmi_gusers = glbl ? 1 : 0; dev->mc_list = dmi; dev->mc_count++; - write_unlock_bh(&dev_mc_lock); - dev_mc_upload(dev); + + __dev_mc_upload(dev); + + spin_unlock_bh(&dev->xmit_lock); return 0; done: - write_unlock_bh(&dev_mc_lock); + spin_unlock_bh(&dev->xmit_lock); if (dmi1) kfree(dmi1); return err; @@ -199,7 +203,8 @@ done: void dev_mc_discard(struct net_device *dev) { - write_lock_bh(&dev_mc_lock); + spin_lock_bh(&dev->xmit_lock); + while (dev->mc_list != NULL) { struct dev_mc_list *tmp = dev->mc_list; dev->mc_list = tmp->next; @@ -208,7 +213,8 @@ void dev_mc_discard(struct net_device *dev) kfree(tmp); } dev->mc_count = 0; - write_unlock_bh(&dev_mc_lock); + + spin_unlock_bh(&dev->xmit_lock); } #ifdef CONFIG_PROC_FS @@ -222,7 +228,7 @@ static int dev_mc_read_proc(char *buffer, char **start, off_t offset, read_lock(&dev_base_lock); for (dev = dev_base; dev; dev = dev->next) { - read_lock_bh(&dev_mc_lock); + spin_lock_bh(&dev->xmit_lock); for (m = dev->mc_list; m; m = m->next) { int i; @@ -240,11 +246,11 @@ static int dev_mc_read_proc(char *buffer, char **start, off_t offset, begin = pos; } if (pos > offset + length) { - read_unlock_bh(&dev_mc_lock); + spin_unlock_bh(&dev->xmit_lock); goto done; } } - read_unlock_bh(&dev_mc_lock); + spin_unlock_bh(&dev->xmit_lock); } *eof = 1; diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c index 348c30fce..8de443979 100644 --- a/net/decnet/af_decnet.c +++ b/net/decnet/af_decnet.c @@ -2053,8 +2053,36 @@ void dn_register_sysctl(void); void dn_unregister_sysctl(void); #endif -void __init decnet_proto_init(struct net_proto *pro) + +#ifdef MODULE +EXPORT_NO_SYMBOLS; +MODULE_DESCRIPTION("The Linux DECnet Network Protocol"); +MODULE_AUTHOR("Linux DECnet Project Team"); + +static int addr[2] = {0, 0}; + +MODULE_PARM(addr, "2i"); +MODULE_PARM_DESC(addr, "The DECnet address of this machine: area,node"); +#endif + + +static int __init decnet_init(void) { +#ifdef MODULE + if (addr[0] > 63 || addr[0] < 0) { + printk(KERN_ERR "DECnet: Area must be between 0 and 63"); + return 1; + } + + if (addr[1] > 1023 || addr[1] < 0) { + printk(KERN_ERR "DECnet: Node must be between 0 and 1023"); + return 1; + } + + decnet_address = dn_htons((addr[0] << 10) | addr[1]); + dn_dn2eth(decnet_ether_address, dn_ntohs(decnet_address)); +#endif + printk(KERN_INFO "NET4: DECnet for Linux: V.2.3.49s (C) 1995-2000 Linux DECnet Project Team\n"); sock_register(&dn_family_ops); @@ -2074,6 +2102,7 @@ void __init decnet_proto_init(struct net_proto *pro) #ifdef CONFIG_SYSCTL dn_register_sysctl(); #endif /* CONFIG_SYSCTL */ + return 0; } @@ -2093,37 +2122,7 @@ static int __init decnet_setup(char *str) __setup("decnet=", decnet_setup); #endif -#ifdef MODULE -EXPORT_NO_SYMBOLS; -MODULE_DESCRIPTION("The Linux DECnet Network Protocol"); -MODULE_AUTHOR("Linux DECnet Project Team"); - -static int addr[2] = {0, 0}; - -MODULE_PARM(addr, "2i"); -MODULE_PARM_DESC(addr, "The DECnet address of this machine: area,node"); - -int __init init_module(void) -{ - if (addr[0] > 63 || addr[0] < 0) { - printk(KERN_ERR "DECnet: Area must be between 0 and 63"); - return 1; - } - - if (addr[1] > 1023 || addr[1] < 0) { - printk(KERN_ERR "DECnet: Node must be between 0 and 1023"); - return 1; - } - - decnet_address = dn_htons((addr[0] << 10) | addr[1]); - dn_dn2eth(decnet_ether_address, dn_ntohs(decnet_address)); - - decnet_proto_init(NULL); - - return 0; -} - -void __exit cleanup_module(void) +static void __exit decnet_exit(void) { #ifdef CONFIG_SYSCTL dn_unregister_sysctl(); @@ -2145,4 +2144,5 @@ void __exit cleanup_module(void) sock_unregister(AF_DECnet); } -#endif +module_init(decnet_init); +module_exit(decnet_exit); diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c index 7a2a815ce..5d44e1f12 100644 --- a/net/econet/af_econet.c +++ b/net/econet/af_econet.c @@ -1143,7 +1143,5 @@ int __init econet_proto_init(void) return 0; } -#ifdef MODULE module_init(econet_proto_init); module_exit(econet_proto_exit); -#endif diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index f53d2e526..544800d7e 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -5,7 +5,7 @@ * * PF_INET protocol family socket handler. * - * Version: $Id: af_inet.c,v 1.115 2000/10/06 10:37:47 davem Exp $ + * Version: $Id: af_inet.c,v 1.116 2000/10/15 01:34:45 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, @@ -956,7 +956,7 @@ extern void tcp_v4_init(struct net_proto_family *); * Called by socket.c on kernel startup. */ -void __init inet_proto_init(struct net_proto *pro) +static int __init inet_init(void) { struct sk_buff *dummy_skb; struct inet_protocol *p; @@ -966,7 +966,7 @@ void __init inet_proto_init(struct net_proto *pro) if (sizeof(struct inet_skb_parm) > sizeof(dummy_skb->cb)) { printk(KERN_CRIT "inet_proto_init: panic\n"); - return; + return -EINVAL; } /* @@ -1040,4 +1040,6 @@ void __init inet_proto_init(struct net_proto *pro) proc_net_create ("tcp", 0, tcp_get_info); proc_net_create ("udp", 0, udp_get_info); #endif /* CONFIG_PROC_FS */ + return 0; } +module_init(inet_init); diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 556634a2f..082848dda 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -5,7 +5,7 @@ * * Implementation of the Transmission Control Protocol(TCP). * - * Version: $Id: tcp_ipv4.c,v 1.216 2000/10/10 03:58:56 davem Exp $ + * Version: $Id: tcp_ipv4.c,v 1.217 2000/10/15 13:15:19 davem Exp $ * * IPv4 specific functions * @@ -75,7 +75,15 @@ static struct socket *tcp_socket=&tcp_inode.u.socket_i; void tcp_v4_send_check(struct sock *sk, struct tcphdr *th, int len, struct sk_buff *skb); +/* + * ALL members must be initialised to prevent gcc-2.7.2.3 miscompilation + */ struct tcp_hashinfo __cacheline_aligned tcp_hashinfo = { + __tcp_ehash: NULL, + __tcp_bhash: NULL, + __tcp_bhash_size: 0, + __tcp_ehash_size: 0, + __tcp_listening_hash: { NULL, }, __tcp_lhash_lock: RW_LOCK_UNLOCKED, __tcp_lhash_users: ATOMIC_INIT(0), __tcp_lhash_wait: diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 869cac689..2528e7c7b 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c @@ -7,7 +7,7 @@ * * Adapted from linux/net/ipv4/af_inet.c * - * $Id: af_inet6.c,v 1.58 2000/09/18 05:59:48 davem Exp $ + * $Id: af_inet6.c,v 1.59 2000/10/15 01:34:45 davem Exp $ * * Fixes: * Hideaki YOSHIFUJI : sin6_scope_id support @@ -502,11 +502,7 @@ extern void ipv6_sysctl_register(void); extern void ipv6_sysctl_unregister(void); #endif -#ifdef MODULE -int init_module(void) -#else -void __init inet6_proto_init(struct net_proto *pro) -#endif +static int __init inet6_init(void) { struct sk_buff *dummy_skb; int err; @@ -523,11 +519,7 @@ void __init inet6_proto_init(struct net_proto *pro) if (sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb)) { printk(KERN_CRIT "inet6_proto_init: size fault\n"); -#ifdef MODULE return -EINVAL; -#else - return; -#endif } /* @@ -577,11 +569,7 @@ void __init inet6_proto_init(struct net_proto *pro) /* Now the userspace is allowed to create INET6 sockets. */ (void) sock_register(&inet6_family_ops); -#ifdef MODULE return 0; -#else - return; -#endif #ifdef CONFIG_PROC_FS proc_snmp6_fail: @@ -603,15 +591,13 @@ icmp_fail: #if defined(MODULE) && defined(CONFIG_SYSCTL) ipv6_sysctl_unregister(); #endif -#ifdef MODULE return err; -#else - return; -#endif } +module_init(inet6_init); + #ifdef MODULE -void cleanup_module(void) +static void inet6_exit(void) { /* First of all disallow new sockets creation. */ sock_unregister(PF_INET6); @@ -636,4 +622,5 @@ void cleanup_module(void) ipv6_sysctl_unregister(); #endif } -#endif /* MODULE */ +module_exit(inet6_exit); +#endif /* MODULE */ diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index bbb2b2630..2fc3ea46c 100644 --- a/net/ipx/af_ipx.c +++ b/net/ipx/af_ipx.c @@ -2387,9 +2387,8 @@ static unsigned char ipx_snap_id[5] = { 0x0, 0x0, 0x0, 0x81, 0x37 }; -/* Called by protocols.c on kernel start up */ -void ipx_proto_init(struct net_proto *pro) +static int __init ipx_init(void) { (void) sock_register(&ipx_family_ops); @@ -2415,7 +2414,9 @@ void ipx_proto_init(struct net_proto *pro) printk(KERN_INFO "NET4: Linux IPX 0.38 for NET4.0\n"); printk(KERN_INFO "IPX Portions Copyright (c) 1995 Caldera, Inc.\n"); + return 0; } +module_init(ipx_init); /* Higher layers need this info to prep tx pkts */ int ipx_if_offset(unsigned long ipx_net_number) @@ -2434,7 +2435,6 @@ EXPORT_SYMBOL(ipx_remove_socket); EXPORT_SYMBOL(ipx_register_spx); EXPORT_SYMBOL(ipx_unregister_spx); -#ifdef MODULE /* Note on MOD_{INC,DEC}_USE_COUNT: * * Use counts are incremented/decremented when @@ -2448,6 +2448,7 @@ EXPORT_SYMBOL(ipx_unregister_spx); * sockets be closed from user space. */ +#ifdef MODULE static void ipx_proto_finito(void) { ipx_interface *ifc; @@ -2486,18 +2487,7 @@ static void ipx_proto_finito(void) return; } - -int init_module(void) -{ - ipx_proto_init(NULL); - return (0); -} - -void cleanup_module(void) -{ - ipx_proto_finito(); - return; -} - +module_exit(ipx_proto_finito); #endif /* MODULE */ + #endif /* CONFIG_IPX || CONFIG_IPX_MODULE */ diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 2ba86afcc..d6e8d81e5 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c @@ -43,6 +43,7 @@ ********************************************************************/ #include +#include #include #include #include @@ -2155,17 +2156,19 @@ static struct notifier_block irda_dev_notifier = { * Initialize IrDA protocol layer * */ -void __init irda_proto_init(struct net_proto *pro) +static int __init irda_proto_init(void) { - sock_register(&irda_family_ops); - - irda_packet_type.type = htons(ETH_P_IRDA); + sock_register(&irda_family_ops); + + irda_packet_type.type = htons(ETH_P_IRDA); dev_add_pack(&irda_packet_type); - - register_netdevice_notifier(&irda_dev_notifier); - - irda_init(); + + register_netdevice_notifier(&irda_dev_notifier); + + irda_init(); + return 0; } +module_init(irda_proto_init); /* * Function irda_proto_cleanup (void) @@ -2186,4 +2189,5 @@ void irda_proto_cleanup(void) return; } +module_exit(irda_proto_cleanup); #endif /* MODULE */ diff --git a/net/irda/irmod.c b/net/irda/irmod.c index fde6788c3..39257f87a 100644 --- a/net/irda/irmod.c +++ b/net/irda/irmod.c @@ -545,28 +545,6 @@ void irda_proc_modcount(struct inode *inode, int fill) MODULE_AUTHOR("Dag Brattli "); MODULE_DESCRIPTION("The Linux IrDA Protocol Subsystem"); MODULE_PARM(irda_debug, "1l"); - -/* - * Function init_module (void) - * - * Initialize the irda module - * - */ -int init_module(void) -{ - irda_proto_init(NULL); - - return 0; -} - -/* - * Function cleanup_module (void) - * - * Cleanup the irda module - * - */ -void cleanup_module(void) -{ - irda_proto_cleanup(); -} +module_exit(irda_proto_cleanup); #endif /* MODULE */ + diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c index 587304bca..bdc84d72f 100644 --- a/net/lapb/lapb_iface.c +++ b/net/lapb/lapb_iface.c @@ -401,25 +401,18 @@ EXPORT_SYMBOL(lapb_disconnect_request); EXPORT_SYMBOL(lapb_data_request); EXPORT_SYMBOL(lapb_data_received); -void __init lapb_proto_init(struct net_proto *pro) +static int __init lapb_init(void) { printk(KERN_INFO "NET4: LAPB for Linux. Version 0.01 for NET4.0\n"); + return 0; } #ifdef MODULE MODULE_AUTHOR("Jonathan Naylor "); MODULE_DESCRIPTION("The X.25 Link Access Procedure B link layer protocol"); +#endif -int init_module(void) -{ - lapb_proto_init(NULL); - return 0; -} - -void cleanup_module(void) -{ -} -#endif +module_init(lapb_init); #endif diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index be011a234..3927d9c3a 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -968,16 +969,19 @@ struct net_proto_family netlink_family_ops = { netlink_create }; -void netlink_proto_init(struct net_proto *pro) +static int __init netlink_proto_init(void) { struct sk_buff *dummy_skb; if (sizeof(struct netlink_skb_parms) > sizeof(dummy_skb->cb)) { - printk(KERN_CRIT "netlink_proto_init: panic\n"); - return; + printk(KERN_CRIT "netlink_init: panic\n"); + return -1; } sock_register(&netlink_family_ops); #ifdef CONFIG_PROC_FS create_proc_read_entry("net/netlink", 0, 0, netlink_read_proc, NULL); #endif + return 0; } + +module_init(netlink_proto_init); diff --git a/net/netlink/netlink_dev.c b/net/netlink/netlink_dev.c index bc1b378fc..da7598a79 100644 --- a/net/netlink/netlink_dev.c +++ b/net/netlink/netlink_dev.c @@ -31,7 +31,7 @@ #include #include -static unsigned open_map = 0; +static unsigned open_map; static struct socket *netlink_user[MAX_LINKS]; /* @@ -178,7 +178,7 @@ static struct file_operations netlink_fops = { release: netlink_release, }; -static devfs_handle_t devfs_handle = NULL; +static devfs_handle_t devfs_handle; static void __init make_devfs_entries (const char *name, int minor) { diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 27d95703b..a0c139b3a 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c @@ -1261,13 +1261,13 @@ static struct notifier_block nr_dev_notifier = { static struct net_device *dev_nr; -void __init nr_proto_init(struct net_proto *pro) +static int __init nr_proto_init(void) { int i; if ((dev_nr = kmalloc(nr_ndevs * sizeof(struct net_device), GFP_KERNEL)) == NULL) { printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device structure\n"); - return; + return -1; } memset(dev_nr, 0x00, nr_ndevs * sizeof(struct net_device)); @@ -1296,8 +1296,12 @@ void __init nr_proto_init(struct net_proto *pro) proc_net_create("nr_neigh", 0, nr_neigh_get_info); proc_net_create("nr_nodes", 0, nr_nodes_get_info); #endif + return 0; } +module_init(nr_proto_init); + + #ifdef MODULE EXPORT_NO_SYMBOLS; @@ -1307,14 +1311,7 @@ MODULE_PARM_DESC(nr_ndevs, "number of NET/ROM devices"); MODULE_AUTHOR("Jonathan Naylor G4KLX "); MODULE_DESCRIPTION("The amateur radio NET/ROM network and transport layer protocol"); -int init_module(void) -{ - nr_proto_init(NULL); - - return 0; -} - -void cleanup_module(void) +static void nr_exit(void) { int i; @@ -1348,7 +1345,9 @@ void cleanup_module(void) kfree(dev_nr); } +module_exit(nr_exit); +#endif /* MODULE */ + -#endif #endif diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 4883d6ec2..906bcffbe 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -5,7 +5,7 @@ * * PACKET - implements raw packet sockets. * - * Version: $Id: af_packet.c,v 1.43 2000/10/06 10:37:47 davem Exp $ + * Version: $Id: af_packet.c,v 1.44 2000/10/15 01:34:47 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, @@ -33,6 +33,7 @@ * Alan Cox : Protocol setting support * Alexey Kuznetsov : Untied from IPv4 stack. * Cyrus Durgin : Fixed kerneld for kmod. + * Michal Ostrowski : Module initialization cleanup. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -1872,8 +1873,8 @@ done: #endif -#ifdef MODULE -void cleanup_module(void) + +static void __exit packet_exit(void) { #ifdef CONFIG_PROC_FS remove_proc_entry("net/packet", 0); @@ -1884,17 +1885,16 @@ void cleanup_module(void) } -int init_module(void) -#else -void __init packet_proto_init(struct net_proto *pro) -#endif +static int __init packet_init(void) { sock_register(&packet_family_ops); register_netdevice_notifier(&packet_netdev_notifier); #ifdef CONFIG_PROC_FS create_proc_read_entry("net/packet", 0, 0, packet_read_proc, NULL); #endif -#ifdef MODULE return 0; -#endif } + + +module_init(packet_init); +module_exit(packet_exit); diff --git a/net/protocols.c b/net/protocols.c deleted file mode 100644 index 2188df912..000000000 --- a/net/protocols.c +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Protocol initializer table. Here separately for convenience - * - */ - - -#include -#include -#include -#include -#include - -#ifdef CONFIG_UNIX -#include -#include -#endif - -#ifdef CONFIG_INET -#include -#ifdef CONFIG_IPV6 -extern void inet6_proto_init(struct net_proto *pro); -#endif -#endif /* INET */ - -#ifdef CONFIG_ECONET -extern void econet_proto_init(struct net_proto *pro); -#endif - -#ifdef CONFIG_NETLINK -extern void netlink_proto_init(struct net_proto *pro); -#endif - -#ifdef CONFIG_PACKET -extern void packet_proto_init(struct net_proto *pro); -#endif - -#if defined(CONFIG_IPX) || defined(CONFIG_IPX_MODULE) -#define NEED_802 -#include -#endif - -#ifdef CONFIG_X25 -#include -#endif - -#ifdef CONFIG_LAPB -#include -#endif - -#ifdef CONFIG_AX25 -#include -#ifdef CONFIG_NETROM -#include -#endif -#ifdef CONFIG_ROSE -#include -#endif -#endif - -#ifdef CONFIG_IRDA -#include -#endif - -#if defined(CONFIG_DECNET) -#include -#endif - -#if defined(CONFIG_ATALK) || defined(CONFIG_ATALK_MODULE) -#define NEED_802 -#include -#endif - -#if defined(CONFIG_NETBEUI) -#define NEED_LLC -#include -#endif - -#if defined(CONFIG_LLC) -#define NEED_LLC -#endif - -#include - -#ifdef CONFIG_TR -#include -#include -extern void rif_init(struct net_proto *); -#endif - -#ifdef CONFIG_ATM -#include -#endif - -#ifdef NEED_LLC -#define NEED_802 -#include -#endif - -#ifdef NEED_802 -#include -#endif - - -/* - * Protocol Table - */ - -struct net_proto protocols[] = { -#ifdef CONFIG_NETLINK - { "NETLINK", netlink_proto_init }, -#endif - -#ifdef CONFIG_PACKET - { "PACKET", packet_proto_init }, -#endif - -#ifdef CONFIG_UNIX - { "UNIX", unix_proto_init }, /* Unix domain socket family */ -#endif - -#ifdef NEED_802 - { "802.2", p8022_proto_init }, /* 802.2 demultiplexor */ - { "SNAP", snap_proto_init }, /* SNAP demultiplexor */ -#endif - -#ifdef CONFIG_TR - { "RIF", rif_init }, /* RIF for Token ring */ -#endif - -#ifdef CONFIG_ATM - { "ATMPVC", atmpvc_proto_init }, /* ATM PVCs */ - { "ATMSVC", atmsvc_proto_init }, /* ATM SVCs */ -#endif - -#ifdef NEED_LLC - { "802.2LLC", llc_init }, /* 802.2 LLC */ -#endif - -#ifdef CONFIG_AX25 - { "AX.25", ax25_proto_init }, /* Amateur Radio AX.25 */ -#ifdef CONFIG_NETROM - { "NET/ROM", nr_proto_init }, /* Amateur Radio NET/ROM */ -#endif -#ifdef CONFIG_ROSE - { "Rose", rose_proto_init }, /* Amateur Radio X.25 PLP */ -#endif -#endif -#ifdef CONFIG_DECNET - { "DECnet", decnet_proto_init }, /* DECnet */ -#endif -#ifdef CONFIG_INET - { "INET", inet_proto_init }, /* TCP/IP */ -#ifdef CONFIG_IPV6 - { "INET6", inet6_proto_init}, /* IPv6 */ -#endif -#endif - -#ifdef CONFIG_IPX - { "IPX", ipx_proto_init }, /* IPX */ -#endif - -#ifdef CONFIG_ATALK - { "DDP", atalk_proto_init }, /* Netatalk Appletalk driver */ -#endif - -#ifdef CONFIG_LAPB - { "LAPB", lapb_proto_init }, /* LAPB protocols */ -#endif - -#ifdef CONFIG_X25 - { "X.25", x25_proto_init }, /* CCITT X.25 Packet Layer */ -#endif - -#ifdef CONFIG_ECONET - { "Econet", econet_proto_init }, /* Acorn Econet */ -#endif - -#ifdef CONFIG_IRDA - { "IrDA", irda_proto_init }, /* IrDA protocols */ -#endif - { NULL, NULL } /* End marker */ -}; diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index f61d9cd34..f639e578a 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c @@ -27,6 +27,7 @@ #include #if defined(CONFIG_ROSE) || defined(CONFIG_ROSE_MODULE) #include +#include #include #include #include @@ -56,7 +57,6 @@ #include #include #include -#include int rose_ndevs = 10; @@ -1427,7 +1427,7 @@ static struct notifier_block rose_dev_notifier = { static struct net_device *dev_rose; -void __init rose_proto_init(struct net_proto *pro) +static int __init rose_proto_init(void) { int i; @@ -1435,7 +1435,7 @@ void __init rose_proto_init(struct net_proto *pro) if ((dev_rose = kmalloc(rose_ndevs * sizeof(struct net_device), GFP_KERNEL)) == NULL) { printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate device structure\n"); - return; + return -1; } memset(dev_rose, 0x00, rose_ndevs * sizeof(struct net_device)); @@ -1466,7 +1466,9 @@ void __init rose_proto_init(struct net_proto *pro) proc_net_create("rose_nodes", 0, rose_nodes_get_info); proc_net_create("rose_routes", 0, rose_routes_get_info); #endif + return 0; } +module_init(rose_proto_init); #ifdef MODULE EXPORT_NO_SYMBOLS; @@ -1477,14 +1479,7 @@ MODULE_PARM_DESC(rose_ndevs, "number of ROSE devices"); MODULE_AUTHOR("Jonathan Naylor G4KLX "); MODULE_DESCRIPTION("The amateur radio ROSE network layer protocol"); -int init_module(void) -{ - rose_proto_init(NULL); - - return 0; -} - -void cleanup_module(void) +static void __exit rose_exit(void) { int i; @@ -1522,7 +1517,8 @@ void cleanup_module(void) kfree(dev_rose); } +module_exit(rose_exit); +#endif /* MODULE */ -#endif #endif diff --git a/net/socket.c b/net/socket.c index 5957514aa..4b6ad8ad5 100644 --- a/net/socket.c +++ b/net/socket.c @@ -1638,20 +1638,6 @@ int sock_unregister(int family) return 0; } -void __init proto_init(void) -{ - extern struct net_proto protocols[]; /* Network protocols */ - struct net_proto *pro; - - /* Kick all configured protocols. */ - pro = protocols; - while (pro->name != NULL) - { - (*pro->init_func)(pro); - pro++; - } - /* We're all done... */ -} extern void sk_init(void); @@ -1712,10 +1698,13 @@ void __init sock_init(void) register_filesystem(&sock_fs_type); sock_mnt = kern_mount(&sock_fs_type); - proto_init(); + /* The real protocol initialization is performed when + * do_initcalls is run. + */ + /* - * The netlink device handler may be needed early. + * The netlink device handler may be needed early. */ #ifdef CONFIG_RTNETLINK diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 407f8f6b6..62e8b1b85 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -8,7 +8,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * - * Version: $Id: af_unix.c,v 1.105 2000/08/16 10:58:22 davem Exp $ + * Version: $Id: af_unix.c,v 1.106 2000/10/15 01:34:48 davem Exp $ * * Fixes: * Linus Torvalds : Assorted bug cures. @@ -46,6 +46,7 @@ * Artur Skawina : Hash function optimizations * Alexey Kuznetsov : Full scale SMP. Lot of bugs are introduced 8) * Malcolm Beattie : Set peercred for socketpair + * Michal Ostrowski : Module initialization cleanup. * * * Known differences from reference BSD that was tested: @@ -1845,16 +1846,12 @@ struct net_proto_family unix_family_ops = { unix_create }; -#ifdef MODULE #ifdef CONFIG_SYSCTL extern void unix_sysctl_register(void); extern void unix_sysctl_unregister(void); #endif -int init_module(void) -#else -void __init unix_proto_init(struct net_proto *pro) -#endif +static int __init af_unix_init(void) { struct sk_buff *dummy_skb; @@ -1862,28 +1859,21 @@ void __init unix_proto_init(struct net_proto *pro) if (sizeof(struct unix_skb_parms) > sizeof(dummy_skb->cb)) { printk(KERN_CRIT "unix_proto_init: panic\n"); -#ifdef MODULE return -1; -#else - return; -#endif } sock_register(&unix_family_ops); #ifdef CONFIG_PROC_FS create_proc_read_entry("net/unix", 0, 0, unix_read_proc, NULL); #endif -#ifdef MODULE #ifdef CONFIG_SYSCTL unix_sysctl_register(); #endif return 0; -#endif } -#ifdef MODULE -void cleanup_module(void) +static void __exit af_unix_exit(void) { sock_unregister(PF_UNIX); #ifdef CONFIG_SYSCTL @@ -1893,7 +1883,9 @@ void cleanup_module(void) remove_proc_entry("net/unix", 0); #endif } -#endif + +module_init(af_unix_init); +module_exit(af_unix_exit); /* * Local variables: diff --git a/net/unix/sysctl_net_unix.c b/net/unix/sysctl_net_unix.c index 744a4446a..885119da3 100644 --- a/net/unix/sysctl_net_unix.c +++ b/net/unix/sysctl_net_unix.c @@ -26,7 +26,6 @@ ctl_table unix_table[] = { {0} }; -#ifdef MODULE static struct ctl_table_header * unix_sysctl_header; static struct ctl_table unix_root_table[]; static struct ctl_table unix_net_table[]; @@ -50,6 +49,5 @@ void unix_sysctl_unregister(void) { unregister_sysctl_table(unix_sysctl_header); } -#endif /* MODULE */ #endif /* CONFIG_SYSCTL */ diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 9af3a0e3d..320722c40 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -1283,8 +1283,11 @@ void x25_kill_by_neigh(struct x25_neigh *neigh) } } -void __init x25_proto_init(struct net_proto *pro) +static int __init x25_init(void) { +#ifdef MODULE + struct net_device *dev; +#endif /* MODULE */ sock_register(&x25_family_ops); x25_packet_type.type = htons(ETH_P_X25); @@ -1302,20 +1305,8 @@ void __init x25_proto_init(struct net_proto *pro) proc_net_create("x25", 0, x25_get_info); proc_net_create("x25_routes", 0, x25_routes_get_info); #endif -} #ifdef MODULE -EXPORT_NO_SYMBOLS; - -MODULE_AUTHOR("Jonathan Naylor "); -MODULE_DESCRIPTION("The X.25 Packet Layer network layer protocol"); - -int init_module(void) -{ - struct net_device *dev; - - x25_proto_init(NULL); - /* * Register any pre existing devices. */ @@ -1329,11 +1320,20 @@ int init_module(void) x25_link_device_up(dev); } read_unlock(&dev_base_lock); - +#endif /* MODULE */ return 0; } +module_init(x25_init); + -void cleanup_module(void) + +#ifdef MODULE +EXPORT_NO_SYMBOLS; + +MODULE_AUTHOR("Jonathan Naylor "); +MODULE_DESCRIPTION("The X.25 Packet Layer network layer protocol"); + +static void __exit x25_exit(void) { #ifdef CONFIG_PROC_FS @@ -1354,7 +1354,7 @@ void cleanup_module(void) sock_unregister(AF_X25); } - +module_exit(x25_exit); #endif #endif -- 2.11.4.GIT