From caec386316b5407a92436825c279c0610d4d829d Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:30:08 -0500 Subject: [PATCH] Import 2.3.40pre2 --- Documentation/Configure.help | 29 +- Documentation/highuid.txt | 17 +- arch/alpha/config.in | 9 + arch/alpha/defconfig | 2 +- arch/alpha/kernel/core_mcpcia.c | 2 + arch/arm/Makefile | 4 +- arch/arm/boot/compressed/Makefile | 6 +- arch/arm/boot/compressed/head-sa1100.S | 65 ++ arch/arm/boot/compressed/head-victor.S | 45 -- arch/arm/boot/compressed/head.S | 8 +- arch/arm/config.in | 22 +- arch/arm/def-configs/a5k | 270 ++++--- arch/arm/def-configs/footbridge | 182 +++-- arch/arm/def-configs/rpc | 235 ++++-- arch/arm/defconfig | 296 +++++-- arch/arm/kernel/armksyms.c | 7 +- arch/arm/kernel/bios32.c | 64 +- arch/arm/kernel/bios32.h | 1 + arch/arm/kernel/calls.S | 12 +- arch/arm/kernel/debug-armv.S | 15 +- arch/arm/kernel/dec21285.c | 4 +- arch/arm/kernel/entry-armo.S | 1 - arch/arm/kernel/entry-armv.S | 10 +- arch/arm/kernel/entry-common.S | 129 ++- arch/arm/kernel/head-armv.S | 70 +- arch/arm/kernel/process.c | 7 +- arch/arm/kernel/setup.c | 91 ++- arch/arm/kernel/signal.c | 1 + arch/arm/kernel/sys_arm.c | 84 +- arch/arm/kernel/time.c | 2 +- arch/arm/kernel/traps.c | 58 +- arch/arm/lib/Makefile | 22 +- arch/arm/lib/bitops.S | 152 ---- arch/arm/lib/changebit.S | 26 + arch/arm/lib/clearbit.S | 26 + arch/arm/lib/copy_page.S | 35 + arch/arm/lib/csumipv6.S | 28 + arch/arm/lib/csumpartial.S | 64 ++ arch/arm/lib/csumpartialcopy.S | 257 ++++++ .../lib/{checksum.S => csumpartialcopyuser.S} | 327 +------- arch/arm/lib/findbit.S | 65 ++ arch/arm/lib/getconsdata.c | 10 + arch/arm/lib/io-footbridge.S | 2 + arch/arm/lib/memchr.S | 24 + arch/arm/lib/{string.S => memcpy.S} | 255 +----- arch/arm/lib/memset.S | 88 ++ arch/arm/lib/memzero.S | 80 ++ arch/arm/lib/setbit.S | 26 + arch/arm/lib/strchr.S | 26 + arch/arm/lib/strrchr.S | 25 + arch/arm/lib/system.c | 22 - arch/arm/lib/testchangebit.S | 25 + arch/arm/lib/testclearbit.S | 25 + arch/arm/lib/testsetbit.S | 25 + arch/arm/lib/uaccess.S | 16 +- arch/arm/mm/fault-armv.c | 184 ++--- arch/arm/mm/fault-common.c | 15 +- arch/arm/mm/init.c | 31 +- arch/arm/mm/mm-armo.c | 14 - arch/arm/mm/mm-armv.c | 139 ++-- arch/arm/mm/mm-sa1100.c | 53 +- arch/arm/mm/proc-arm6,7.S | 14 +- arch/arm/mm/proc-sa110.S | 17 +- arch/arm/vmlinux-armv.lds.in | 134 ++-- arch/i386/config.in | 4 +- arch/i386/defconfig | 2 +- arch/i386/kernel/pci-i386.c | 4 +- arch/m68k/config.in | 3 + arch/ppc/config.in | 6 +- arch/ppc/configs/common_defconfig | 6 +- arch/ppc/configs/gemini_defconfig | 6 +- arch/ppc/configs/oak_defconfig | 6 +- arch/ppc/configs/pmac_defconfig | 1 + arch/ppc/configs/walnut_defconfig | 6 +- arch/ppc/defconfig | 6 +- arch/sparc/ap1000/apmmu.c | 1 - arch/sparc/kernel/process.c | 5 +- arch/sparc/kernel/sparc_ksyms.c | 6 +- arch/sparc/kernel/sunos_asm.S | 10 +- arch/sparc/kernel/systbls.S | 52 +- arch/sparc/mm/loadmmu.c | 4 +- arch/sparc/mm/srmmu.c | 752 ++---------------- arch/sparc/mm/sun4c.c | 52 +- arch/sparc64/kernel/entry.S | 10 +- arch/sparc64/kernel/ioctl32.c | 67 +- arch/sparc64/kernel/pci.c | 7 +- arch/sparc64/kernel/pci_psycho.c | 7 +- arch/sparc64/kernel/pci_sabre.c | 3 +- arch/sparc64/kernel/sys32.S | 18 +- arch/sparc64/kernel/sys_sparc.c | 9 +- arch/sparc64/kernel/sys_sparc32.c | 304 +++---- arch/sparc64/kernel/systbls.S | 56 +- arch/sparc64/solaris/entry64.S | 10 +- arch/sparc64/solaris/fs.c | 67 +- arch/sparc64/solaris/misc.c | 14 +- arch/sparc64/solaris/systbl.S | 8 +- drivers/acorn/block/mfmhd.c | 42 +- drivers/acorn/scsi/Config.in | 10 +- drivers/char/Config.in | 2 +- drivers/char/pcmcia/Config.in | 21 +- drivers/net/Config.in | 2 +- drivers/net/pcmcia/Config.in | 6 +- drivers/net/pcmcia/tulip_cb.c | 15 +- drivers/net/tokenring/olympic.c | 25 +- drivers/net/tokenring/olympic.h | 2 + drivers/parport/Config.in | 2 +- drivers/parport/parport_pc.c | 2 +- drivers/pci/Makefile | 2 +- drivers/pci/helper.c | 69 -- drivers/pci/pci.c | 2 +- drivers/pci/pcisyms.c | 2 +- drivers/pci/setup-res.c | 1 - drivers/pci/syscall.c | 4 +- drivers/pcmcia/cs.c | 2 +- drivers/pcmcia/ricoh.h | 2 + drivers/pcmcia/ti113x.h | 1 + drivers/pcmcia/yenta.c | 4 +- drivers/sbus/char/envctrl.c | 6 +- drivers/usb/Config.in | 7 + drivers/usb/acm.c | 10 +- drivers/usb/hub.c | 31 +- drivers/usb/mousedev.c | 2 +- drivers/usb/ohci-hcd.c | 97 ++- drivers/usb/ohci-hcd.h | 7 + drivers/usb/ov511.c | 552 +++++++------ drivers/usb/usb-serial.c | 54 +- drivers/usb/usb.h | 8 +- drivers/video/dummycon.c | 2 +- fs/hfs/ChangeLog | 4 + fs/hfs/extent.c | 21 +- fs/hfs/file.c | 35 +- fs/hfs/hfs_btree.h | 24 +- fs/hfs/inode.c | 6 +- fs/namei.c | 118 ++- fs/ncpfs/ioctl.c | 2 +- fs/smbfs/ioctl.c | 2 +- include/asm-alpha/posix_types.h | 9 +- include/asm-arm/arch-arc/serial.h | 4 +- include/asm-arm/arch-arc/system.h | 3 +- include/asm-arm/arch-cl7500/system.h | 2 + include/asm-arm/arch-ebsa110/system.h | 1 + include/asm-arm/arch-ebsa285/io.h | 4 +- include/asm-arm/arch-ebsa285/irq.h | 13 +- include/asm-arm/arch-ebsa285/system.h | 1 + include/asm-arm/arch-nexuspci/system.h | 1 + include/asm-arm/arch-rpc/system.h | 3 +- include/asm-arm/arch-sa1100/hardware.h | 4 +- include/asm-arm/arch-sa1100/ide.h | 96 +++ include/asm-arm/arch-sa1100/memory.h | 16 +- include/asm-arm/arch-sa1100/param.h | 2 +- include/asm-arm/arch-sa1100/serial.h | 2 +- include/asm-arm/arch-sa1100/system.h | 9 +- include/asm-arm/arch-sa1100/uncompress.h | 51 ++ include/asm-arm/checksum.h | 36 +- include/asm-arm/div64.h | 33 +- include/asm-arm/io.h | 16 +- include/asm-arm/iomd.h | 18 +- include/asm-arm/page.h | 6 +- include/asm-arm/posix_types.h | 9 +- include/asm-arm/proc-armv/uncompress.h | 2 +- include/asm-arm/proc-fns.h | 8 + include/asm-arm/sigcontext.h | 1 + include/asm-arm/stat.h | 37 +- include/asm-arm/string.h | 3 +- include/asm-arm/system.h | 13 + include/asm-arm/unistd.h | 11 +- include/asm-i386/posix_types.h | 7 +- include/asm-m68k/posix_types.h | 7 +- include/asm-sparc/a.out.h | 27 +- include/asm-sparc/asm_offsets.h | 404 +++++----- include/asm-sparc/ipcbuf.h | 31 + include/asm-sparc/msgbuf.h | 31 + include/asm-sparc/posix_types.h | 15 +- include/asm-sparc/processor.h | 8 +- include/asm-sparc/sembuf.h | 25 + include/asm-sparc/shmbuf.h | 42 + include/asm-sparc/unistd.h | 43 +- include/asm-sparc64/asm_offsets.h | 504 ++++++------ include/asm-sparc64/floppy.h | 19 +- include/asm-sparc64/ipcbuf.h | 28 + include/asm-sparc64/msgbuf.h | 27 + include/asm-sparc64/ns87303.h | 42 +- include/asm-sparc64/parport.h | 46 +- include/asm-sparc64/pci.h | 3 + include/asm-sparc64/posix_types.h | 9 + include/asm-sparc64/sembuf.h | 22 + include/asm-sparc64/shmbuf.h | 38 + include/asm-sparc64/unistd.h | 40 +- include/linux/hfs_fs.h | 13 + include/linux/highuid.h | 26 +- include/linux/init.h | 2 + include/linux/pci.h | 30 +- kernel/Makefile | 6 +- kernel/ksyms.c | 6 + kernel/signal.c | 10 +- kernel/sys.c | 5 + kernel/sysctl.c | 2 + mm/slab.c | 25 +- mm/vmscan.c | 2 +- net/ipv4/route.c | 2 +- net/ipv4/tcp_output.c | 12 +- 201 files changed, 4699 insertions(+), 3992 deletions(-) create mode 100644 arch/arm/boot/compressed/head-sa1100.S delete mode 100644 arch/arm/boot/compressed/head-victor.S delete mode 100644 arch/arm/lib/bitops.S create mode 100644 arch/arm/lib/changebit.S create mode 100644 arch/arm/lib/clearbit.S create mode 100644 arch/arm/lib/copy_page.S create mode 100644 arch/arm/lib/csumipv6.S create mode 100644 arch/arm/lib/csumpartial.S create mode 100644 arch/arm/lib/csumpartialcopy.S rename arch/arm/lib/{checksum.S => csumpartialcopyuser.S} (55%) create mode 100644 arch/arm/lib/findbit.S create mode 100644 arch/arm/lib/memchr.S rename arch/arm/lib/{string.S => memcpy.S} (54%) create mode 100644 arch/arm/lib/memset.S create mode 100644 arch/arm/lib/memzero.S create mode 100644 arch/arm/lib/setbit.S create mode 100644 arch/arm/lib/strchr.S create mode 100644 arch/arm/lib/strrchr.S delete mode 100644 arch/arm/lib/system.c create mode 100644 arch/arm/lib/testchangebit.S create mode 100644 arch/arm/lib/testclearbit.S create mode 100644 arch/arm/lib/testsetbit.S delete mode 100644 drivers/pci/helper.c create mode 100644 include/asm-arm/arch-sa1100/ide.h create mode 100644 include/asm-arm/arch-sa1100/uncompress.h create mode 100644 include/asm-sparc/ipcbuf.h create mode 100644 include/asm-sparc/msgbuf.h create mode 100644 include/asm-sparc/sembuf.h create mode 100644 include/asm-sparc/shmbuf.h create mode 100644 include/asm-sparc64/ipcbuf.h create mode 100644 include/asm-sparc64/msgbuf.h create mode 100644 include/asm-sparc64/sembuf.h create mode 100644 include/asm-sparc64/shmbuf.h diff --git a/Documentation/Configure.help b/Documentation/Configure.help index 8725dcb62da8..36dad9a23f20 100644 --- a/Documentation/Configure.help +++ b/Documentation/Configure.help @@ -8002,7 +8002,7 @@ CONFIG_USB_ACM The module will be called acm.o. If you want to compile it as a module, say M here and read Documentation/modules.txt. -USB serial converter support +USB Serial converter support CONFIG_USB_SERIAL Say Y here if you want to connect a Connect Tech WhiteHEAT multi-port USB to serial converter; a Belkin, Peracom, or eTek @@ -8014,6 +8014,33 @@ CONFIG_USB_SERIAL The module will be called usb-serial.o. If you want to compile it as a module, say M here and read Documentation/modules.txt. +USB Generic Serial Driver +CONFIG_USB_SERIAL_GENERIC + Say Y here if you want to use the generic USB serial driver. + Please read Documentation/usb/usb-serial.txt for more information + on using this driver. It is recommended that the USB Serial + Driver be compiled as a module for this driver to be used properly. + +USB ConnectTech WhiteHEAT Serial Driver +CONFIG_USB_SERIAL_WHITEHEAT + Say Y here if you want to use a ConnectTech WhiteHEAT 4 port + USB to serial converter device. + +USB Handspring Visor Driver +CONFIG_USB_SERIAL_VISOR + Say Y here if you want to connect to your HandSpring Visor through + its USB docking station. + +USB Belkin Single Port Serial Driver +CONFIG_USB_SERIAL_BELKIN + Say Y here if you want to use a Belkin single port USB to serial + converter device. + +USB Peracom Single Port Serial Driver +CONFIG_USB_SERIAL_PERACOM + Say Y here if you want to use a Peracom single port USB to serial + converter device. + USB Printer support CONFIG_USB_PRINTER Say Y here if you want to connect a USB printer to your computer's USB diff --git a/Documentation/highuid.txt b/Documentation/highuid.txt index 23d27de7f8c9..ce7c17b7b380 100644 --- a/Documentation/highuid.txt +++ b/Documentation/highuid.txt @@ -17,11 +17,6 @@ What's left to be done for 32-bit UIDs on all Linux architectures: properly with huge UIDs. If it can deal with 64-bit file offsets on all architectures, this should not be a problem. -- Decide on a final layout for the new msqid64_ds, semid64_ds, and - shmid64_ds, and shminfo64 structures. The current ones leave pad space - for 64-bit time_t and 32-bit pid_t, as well as 4 extra machine words. - Perhaps more pad space should be left for future use? - - Decide whether or not to keep backwards compatibility with the system accounting file, or if we should break it as the comments suggest (currently, the old 16-bit UID and GID are still written to disk, and @@ -33,7 +28,7 @@ What's left to be done for 32-bit UIDs on all Linux architectures: uses the 32-bit UID system calls properly otherwise. This affects at least: - SunOS emulation - now fixed? + SunOS emulation Solaris emulation iBCS on Intel @@ -62,8 +57,8 @@ What's left to be done for 32-bit UIDs on all Linux architectures: Other filesystems have not been checked yet. -- The ncpfs and smpfs filesystems can not presently return 32-bit UIDs to - all ioctl()s. Some new ioctl()s have been added for 32-bit UIDs, but +- The ncpfs and smpfs filesystems can not presently use 32-bit UIDs in + all ioctl()s. Some new ioctl()s have been added with 32-bit UIDs, but more are needed. (as well as new user<->kernel data structures) - The ELF core dump format only supports 16-bit UIDs on arm, i386, m68k, @@ -76,3 +71,9 @@ What's left to be done for 32-bit UIDs on all Linux architectures: - make sure that the UID mapping feature of AX25 networking works properly (it should be safe because it's always used a 32-bit integer to communicate between user and kernel) + + +Chris Wing +wingc@umich.edu + +last updated: January 11, 2000 diff --git a/arch/alpha/config.in b/arch/alpha/config.in index 6830ee64994c..ce5c0853e731 100644 --- a/arch/alpha/config.in +++ b/arch/alpha/config.in @@ -2,6 +2,9 @@ # For a description of the syntax of this configuration file, # see the Configure script. # + +define_bool CONFIG_UID16 n + mainmenu_name "Kernel configuration of Linux for Alpha machines" mainmenu_option next_comment @@ -180,6 +183,12 @@ fi source drivers/pci/Config.in +bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG + +if [ "$CONFIG_HOTPLUG" = "y" ] ; then + source drivers/pcmcia/Config.in +fi + bool 'Networking support' CONFIG_NET bool 'System V IPC' CONFIG_SYSVIPC bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT diff --git a/arch/alpha/defconfig b/arch/alpha/defconfig index b80c36954fc8..d996415290c2 100644 --- a/arch/alpha/defconfig +++ b/arch/alpha/defconfig @@ -321,11 +321,11 @@ CONFIG_PSMOUSE=y # CONFIG_FTAPE is not set # CONFIG_DRM is not set # CONFIG_DRM_TDFX is not set +CONFIG_PCMCIA_SERIAL=y # # PCMCIA character device support # -CONFIG_PCMCIA_SERIAL=y # CONFIG_PCMCIA_SERIAL_CS is not set # diff --git a/arch/alpha/kernel/core_mcpcia.c b/arch/alpha/kernel/core_mcpcia.c index 4b165940dd53..847958212449 100644 --- a/arch/alpha/kernel/core_mcpcia.c +++ b/arch/alpha/kernel/core_mcpcia.c @@ -560,12 +560,14 @@ mcpcia_machine_check(unsigned long vector, unsigned long la_ptr, switch (expected) { case 0: + { /* FIXME: how do we figure out which hose the error was on? */ struct pci_controler *hose; for (hose = hose_head; hose; hose = hose->next) mcpcia_pci_clr_err(hose2mid(hose->index)); break; + } case 1: mcpcia_pci_clr_err(mcheck_extra(cpu)); break; diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 2c81731b963b..0df16ffa48cf 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -136,7 +136,7 @@ MACHINE = nexuspci ARCHDIR = nexuspci endif -ifeq ($(CONFIG_ARCH_SA1100),u) +ifeq ($(CONFIG_ARCH_SA1100),y) MACHINE = sa1100 ARCHDIR = sa1100 endif @@ -146,7 +146,7 @@ HEAD := arch/arm/kernel/head-$(PROCESSOR).o \ SUBDIRS += arch/arm/kernel arch/arm/mm arch/arm/lib \ arch/arm/special arch/arm/nwfpe CORE_FILES := arch/arm/kernel/kernel.o arch/arm/mm/mm.o $(CORE_FILES) -LIBS := arch/arm/lib/lib.a $(LIBS) $(GCCLIB) +LIBS := arch/arm/lib/lib.o arch/arm/lib/lib.a $(LIBS) $(GCCLIB) DRIVERS += arch/arm/special/special.a ifeq ($(CONFIG_NWFPE),y) diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 8a100eb77997..d2992a491851 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -44,9 +44,9 @@ ZTEXTADDR = 0x40200000 ZRELADDR = 0x40008000 endif -ifeq ($(CONFIG_ARCH_SA110),y) +ifeq ($(CONFIG_ARCH_SA1100),y) +OBJS += head-sa1100.o ifeq ($(CONFIG_SA1100_VICTOR),y) -HEAD = head-victor.o ZTEXTADDR = 0x00002000 ZBSSADDR = 0xc0100000 else @@ -91,7 +91,7 @@ font.o: $(FONTC) vmlinux.lds: vmlinux.lds.in @sed "$(SEDFLAGS)" < vmlinux.lds.in > $@ -clean:; rm -f vmlinux core piggy* +clean:; rm -f vmlinux core piggy* vmlinux.lds .PHONY: vmlinux.lds clean diff --git a/arch/arm/boot/compressed/head-sa1100.S b/arch/arm/boot/compressed/head-sa1100.S new file mode 100644 index 000000000000..90018e52b802 --- /dev/null +++ b/arch/arm/boot/compressed/head-sa1100.S @@ -0,0 +1,65 @@ +/* + * linux/arch/arm/boot/compressed/head-sa1100.S + * + * Copyright (C) 1999 Nicolas Pitre + * + * SA1100 specific tweaks. This is merged with head.S by the linker. + */ + +#include + + + .section ".start", #alloc, #execinstr + +#ifndef CONFIG_ARCH_SA1100 +#error What am I doing here... +#endif + +#ifdef CONFIG_SA1100_BRUTUS +@ need to enter SVC mode +#define angel_SWIreason_EnterSVC 0x17 /* from arm.h, in angel source */ +#define angel_SWI_ARM (0xEF123456 & 0xffffff) + mov r0, #angel_SWIreason_EnterSVC + swi #angel_SWI_ARM + + @ turn off interrupts to prevent the angel from running + mrs r0, cpsr + orr r0, r0, #0xc0 + msr cpsr, r0 +#endif + +#ifdef CONFIG_SA1100_VICTOR + @ Copy cmdline to 0xc0000000 + mov r1, #0xc0000000 + cmp r0, #0 + moveq r2, #0 +1: ldrneb r2, [r0], #1 + cmpne r2, #0 + strb r2, [r1], #1 + bne 1b +#endif + + @ Data cache might be active. + @ Be sure to flush kernel binary out of the cache, + @ whatever state it is, before it is turned off. + @ This is done by fetching through currently executed + @ memory to be sure we hit the same cache. + bic r2, pc, #0x1f + add r3, r2, #0x4000 @ 16 kb is quite enough... +1: ldr r0, [r2], #32 + teq r2, r3 + bne 1b + mcr p15, 0, r0, c7, c10, 4 @ drain WB + mcr p15, 0, r0, c7, c7, 0 @ flush I & D caches + + @ disabling MMU, enabling I cache + mrc p15, 0, r0, c1, c0, 0 @ read control reg + bic r0, r0, #0x0d @ clear WB, DC, MMU + orr r0, r0, #0x1000 @ set Icache + mcr p15, 0, r0, c1, c0, 0 + + @ set registers for entry + mov r0, #0 + mov r1, #16 + + diff --git a/arch/arm/boot/compressed/head-victor.S b/arch/arm/boot/compressed/head-victor.S deleted file mode 100644 index e556383bacf5..000000000000 --- a/arch/arm/boot/compressed/head-victor.S +++ /dev/null @@ -1,45 +0,0 @@ -/* - * linux/arch/arm/boot/compressed/head-victor.S - * - * Copyright (C) 1998 Nicolas Pitre - */ - -#include - - .text - .globl _start -_start: - @ just in case we still use an a.out loader... - nop - nop - nop - nop - nop - nop - nop - nop - - @ load different addresses - adr r2, LC0 - ldmia r2, {r4, r5, r6, sp} - - @ clear BSS - mov r2, #0 -1: str r2, [r5], #4 - cmp r5, r6 - blt 1b - - @ uncompress the kernel - mov r8, r0 @ save cmdline ptr - mov r0, r4 @ where to put uncompressed data - add r1, r6, #31 - bic r1, r1, #31 @ free memory space - add r2, r1, #65536 @ end of free mem space - bl SYMBOL_NAME(decompress_kernel) - mov r0, r8 @ retrieve cmdline ptr - mov pc, r4 @ call via EXEC entry - -LC0: .word _load_addr - .word __bss_start - .word SYMBOL_NAME(_end) - .word SYMBOL_NAME(user_stack)+4096 diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index e87c0a72e969..796f812abd94 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -77,10 +77,10 @@ start: cmp r2, r3 blt 1b - eor r1, r6, #0x44 << 24 @ SA-110? + eor r1, r6, #0x44 << 24 @ SA-110 or SA-1100? eor r1, r1, #0x01 << 16 eor r1, r1, #0xa1 << 8 - movs r1, r1, lsr #4 + movs r1, r1, lsr #5 mcreq p15, 0, r1, c7, c7, 0 @ flush I & D-cache mcreq p15, 0, r1, c7, c10, 4 @ drain WB add pc, r5, r0 @ call relocation code @@ -144,10 +144,10 @@ reloc_start: add r8, r5, r0 mov r0, r4 bl memdump #endif - eor r0, r6, #0x44 << 24 @ SA-110? + eor r0, r6, #0x44 << 24 @ SA-110 or SA-1100? eor r0, r0, #0x01 << 16 eor r0, r0, #0xa1 << 8 - movs r0, r0, lsr #4 + movs r0, r0, lsr #5 mcreq p15, 0, r0, c7, c7, 0 @ flush I cache mcreq p15, 0, r1, c7, c10, 4 @ drain WB diff --git a/arch/arm/config.in b/arch/arm/config.in index e1d54c4e7f0e..be7102698b32 100644 --- a/arch/arm/config.in +++ b/arch/arm/config.in @@ -6,6 +6,8 @@ mainmenu_name "Linux Kernel Configuration" define_bool CONFIG_ARM y +define_bool CONFIG_UID16 y + mainmenu_option next_comment comment 'Code maturity level options' bool 'Prompt for development and/or incomplete code/drivers' CONFIG_EXPERIMENTAL @@ -44,7 +46,6 @@ if [ "$CONFIG_ADDIN_FOOTBRIDGE" = "y" ]; then fi if [ "$CONFIG_ARCH_SA1100" = "y" ]; then - define_bool CONFIG_CPU_SA1100 y choice 'SA1100 implementation' \ "Brutus CONFIG_SA1100_BRUTUS \ Empeg CONFIG_SA1100_EMPEG \ @@ -93,7 +94,11 @@ else "$CONFIG_FOOTBRIDGE" = "y" -o \ "$CONFIG_ARCH_NEXUSPCI" = "y" ]; then define_bool CONFIG_CPU_32v4 y - define_bool CONFIG_CPU_SA110 y + if [ "$CONFIG_ARCH_SA1100" = "y" ]; then + define_bool CONFIG_CPU_SA1100 y + else + define_bool CONFIG_CPU_SA110 y + fi else if [ "$CONFIG_ARCH_RPC" = "y" ]; then define_bool CONFIG_CPU_32v3 y @@ -110,7 +115,7 @@ fi if [ "$CONFIG_ARCH_NEXUSPCI" = "y" -o \ "$CONFIG_HOST_FOOTBRIDGE" = "y" ]; then define_bool CONFIG_PCI y - source drivers/pci/Config.h + source drivers/pci/Config.in fi # @@ -123,8 +128,8 @@ else define_bool CONFIG_ISA_DMA n fi -if [ "$CONFIG_CPU_32" = "y" -a "$CONFIG_ARCH_EBSA110" != "y" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then - bool 'Enable kernel-mode alignment trap handler (EXPERIMENTAL)' CONFIG_ALIGNMENT_TRAP +if [ "$CONFIG_CPU_32" = "y" -a "$CONFIG_ARCH_EBSA110" != "y" ]; then + bool 'Kernel-mode alignment trap handler' CONFIG_ALIGNMENT_TRAP fi #bool 'Split text into discardable sections' CONFIG_TEXT_SECTIONS endmenu @@ -273,11 +278,10 @@ bool 'Verbose user fault messages' CONFIG_DEBUG_USER bool 'Include debugging information in kernel binary' CONFIG_DEBUG_INFO #bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ +if [ "$CONFIG_CPU_26" = "y" ]; then + bool 'Disable pgtable cache' CONFIG_NO_PGT_CACHE +fi if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - if [ "$CONFIG_CPU_26" = "y" ]; then - bool 'Disable pgtable cache (EXPERIMENTAL)' CONFIG_NO_PGT_CACHE - fi - # These options are only for real kernel hackers # who want to get their hands dirty. bool 'Kernel low-level debugging functions' CONFIG_DEBUG_LL diff --git a/arch/arm/def-configs/a5k b/arch/arm/def-configs/a5k index 8b402a59ec3e..21a6488eb2f5 100644 --- a/arch/arm/def-configs/a5k +++ b/arch/arm/def-configs/a5k @@ -3,6 +3,11 @@ # CONFIG_ARM=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + # # System and processor type # @@ -12,22 +17,10 @@ CONFIG_ARCH_A5K=y # CONFIG_ARCH_EBSA110 is not set # CONFIG_FOOTBRIDGE is not set CONFIG_ARCH_ACORN=y -# CONFIG_ISA_DMA is not set # CONFIG_CPU_32 is not set CONFIG_CPU_26=y -# CONFIG_CPU_ARM2 is not set -CONFIG_CPU_ARM3=y -# CONFIG_CPU_ARM6 is not set -# CONFIG_CPU_ARM7 is not set -# CONFIG_CPU_SA110 is not set -CONFIG_PAGESIZE_32=y # CONFIG_PAGESIZE_16 is not set - -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -# CONFIG_TEXT_SECTIONS is not set +# CONFIG_ISA_DMA is not set # # Loadable module support @@ -43,17 +36,38 @@ CONFIG_NET=y CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y -# CONFIG_NWFPE is not set +CONFIG_NWFPE=y +CONFIG_KCORE_ELF=y +# CONFIG_KCORE_AOUT is not set CONFIG_BINFMT_AOUT=y -CONFIG_BINFMT_ELF=m +# CONFIG_BINFMT_ELF is not set # CONFIG_BINFMT_MISC is not set -CONFIG_PARPORT=y -CONFIG_PARPORT_PC=y +CONFIG_PARPORT=m +CONFIG_PARPORT_PC=m +# CONFIG_PARPORT_PC_FIFO is not set +# CONFIG_PARPORT_ARC is not set +# CONFIG_PARPORT_AMIGA is not set +# CONFIG_PARPORT_MFC3 is not set +# CONFIG_PARPORT_ATARI is not set +# CONFIG_PARPORT_SUNBPP is not set +# CONFIG_PARPORT_OTHER is not set +# CONFIG_PARPORT_1284 is not set # -# Plug and Play support +# 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 + +# +# Plug and Play configuration # # CONFIG_PNP is not set +# CONFIG_ISAPNP is not set # # Block devices @@ -66,11 +80,19 @@ CONFIG_BLK_DEV_IDE=y # # CONFIG_BLK_DEV_HD_IDE is not set CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set # CONFIG_BLK_DEV_IDECD is not set # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# # CONFIG_BLK_DEV_CMD640 is not set +CONFIG_BLK_DEV_IDE_ICSIDE=y +# CONFIG_BLK_DEV_IDEDMA_ICS is not set +# CONFIG_BLK_DEV_IDE_RAPIDE is not set # CONFIG_IDE_CHIPSETS is not set # @@ -82,16 +104,14 @@ CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_INITRD=y # CONFIG_BLK_DEV_XD is not set -CONFIG_PARIDE_PARPORT=y +CONFIG_PARIDE_PARPORT=m # CONFIG_PARIDE is not set +# CONFIG_BLK_DEV_IDE_MODES is not set # CONFIG_BLK_DEV_HD is not set # # Acorn-specific block devices # -CONFIG_BLK_DEV_IDE_CARDS=y -CONFIG_BLK_DEV_IDE_ICSIDE=y -# CONFIG_BLK_DEV_IDE_RAPIDE is not set # CONFIG_BLK_DEV_FD1772 is not set CONFIG_BLK_DEV_MFM=m CONFIG_BLK_DEV_MFM_AUTODETECT=y @@ -102,26 +122,33 @@ CONFIG_BLK_DEV_MFM_AUTODETECT=y CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_SERIAL=y -# CONFIG_SERIAL_CONSOLE is not set +CONFIG_SERIAL_CONSOLE=y +# CONFIG_ATOMWIDE_SERIAL is not set +# CONFIG_DUALSP_SERIAL is not set # CONFIG_SERIAL_EXTENDED is not set -CONFIG_ATOMWIDE_SERIAL=y -CONFIG_DUALSP_SERIAL=y # CONFIG_SERIAL_NONSTANDARD is not set # CONFIG_UNIX98_PTYS is not set -CONFIG_PRINTER=y -CONFIG_PRINTER_READBACK=y -CONFIG_MOUSE=y +# CONFIG_PRINTER is not set +# CONFIG_PPDEV is not set # # Mice # -# CONFIG_ATIXL_BUSMOUSE is not set # CONFIG_BUSMOUSE is not set -# CONFIG_MS_BUSMOUSE is not set +CONFIG_MOUSE=y # CONFIG_PSMOUSE is not set # CONFIG_82C710_MOUSE is not set # CONFIG_PC110_PAD is not set + +# +# Joysticks +# +# CONFIG_JOYSTICK is not set # CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# # CONFIG_WATCHDOG is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set @@ -130,27 +157,43 @@ CONFIG_MOUSE=y # Video For Linux # # CONFIG_VIDEO_DEV is not set - -# -# Joystick support -# -# CONFIG_JOYSTICK is not set # CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # # CONFIG_FTAPE is not set -CONFIG_KBDMOUSE=y +# CONFIG_DRM is not set +# CONFIG_DRM_TDFX is not set + +# +# PCMCIA character device support +# +# CONFIG_PCMCIA_SERIAL_CS is not set +# CONFIG_AGP is not set + +# +# Support for USB +# +# CONFIG_USB is not set # # Console drivers # CONFIG_FB=y + +# +# Frame-buffer support +# +CONFIG_FB=y CONFIG_DUMMY_CONSOLE=y CONFIG_FB_ACORN=y # CONFIG_FB_MATROX is not set # CONFIG_FB_ATY is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_3DFX is not set # CONFIG_FB_VIRTUAL is not set # CONFIG_FBCON_ADVANCED is not set CONFIG_FBCON_MFB=y @@ -158,9 +201,13 @@ CONFIG_FBCON_CFB2=y CONFIG_FBCON_CFB4=y CONFIG_FBCON_CFB8=y # CONFIG_FBCON_FONTWIDTH8_ONLY is not set -# CONFIG_FBCON_FONTS is not set -CONFIG_FONT_8x8=y -CONFIG_FONT_8x16=y +CONFIG_FBCON_FONTS=y +# CONFIG_FONT_8x8 is not set +# CONFIG_FONT_8x16 is not set +# CONFIG_FONT_SUN8x16 is not set +# CONFIG_FONT_SUN12x22 is not set +# CONFIG_FONT_6x11 is not set +# CONFIG_FONT_PEARL_8x8 is not set CONFIG_FONT_ACORN_8x8=y # @@ -168,7 +215,7 @@ CONFIG_FONT_ACORN_8x8=y # # CONFIG_PACKET is not set # CONFIG_NETLINK is not set -# CONFIG_FIREWALL is not set +# CONFIG_NETFILTER is not set # CONFIG_FILTER is not set CONFIG_UNIX=y CONFIG_INET=y @@ -184,15 +231,17 @@ CONFIG_INET=y # # (it is safe to leave these untouched) # -# CONFIG_INET_RARP is not set # CONFIG_SKB_LARGE is not set # 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_X25 is not set # CONFIG_LAPB is not set # CONFIG_BRIDGE is not set @@ -201,7 +250,6 @@ CONFIG_INET=y # CONFIG_WAN_ROUTER is not set # CONFIG_NET_FASTROUTE is not set # CONFIG_NET_HW_FLOWCONTROL is not set -# CONFIG_CPU_IS_SLOW is not set # # QoS and/or fair queueing @@ -214,7 +262,7 @@ CONFIG_INET=y # CONFIG_HAMRADIO is not set # -# IrDA subsystem support +# IrDA (infrared) support # # CONFIG_IRDA is not set @@ -222,9 +270,18 @@ CONFIG_INET=y # Network device support # CONFIG_NETDEVICES=y + +# +# ARCnet devices +# # CONFIG_ARCNET is not set # CONFIG_DUMMY is not set # CONFIG_EQUALIZER is not set +# CONFIG_NET_SB1000 is not set + +# +# Ethernet (10 or 100Mbit) +# CONFIG_NET_ETHERNET=y CONFIG_ARM_ETHER1=y CONFIG_ARM_ETHER3=y @@ -234,96 +291,52 @@ CONFIG_ARM_ETHER3=y # CONFIG_NET_VENDOR_SMC is not set # CONFIG_NET_VENDOR_RACAL is not set # CONFIG_RTL8139 is not set -# CONFIG_YELLOWFIN is not set -# CONFIG_ACENIC is not set +# CONFIG_DM9102 is not set +# CONFIG_AT1700 is not set +# CONFIG_DEPCA is not set # CONFIG_NET_ISA is not set # CONFIG_NET_EISA is not set # CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_YELLOWFIN is not set +# CONFIG_ACENIC is not set +# CONFIG_SK98LIN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set -# CONFIG_DLCI is not set # CONFIG_PLIP is not set # CONFIG_PPP is not set # CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# # CONFIG_NET_RADIO is not set + +# +# Token Ring driver support +# # CONFIG_TR is not set -# CONFIG_SHAPER is not set -# CONFIG_HOSTESS_SV11 is not set -# CONFIG_COSA is not set +# CONFIG_NET_FC is not set # CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set # # SCSI support # -CONFIG_SCSI=y - -# -# SCSI support type (disk, tape, CD-ROM) -# -CONFIG_BLK_DEV_SD=y -# CONFIG_CHR_DEV_ST is not set -CONFIG_BLK_DEV_SR=y -# CONFIG_BLK_DEV_SR_VENDOR is not set -# CONFIG_CHR_DEV_SG is not set - -# -# Some SCSI devices (e.g. CD jukebox) support multiple LUNs -# -# CONFIG_SCSI_MULTI_LUN is not set -CONFIG_SCSI_CONSTANTS=y -CONFIG_SCSI_LOGGING=y - -# -# SCSI low-level drivers -# -# CONFIG_SCSI_7000FASST is not set -# CONFIG_SCSI_ACARD is not set -# 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_ADVANSYS is not set -# CONFIG_SCSI_IN2000 is not set -# CONFIG_SCSI_AM53C974 is not set -# CONFIG_SCSI_MEGARAID is not set -# CONFIG_SCSI_BUSLOGIC is not set -# CONFIG_SCSI_DTC3280 is not set -# CONFIG_SCSI_EATA is not set -# CONFIG_SCSI_EATA_DMA is not set -# CONFIG_SCSI_EATA_PIO is not set -# CONFIG_SCSI_FUTURE_DOMAIN is not set -# CONFIG_SCSI_GDTH is not set -# CONFIG_SCSI_GENERIC_NCR5380 is not set -CONFIG_SCSI_PPA=m -# CONFIG_SCSI_IMM is not set -# CONFIG_SCSI_IZIP_EPP16 is not set -# CONFIG_SCSI_IZIP_SLOW_CTR is not set -# CONFIG_SCSI_NCR53C406A is not set -# CONFIG_SCSI_SYM53C416 is not set -# CONFIG_SCSI_PAS16 is not set -# CONFIG_SCSI_PCI2000 is not set -# CONFIG_SCSI_PCI2220I is not set -# CONFIG_SCSI_PSI240I is not set -# CONFIG_SCSI_QLOGIC_FAS is not set -# CONFIG_SCSI_SEAGATE is not set -# CONFIG_SCSI_T128 is not set -# CONFIG_SCSI_U14_34F is not set -# CONFIG_SCSI_ULTRASTOR is not set -# CONFIG_SCSI_DEBUG is not set -CONFIG_SCSI_ACORNSCSI_3=y -CONFIG_SCSI_ACORNSCSI_TAGGED_QUEUE=y -CONFIG_SCSI_ACORNSCSI_SYNC=y -CONFIG_SCSI_ARXESCSI=m -# CONFIG_SCSI_CUMANA_2 is not set -CONFIG_SCSI_EESOXSCSI=y -# CONFIG_SCSI_POWERTECSCSI is not set - -# -# The following drivers are not fully supported -# -# CONFIG_SCSI_CUMANA_1 is not set -# CONFIG_SCSI_ECOSCSI is not set -# CONFIG_SCSI_OAK1 is not set +# CONFIG_SCSI is not set # # Sound @@ -338,12 +351,14 @@ CONFIG_SCSI_EESOXSCSI=y CONFIG_ADFS_FS=y # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m # CONFIG_UMSDOS_FS is not set -CONFIG_VFAT_FS=m -CONFIG_ISO9660_FS=y -CONFIG_JOLIET=y +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_ISO9660_FS is not set +# CONFIG_JOLIET is not set # CONFIG_MINIX_FS is not set # CONFIG_NTFS_FS is not set # CONFIG_HPFS_FS is not set @@ -352,6 +367,7 @@ CONFIG_PROC_FS=y # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set # CONFIG_UFS_FS is not set # @@ -359,8 +375,7 @@ CONFIG_EXT2_FS=y # # CONFIG_CODA_FS is not set CONFIG_NFS_FS=y -CONFIG_NFSD=y -# CONFIG_NFSD_SUN is not set +# CONFIG_NFSD is not set CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_SMB_FS is not set @@ -369,12 +384,10 @@ CONFIG_LOCKD=y # # Partition Types # -# CONFIG_OSF_PARTITION is not set -# CONFIG_MAC_PARTITION is not set +# CONFIG_PARTITION_ADVANCED is not set CONFIG_MSDOS_PARTITION=y # CONFIG_SGI_PARTITION is not set # CONFIG_SUN_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set CONFIG_ACORN_PARTITION=y CONFIG_ACORN_PARTITION_ADFS=y CONFIG_ACORN_PARTITION_ICS=y @@ -410,6 +423,7 @@ CONFIG_NLS=y # 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 @@ -418,8 +432,8 @@ CONFIG_NLS=y # CONFIG_FRAME_POINTER=y CONFIG_DEBUG_ERRORS=y -# CONFIG_DEBUG_USER is not set +CONFIG_DEBUG_USER=y # CONFIG_DEBUG_INFO is not set CONFIG_MAGIC_SYSRQ=y CONFIG_NO_PGT_CACHE=y -# CONFIG_DEBUG_LL is not set +CONFIG_DEBUG_LL=y diff --git a/arch/arm/def-configs/footbridge b/arch/arm/def-configs/footbridge index fa410d522c4a..e43a8d2a9a42 100644 --- a/arch/arm/def-configs/footbridge +++ b/arch/arm/def-configs/footbridge @@ -3,6 +3,11 @@ # CONFIG_ARM=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + # # System and processor type # @@ -23,11 +28,6 @@ CONFIG_CPU_32v4=y CONFIG_CPU_SA110=y CONFIG_PCI=y CONFIG_ISA_DMA=y - -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y # CONFIG_ALIGNMENT_TRAP is not set # @@ -45,6 +45,8 @@ CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y CONFIG_NWFPE=y +CONFIG_KCORE_ELF=y +# CONFIG_KCORE_AOUT is not set CONFIG_BINFMT_AOUT=y CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set @@ -60,7 +62,7 @@ CONFIG_PARPORT_PC_FIFO=y # CONFIG_PARPORT_SUNBPP is not set # CONFIG_PARPORT_OTHER is not set CONFIG_PARPORT_1284=y -CONFIG_CMDLINE="root=/dev/hda2 ro mem=32M parport=0x378,7 ide0=autotune" +CONFIG_CMDLINE="root=/dev/hda1 ro mem=32M parport=0x378,7 ide0=autotune" CONFIG_LEDS=y CONFIG_LEDS_TIMER=y # CONFIG_LEDS_CPU is not set @@ -97,15 +99,20 @@ CONFIG_IDEDISK_MULTI_MODE=y # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# # CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_RZ1000 is not set CONFIG_BLK_DEV_IDEPCI=y CONFIG_BLK_DEV_IDEDMA_PCI=y CONFIG_IDEDMA_PCI_AUTO=y -# IDEDMA_NEW_DRIVE_LISTINGS is not set -IDEDMA_PCI_EXPERIMENTAL=y +CONFIG_IDEDMA_NEW_DRIVE_LISTINGS=y +CONFIG_IDEDMA_PCI_EXPERIMENTAL=y CONFIG_BLK_DEV_OFFBOARD=y # CONFIG_BLK_DEV_AEC6210 is not set +# CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_BLK_DEV_CMD646 is not set CONFIG_BLK_DEV_CY82C693=y # CONFIG_BLK_DEV_HPT34X is not set @@ -113,8 +120,8 @@ CONFIG_BLK_DEV_CY82C693=y # CONFIG_BLK_DEV_NS87415 is not set # CONFIG_BLK_DEV_OPTI621 is not set CONFIG_BLK_DEV_PDC202XX=y -# PDC202XX_FORCE_BURST_BIT is not set -# PDC202XX_FORCE_MASTER_MODE is not set +# CONFIG_PDC202XX_FORCE_BURST_BIT is not set +# CONFIG_PDC202XX_FORCE_MASTER_MODE is not set # CONFIG_BLK_DEV_TRM290 is not set CONFIG_BLK_DEV_SL82C105=y CONFIG_BLK_DEV_IDEDMA=y @@ -135,6 +142,7 @@ CONFIG_MD_RAID5=m CONFIG_BLK_DEV_RAM=y # CONFIG_BLK_DEV_INITRD is not set # CONFIG_BLK_DEV_XD is not set +# CONFIG_BLK_DEV_DAC960 is not set CONFIG_PARIDE_PARPORT=y CONFIG_PARIDE=m @@ -176,7 +184,8 @@ CONFIG_SERIAL=y CONFIG_SERIAL_CONSOLE=y # CONFIG_SERIAL_EXTENDED is not set # CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_UNIX98_PTYS is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 CONFIG_PRINTER=m # CONFIG_LP_CONSOLE is not set # CONFIG_PPDEV is not set @@ -189,12 +198,17 @@ CONFIG_MOUSE=y CONFIG_PSMOUSE=y # CONFIG_82C710_MOUSE is not set # CONFIG_PC110_PAD is not set + +# +# Joysticks +# +# CONFIG_JOYSTICK is not set # CONFIG_QIC02_TAPE is not set -CONFIG_WATCHDOG=y # # Watchdog Cards # +CONFIG_WATCHDOG=y # CONFIG_WATCHDOG_NOWAYOUT is not set # CONFIG_WDT is not set CONFIG_SOFT_WATCHDOG=y @@ -212,12 +226,33 @@ CONFIG_RTC=y # # Video For Linux # -# CONFIG_VIDEO_DEV is not set - -# -# Joystick support -# -# CONFIG_JOYSTICK is not set +CONFIG_VIDEO_DEV=y +# CONFIG_I2C_PARPORT is not set + +# +# Radio/Video Adapters +# +# CONFIG_RADIO_CADET is not set +# CONFIG_RADIO_RTRACK is not set +# CONFIG_RADIO_RTRACK2 is not set +# CONFIG_RADIO_AZTECH is not set +# CONFIG_VIDEO_BT848 is not set +# CONFIG_RADIO_GEMTEK is not set +# CONFIG_VIDEO_PMS is not set +# CONFIG_RADIO_MIROPCM20 is not set +# CONFIG_VIDEO_BWQCAM is not set +# CONFIG_VIDEO_CQCAM is not set +# CONFIG_VIDEO_SAA5249 is not set +# CONFIG_RADIO_SF16FMI is not set +# CONFIG_VIDEO_STRADIS is not set +# CONFIG_RADIO_TERRATEC is not set +# CONFIG_RADIO_TRUST is not set +# CONFIG_RADIO_TYPHOON is not set +# CONFIG_RADIO_ZOLTRIX is not set +# CONFIG_VIDEO_ZORAN is not set +# CONFIG_VIDEO_BUZ is not set +# CONFIG_VIDEO_ZR36120 is not set +CONFIG_VIDEO_CYBERPRO=m # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -226,41 +261,70 @@ CONFIG_RTC=y # Ftape, the floppy tape device driver # # CONFIG_FTAPE is not set +# CONFIG_DRM is not set +# CONFIG_DRM_TDFX is not set + +# +# PCMCIA character device support +# +# CONFIG_PCMCIA_SERIAL_CS is not set +# CONFIG_AGP is not set # -# USB drivers - not for the faint of heart +# Support for USB # CONFIG_USB=m + +# +# USB Controllers +# # CONFIG_USB_UHCI is not set CONFIG_USB_OHCI=m CONFIG_USB_OHCI_DEBUG=y CONFIG_USB_OHCI_HCD=m CONFIG_USB_OHCI_VROOTHUB=y + +# +# Miscellaneous USB options +# # CONFIG_USB_DEBUG_ISOC is not set -CONFIG_USB_HUB=m +CONFIG_USB_PROC=y +# CONFIG_USB_EZUSB is not set + +# +# USB Devices +# CONFIG_USB_MOUSE=m +# CONFIG_USB_HP_SCANNER is not set CONFIG_USB_KBD=m CONFIG_USB_AUDIO=m CONFIG_USB_ACM=m CONFIG_USB_PRINTER=m +# CONFIG_USB_SERIAL is not set # CONFIG_USB_CPIA is not set -CONFIG_USB_SCSI=m -CONFIG_USB_SCSI_DEBUG=m -# CONFIG_USB_EZUSB is not set +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_SCSI is not set # CONFIG_USB_USS720 is not set -CONFIG_USB_PROC=y # # Console drivers # CONFIG_VGA_CONSOLE=y CONFIG_FB=y + +# +# Frame-buffer support +# +CONFIG_FB=y CONFIG_DUMMY_CONSOLE=y +# CONFIG_FB_RIVA is not set # CONFIG_FB_CLGEN is not set # CONFIG_FB_PM2 is not set CONFIG_FB_CYBER2000=y # CONFIG_FB_MATROX is not set # CONFIG_FB_ATY is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_3DFX is not set # CONFIG_FB_VIRTUAL is not set CONFIG_FBCON_ADVANCED=y # CONFIG_FBCON_MFB is not set @@ -377,12 +441,13 @@ CONFIG_VORTEX=y # CONFIG_NET_VENDOR_SMC is not set # CONFIG_NET_VENDOR_RACAL is not set # CONFIG_RTL8139 is not set -# CONFIG_SIS900 is not set -# CONFIG_YELLOWFIN is not set +# CONFIG_DM9102 is not set +# CONFIG_AT1700 is not set +# CONFIG_DEPCA is not set # CONFIG_NET_ISA is not set CONFIG_NET_EISA=y # CONFIG_PCNET32 is not set -# CONFIG_ACENIC is not set +# CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_AC3200 is not set # CONFIG_APRICOT is not set # CONFIG_CS89x0 is not set @@ -393,27 +458,40 @@ CONFIG_DEC_ELCP=m # CONFIG_LNE390 is not set # CONFIG_NE3210 is not set CONFIG_NE2K_PCI=y +# CONFIG_SIS900 is not set # CONFIG_TLAN is not set # CONFIG_VIA_RHINE is not set # CONFIG_ES3210 is not set # CONFIG_EPIC100 is not set # CONFIG_ZNET is not set # CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_YELLOWFIN is not set +# CONFIG_ACENIC is not set +# CONFIG_SK98LIN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_PLIP is not set CONFIG_PPP=m CONFIG_PPP_ASYNC=m +# CONFIG_PPP_SYNC_TTY is not set CONFIG_PPP_DEFLATE=m CONFIG_PPP_BSDCOMP=m CONFIG_SLIP=m CONFIG_SLIP_COMPRESSED=y CONFIG_SLIP_SMART=y CONFIG_SLIP_MODE_SLIP6=y + +# +# Wireless LAN (non-hamradio) +# # CONFIG_NET_RADIO is not set # -# Token ring devices +# Token Ring driver support # # CONFIG_TR is not set # CONFIG_NET_FC is not set @@ -423,10 +501,12 @@ CONFIG_SLIP_MODE_SLIP6=y # # Wan interfaces # -# CONFIG_HOSTESS_SV11 is not set -# CONFIG_COSA is not set -# CONFIG_SEALEVEL_4021 is not set -# CONFIG_DLCI is not set +# CONFIG_WAN is not set + +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set # # SCSI support @@ -441,30 +521,33 @@ CONFIG_SOUND=m # CONFIG_SOUND_ES1370 is not set # CONFIG_SOUND_ES1371 is not set # 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_OSS=m -# CONFIG_SOUND_PAS is not set -CONFIG_SOUND_SB=m -CONFIG_SOUND_ADLIB=m -# CONFIG_SOUND_GUS is not set -# CONFIG_SOUND_MPU401 is not set -# CONFIG_SOUND_PSS is not set -# CONFIG_SOUND_MSS is not set +# CONFIG_SOUND_AD1816 is not set +# CONFIG_SOUND_SGALAXY is not set +# CONFIG_SOUND_CS4232 is not set # CONFIG_SOUND_SSCAPE is not set +# CONFIG_SOUND_GUS is not set +# CONFIG_SOUND_VMIDI is not set # CONFIG_SOUND_TRIX is not set +# CONFIG_SOUND_MSS is not set +# CONFIG_SOUND_MPU401 is not set +# CONFIG_SOUND_NM256 is not set # CONFIG_SOUND_MAD16 is not set +# CONFIG_SOUND_PAS is not set +# CONFIG_SOUND_PSS is not set +# CONFIG_SOUND_SOFTOSS is not set +CONFIG_SOUND_SB=m # CONFIG_SOUND_WAVEFRONT is not set -# CONFIG_SOUND_CS4232 is not set -# CONFIG_SOUND_OPL3SA2 is not set # CONFIG_SOUND_MAUI is not set -# CONFIG_SOUND_SGALAXY is not set -# CONFIG_SOUND_AD1816 is not set -# CONFIG_SOUND_OPL3SA1 is not set -# CONFIG_SOUND_SOFTOSS is not set +# CONFIG_SOUND_VIA82CXXX is not set # CONFIG_SOUND_YM3812 is not set -# CONFIG_SOUND_VMIDI is not set +# CONFIG_SOUND_OPL3SA1 is not set +# CONFIG_SOUND_OPL3SA2 is not set # CONFIG_SOUND_UART6850 is not set # CONFIG_SOUND_VIDC is not set CONFIG_SOUND_WAVEARTIST=m @@ -482,10 +565,11 @@ CONFIG_WAVEARTIST_DMA2=7 # Filesystems # # CONFIG_QUOTA is not set -# CONFIG_AUTOFS_FS is not set +CONFIG_AUTOFS_FS=y CONFIG_ADFS_FS=y # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m # CONFIG_UMSDOS_FS is not set @@ -497,10 +581,12 @@ CONFIG_JOLIET=y # CONFIG_NTFS_FS is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y +CONFIG_DEVPTS_FS=y # CONFIG_QNX4FS_FS is not set # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set # CONFIG_UFS_FS is not set # @@ -510,7 +596,7 @@ CONFIG_EXT2_FS=y CONFIG_NFS_FS=y CONFIG_ROOT_NFS=y CONFIG_NFSD=m -# CONFIG_NFSD_SUN is not set +# CONFIG_NFSD_V3 is not set CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_SMB_FS is not set diff --git a/arch/arm/def-configs/rpc b/arch/arm/def-configs/rpc index 904bb0724433..a22e1d992585 100644 --- a/arch/arm/def-configs/rpc +++ b/arch/arm/def-configs/rpc @@ -3,6 +3,11 @@ # CONFIG_ARM=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + # # System and processor type # @@ -12,21 +17,14 @@ CONFIG_ARCH_RPC=y # CONFIG_ARCH_EBSA110 is not set # CONFIG_FOOTBRIDGE is not set CONFIG_ARCH_ACORN=y -# CONFIG_ISA_DMA is not set CONFIG_CPU_32=y # CONFIG_CPU_26 is not set -# CONFIG_CPU_ARM2 is not set -# CONFIG_CPU_ARM3 is not set -# CONFIG_CPU_ARM6 is not set -# CONFIG_CPU_ARM7 is not set +CONFIG_CPU_32v3=y +CONFIG_CPU_ARM6=y +CONFIG_CPU_ARM7=y CONFIG_CPU_SA110=y - -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y +# CONFIG_ISA_DMA is not set # CONFIG_ALIGNMENT_TRAP is not set -# CONFIG_TEXT_SECTIONS is not set # # Loadable module support @@ -43,16 +41,39 @@ CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # CONFIG_NWFPE is not set +CONFIG_KCORE_ELF=y +# CONFIG_KCORE_AOUT is not set CONFIG_BINFMT_AOUT=y CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set +# CONFIG_ARTHUR is not set CONFIG_PARPORT=y CONFIG_PARPORT_PC=y +# CONFIG_PARPORT_PC_FIFO is not set +# CONFIG_PARPORT_PC_PCMCIA is not set +# CONFIG_PARPORT_ARC is not set +# CONFIG_PARPORT_AMIGA is not set +# CONFIG_PARPORT_MFC3 is not set +# CONFIG_PARPORT_ATARI is not set +# CONFIG_PARPORT_SUNBPP is not set +# CONFIG_PARPORT_OTHER is not set +# CONFIG_PARPORT_1284 is not set # -# Plug and Play support +# 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 + +# +# Plug and Play configuration # # CONFIG_PNP is not set +# CONFIG_ISAPNP is not set # # Block devices @@ -65,11 +86,22 @@ CONFIG_BLK_DEV_IDE=y # # CONFIG_BLK_DEV_HD_IDE is not set CONFIG_BLK_DEV_IDEDISK=y +CONFIG_IDEDISK_MULTI_MODE=y CONFIG_BLK_DEV_IDECD=y -CONFIG_BLK_DEV_IDETAPE=y -CONFIG_BLK_DEV_IDEFLOPPY=y +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# # CONFIG_BLK_DEV_CMD640 is not set +CONFIG_BLK_DEV_IDE_ICSIDE=y +CONFIG_BLK_DEV_IDEDMA_ICS=y +CONFIG_IDEDMA_ICS_AUTO=y +CONFIG_BLK_DEV_IDE_RAPIDE=y +CONFIG_BLK_DEV_IDEDMA=y +CONFIG_IDEDMA_AUTO=y # CONFIG_IDE_CHIPSETS is not set # @@ -83,14 +115,12 @@ CONFIG_BLK_DEV_INITRD=y # CONFIG_BLK_DEV_XD is not set CONFIG_PARIDE_PARPORT=y # CONFIG_PARIDE is not set +# CONFIG_BLK_DEV_IDE_MODES is not set # CONFIG_BLK_DEV_HD is not set # # Acorn-specific block devices # -CONFIG_BLK_DEV_IDE_CARDS=y -CONFIG_BLK_DEV_IDE_ICSIDE=y -CONFIG_BLK_DEV_IDE_RAPIDE=y # # Character devices @@ -99,25 +129,36 @@ CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_SERIAL=y # CONFIG_SERIAL_CONSOLE is not set -# CONFIG_SERIAL_EXTENDED is not set CONFIG_ATOMWIDE_SERIAL=y CONFIG_DUALSP_SERIAL=y +# CONFIG_SERIAL_EXTENDED is not set # CONFIG_SERIAL_NONSTANDARD is not set # CONFIG_UNIX98_PTYS is not set CONFIG_PRINTER=m -CONFIG_PRINTER_READBACK=y -CONFIG_MOUSE=y +# CONFIG_LP_CONSOLE is not set +# CONFIG_PPDEV is not set # # Mice # +CONFIG_BUSMOUSE=y # CONFIG_ATIXL_BUSMOUSE is not set -# CONFIG_BUSMOUSE is not set +# CONFIG_LOGIBUSMOUSE is not set # CONFIG_MS_BUSMOUSE is not set +CONFIG_MOUSE=y # CONFIG_PSMOUSE is not set # CONFIG_82C710_MOUSE is not set # CONFIG_PC110_PAD is not set + +# +# Joysticks +# +# CONFIG_JOYSTICK is not set # CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# # CONFIG_WATCHDOG is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set @@ -126,27 +167,44 @@ CONFIG_MOUSE=y # Video For Linux # # CONFIG_VIDEO_DEV is not set - -# -# Joystick support -# -# CONFIG_JOYSTICK is not set # CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # # CONFIG_FTAPE is not set +# CONFIG_DRM is not set +# CONFIG_DRM_TDFX is not set + +# +# PCMCIA character device support +# +# CONFIG_PCMCIA_SERIAL_CS is not set +# CONFIG_AGP is not set CONFIG_RPCMOUSE=y +# +# Support for USB +# +# CONFIG_USB is not set + # # Console drivers # CONFIG_FB=y + +# +# Frame-buffer support +# +CONFIG_FB=y CONFIG_DUMMY_CONSOLE=y CONFIG_FB_ACORN=y # CONFIG_FB_MATROX is not set # CONFIG_FB_ATY is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_3DFX is not set # CONFIG_FB_VIRTUAL is not set CONFIG_FBCON_ADVANCED=y CONFIG_FBCON_MFB=y @@ -162,6 +220,7 @@ CONFIG_FBCON_CFB32=y # CONFIG_FBCON_IPLAN2P4 is not set # CONFIG_FBCON_IPLAN2P8 is not set # CONFIG_FBCON_MAC is not set +# CONFIG_FBCON_VGA_PLANES is not set # CONFIG_FBCON_VGA is not set # CONFIG_FBCON_FONTWIDTH8_ONLY is not set CONFIG_FBCON_FONTS=y @@ -178,7 +237,7 @@ CONFIG_FONT_ACORN_8x8=y # # CONFIG_PACKET is not set # CONFIG_NETLINK is not set -# CONFIG_FIREWALL is not set +# CONFIG_NETFILTER is not set # CONFIG_FILTER is not set CONFIG_UNIX=y CONFIG_INET=y @@ -194,15 +253,17 @@ CONFIG_INET=y # # (it is safe to leave these untouched) # -# CONFIG_INET_RARP is not set CONFIG_SKB_LARGE=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_X25 is not set # CONFIG_LAPB is not set # CONFIG_BRIDGE is not set @@ -211,7 +272,6 @@ CONFIG_SKB_LARGE=y # CONFIG_WAN_ROUTER is not set # CONFIG_NET_FASTROUTE is not set # CONFIG_NET_HW_FLOWCONTROL is not set -# CONFIG_CPU_IS_SLOW is not set # # QoS and/or fair queueing @@ -224,7 +284,7 @@ CONFIG_SKB_LARGE=y # CONFIG_HAMRADIO is not set # -# IrDA subsystem support +# IrDA (infrared) support # # CONFIG_IRDA is not set @@ -232,39 +292,72 @@ CONFIG_SKB_LARGE=y # Network device support # CONFIG_NETDEVICES=y + +# +# ARCnet devices +# # CONFIG_ARCNET is not set # CONFIG_DUMMY is not set # CONFIG_EQUALIZER is not set +# CONFIG_NET_SB1000 is not set + +# +# Ethernet (10 or 100Mbit) +# CONFIG_NET_ETHERNET=y CONFIG_ARM_ETHER1=m CONFIG_ARM_ETHER3=m -CONFIG_ARM_ETHERH=m +CONFIG_ARM_ETHERH=y # CONFIG_NET_VENDOR_3COM is not set # CONFIG_LANCE is not set # CONFIG_NET_VENDOR_SMC is not set # CONFIG_NET_VENDOR_RACAL is not set # CONFIG_RTL8139 is not set -# CONFIG_YELLOWFIN is not set -# CONFIG_ACENIC is not set +# CONFIG_DM9102 is not set +# CONFIG_AT1700 is not set +# CONFIG_DEPCA is not set # CONFIG_NET_ISA is not set # CONFIG_NET_EISA is not set # CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_YELLOWFIN is not set +# CONFIG_ACENIC is not set +# CONFIG_SK98LIN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set -# CONFIG_DLCI is not set # CONFIG_PLIP is not set CONFIG_PPP=m +# CONFIG_PPP_ASYNC is not set +# CONFIG_PPP_SYNC_TTY is not set +# CONFIG_PPP_DEFLATE is not set +# CONFIG_PPP_BSDCOMP is not set +# CONFIG_SLIP is not set # -# CCP compressors for PPP are only built as modules. +# Wireless LAN (non-hamradio) # -# CONFIG_SLIP is not set # CONFIG_NET_RADIO is not set + +# +# Token Ring driver support +# # CONFIG_TR is not set -# CONFIG_SHAPER is not set -# CONFIG_HOSTESS_SV11 is not set -# CONFIG_COSA is not set +# CONFIG_NET_FC is not set # CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set # # SCSI support @@ -283,6 +376,7 @@ CONFIG_CHR_DEV_SG=y # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # +CONFIG_SCSI_DEBUG_QUEUES=y # CONFIG_SCSI_MULTI_LUN is not set CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_LOGGING=y @@ -296,6 +390,7 @@ CONFIG_SCSI_LOGGING=y # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1740 is not set # CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_IPS is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_IN2000 is not set # CONFIG_SCSI_AM53C974 is not set @@ -314,6 +409,7 @@ CONFIG_SCSI_IMM=m # CONFIG_SCSI_IZIP_SLOW_CTR is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_SIM710 is not set # CONFIG_SCSI_PAS16 is not set # CONFIG_SCSI_PCI2000 is not set # CONFIG_SCSI_PCI2220I is not set @@ -342,32 +438,37 @@ CONFIG_SCSI_OAK1=m # Sound # CONFIG_SOUND=m +# CONFIG_SOUND_CMPCI is not set # CONFIG_SOUND_ES1370 is not set # CONFIG_SOUND_ES1371 is not set +# 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_OSS=m -# CONFIG_SOUND_PAS is not set -# CONFIG_SOUND_SB is not set -# CONFIG_SOUND_ADLIB is not set -# CONFIG_SOUND_GUS is not set -# CONFIG_SOUND_MPU401 is not set -# CONFIG_SOUND_PSS is not set -# CONFIG_SOUND_MSS is not set +# CONFIG_SOUND_AD1816 is not set +# CONFIG_SOUND_SGALAXY is not set +# CONFIG_SOUND_CS4232 is not set # CONFIG_SOUND_SSCAPE is not set +# CONFIG_SOUND_GUS is not set +# CONFIG_SOUND_VMIDI is not set # CONFIG_SOUND_TRIX is not set +# CONFIG_SOUND_MSS is not set +# CONFIG_SOUND_MPU401 is not set +# CONFIG_SOUND_NM256 is not set # CONFIG_SOUND_MAD16 is not set +# CONFIG_SOUND_PAS is not set +# CONFIG_SOUND_PSS is not set +# CONFIG_SOUND_SOFTOSS is not set +# CONFIG_SOUND_SB is not set # CONFIG_SOUND_WAVEFRONT is not set -# CONFIG_SOUND_CS4232 is not set -# CONFIG_SOUND_OPL3SA2 is not set # CONFIG_SOUND_MAUI is not set -# CONFIG_SOUND_SGALAXY is not set -# CONFIG_SOUND_AD1816 is not set -# CONFIG_SOUND_OPL3SA1 is not set -# CONFIG_SOUND_SOFTOSS is not set +# CONFIG_SOUND_VIA82CXXX is not set # CONFIG_SOUND_YM3812 is not set -# CONFIG_SOUND_VMIDI is not set +# CONFIG_SOUND_OPL3SA1 is not set +# CONFIG_SOUND_OPL3SA2 is not set # CONFIG_SOUND_UART6850 is not set CONFIG_SOUND_VIDC=m # CONFIG_SOUND_WAVEARTIST is not set @@ -385,10 +486,12 @@ CONFIG_SOUND_VIDC=m CONFIG_ADFS_FS=y # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set -CONFIG_FAT_FS=y -CONFIG_MSDOS_FS=y +# CONFIG_BFS_FS is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set # CONFIG_UMSDOS_FS is not set -CONFIG_VFAT_FS=y +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set CONFIG_ISO9660_FS=y CONFIG_JOLIET=y # CONFIG_MINIX_FS is not set @@ -399,6 +502,7 @@ CONFIG_PROC_FS=y # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set # CONFIG_UFS_FS is not set # @@ -415,12 +519,17 @@ CONFIG_LOCKD=y # # Partition Types # -# CONFIG_OSF_PARTITION is not set -# CONFIG_MAC_PARTITION is not set +CONFIG_PARTITION_ADVANCED=y +CONFIG_OSF_PARTITION=y +CONFIG_MAC_PARTITION=y CONFIG_MSDOS_PARTITION=y -# CONFIG_SGI_PARTITION is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set +CONFIG_BSD_DISKLABEL=y +CONFIG_SOLARIS_X86_PARTITION=y +# CONFIG_UNIXWARE_DISKLABEL is not set +CONFIG_SGI_PARTITION=y +CONFIG_SUN_PARTITION=y +CONFIG_AMIGA_PARTITION=y +# CONFIG_ATARI_PARTITION is not set CONFIG_ACORN_PARTITION=y CONFIG_ACORN_PARTITION_ADFS=y CONFIG_ACORN_PARTITION_ICS=y @@ -456,6 +565,7 @@ CONFIG_NLS_ISO8859_6=m CONFIG_NLS_ISO8859_7=m CONFIG_NLS_ISO8859_8=m CONFIG_NLS_ISO8859_9=m +# CONFIG_NLS_ISO8859_14 is not set # CONFIG_NLS_ISO8859_15 is not set CONFIG_NLS_KOI8_R=m @@ -467,5 +577,4 @@ CONFIG_DEBUG_ERRORS=y # CONFIG_DEBUG_USER is not set # CONFIG_DEBUG_INFO is not set CONFIG_MAGIC_SYSRQ=y -# CONFIG_ARTHUR is not set -# CONFIG_DEBUG_LL is not set +CONFIG_DEBUG_LL=y diff --git a/arch/arm/defconfig b/arch/arm/defconfig index 2aba351c25dc..e43a8d2a9a42 100644 --- a/arch/arm/defconfig +++ b/arch/arm/defconfig @@ -3,6 +3,11 @@ # CONFIG_ARM=y +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + # # System and processor type # @@ -17,23 +22,13 @@ CONFIG_ARCH_EBSA285=y # CONFIG_CATS is not set CONFIG_ARCH_NETWINDER=y # CONFIG_ARCH_ACORN is not set -CONFIG_PCI=y -CONFIG_PCI_NAMES=y -CONFIG_ISA_DMA=y CONFIG_CPU_32=y # CONFIG_CPU_26 is not set -# CONFIG_CPU_ARM2 is not set -# CONFIG_CPU_ARM3 is not set -# CONFIG_CPU_ARM6 is not set -# CONFIG_CPU_ARM7 is not set +CONFIG_CPU_32v4=y CONFIG_CPU_SA110=y - -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y +CONFIG_PCI=y +CONFIG_ISA_DMA=y # CONFIG_ALIGNMENT_TRAP is not set -# CONFIG_TEXT_SECTIONS is not set # # Loadable module support @@ -58,15 +53,35 @@ CONFIG_BINFMT_ELF=y # CONFIG_ARTHUR is not set CONFIG_PARPORT=y CONFIG_PARPORT_PC=y +CONFIG_PARPORT_PC_FIFO=y +# CONFIG_PARPORT_PC_PCMCIA is not set +# CONFIG_PARPORT_ARC is not set +# CONFIG_PARPORT_AMIGA is not set +# CONFIG_PARPORT_MFC3 is not set +# CONFIG_PARPORT_ATARI is not set +# CONFIG_PARPORT_SUNBPP is not set +# CONFIG_PARPORT_OTHER is not set +CONFIG_PARPORT_1284=y CONFIG_CMDLINE="root=/dev/hda1 ro mem=32M parport=0x378,7 ide0=autotune" CONFIG_LEDS=y CONFIG_LEDS_TIMER=y # CONFIG_LEDS_CPU is not set # -# Plug and Play support +# I2O device support # -# CONFIG_PNP is not set +# 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 + +# +# Plug and Play configuration +# +CONFIG_PNP=y +CONFIG_ISAPNP=y # # Block devices @@ -79,23 +94,40 @@ CONFIG_BLK_DEV_IDE=y # # CONFIG_BLK_DEV_HD_IDE is not set CONFIG_BLK_DEV_IDEDISK=y +CONFIG_IDEDISK_MULTI_MODE=y # CONFIG_BLK_DEV_IDECD is not set # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set + +# +# IDE chipset support/bugfixes +# # CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_RZ1000 is not set CONFIG_BLK_DEV_IDEPCI=y -CONFIG_BLK_DEV_IDEDMA=y -CONFIG_BLK_DEV_OFFBOARD=y +CONFIG_BLK_DEV_IDEDMA_PCI=y CONFIG_IDEDMA_PCI_AUTO=y +CONFIG_IDEDMA_NEW_DRIVE_LISTINGS=y +CONFIG_IDEDMA_PCI_EXPERIMENTAL=y +CONFIG_BLK_DEV_OFFBOARD=y +# CONFIG_BLK_DEV_AEC6210 is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_BLK_DEV_CMD646 is not set +CONFIG_BLK_DEV_CY82C693=y +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_NS87415 is not set # CONFIG_BLK_DEV_OPTI621 is not set +CONFIG_BLK_DEV_PDC202XX=y +# CONFIG_PDC202XX_FORCE_BURST_BIT is not set +# CONFIG_PDC202XX_FORCE_MASTER_MODE is not set # CONFIG_BLK_DEV_TRM290 is not set -# CONFIG_BLK_DEV_NS87415 is not set -# CONFIG_BLK_DEV_VIA82C586 is not set -# CONFIG_BLK_DEV_CMD646 is not set CONFIG_BLK_DEV_SL82C105=y +CONFIG_BLK_DEV_IDEDMA=y +CONFIG_IDEDMA_AUTO=y # CONFIG_IDE_CHIPSETS is not set +# CONFIG_BLK_CPQ_DA is not set # # Additional Block Devices @@ -110,6 +142,7 @@ CONFIG_MD_RAID5=m CONFIG_BLK_DEV_RAM=y # CONFIG_BLK_DEV_INITRD is not set # CONFIG_BLK_DEV_XD is not set +# CONFIG_BLK_DEV_DAC960 is not set CONFIG_PARIDE_PARPORT=y CONFIG_PARIDE=m @@ -139,6 +172,7 @@ CONFIG_PARIDE_KBIC=m CONFIG_PARIDE_KTTI=m CONFIG_PARIDE_ON20=m CONFIG_PARIDE_ON26=m +CONFIG_BLK_DEV_IDE_MODES=y # CONFIG_BLK_DEV_HD is not set # @@ -150,31 +184,38 @@ CONFIG_SERIAL=y CONFIG_SERIAL_CONSOLE=y # CONFIG_SERIAL_EXTENDED is not set # CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_UNIX98_PTYS is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 CONFIG_PRINTER=m -CONFIG_PRINTER_READBACK=y -CONFIG_MOUSE=y +# CONFIG_LP_CONSOLE is not set +# CONFIG_PPDEV is not set # # Mice # -# CONFIG_ATIXL_BUSMOUSE is not set # CONFIG_BUSMOUSE is not set -# CONFIG_MS_BUSMOUSE is not set +CONFIG_MOUSE=y CONFIG_PSMOUSE=y # CONFIG_82C710_MOUSE is not set # CONFIG_PC110_PAD is not set + +# +# Joysticks +# +# CONFIG_JOYSTICK is not set # CONFIG_QIC02_TAPE is not set -CONFIG_WATCHDOG=y # # Watchdog Cards # +CONFIG_WATCHDOG=y # CONFIG_WATCHDOG_NOWAYOUT is not set # CONFIG_WDT is not set CONFIG_SOFT_WATCHDOG=y # CONFIG_PCWATCHDOG is not set # CONFIG_ACQUIRE_WDT is not set +# CONFIG_21285_WATCHDOG is not set +CONFIG_977_WATCHDOG=m CONFIG_DS1620=y CONFIG_NWBUTTON=y CONFIG_NWBUTTON_REBOOT=y @@ -185,29 +226,105 @@ CONFIG_RTC=y # # Video For Linux # -# CONFIG_VIDEO_DEV is not set - -# -# Joystick support -# -# CONFIG_JOYSTICK is not set +CONFIG_VIDEO_DEV=y +# CONFIG_I2C_PARPORT is not set + +# +# Radio/Video Adapters +# +# CONFIG_RADIO_CADET is not set +# CONFIG_RADIO_RTRACK is not set +# CONFIG_RADIO_RTRACK2 is not set +# CONFIG_RADIO_AZTECH is not set +# CONFIG_VIDEO_BT848 is not set +# CONFIG_RADIO_GEMTEK is not set +# CONFIG_VIDEO_PMS is not set +# CONFIG_RADIO_MIROPCM20 is not set +# CONFIG_VIDEO_BWQCAM is not set +# CONFIG_VIDEO_CQCAM is not set +# CONFIG_VIDEO_SAA5249 is not set +# CONFIG_RADIO_SF16FMI is not set +# CONFIG_VIDEO_STRADIS is not set +# CONFIG_RADIO_TERRATEC is not set +# CONFIG_RADIO_TRUST is not set +# CONFIG_RADIO_TYPHOON is not set +# CONFIG_RADIO_ZOLTRIX is not set +# CONFIG_VIDEO_ZORAN is not set +# CONFIG_VIDEO_BUZ is not set +# CONFIG_VIDEO_ZR36120 is not set +CONFIG_VIDEO_CYBERPRO=m # CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # # CONFIG_FTAPE is not set +# CONFIG_DRM is not set +# CONFIG_DRM_TDFX is not set + +# +# PCMCIA character device support +# +# CONFIG_PCMCIA_SERIAL_CS is not set +# CONFIG_AGP is not set + +# +# Support for USB +# +CONFIG_USB=m + +# +# USB Controllers +# +# CONFIG_USB_UHCI is not set +CONFIG_USB_OHCI=m +CONFIG_USB_OHCI_DEBUG=y +CONFIG_USB_OHCI_HCD=m +CONFIG_USB_OHCI_VROOTHUB=y + +# +# Miscellaneous USB options +# +# CONFIG_USB_DEBUG_ISOC is not set +CONFIG_USB_PROC=y +# CONFIG_USB_EZUSB is not set + +# +# USB Devices +# +CONFIG_USB_MOUSE=m +# CONFIG_USB_HP_SCANNER is not set +CONFIG_USB_KBD=m +CONFIG_USB_AUDIO=m +CONFIG_USB_ACM=m +CONFIG_USB_PRINTER=m +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_CPIA is not set +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_SCSI is not set +# CONFIG_USB_USS720 is not set # # Console drivers # CONFIG_VGA_CONSOLE=y CONFIG_FB=y + +# +# Frame-buffer support +# +CONFIG_FB=y CONFIG_DUMMY_CONSOLE=y +# CONFIG_FB_RIVA is not set +# CONFIG_FB_CLGEN is not set # CONFIG_FB_PM2 is not set CONFIG_FB_CYBER2000=y # CONFIG_FB_MATROX is not set # CONFIG_FB_ATY is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_3DFX is not set # CONFIG_FB_VIRTUAL is not set CONFIG_FBCON_ADVANCED=y # CONFIG_FBCON_MFB is not set @@ -223,6 +340,7 @@ CONFIG_FBCON_CFB24=y # CONFIG_FBCON_IPLAN2P4 is not set # CONFIG_FBCON_IPLAN2P8 is not set # CONFIG_FBCON_MAC is not set +# CONFIG_FBCON_VGA_PLANES is not set CONFIG_FBCON_VGA=y # CONFIG_FBCON_FONTWIDTH8_ONLY is not set CONFIG_FBCON_FONTS=y @@ -238,8 +356,9 @@ CONFIG_FONT_ACORN_8x8=y # Networking options # CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set # CONFIG_NETLINK is not set -# CONFIG_FIREWALL is not set +# CONFIG_NETFILTER is not set # CONFIG_FILTER is not set CONFIG_UNIX=y CONFIG_INET=y @@ -257,15 +376,17 @@ CONFIG_IP_ALIAS=y # # (it is safe to leave these untouched) # -# CONFIG_INET_RARP is not set CONFIG_SKB_LARGE=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_X25 is not set # CONFIG_LAPB is not set # CONFIG_BRIDGE is not set @@ -274,7 +395,6 @@ CONFIG_SKB_LARGE=y # CONFIG_WAN_ROUTER is not set # CONFIG_NET_FASTROUTE is not set # CONFIG_NET_HW_FLOWCONTROL is not set -# CONFIG_CPU_IS_SLOW is not set # # QoS and/or fair queueing @@ -287,7 +407,7 @@ CONFIG_SKB_LARGE=y # CONFIG_HAMRADIO is not set # -# IrDA subsystem support +# IrDA (infrared) support # # CONFIG_IRDA is not set @@ -295,9 +415,18 @@ CONFIG_SKB_LARGE=y # Network device support # CONFIG_NETDEVICES=y + +# +# ARCnet devices +# # CONFIG_ARCNET is not set # CONFIG_DUMMY is not set # CONFIG_EQUALIZER is not set +# CONFIG_NET_SB1000 is not set + +# +# Ethernet (10 or 100Mbit) +# CONFIG_NET_ETHERNET=y # CONFIG_ARM_AM79C961A is not set CONFIG_NET_VENDOR_3COM=y @@ -312,11 +441,13 @@ CONFIG_VORTEX=y # CONFIG_NET_VENDOR_SMC is not set # CONFIG_NET_VENDOR_RACAL is not set # CONFIG_RTL8139 is not set -# CONFIG_YELLOWFIN is not set -# CONFIG_ACENIC is not set +# CONFIG_DM9102 is not set +# CONFIG_AT1700 is not set +# CONFIG_DEPCA is not set # CONFIG_NET_ISA is not set CONFIG_NET_EISA=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 @@ -327,31 +458,55 @@ CONFIG_DEC_ELCP=m # CONFIG_LNE390 is not set # CONFIG_NE3210 is not set CONFIG_NE2K_PCI=y +# CONFIG_SIS900 is not set # CONFIG_TLAN is not set # CONFIG_VIA_RHINE is not set # CONFIG_ES3210 is not set # CONFIG_EPIC100 is not set # CONFIG_ZNET is not set # CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_YELLOWFIN is not set +# CONFIG_ACENIC is not set +# CONFIG_SK98LIN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set -# CONFIG_DLCI is not set # CONFIG_PLIP is not set CONFIG_PPP=m - -# -# CCP compressors for PPP are only built as modules. -# +CONFIG_PPP_ASYNC=m +# CONFIG_PPP_SYNC_TTY is not set +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_BSDCOMP=m CONFIG_SLIP=m CONFIG_SLIP_COMPRESSED=y CONFIG_SLIP_SMART=y CONFIG_SLIP_MODE_SLIP6=y + +# +# Wireless LAN (non-hamradio) +# # CONFIG_NET_RADIO is not set + +# +# Token Ring driver support +# # CONFIG_TR is not set -# CONFIG_SHAPER is not set -# CONFIG_HOSTESS_SV11 is not set -# CONFIG_COSA is not set +# CONFIG_NET_FC is not set # CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set # # SCSI support @@ -362,32 +517,37 @@ CONFIG_SLIP_MODE_SLIP6=y # Sound # CONFIG_SOUND=m +# CONFIG_SOUND_CMPCI is not set # CONFIG_SOUND_ES1370 is not set # CONFIG_SOUND_ES1371 is not set +# 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_OSS=m -# CONFIG_SOUND_PAS is not set -CONFIG_SOUND_SB=m -CONFIG_SOUND_ADLIB=m -# CONFIG_SOUND_GUS is not set -# CONFIG_SOUND_MPU401 is not set -# CONFIG_SOUND_PSS is not set -# CONFIG_SOUND_MSS is not set +# CONFIG_SOUND_AD1816 is not set +# CONFIG_SOUND_SGALAXY is not set +# CONFIG_SOUND_CS4232 is not set # CONFIG_SOUND_SSCAPE is not set +# CONFIG_SOUND_GUS is not set +# CONFIG_SOUND_VMIDI is not set # CONFIG_SOUND_TRIX is not set +# CONFIG_SOUND_MSS is not set +# CONFIG_SOUND_MPU401 is not set +# CONFIG_SOUND_NM256 is not set # CONFIG_SOUND_MAD16 is not set +# CONFIG_SOUND_PAS is not set +# CONFIG_SOUND_PSS is not set +# CONFIG_SOUND_SOFTOSS is not set +CONFIG_SOUND_SB=m # CONFIG_SOUND_WAVEFRONT is not set -# CONFIG_SOUND_CS4232 is not set -# CONFIG_SOUND_OPL3SA2 is not set # CONFIG_SOUND_MAUI is not set -# CONFIG_SOUND_SGALAXY is not set -# CONFIG_SOUND_AD1816 is not set -# CONFIG_SOUND_OPL3SA1 is not set -# CONFIG_SOUND_SOFTOSS is not set +# CONFIG_SOUND_VIA82CXXX is not set # CONFIG_SOUND_YM3812 is not set -# CONFIG_SOUND_VMIDI is not set +# CONFIG_SOUND_OPL3SA1 is not set +# CONFIG_SOUND_OPL3SA2 is not set # CONFIG_SOUND_UART6850 is not set # CONFIG_SOUND_VIDC is not set CONFIG_SOUND_WAVEARTIST=m @@ -405,24 +565,28 @@ CONFIG_WAVEARTIST_DMA2=7 # Filesystems # # CONFIG_QUOTA is not set -# CONFIG_AUTOFS_FS is not set +CONFIG_AUTOFS_FS=y CONFIG_ADFS_FS=y # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m # CONFIG_UMSDOS_FS is not set CONFIG_VFAT_FS=m +# CONFIG_EFS_FS is not set CONFIG_ISO9660_FS=m CONFIG_JOLIET=y # CONFIG_MINIX_FS is not set # CONFIG_NTFS_FS is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y +CONFIG_DEVPTS_FS=y # CONFIG_QNX4FS_FS is not set # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set # CONFIG_UFS_FS is not set # @@ -432,7 +596,7 @@ CONFIG_EXT2_FS=y CONFIG_NFS_FS=y CONFIG_ROOT_NFS=y CONFIG_NFSD=m -# CONFIG_NFSD_SUN is not set +# CONFIG_NFSD_V3 is not set CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_SMB_FS is not set @@ -441,12 +605,17 @@ CONFIG_LOCKD=y # # Partition Types # +CONFIG_PARTITION_ADVANCED=y # CONFIG_OSF_PARTITION is not set # CONFIG_MAC_PARTITION is not set CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set # CONFIG_SGI_PARTITION is not set # CONFIG_SUN_PARTITION is not set # CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set CONFIG_ACORN_PARTITION=y CONFIG_ACORN_PARTITION_ADFS=y # CONFIG_ACORN_PARTITION_ICS is not set @@ -482,6 +651,7 @@ CONFIG_NLS_ISO8859_2=m # 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=m # CONFIG_NLS_KOI8_R is not set @@ -490,7 +660,7 @@ CONFIG_NLS_ISO8859_15=m # CONFIG_FRAME_POINTER=y CONFIG_DEBUG_ERRORS=y -# CONFIG_DEBUG_USER is not set +CONFIG_DEBUG_USER=y # CONFIG_DEBUG_INFO is not set CONFIG_MAGIC_SYSRQ=y # CONFIG_DEBUG_LL is not set diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c index cdd7a9821eaa..0caf4bf26057 100644 --- a/arch/arm/kernel/armksyms.c +++ b/arch/arm/kernel/armksyms.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -29,8 +30,6 @@ extern void outswb(unsigned int port, const void *to, int len); extern unsigned int local_bh_count[NR_CPUS]; extern unsigned int local_irq_count[NR_CPUS]; -extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); - /* * syscalls */ @@ -125,7 +124,6 @@ EXPORT_SYMBOL(cpu_cache_purge_area); EXPORT_SYMBOL(__machine_arch_type); /* networking */ -EXPORT_SYMBOL(csum_partial_copy); EXPORT_SYMBOL(csum_partial_copy_nocheck); EXPORT_SYMBOL(__csum_ipv6_magic); @@ -172,8 +170,7 @@ EXPORT_SYMBOL_NOVERS(strpbrk); EXPORT_SYMBOL_NOVERS(strtok); EXPORT_SYMBOL_NOVERS(strrchr); EXPORT_SYMBOL_NOVERS(strstr); -EXPORT_SYMBOL_NOVERS(__memset); -EXPORT_SYMBOL_NOVERS(memset); /* needed for some versions of gcc */ +EXPORT_SYMBOL_NOVERS(memset); EXPORT_SYMBOL_NOVERS(memcpy); EXPORT_SYMBOL_NOVERS(memmove); EXPORT_SYMBOL_NOVERS(memcmp); diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index b9b7d57b4078..4ce3079b471c 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -33,8 +33,8 @@ void pcibios_report_device_errors(void) continue; pci_write_config_word(dev, PCI_STATUS, status & 0xf900); - printk(KERN_DEBUG "PCI: status %04X on %s\n", - status, dev->name); + printk(KERN_DEBUG "PCI: %02X:%02X: status %04X on %s\n", + dev->bus->number, dev->devfn, status, dev->name); } } @@ -162,9 +162,10 @@ void __init pcibios_update_irq(struct pci_dev *dev, int irq) */ void __init pcibios_fixup_bus(struct pci_bus *bus) { - struct pci_dev *dev; + struct list_head *walk = &bus->devices; - for (dev = bus->devices; dev; dev = dev->sibling) { + for (walk = walk->next; walk != &bus->devices; walk = walk->next) { + struct pci_dev *dev = pci_dev_b(walk); u16 cmd; /* @@ -220,6 +221,7 @@ static u8 __init no_swizzle(struct pci_dev *dev, u8 *pin) return 0; } +#ifdef CONFIG_FOOTBRIDGE /* ebsa285 host-specific stuff */ static int irqmap_ebsa285[] __initdata = { IRQ_IN1, IRQ_IN0, IRQ_PCI, IRQ_IN3 }; @@ -255,7 +257,7 @@ static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 }; static int __init cats_map_irq(struct pci_dev *dev, u8 slot, u8 pin) { if (dev->irq >= 128) - return 16 + (dev->irq & 0x1f); + return dev->irq & 0x1f; if (dev->irq >= 1 && dev->irq <= 4) return irqmap_cats[dev->irq - 1]; @@ -313,17 +315,53 @@ static struct hw_pci netwinder_pci __initdata = { no_swizzle, netwinder_map_irq }; +#endif + +#ifdef CONFIG_ARCH_NEXUSPCI +/* + * Owing to a PCB cockup, issue A backplanes are wired thus: + * + * Slot 1 2 3 4 5 Bridge + * IRQ D C B A A + * A D C B B + * B A D C C + * C B A D D + * + * ID A31 A30 A29 A28 A27 A26 + */ + +static int irqmap_ftv[] __initdata = { IRQ_PCI_A, IRQ_PCI_B, IRQ_PCI_C, IRQ_PCI_D }; + +static int __init ftv_map_irq(struct pci_dev *dev, u8 slot, u8 pin) +{ + return irqmap_ftv[(slot + pin) & 3]; +} + +/* ftv host-specific stuff */ +static struct hw_pci ftv_pci __initdata = { + plx90x0_init, + 0x9000, + 0x00100000, + no_swizzle, + ftv_map_irq +}; +#endif void __init pcibios_init(void) { struct hw_pci *hw_pci = NULL; +#ifdef CONFIG_FOOTBRIDGE if (machine_is_ebsa285()) hw_pci = &ebsa285_pci; else if (machine_is_cats()) hw_pci = &cats_pci; else if (machine_is_netwinder()) hw_pci = &netwinder_pci; +#endif +#ifdef CONFIG_ARCH_NEXUSPCI + hw_pci = &ftv_pci; +#endif if (hw_pci == NULL) return; @@ -346,12 +384,14 @@ void __init pcibios_init(void) pci_fixup_irqs(hw_pci->swizzle, hw_pci->map_irq); pci_set_bus_ranges(); +#ifdef CONFIG_FOOTBRIDGE /* * Initialise any other hardware after we've got the PCI bus * initialised. We may need the PCI bus to talk to this other * hardware. */ hw_init(); +#endif } char * __init pcibios_setup(char *str) @@ -363,7 +403,17 @@ char * __init pcibios_setup(char *str) return str; } -void __init -pcibios_align_resource(void *data, struct resource *res, unsigned long size) +/* + * Assign new address to PCI resource. We hope our resource information + * is complete. + * + * Expects start=0, end=size-1, flags=resource type. + */ +int pci_assign_resource(struct pci_dev *dev, int i) +{ + return 0; +} + +void pcibios_align_resource(void *data, struct resource *res, unsigned long size) { } diff --git a/arch/arm/kernel/bios32.h b/arch/arm/kernel/bios32.h index fb311745201f..9a4380732566 100644 --- a/arch/arm/kernel/bios32.h +++ b/arch/arm/kernel/bios32.h @@ -7,3 +7,4 @@ struct hw_pci { }; void __init dc21285_init(void); +void __init plx90x0_init(void); diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S index 201a271e0dcb..d8d416c4e6d7 100644 --- a/arch/arm/kernel/calls.S +++ b/arch/arm/kernel/calls.S @@ -27,17 +27,17 @@ /* 15 */ .long SYMBOL_NAME(sys_chmod) .long SYMBOL_NAME(sys_lchown16) .long SYMBOL_NAME(sys_ni_syscall) /* was sys_break */ - .long SYMBOL_NAME(sys_stat) + .long SYMBOL_NAME(sys_ni_syscall) /* was sys_stat */ .long SYMBOL_NAME(sys_lseek) /* 20 */ .long SYMBOL_NAME(sys_getpid) - .long SYMBOL_NAME(sys_mount_wrapper) + .long SYMBOL_NAME(sys_mount) .long SYMBOL_NAME(sys_oldumount) .long SYMBOL_NAME(sys_setuid16) .long SYMBOL_NAME(sys_getuid16) /* 25 */ .long SYMBOL_NAME(sys_stime) .long SYMBOL_NAME(sys_ptrace) .long SYMBOL_NAME(sys_alarm) - .long SYMBOL_NAME(sys_fstat) + .long SYMBOL_NAME(sys_ni_syscall) /* was sys_fstat */ .long SYMBOL_NAME(sys_pause) /* 30 */ .long SYMBOL_NAME(sys_utime) .long SYMBOL_NAME(sys_ni_syscall) /* was sys_stty */ @@ -93,7 +93,7 @@ .long SYMBOL_NAME(sys_setgroups16) .long SYMBOL_NAME(old_select) .long SYMBOL_NAME(sys_symlink) - .long SYMBOL_NAME(sys_lstat) + .long SYMBOL_NAME(sys_ni_syscall) /* was sys_lstat */ /* 85 */ .long SYMBOL_NAME(sys_readlink) .long SYMBOL_NAME(sys_uselib) .long SYMBOL_NAME(sys_swapon) @@ -132,7 +132,7 @@ /* 120 */ .long SYMBOL_NAME(sys_clone_wapper) .long SYMBOL_NAME(sys_setdomainname) .long SYMBOL_NAME(sys_newuname) - .long SYMBOL_NAME(sys_ni_syscall) /* .long SYMBOL_NAME(sys_modify_ldt) */ + .long SYMBOL_NAME(sys_ni_syscall) .long SYMBOL_NAME(sys_adjtimex) /* 125 */ .long SYMBOL_NAME(sys_mprotect) .long SYMBOL_NAME(sys_sigprocmask) @@ -149,7 +149,7 @@ .long SYMBOL_NAME(sys_ni_syscall) /* .long _sys_afs_syscall */ .long SYMBOL_NAME(sys_setfsuid16) .long SYMBOL_NAME(sys_setfsgid16) -/* 140 */ .long SYMBOL_NAME(sys_llseek_wrapper) +/* 140 */ .long SYMBOL_NAME(sys_llseek) .long SYMBOL_NAME(sys_getdents) .long SYMBOL_NAME(sys_select) .long SYMBOL_NAME(sys_flock) diff --git a/arch/arm/kernel/debug-armv.S b/arch/arm/kernel/debug-armv.S index fef1489b7cd9..5802dac708ef 100644 --- a/arch/arm/kernel/debug-armv.S +++ b/arch/arm/kernel/debug-armv.S @@ -134,19 +134,26 @@ #elif defined(CONFIG_ARCH_SA1100) .macro addruart,rx mov \rx, #0xf8000000 - add \rx, \rx, #0x00050000 + add \rx, \rx, #0x00050000 @ Ser3 + @add \rx, \rx, #0x00010000 @ Ser1 .endm .macro senduart,rd,rx - str \rd, [\rx, #0x14] @ UARTDR + str \rd, [\rx, #0x14] @ UTDR .endm - .macro busyuart,rd,rx + .macro waituart,rd,rx 1001: ldr \rd, [\rx, #0x20] @ UTSR1 - tst \rd, #1 << 2 + tst \rd, #1 << 2 @ UTSR1_TNF beq 1001b .endm + .macro busyuart,rd,rx +1001: ldr \rd, [\rx, #0x20] @ UTSR1 + tst \rd, #1 << 0 @ UTSR1_TBY + bne 1001b + .endm + #else #error Unknown architecture #endif diff --git a/arch/arm/kernel/dec21285.c b/arch/arm/kernel/dec21285.c index dc7cc054ee98..6158e995a83f 100644 --- a/arch/arm/kernel/dec21285.c +++ b/arch/arm/kernel/dec21285.c @@ -220,7 +220,9 @@ void __init dc21285_init(void) #ifdef CONFIG_HOST_FOOTBRIDGE csrio.flags = IORESOURCE_IO; + csrio.name = "DC21285"; csrmem.flags = IORESOURCE_MEM; + csrmem.name = "DC21285"; allocate_resource(&ioport_resource, &csrio, 128, 0xff00, 0xffff, 128, NULL, NULL); @@ -244,7 +246,7 @@ void __init dc21285_init(void) (1 << 31) | (1 << 29) | (1 << 28) | (1 << 24); #endif - printk(KERN_DEBUG"PCI: DC21285 footbridge, revision %02lX\n", + printk(KERN_DEBUG "PCI: DC21285 footbridge, revision %02lX\n", *CSR_CLASSREV & 0xff); pci_scan_bus(0, &dc21285_ops, NULL); diff --git a/arch/arm/kernel/entry-armo.S b/arch/arm/kernel/entry-armo.S index 5d9ce0ac6622..f2dc9e36cd27 100644 --- a/arch/arm/kernel/entry-armo.S +++ b/arch/arm/kernel/entry-armo.S @@ -535,7 +535,6 @@ Ldata_unknown: @ Part of jumptable mov r0, r1 mov r1, r4 mov r2, r3 - mov r3, lr b baddataabort Ldata_ldrstr_post: diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 6d4107ede004..f4f03ee9354a 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -429,7 +429,10 @@ __und_invalid: sub sp, sp, #S_FRAME_SIZE and r2, r6, #31 @ int mode b SYMBOL_NAME(bad_mode) - +#ifdef CONFIG_NWFPE + /* The FPE is always present */ + .equ fpe_not_present, 0 +#else wfs_mask_data: .word 0x0e200110 @ WFS/RFS .word 0x0fef0fff .word 0x0d0d0100 @ LDF [sp]/STF [sp] @@ -466,6 +469,7 @@ fpe_not_present: add r5, r5, r4, lsl #2 str r5, [sp, r6, lsr #14] @ Save reg mov pc, r9 +#endif /* * SVC mode handlers @@ -685,11 +689,11 @@ ENTRY(__switch_to) stmfd sp!, {r4 - sl, fp, lr} @ Store most regs on stack mrs ip, cpsr stmfd sp!, {ip} @ Save cpsr_SVC - ldr r2, [r1, #TSS_DOMAIN] str sp, [r0, #TSS_SAVE] @ Save sp_SVC ldr sp, [r1, #TSS_SAVE] @ Get saved sp_SVC - mcr p15, 0, r2, c3, c0 @ Set domain register + ldr r2, [r1, #TSS_DOMAIN] ldmfd sp!, {ip} + mcr p15, 0, r2, c3, c0 @ Set domain register msr spsr, ip @ Save tasks CPSR into SPSR for this return ldmfd sp!, {r4 - sl, fp, pc}^ @ Load all regs saved previously diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index bdf6de6b3807..2be1a6012160 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -3,6 +3,9 @@ * All exits to user mode from the kernel go through this code. */ +#define S_OFF 8 +#define SYSCALL_REGS r4, r5 + /* * Define to favour ARM8, ARM9 and StrongARM cpus. This says that it is * cheaper to use two LDR instructions than a two-register LDM, if the @@ -16,9 +19,9 @@ .align 5 fast_syscall_return: - str r0, [sp, #S_R0 + 4] @ returned r0 + str r0, [sp, #S_R0 + S_OFF] @ returned r0 slow_syscall_return: - add sp, sp, #4 + add sp, sp, #S_OFF ret_from_sys_call: #ifdef HARVARD_CACHE ldr r0, bh_data @@ -74,65 +77,71 @@ ret_from_exception: /*============================================================================= * SWI handler *----------------------------------------------------------------------------- - * - * We now handle sys-call tracing, and the errno in the task structure. - * Still have a problem with >4 arguments for functions. Theres only - * a couple of functions in the code that have 5 arguments, so Im not - * too worried. */ +/* + * Create some aliases for some registers. These should allow + * us to have in theory up to 7 arguments to a function. + */ +scno .req r9 @ syscall number +tbl .req r8 @ syscall table pointer +tip .req r7 @ temporary IP + .align 5 vector_swi: save_user_regs mask_pc lr, lr mov fp, #0 - ldr r6, [lr, #-4] @ get SWI instruction - arm700_bug_check r6, r7 + ldr scno, [lr, #-4] @ get SWI instruction + arm700_bug_check scno, ip #ifdef CONFIG_ALIGNMENT_TRAP - ldr r7, .LCswi - ldr r7, [r7] - mcr p15, 0, r7, c1, c0 + ldr ip, .LCswi + ldr ip, [ip] + mcr p15, 0, ip, c1, c0 #endif - enable_irqs r7 + enable_irqs ip - str r4, [sp, #-4]! @ new style: (r0 = arg1, r4 = arg5) + stmdb sp!, {SYSCALL_REGS} @ new style: (r0 = arg1, r4 = arg5, r5 = arg6) + @ Note that we dont have to handle + @ sys_syscalls arg7 here adrsvc al, lr, fast_syscall_return - bic r6, r6, #0xff000000 @ mask off SWI op-code - eor r6, r6, #OS_NUMBER<<20 @ check OS number - cmp r6, #NR_syscalls @ check upper syscall limit + bic scno, scno, #0xff000000 @ mask off SWI op-code + eor scno, scno, #OS_NUMBER<<20 @ check OS number + cmp scno, #NR_syscalls @ check upper syscall limit bcs 2f - get_current_task r7 - ldr ip, [r7, #TSK_FLAGS] @ check for syscall tracing - adr r5, SYMBOL_NAME(sys_call_table) + get_current_task ip + ldr ip, [ip, #TSK_FLAGS] @ check for syscall tracing + adr tbl, SYMBOL_NAME(sys_call_table) tst ip, #PF_TRACESYS - ldreq pc, [r5, r6, lsl #2] @ call sys routine + ldreq pc, [tbl, scno, lsl #2] @ call sys routine - ldr r7, [sp, #S_IP + 4] @ save old IP - mov r0, #0 - str r0, [sp, #S_IP + 4] @ trace entry [IP = 0] + ldr tip, [sp, #S_IP + S_OFF] @ save old IP + mov ip, #0 + str ip, [sp, #S_IP + S_OFF] @ trace entry [IP = 0] bl SYMBOL_NAME(syscall_trace) - str r7, [sp, #S_IP + 4] + str tip, [sp, #S_IP + S_OFF] - ldmib sp, {r0 - r3} @ have to reload r0 - r3 + add ip, sp, #S_OFF + ldmia ip, {r0 - r3} @ have to reload r0 - r3 mov lr, pc - ldr pc, [r5, r6, lsl #2] @ call sys routine - str r0, [sp, #S_R0 + 4] @ returned r0 + ldr pc, [tbl, scno, lsl #2] @ call sys routine + str r0, [sp, #S_R0 + S_OFF] @ returned r0 - mov r0, #1 - str r0, [sp, #S_IP + 4] @ trace exit [IP = 1] + mov ip, #1 + str ip, [sp, #S_IP + S_OFF] @ trace exit [IP = 1] bl SYMBOL_NAME(syscall_trace) - str r7, [sp, #S_IP + 4] + str tip, [sp, #S_IP + S_OFF] b slow_syscall_return -2: add r1, sp, #4 - tst r6, #0x00f00000 @ is it a Unix SWI? +2: add r1, sp, #S_OFF + tst scno, #0x00f00000 @ is it a Unix SWI? bne 3f - subs r0, r6, #(KSWI_SYS_BASE - KSWI_BASE) + subs r0, scno, #(KSWI_SYS_BASE - KSWI_BASE) bcs SYMBOL_NAME(arm_syscall) b SYMBOL_NAME(sys_ni_syscall) @ not private func -3: eor r0, r6, #OS_NUMBER <<20 @ Put OS number back +3: eor r0, scno, #OS_NUMBER <<20 @ Put OS number back adrsvc al, lr, slow_syscall_return b SYMBOL_NAME(deferred) @@ -150,67 +159,49 @@ ENTRY(sys_call_table) @ r0 = syscall number @ r5 = syscall table SYMBOL_NAME(sys_syscall): - eor r6, r0, #OS_NUMBER << 20 - cmp r6, #NR_syscalls @ check range - add ip, sp, #4 - ldmleib ip, {r0 - r4} @ get our args - strle r4, [sp] @ Put our arg on the stack - ldrle pc, [r5, r6, lsl #2] + eor scno, r0, #OS_NUMBER << 20 + cmp scno, #NR_syscalls @ check range + add ip, sp, #S_OFF + ldmleib ip, {r0 - r3, SYSCALL_REGS} @ get our args + stmleia sp, {SYSCALL_REGS} @ Put our arg on the stack + ldrle pc, [tbl, scno, lsl #2] mov r0, #-ENOSYS - mov pc, lr + RETINSTR(mov,pc,lr) sys_fork_wrapper: - add r0, sp, #4 + add r0, sp, #S_OFF b SYMBOL_NAME(sys_fork) sys_vfork_wrapper: - add r0, sp, #4 + add r0, sp, #S_OFF b SYMBOL_NAME(sys_vfork) sys_execve_wrapper: - add r3, sp, #4 + add r3, sp, #S_OFF b SYMBOL_NAME(sys_execve) -sys_mount_wrapper: - mov r6, lr - add r5, sp, #4 - str r5, [sp] - str r4, [sp, #-4]! - bl SYMBOL_NAME(sys_compat_mount) - add sp, sp, #4 - RETINSTR(mov,pc,r6) - sys_clone_wapper: - add r2, sp, #4 + add r2, sp, #S_OFF b SYMBOL_NAME(sys_clone) -sys_llseek_wrapper: - mov r6, lr - add r5, sp, #4 - str r5, [sp] - str r4, [sp, #-4]! - bl SYMBOL_NAME(sys_compat_llseek) - add sp, sp, #4 - RETINSTR(mov,pc,r6) - sys_sigsuspend_wrapper: - add r3, sp, #4 + add r3, sp, #S_OFF b SYMBOL_NAME(sys_sigsuspend) sys_rt_sigsuspend_wrapper: - add r2, sp, #4 + add r2, sp, #S_OFF b SYMBOL_NAME(sys_rt_sigsuspend) sys_sigreturn_wrapper: - add r0, sp, #4 + add r0, sp, #S_OFF b SYMBOL_NAME(sys_sigreturn) sys_rt_sigreturn_wrapper: - add r0, sp, #4 + add r0, sp, #S_OFF b SYMBOL_NAME(sys_rt_sigreturn) sys_sigaltstack_wrapper: - ldr r2, [sp, #4 + S_SP] + ldr r2, [sp, #S_OFF + S_SP] b do_sigaltstack .data diff --git a/arch/arm/kernel/head-armv.S b/arch/arm/kernel/head-armv.S index 2996d89aff32..35e71a4a9587 100644 --- a/arch/arm/kernel/head-armv.S +++ b/arch/arm/kernel/head-armv.S @@ -69,7 +69,7 @@ ENTRY(_stext) * r1 contains the unique architecture number. See * linux/arch/arm/kernel/setup.c machine_desc[] array for the complete * list. If you require a new number, please follow the instructions - * given in Documentation/ARM-README. + * given in Documentation/arm/README. */ __entry: teq r0, #0 movne r0, #'i' @@ -83,7 +83,7 @@ __entry: teq r0, #0 moveq r0, #'a' beq __error bl __create_page_tables - adr lr, __aligned_call + adr lr, __ret add pc, r10, #12 @ flush caches (returns ctrl reg) __switch_data: .long __mmap_switched @@ -94,16 +94,11 @@ __switch_data: .long __mmap_switched .long SYMBOL_NAME(cr_alignment) .long SYMBOL_NAME(init_task_union)+8192 - /* - * This needs to be aligned to a cache line. - */ - .align 5 -__aligned_call: - ldr lr, __switch_data -#ifdef CONFIG_ALIGNMENT_TRAP - orr r0, r0, #2 @ ...........A. -#endif +__ret: ldr lr, __switch_data mcr p15, 0, r0, c1, c0 + mov r0, r0 + mov r0, r0 + mov r0, r0 mov pc, lr /* @@ -126,6 +121,9 @@ __mmap_switched: str r9, [r6] @ Save processor ID str r1, [r7] @ Save machine type +#ifdef CONFIG_ALIGNMENT_TRAP + orr r0, r0, #2 @ ...........A. +#endif bic r2, r0, #2 @ Clear 'A' bit stmia r8, {r0, r2} @ Save control register values b SYMBOL_NAME(start_kernel) @@ -137,16 +135,16 @@ __mmap_switched: * amount which are required to get the kernel running, which * generally means mapping in the kernel code. * - * We only map in 2MB of RAM, which should be sufficient in + * We only map in 4MB of RAM, which should be sufficient in * all cases. * - * r4 = physical address of page tables * r5 = physical address of start of RAM * r6 = physical IO address * r7 = byte offset into page tables for IO * r8 = page table flags */ __create_page_tables: + add r4, r5, #SWAPPER_PGDIR_OFFSET mov r0, r4 mov r3, #0 add r2, r0, #0x4000 @ Clear page table @@ -157,13 +155,22 @@ __create_page_tables: teq r0, r2 bne 1b /* - * map in two sections (2MB) for kernel. + * Create identity mapping for first MB of kernel. + * map in four sections (4MB) for kernel. * these are marked cacheable and bufferable. + * + * The identity mapping will be removed by paging_init() */ - add r0, r4, #(TEXTADDR - 0x8000) >> 18 mov r3, #0x0c orr r3, r3, r8 add r3, r3, r5 + add r0, r4, r5, lsr #18 + str r3, [r0] + add r0, r4, #(TEXTADDR - 0x8000) >> 18 + str r3, [r0], #4 + add r3, r3, #1 << 20 + str r3, [r0], #4 + add r3, r3, #1 << 20 str r3, [r0], #4 add r3, r3, #1 << 20 str r3, [r0], #4 @@ -174,8 +181,11 @@ __create_page_tables: * via a serial before paging_init. */ add r0, r4, r7 + rsb r3, r7, #0x4000 @ PTRS_PER_PGD*sizeof(long) + cmp r3, #0x0800 + addge r2, r0, #0x0800 + addlt r2, r0, r3 orr r3, r6, r8 - add r2, r0, #0x0800 1: str r3, [r0], #4 add r3, r3, #1 << 20 teq r0, r2 @@ -273,7 +283,7 @@ __lookup_processor_type: * Lookup machine architecture * r1 = machine architecture number * Returns: - * r4 = physical address of page tables + * r4 = unused word * r5 = physical start address of RAM * r6 = physical address of IO * r7 = byte offset into page tables for IO @@ -284,7 +294,6 @@ __lookup_architecture_type: adr r4, __arch_types_start add r4, r4, r1, lsl #4 ldmia r4, {r4, r5, r6, r7} - add r4, r5, #SWAPPER_PGDIR_OFFSET mov r7, r7, lsr #18 mov pc, lr 1: mov r7, #0 @@ -330,20 +339,20 @@ __arch_types_start: @ 0x04 - DEC EBSA285 .long 0 .long 0 - .long 0x24000000 @ I/O base address (0x42000000 -> 0xfe000000) - .long 0xe0000000 + .long DC21285_ARMCSR_BASE + .long 0xfe000000 @ 0x05 - Rebel.com NetWinder .long 0 .long 0 - .long 0x24000000 @ I/O base address (0x42000000 -> 0xfe000000) - .long 0xe0000000 + .long DC21285_ARMCSR_BASE + .long 0xfe000000 @ 0x06 - CATS .long 0 .long 0 - .long 0x24000000 @ I/O base address (0x42000000 -> 0xfe000000) - .long 0xe0000000 + .long DC21285_ARMCSR_BASE + .long 0xfe000000 @ 0x07 - tbox .long 0 @@ -398,9 +407,16 @@ __arch_types_start: .long 0 .long 0 .long 0 -__arch_types_end: - @ unknown - SA1100 + + @ 0x10 - SA1100 .long 0 .long 0xc0000000 .long 0x80000000 - .long 0xe0000000 + .long 0xf8000000 + + /* + * Don't add anything here unless you have an + * architecture number allocated - see + * Documentation/arm/README + */ +__arch_types_end: diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 9afacbde35aa..46afd5938742 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -50,13 +50,13 @@ void enable_hlt(void) static int __init nohlt_setup(char *__unused) { hlt_counter = 1; - return 0; + return 1; } static int __init hlt_setup(char *__unused) { hlt_counter = 0; - return 0; + return 1; } __setup("nohlt", nohlt_setup); @@ -114,6 +114,7 @@ void machine_halt(void) void machine_power_off(void) { + arch_power_off(); } void show_regs(struct pt_regs * regs) @@ -284,7 +285,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp, int dump_fpu (struct pt_regs *regs, struct user_fp *fp) { if (current->used_math) - memcpy(fp, ¤t->thread.fpstate.soft, sizeof (fp)); + memcpy(fp, ¤t->thread.fpstate.soft, sizeof (*fp)); return current->used_math; } diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index a060bf4d9dc1..a2f7292f6a39 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -54,13 +54,13 @@ struct meminfo meminfo; struct machine_desc { const char *name; /* architecture name */ unsigned int param_offset; /* parameter page */ + unsigned int video_start; /* start of video RAM */ + unsigned int video_end; /* end of video RAM */ unsigned int reserve_lp0 :1; /* never has lp0 */ unsigned int reserve_lp1 :1; /* never has lp1 */ unsigned int reserve_lp2 :1; /* never has lp2 */ unsigned int broken_hlt :1; /* hlt is broken */ unsigned int soft_reboot :1; /* soft reboot */ - unsigned int video_start; /* start of video RAM */ - unsigned int video_end; /* end of video RAM */ void (*fixup)(struct machine_desc *, struct param_struct *, char **); }; @@ -201,7 +201,7 @@ parse_cmdline(char **cmdline_p, char *from) meminfo.nr_banks = 0; } - start = 0; + start = PHYS_OFFSET; size = memparse(from + 4, &from); if (*from == '@') start = memparse(from + 1, &from); @@ -250,17 +250,18 @@ static void __init setup_initrd(unsigned int start, unsigned int size) } #define O_PFN_DOWN(x) ((x) >> PAGE_SHIFT) -#define P_PFN_DOWN(x) O_PFN_DOWN((x) - PHYS_OFFSET) #define V_PFN_DOWN(x) O_PFN_DOWN(__pa(x)) #define O_PFN_UP(x) (PAGE_ALIGN(x) >> PAGE_SHIFT) -#define P_PFN_UP(x) O_PFN_UP((x) - PHYS_OFFSET) #define V_PFN_UP(x) O_PFN_UP(__pa(x)) #define PFN_SIZE(x) ((x) >> PAGE_SHIFT) #define PFN_RANGE(s,e) PFN_SIZE(PAGE_ALIGN((unsigned long)(e)) - \ (((unsigned long)(s)) & PAGE_MASK)) +/* + * FIXME: These can be removed when Ingo's cleanup patch goes in + */ #define free_bootmem(s,sz) free_bootmem((s)< (meminfo.end + PHYS_OFFSET)) { + if (__pa(initrd_end) > meminfo.end) { printk ("initrd extends beyond end of memory " "(0x%08lx > 0x%08lx) - disabling initrd\n", - __pa(initrd_end), meminfo.end + PHYS_OFFSET); + __pa(initrd_end), meminfo.end); initrd_start = 0; initrd_end = 0; } @@ -373,7 +374,7 @@ static void __init setup_bootmem(void) #endif #ifdef CONFIG_BLK_DEV_INITRD if (initrd_start) - reserve_bootmem(O_PFN_DOWN(initrd_start), + reserve_bootmem(V_PFN_DOWN(initrd_start), PFN_RANGE(initrd_start, initrd_end)); #endif } @@ -528,16 +529,66 @@ fixup_coebsa285(struct machine_desc *desc, struct param_struct *params, char **cmdline) { #if 0 - if (machine_is_co285()) { - extern unsigned long boot_memory_end; - extern char boot_command_line[]; + extern unsigned long boot_memory_end; + extern char boot_command_line[]; - meminfo.nr_banks = 1; - meminfo.bank[0].start = PHYS_OFFSET; - meminfo.bank[0].size = boot_memory_end; + meminfo.nr_banks = 1; + meminfo.bank[0].start = PHYS_OFFSET; + meminfo.bank[0].size = boot_memory_end; + + *cmdline = boot_command_line; +#endif +} - *cmdline = boot_command_line; +static void __init +fixup_sa1100(struct machine_desc *desc, struct param_struct *params, + char **cmdline) +{ +#ifdef CONFIG_ARCH_SA1100 + int i; + extern struct mem_desc { + unsigned long phys_start; + unsigned long length; + } mem_desc[]; + extern unsigned int mem_desc_size; + + for( i = 0; i < mem_desc_size; i++ ) { + if( i >= NR_BANKS ) { + printk( __FUNCTION__ + ": mem_desc too large for meminfo structure\n"); + break; + } + meminfo.bank[i].start = mem_desc[i].phys_start; + meminfo.bank[i].size = mem_desc[i].length; } + meminfo.nr_banks = i; + +#if defined(CONFIG_SA1100_BRUTUS) + ROOT_DEV = MKDEV(RAMDISK_MAJOR,0); + setup_ramdisk( 1, 0, 0, 8192 ); + setup_initrd( __phys_to_virt(0xd8000000), 0x00400000 ); +#elif defined(CONFIG_SA1100_EMPEG) + ROOT_DEV = MKDEV( 3, 1 ); /* /dev/hda1 */ + setup_ramdisk( 1, 0, 0, 4096 ); + setup_initrd( 0xd0000000+((1024-320)*1024), (320*1024) ); +#elif defined(CONFIG_SA1100_TIFON) + ROOT_DEV = MKDEV(UNNAMED_MAJOR, 0); + setup_ramdisk(1, 0, 0, 4096); + setup_initrd( 0xd0000000 + 0x1100004, 0x140000 ); +#elif defined(CONFIG_SA1100_VICTOR) + ROOT_DEV = MKDEV( 60, 2 ); + + /* Get command line parameters passed from the loader (if any) */ + if( *((char*)0xc0000000) ) + strcpy( default_command_line, ((char *)0xc0000000) ); + + /* power off if any problem */ + strcat( default_command_line, " panic=1" ); +#elif defined(CONFIG_SA1100_LART) + ROOT_DEV = MKDEV(RAMDISK_MAJOR,0); + setup_ramdisk(1, 0, 0, 8192); + setup_initrd(0xc0400000, 0x00400000); +#endif #endif } @@ -565,7 +616,7 @@ static struct machine_desc machine_desc[] __initdata = { NO_VIDEO, 0, 0, 0, 0, 0, NULL - }, { "Nexus-FTV/PCI", /* Philip Blundell */ + }, { "FTV/PCI", /* Philip Blundell */ NO_PARAMS, NO_VIDEO, 0, 0, 0, 0, 0, @@ -627,9 +678,15 @@ static struct machine_desc machine_desc[] __initdata = { NULL }, { "Shark", /* Alexander Schulz */ NO_PARAMS, - NO_VIDEO, + /* do you really mean 0x200000? */ + 0x06000000, 0x06000000+0x00200000, 0, 0, 0, 0, 0, NULL + }, { "SA1100-based", /* Nicolas Pitre */ + NO_PARAMS, + NO_VIDEO, + 0, 0, 0, 0, 0, + fixup_sa1100 } }; diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index 46affebf6d97..f9fbd25368b6 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c @@ -278,6 +278,7 @@ setup_sigcontext(struct sigcontext *sc, /*struct _fpstate *fpstate,*/ err |= __put_user (current->thread.trap_no, &sc->trap_no); err |= __put_user (current->thread.error_code, &sc->error_code); + err |= __put_user (current->thread.address, &sc->fault_address); err |= __put_user (mask, &sc->oldmask); return err; diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c index 408149bc51dc..5e989663b9c8 100644 --- a/arch/arm/kernel/sys_arm.c +++ b/arch/arm/kernel/sys_arm.c @@ -79,12 +79,26 @@ out: return error; } +#define PGOFF_SHIFT (PAGE_SHIFT - 12) +#define PGOFF_MASK (~((1 << PGOFF_SHIFT) - 1)) + /* - * Perform the select(nd, in, out, ex, tv) and mmap() system - * calls. ARM Linux didn't use to be able to handle more than - * 4 system call parameters, so these system calls used a memory - * block for parameter passing.. + * Note: off_4k is always units of 4K. If we can't do the requested + * offset, we return EINVAL. */ +asmlinkage long +sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, + unsigned long flags, unsigned long fd, unsigned long off_4k) +{ + unsigned long pgoff; + + if (off_4k & ~PGOFF_MASK) + return -EINVAL; + + pgoff = off_4k >> PGOFF_SHIFT; + + return do_mmap2(addr, len, prot, flags, fd, pgoff); +} struct mmap_arg_struct { unsigned long addr; @@ -112,6 +126,10 @@ out: return error; } +/* + * Perform the select(nd, in, out, ex, tv) and mmap() system + * calls. + */ extern asmlinkage int sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *); struct sel_arg_struct { @@ -251,48 +269,11 @@ out: return error; } -/* - * Detect the old function calling standard - */ -static inline unsigned long old_calling_standard (struct pt_regs *regs) -{ - unsigned long instr, *pcv = (unsigned long *)(instruction_pointer(regs) - 8); - return (!get_user (instr, pcv) && instr == 0xe1a0300d); -} - /* Compatability functions - we used to pass 5 parameters as r0, r1, r2, *r3, *(r3+4) * We now use r0 - r4, and return an error if the old style calling standard is used. * Eventually these functions will disappear. */ -asmlinkage int -sys_compat_llseek (unsigned int fd, unsigned long offset_high, unsigned long offset_low, - loff_t *result, unsigned int origin, struct pt_regs *regs) -{ - extern int sys_llseek (unsigned int, unsigned long, unsigned long, loff_t *, unsigned int); - - if (old_calling_standard (regs)) { - printk (KERN_NOTICE "%s (%d): unsupported llseek call standard\n", - current->comm, current->pid); - return -EINVAL; - } - return sys_llseek (fd, offset_high, offset_low, result, origin); -} - -asmlinkage int -sys_compat_mount (char *devname, char *dirname, char *type, unsigned long flags, void *data, - struct pt_regs *regs) -{ - extern int sys_mount (char *, char *, char *, unsigned long, void *); - - if (old_calling_standard (regs)) { - printk (KERN_NOTICE "%s (%d): unsupported mount call standard\n", - current->comm, current->pid); - return -EINVAL; - } - return sys_mount (devname, dirname, type, flags, data); -} - -asmlinkage int sys_uname (struct old_utsname * name) +asmlinkage int sys_uname(struct old_utsname * name) { static int warned = 0; int err; @@ -331,15 +312,15 @@ asmlinkage int sys_olduname(struct oldold_utsname * name) down(&uts_sem); error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN); - error -= __put_user(0,name->sysname+__OLD_UTS_LEN); - error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); - error -= __put_user(0,name->nodename+__OLD_UTS_LEN); - error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); - error -= __put_user(0,name->release+__OLD_UTS_LEN); - error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); - error -= __put_user(0,name->version+__OLD_UTS_LEN); - error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); - error -= __put_user(0,name->machine+__OLD_UTS_LEN); + error |= __put_user(0,name->sysname+__OLD_UTS_LEN); + error |= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); + error |= __put_user(0,name->nodename+__OLD_UTS_LEN); + error |= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); + error |= __put_user(0,name->release+__OLD_UTS_LEN); + error |= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); + error |= __put_user(0,name->version+__OLD_UTS_LEN); + error |= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); + error |= __put_user(0,name->machine+__OLD_UTS_LEN); up(&uts_sem); @@ -354,4 +335,3 @@ asmlinkage int sys_pause(void) schedule(); return -ERESTARTNOHAND; } - diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index c48c62108b12..67c2597e69d2 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c @@ -112,7 +112,7 @@ void do_gettimeofday(struct timeval *tv) /* * xtime is atomically updated in timer_bh. lost_ticks is - * nonzero if the tiemr bottom half hasnt executed yet. + * nonzero if the timer bottom half hasnt executed yet. */ if (lost_ticks) tv->tv_usec += USECS_PER_JIFFY; diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 26ecfa1947af..ac15651d3936 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -187,10 +187,11 @@ void die(const char *str, struct pt_regs *regs, int err) dump_instr(instruction_pointer(regs), 0); } - spin_unlock_irq(&die_lock); + spin_unlock_irq(&die_lock); + do_exit(SIGSEGV); } -static void die_if_kernel(const char *str, struct pt_regs *regs, int err) +void die_if_kernel(const char *str, struct pt_regs *regs, int err) { if (user_mode(regs)) return; @@ -241,11 +242,10 @@ asmlinkage void do_unexp_fiq (struct pt_regs *regs) } /* - * bad_mode handles the impossible case in the vectors. - * If you see one of these, then it's extremely serious, - * and could mean you have buggy hardware. It never - * returns, and never tries to sync. We hope that we - * can dump out some state information... + * bad_mode handles the impossible case in the vectors. If you see one of + * these, then it's extremely serious, and could mean you have buggy hardware. + * It never returns, and never tries to sync. We hope that we can at least + * dump out some state information... */ asmlinkage void bad_mode(struct pt_regs *regs, int reason, int proc_mode) { @@ -255,7 +255,8 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason, int proc_mode) handler[reason], processor_modes[proc_mode]); /* - * Dump out the vectors and stub routines + * Dump out the vectors and stub routines. Maybe a better solution + * would be to dump them out only if we detect that they are corrupted. */ printk(KERN_CRIT "Vectors:\n"); dump_mem(0, 0x40); @@ -279,6 +280,9 @@ asmlinkage void math_state_restore (void) current->used_math = 1; } +/* + * Handle some more esoteric system calls + */ asmlinkage int arm_syscall (int no, struct pt_regs *regs) { switch (no) { @@ -295,7 +299,7 @@ asmlinkage int arm_syscall (int no, struct pt_regs *regs) case 2: /* sys_cacheflush */ #ifdef CONFIG_CPU_32 - /* r0 = start, r1 = length, r2 = flags */ + /* r0 = start, r1 = end, r2 = flags */ cpu_flush_cache_area(regs->ARM_r0, regs->ARM_r1, 1); #endif break; @@ -308,7 +312,7 @@ asmlinkage int arm_syscall (int no, struct pt_regs *regs) if (no <= 0x7ff) return -ENOSYS; #ifdef CONFIG_DEBUG_USER - /* experiance shows that these seem to indicate that + /* experience shows that these seem to indicate that * something catastrophic has happened */ printk("[%d] %s: arm syscall %d\n", current->pid, current->comm, no); @@ -357,16 +361,19 @@ asmlinkage void arm_invalidptr(const char *function, int size) function, __builtin_return_address(0), size); } -#ifdef CONFIG_CPU_26 -asmlinkage void baddataabort(int code, unsigned long instr, struct pt_regs *regs) +/* + * A data abort trap was taken, but the instruction was not an instruction + * which should cause the trap to be taken. Try to abort it. Note that + * the while(1) is there because we cannot currently handle returning from + * this function. + */ +asmlinkage void +baddataabort(int code, unsigned long instr, struct pt_regs *regs) { unsigned long phys, addr = instruction_pointer(regs); #ifdef CONFIG_DEBUG_ERRORS - printk("pid=%d\n", current->pid); - - show_regs(regs); - dump_instr(instruction_pointer(regs), 1); + dump_instr(addr, 1); { pgd_t *pgd; @@ -385,10 +392,10 @@ asmlinkage void baddataabort(int code, unsigned long instr, struct pt_regs *regs printk ("\n"); } #endif - panic("unknown data abort code %d [pc=%08lx *pc=%08lx lr=%08lx sp=%08lx]", - code, regs->ARM_pc, instr, regs->ARM_lr, regs->ARM_sp); + force_sig(SIGILL, current); + die_if_kernel("unknown data abort code", regs, instr); + while (1); } -#endif void __bug(const char *file, int line, void *data) { @@ -425,6 +432,19 @@ asmlinkage void __div0(void) __backtrace(); } +void abort(void) +{ + void *lr = __builtin_return_address(0); + + printk(KERN_CRIT "abort() called from %p! (Please " + "report to rmk@arm.linux.org.uk)\n", lr); + + *(int *)0 = 0; + + /* if that doesn't kill us, halt */ + panic("Oops failed to kill thread"); +} + void __init trap_init(void) { extern void __trap_init(void); diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 9a22fe08f3d3..5046a3377b23 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -5,8 +5,14 @@ # L_TARGET := lib.a -L_OBJS := backtrace.o bitops.o checksum.o delay.o \ - string.o system.o uaccess.o +L_OBJS := changebit.o csumipv6.o csumpartial.o csumpartialcopy.o \ + csumpartialcopyuser.o clearbit.o copy_page.o findbit.o \ + memchr.o memcpy.o memset.o memzero.o setbit.o strchr.o \ + strrchr.o testchangebit.o testclearbit.o testsetbit.o \ + uaccess.o + +O_TARGET := lib.o +O_OBJS := backtrace.o delay.o ifeq ($(PROCESSOR),armo) L_OBJS += uaccess-armo.o @@ -25,13 +31,21 @@ endif ifeq ($(MACHINE),ebsa110) L_OBJS += io-ebsa110.o else - LX_OBJS += io.o + OX_OBJS += io.o endif ifeq ($(MACHINE),footbridge) L_OBJS += io-footbridge.o endif +# +# SA1100 IO routines happen to be the +# same as the footbridge routines +# +ifeq ($(MACHINE),sa1100) + L_OBJS += io-footbridge.o +endif + include $(TOPDIR)/Rules.make .S.o: @@ -42,5 +56,3 @@ constants.h: getconsdata.o extractconstants.pl getconsdata.o: getconsdata.c $(CC) $(CFLAGS) -c getconsdata.c - -checksum.o string.o: constants.h diff --git a/arch/arm/lib/bitops.S b/arch/arm/lib/bitops.S deleted file mode 100644 index 4c1f4b0aa232..000000000000 --- a/arch/arm/lib/bitops.S +++ /dev/null @@ -1,152 +0,0 @@ -/* - * linux/arch/arm/lib/bitops.S - * - * Copyright (C) 1995, 1996 Russell King - */ - -#include -#include - .text - -@ Purpose : Function to set a bit -@ Prototype: int set_bit(int bit,int *addr) - -ENTRY(set_bit) - and r2, r0, #7 - mov r3, #1 - mov r3, r3, lsl r2 - SAVEIRQS(ip) - DISABLEIRQS(ip) - ldrb r2, [r1, r0, lsr #3] - orr r2, r2, r3 - strb r2, [r1, r0, lsr #3] - RESTOREIRQS(ip) - RETINSTR(mov,pc,lr) - -ENTRY(test_and_set_bit) - add r1, r1, r0, lsr #3 @ Get byte offset - and r3, r0, #7 @ Get bit offset - mov r0, #1 - SAVEIRQS(ip) - DISABLEIRQS(ip) - ldrb r2, [r1] - tst r2, r0, lsl r3 - orr r2, r2, r0, lsl r3 - moveq r0, #0 - strb r2, [r1] - RESTOREIRQS(ip) - RETINSTR(mov,pc,lr) - -@ Purpose : Function to clear a bit -@ Prototype: int clear_bit(int bit,int *addr) - -ENTRY(clear_bit) - and r2, r0, #7 - mov r3, #1 - mov r3, r3, lsl r2 - SAVEIRQS(ip) - DISABLEIRQS(ip) - ldrb r2, [r1, r0, lsr #3] - bic r2, r2, r3 - strb r2, [r1, r0, lsr #3] - RESTOREIRQS(ip) - RETINSTR(mov,pc,lr) - -ENTRY(test_and_clear_bit) - add r1, r1, r0, lsr #3 @ Get byte offset - and r3, r0, #7 @ Get bit offset - mov r0, #1 - SAVEIRQS(ip) - DISABLEIRQS(ip) - ldrb r2, [r1] - tst r2, r0, lsl r3 - bic r2, r2, r0, lsl r3 - moveq r0, #0 - strb r2, [r1] - RESTOREIRQS(ip) - RETINSTR(mov,pc,lr) - -/* Purpose : Function to change a bit - * Prototype: int change_bit(int bit,int *addr) - */ -ENTRY(change_bit) - and r2, r0, #7 - mov r3, #1 - mov r3, r3, lsl r2 - SAVEIRQS(ip) - DISABLEIRQS(ip) - ldrb r2, [r1, r0, lsr #3] - eor r2, r2, r3 - strb r2, [r1, r0, lsr #3] - RESTOREIRQS(ip) - RETINSTR(mov,pc,lr) - -ENTRY(test_and_change_bit) - add r1, r1, r0, lsr #3 - and r3, r0, #7 - mov r0, #1 - SAVEIRQS(ip) - DISABLEIRQS(ip) - ldrb r2, [r1] - tst r2, r0, lsl r3 - eor r2, r2, r0, lsl r3 - moveq r0, #0 - strb r2, [r1] - RESTOREIRQS(ip) - RETINSTR(mov,pc,lr) - -@ Purpose : Find a 'zero' bit -@ Prototype: int find_first_zero_bit(char *addr,int maxbit); - -ENTRY(find_first_zero_bit) - mov r2, #0 @ Initialise bit position -Lfindzbit1lp: ldrb r3, [r0, r2, lsr #3] @ Check byte, if 0xFF, then all bits set - teq r3, #0xFF - bne Lfoundzbit - add r2, r2, #8 - cmp r2, r1 @ Check to see if we have come to the end - bcc Lfindzbit1lp - add r0, r1, #1 @ Make sure that we flag an error - RETINSTR(mov,pc,lr) -Lfoundzbit: tst r3, #1 @ Check individual bits - moveq r0, r2 - RETINSTR(moveq,pc,lr) - tst r3, #2 - addeq r0, r2, #1 - RETINSTR(moveq,pc,lr) - tst r3, #4 - addeq r0, r2, #2 - RETINSTR(moveq,pc,lr) - tst r3, #8 - addeq r0, r2, #3 - RETINSTR(moveq,pc,lr) - tst r3, #16 - addeq r0, r2, #4 - RETINSTR(moveq,pc,lr) - tst r3, #32 - addeq r0, r2, #5 - RETINSTR(moveq,pc,lr) - tst r3, #64 - addeq r0, r2, #6 - RETINSTR(moveq,pc,lr) - add r0, r2, #7 - RETINSTR(mov,pc,lr) - -@ Purpose : Find next 'zero' bit -@ Prototype: int find_next_zero_bit(char *addr,int maxbit,int offset) - -ENTRY(find_next_zero_bit) - tst r2, #7 - beq Lfindzbit1lp @ If new byte, goto old routine - ldrb r3, [r0, r2, lsr#3] - orr r3, r3, #0xFF00 @ Set top bits so we wont get confused - stmfd sp!, {r4} - and r4, r2, #7 - mov r3, r3, lsr r4 @ Shift right by no. of bits - ldmfd sp!, {r4} - and r3, r3, #0xFF - teq r3, #0xFF - orreq r2, r2, #7 - addeq r2, r2, #1 - beq Lfindzbit1lp @ If all bits are set, goto old routine - b Lfoundzbit diff --git a/arch/arm/lib/changebit.S b/arch/arm/lib/changebit.S new file mode 100644 index 000000000000..8005fd49a64d --- /dev/null +++ b/arch/arm/lib/changebit.S @@ -0,0 +1,26 @@ +/* + * linux/arch/arm/lib/changebit.S + * + * Copyright (C) 1995-1996 Russell King + */ + +#include +#include + .text + +/* Purpose : Function to change a bit + * Prototype: int change_bit(int bit,int *addr) + */ +ENTRY(change_bit) + and r2, r0, #7 + mov r3, #1 + mov r3, r3, lsl r2 + SAVEIRQS(ip) + DISABLEIRQS(ip) + ldrb r2, [r1, r0, lsr #3] + eor r2, r2, r3 + strb r2, [r1, r0, lsr #3] + RESTOREIRQS(ip) + RETINSTR(mov,pc,lr) + + diff --git a/arch/arm/lib/clearbit.S b/arch/arm/lib/clearbit.S new file mode 100644 index 000000000000..d936ab549ee2 --- /dev/null +++ b/arch/arm/lib/clearbit.S @@ -0,0 +1,26 @@ +/* + * linux/arch/arm/lib/clearbit.S + * + * Copyright (C) 1995-1996 Russell King + */ + +#include +#include + .text + +@ Purpose : Function to clear a bit +@ Prototype: int clear_bit(int bit,int *addr) + +ENTRY(clear_bit) + and r2, r0, #7 + mov r3, #1 + mov r3, r3, lsl r2 + SAVEIRQS(ip) + DISABLEIRQS(ip) + ldrb r2, [r1, r0, lsr #3] + bic r2, r2, r3 + strb r2, [r1, r0, lsr #3] + RESTOREIRQS(ip) + RETINSTR(mov,pc,lr) + + diff --git a/arch/arm/lib/copy_page.S b/arch/arm/lib/copy_page.S new file mode 100644 index 000000000000..16c43268a6b5 --- /dev/null +++ b/arch/arm/lib/copy_page.S @@ -0,0 +1,35 @@ +/* + * linux/arch/arm/lib/copypage.S + * + * Copyright (C) 1995-1999 Russell King + * + * ASM optimised string functions + * + */ +#include +#include +#include "constants.h" + + .text +/* + * StrongARM optimised copy_page routine + * now 1.72bytes/cycle, was 1.60 bytes/cycle + * (50MHz bus -> 86MB/s) + */ + +ENTRY(copy_page) + stmfd sp!, {r4, lr} @ 2 + mov r2, #PAGE_SZ/64 @ 1 +1: ldmia r1!, {r3, r4, ip, lr} @ 4 + subs r2, r2, #1 @ 1 + stmia r0!, {r3, r4, ip, lr} @ 4 + ldmia r1!, {r3, r4, ip, lr} @ 4+1 + stmia r0!, {r3, r4, ip, lr} @ 4 + ldmia r1!, {r3, r4, ip, lr} @ 4+1 + stmia r0!, {r3, r4, ip, lr} @ 4 + ldmia r1!, {r3, r4, ip, lr} @ 4+1 + stmia r0!, {r3, r4, ip, lr} @ 4 + bne 1b @ 1 + LOADREGS(fd, sp!, {r4, pc}) @ 3 + + diff --git a/arch/arm/lib/csumipv6.S b/arch/arm/lib/csumipv6.S new file mode 100644 index 000000000000..76e7d26d8f43 --- /dev/null +++ b/arch/arm/lib/csumipv6.S @@ -0,0 +1,28 @@ +/* + * linux/arch/arm/lib/csumipv6.S + * + * Copyright (C) 1995-1998 Russell King + */ +#include +#include + + .text + +ENTRY(__csum_ipv6_magic) + str lr, [sp, #-4]! + adds ip, r2, r3 + ldmia r1, {r1 - r3, lr} + adcs ip, ip, r1 + adcs ip, ip, r2 + adcs ip, ip, r3 + adcs ip, ip, lr + ldmia r0, {r0 - r3} + adcs r0, ip, r0 + adcs r0, r0, r1 + adcs r0, r0, r2 + ldr r2, [sp, #4] + adcs r0, r0, r3 + adcs r0, r0, r2 + adcs r0, r0, #0 + LOADREGS(fd, sp!, {pc}) + diff --git a/arch/arm/lib/csumpartial.S b/arch/arm/lib/csumpartial.S new file mode 100644 index 000000000000..2406dfb382cf --- /dev/null +++ b/arch/arm/lib/csumpartial.S @@ -0,0 +1,64 @@ +/* + * linux/arch/arm/lib/csumpartial.S + * + * Copyright (C) 1995-1998 Russell King + */ +#include +#include + + .text + +/* Function: __u32 csum_partial(const char *src, int len, __u32) + * Params : r0 = buffer, r1 = len, r2 = checksum + * Returns : r0 = new checksum + */ + +ENTRY(csum_partial) + tst r0, #2 + beq 1f + subs r1, r1, #2 + addmi r1, r1, #2 + bmi 3f + bic r0, r0, #3 + ldr r3, [r0], #4 + adds r2, r2, r3, lsr #16 + adcs r2, r2, #0 +1: adds r2, r2, #0 + bics ip, r1, #31 + beq 3f + stmfd sp!, {r4 - r6} +2: ldmia r0!, {r3 - r6} + adcs r2, r2, r3 + adcs r2, r2, r4 + adcs r2, r2, r5 + adcs r2, r2, r6 + ldmia r0!, {r3 - r6} + adcs r2, r2, r3 + adcs r2, r2, r4 + adcs r2, r2, r5 + adcs r2, r2, r6 + sub ip, ip, #32 + teq ip, #0 + bne 2b + adcs r2, r2, #0 + ldmfd sp!, {r4 - r6} +3: ands ip, r1, #0x1c + beq 5f +4: ldr r3, [r0], #4 + sub ip, ip, #4 + adcs r2, r2, r3 + teq ip, #0 + bne 4b + adcs r2, r2, #0 +5: ands ip, r1, #3 + moveq r0, r2 + RETINSTR(moveq,pc,lr) + mov ip, ip, lsl #3 + ldr r3, [r0] + rsb ip, ip, #32 + mov r3, r3, lsl ip + adds r2, r2, r3, lsr ip + adc r0, r2, #0 + RETINSTR(mov,pc,lr) + + diff --git a/arch/arm/lib/csumpartialcopy.S b/arch/arm/lib/csumpartialcopy.S new file mode 100644 index 000000000000..7289619da1b5 --- /dev/null +++ b/arch/arm/lib/csumpartialcopy.S @@ -0,0 +1,257 @@ +/* + * linux/arch/arm/lib/csumpartialcopy.S + * + * Copyright (C) 1995-1998 Russell King + */ +#include +#include + + .text + +/* Function: __u32 csum_partial_copy_nocheck(const char *src, char *dst, int len, __u32 sum) + * Params : r0 = src, r1 = dst, r2 = len, r3 = checksum + * Returns : r0 = new checksum + */ +ENTRY(csum_partial_copy_nocheck) + mov ip, sp + stmfd sp!, {r4 - r8, fp, ip, lr, pc} + sub fp, ip, #4 + cmp r2, #4 + blt Ltoo_small + tst r1, #2 @ Test destination alignment + beq Ldst_aligned + ldrb ip, [r0], #1 + ldrb r8, [r0], #1 + subs r2, r2, #2 @ We do not know if SRC is aligned... + orr ip, ip, r8, lsl #8 + adds r3, r3, ip + adcs r3, r3, #0 + strb ip, [r1], #1 + mov ip, ip, lsr #8 + strb ip, [r1], #1 @ Destination now aligned +Ldst_aligned: tst r0, #3 + bne Lsrc_not_aligned + adds r3, r3, #0 + bics ip, r2, #15 @ Routine for src & dst aligned + beq 3f +1: ldmia r0!, {r4, r5, r6, r7} + stmia r1!, {r4, r5, r6, r7} + adcs r3, r3, r4 + adcs r3, r3, r5 + adcs r3, r3, r6 + adcs r3, r3, r7 + sub ip, ip, #16 + teq ip, #0 + bne 1b +3: ands ip, r2, #12 + beq 5f + tst ip, #8 + beq 4f + ldmia r0!, {r4, r5} + stmia r1!, {r4, r5} + adcs r3, r3, r4 + adcs r3, r3, r5 + tst ip, #4 + beq 5f +4: ldr r4, [r0], #4 + str r4, [r1], #4 + adcs r3, r3, r4 +5: ands r2, r2, #3 + adceq r0, r3, #0 + LOADREGS(eqea,fp,{r4 - r8, fp, sp, pc}) + ldr r4, [r0], #4 + tst r2, #2 + beq Lexit_r4 + adcs r3, r3, r4, lsl #16 + strb r4, [r1], #1 + mov r4, r4, lsr #8 + strb r4, [r1], #1 + mov r4, r4, lsr #8 + b Lexit_r4 + +Ltoo_small: teq r2, #0 + LOADREGS(eqea,fp,{r4 - r8, fp, sp, pc}) + cmp r2, #2 + blt Ltoo_small1 + ldrb ip, [r0], #1 + ldrb r8, [r0], #1 + orr ip, ip, r8, lsl #8 + adds r3, r3, ip + strb ip, [r1], #1 + strb r8, [r1], #1 + tst r2, #1 +Ltoo_small1: ldrneb r4, [r0], #1 +Lexit_r4: tst r2, #1 + strneb r4, [r1], #1 + andne r4, r4, #255 + adcnes r3, r3, r4 + adcs r0, r3, #0 + LOADREGS(ea,fp,{r4 - r8, fp, sp, pc}) + +Lsrc_not_aligned: + cmp r2, #4 + blt Ltoo_small + and ip, r0, #3 + bic r0, r0, #3 + ldr r4, [r0], #4 + cmp ip, #2 + beq Lsrc2_aligned + bhi Lsrc3_aligned + mov r4, r4, lsr #8 + adds r3, r3, #0 + bics ip, r2, #15 + beq 2f +1: ldmia r0!, {r5, r6, r7, r8} + orr r4, r4, r5, lsl #24 + mov r5, r5, lsr #8 + orr r5, r5, r6, lsl #24 + mov r6, r6, lsr #8 + orr r6, r6, r7, lsl #24 + mov r7, r7, lsr #8 + orr r7, r7, r8, lsl #24 + stmia r1!, {r4, r5, r6, r7} + adcs r3, r3, r4 + adcs r3, r3, r5 + adcs r3, r3, r6 + adcs r3, r3, r7 + mov r4, r8, lsr #8 + sub ip, ip, #16 + teq ip, #0 + bne 1b +2: ands ip, r2, #12 + beq 4f + tst ip, #8 + beq 3f + ldmia r0!, {r5, r6} + orr r4, r4, r5, lsl #24 + mov r5, r5, lsr #8 + orr r5, r5, r6, lsl #24 + stmia r1!, {r4, r5} + adcs r3, r3, r4 + adcs r3, r3, r5 + mov r4, r6, lsr #8 + tst ip, #4 + beq 4f +3: ldr r5, [r0], #4 + orr r4, r4, r5, lsl #24 + str r4, [r1], #4 + adcs r3, r3, r4 + mov r4, r5, lsr #8 +4: ands r2, r2, #3 + adceq r0, r3, #0 + LOADREGS(eqea,fp,{r4 - r8, fp, sp, pc}) + tst r2, #2 + beq Lexit_r4 + adcs r3, r3, r4, lsl #16 + strb r4, [r1], #1 + mov r4, r4, lsr #8 + strb r4, [r1], #1 + mov r4, r4, lsr #8 + b Lexit_r4 + +Lsrc2_aligned: mov r4, r4, lsr #16 + adds r3, r3, #0 + bics ip, r2, #15 + beq 2f +1: ldmia r0!, {r5, r6, r7, r8} + orr r4, r4, r5, lsl #16 + mov r5, r5, lsr #16 + orr r5, r5, r6, lsl #16 + mov r6, r6, lsr #16 + orr r6, r6, r7, lsl #16 + mov r7, r7, lsr #16 + orr r7, r7, r8, lsl #16 + stmia r1!, {r4, r5, r6, r7} + adcs r3, r3, r4 + adcs r3, r3, r5 + adcs r3, r3, r6 + adcs r3, r3, r7 + mov r4, r8, lsr #16 + sub ip, ip, #16 + teq ip, #0 + bne 1b +2: ands ip, r2, #12 + beq 4f + tst ip, #8 + beq 3f + ldmia r0!, {r5, r6} + orr r4, r4, r5, lsl #16 + mov r5, r5, lsr #16 + orr r5, r5, r6, lsl #16 + stmia r1!, {r4, r5} + adcs r3, r3, r4 + adcs r3, r3, r5 + mov r4, r6, lsr #16 + tst ip, #4 + beq 4f +3: ldr r5, [r0], #4 + orr r4, r4, r5, lsl #16 + str r4, [r1], #4 + adcs r3, r3, r4 + mov r4, r5, lsr #16 +4: ands r2, r2, #3 + adceq r0, r3, #0 + LOADREGS(eqea,fp,{r4 - r8, fp, sp, pc}) + tst r2, #2 + beq Lexit_r4 + adcs r3, r3, r4, lsl #16 + strb r4, [r1], #1 + mov r4, r4, lsr #8 + strb r4, [r1], #1 + ldrb r4, [r0], #1 + b Lexit_r4 + +Lsrc3_aligned: mov r4, r4, lsr #24 + adds r3, r3, #0 + bics ip, r2, #15 + beq 2f +1: ldmia r0!, {r5, r6, r7, r8} + orr r4, r4, r5, lsl #8 + mov r5, r5, lsr #24 + orr r5, r5, r6, lsl #8 + mov r6, r6, lsr #24 + orr r6, r6, r7, lsl #8 + mov r7, r7, lsr #24 + orr r7, r7, r8, lsl #8 + stmia r1!, {r4, r5, r6, r7} + adcs r3, r3, r4 + adcs r3, r3, r5 + adcs r3, r3, r6 + adcs r3, r3, r7 + mov r4, r8, lsr #24 + sub ip, ip, #16 + teq ip, #0 + bne 1b +2: ands ip, r2, #12 + beq 4f + tst ip, #8 + beq 3f + ldmia r0!, {r5, r6} + orr r4, r4, r5, lsl #8 + mov r5, r5, lsr #24 + orr r5, r5, r6, lsl #8 + stmia r1!, {r4, r5} + adcs r3, r3, r4 + adcs r3, r3, r5 + mov r4, r6, lsr #24 + tst ip, #4 + beq 4f +3: ldr r5, [r0], #4 + orr r4, r4, r5, lsl #8 + str r4, [r1], #4 + adcs r3, r3, r4 + mov r4, r5, lsr #24 +4: ands r2, r2, #3 + adceq r0, r3, #0 + LOADREGS(eqea,fp,{r4 - r8, fp, sp, pc}) + tst r2, #2 + beq Lexit_r4 + adcs r3, r3, r4, lsl #16 + strb r4, [r1], #1 + ldr r4, [r0], #4 + strb r4, [r1], #1 + adcs r3, r3, r4, lsl #24 + mov r4, r4, lsr #8 + b Lexit_r4 + + diff --git a/arch/arm/lib/checksum.S b/arch/arm/lib/csumpartialcopyuser.S similarity index 55% rename from arch/arm/lib/checksum.S rename to arch/arm/lib/csumpartialcopyuser.S index ae78b657abf6..f698c0d26475 100644 --- a/arch/arm/lib/checksum.S +++ b/arch/arm/lib/csumpartialcopyuser.S @@ -1,7 +1,7 @@ /* - * linux/arch/arm/lib/checksum.S + * linux/arch/arm/lib/csumpartialcopyuser.S * - * Copyright (C) 1995, 1996, 1997, 1998 Russell King + * Copyright (C) 1995-1998 Russell King */ #include #include @@ -11,59 +11,6 @@ .text -/* Function: __u32 csum_partial(const char *src, int len, __u32) - * Params : r0 = buffer, r1 = len, r2 = checksum - * Returns : r0 = new checksum - */ - -ENTRY(csum_partial) - tst r0, #2 - beq 1f - subs r1, r1, #2 - addmi r1, r1, #2 - bmi 3f - bic r0, r0, #3 - ldr r3, [r0], #4 - adds r2, r2, r3, lsr #16 - adcs r2, r2, #0 -1: adds r2, r2, #0 - bics ip, r1, #31 - beq 3f - stmfd sp!, {r4 - r6} -2: ldmia r0!, {r3 - r6} - adcs r2, r2, r3 - adcs r2, r2, r4 - adcs r2, r2, r5 - adcs r2, r2, r6 - ldmia r0!, {r3 - r6} - adcs r2, r2, r3 - adcs r2, r2, r4 - adcs r2, r2, r5 - adcs r2, r2, r6 - sub ip, ip, #32 - teq ip, #0 - bne 2b - adcs r2, r2, #0 - ldmfd sp!, {r4 - r6} -3: ands ip, r1, #0x1c - beq 5f -4: ldr r3, [r0], #4 - adcs r2, r2, r3 - sub ip, ip, #4 - teq ip, #0 - bne 4b - adcs r2, r2, #0 -5: ands ip, r1, #3 - moveq r0, r2 - RETINSTR(moveq,pc,lr) - mov ip, ip, lsl #3 - rsb ip, ip, #32 - ldr r3, [r0] - mov r3, r3, lsl ip - adds r2, r2, r3, lsr ip - adc r0, r2, #0 - RETINSTR(mov,pc,lr) - /* Function: __u32 csum_partial_copy_from_user (const char *src, char *dst, int len, __u32 sum, int *err_ptr) * Params : r0 = src, r1 = dst, r2 = len, r3 = sum, [sp, #0] = &err * Returns : r0 = checksum, [[sp, #0], #0] = 0 or -EFAULT @@ -209,8 +156,8 @@ ENTRY(csum_partial_copy_from_user) blt .too_small_user tst r1, #2 @ Test destination alignment beq .dst_aligned_user - subs r2, r2, #2 @ We do not know if SRC is aligned... load2b ip, r8 + subs r2, r2, #2 @ We do not know if SRC is aligned... orr ip, ip, r8, lsl #8 adds r3, r3, ip adcs r3, r3, #0 @@ -393,6 +340,9 @@ ENTRY(csum_partial_copy_from_user) strb r4, [r1], #1 mov r4, r4, lsr #8 strb r4, [r1], #1 + tst r2, #1 + adceq r0, r3, #0 + load_regs eqea load1b r4 b .exit @@ -467,268 +417,3 @@ ENTRY(csum_partial_copy_from_user) #if defined(CONFIG_CPU_32) .previous #endif - -/* Function: __u32 csum_partial_copy (const char *src, char *dst, int len, __u32 sum) - * Params : r0 = src, r1 = dst, r2 = len, r3 = checksum - * Returns : r0 = new checksum - */ -ENTRY(csum_partial_copy_nocheck) -ENTRY(csum_partial_copy) - mov ip, sp - stmfd sp!, {r4 - r8, fp, ip, lr, pc} - sub fp, ip, #4 - cmp r2, #4 - blt Ltoo_small - tst r1, #2 @ Test destination alignment - beq Ldst_aligned - subs r2, r2, #2 @ We do not know if SRC is aligned... - ldrb ip, [r0], #1 - ldrb r8, [r0], #1 - orr ip, ip, r8, lsl #8 - adds r3, r3, ip - adcs r3, r3, #0 - strb ip, [r1], #1 - mov ip, ip, lsr #8 - strb ip, [r1], #1 @ Destination now aligned -Ldst_aligned: tst r0, #3 - bne Lsrc_not_aligned - adds r3, r3, #0 - bics ip, r2, #15 @ Routine for src & dst aligned - beq 3f -1: ldmia r0!, {r4, r5, r6, r7} - stmia r1!, {r4, r5, r6, r7} - adcs r3, r3, r4 - adcs r3, r3, r5 - adcs r3, r3, r6 - adcs r3, r3, r7 - sub ip, ip, #16 - teq ip, #0 - bne 1b -3: ands ip, r2, #12 - beq 5f - tst ip, #8 - beq 4f - ldmia r0!, {r4, r5} - stmia r1!, {r4, r5} - adcs r3, r3, r4 - adcs r3, r3, r5 - tst ip, #4 - beq 5f -4: ldr r4, [r0], #4 - str r4, [r1], #4 - adcs r3, r3, r4 -5: ands r2, r2, #3 - adceq r0, r3, #0 - LOADREGS(eqea,fp,{r4 - r8, fp, sp, pc}) - ldr r4, [r0], #4 - tst r2, #2 - beq Lexit_r4 - adcs r3, r3, r4, lsl #16 - strb r4, [r1], #1 - mov r4, r4, lsr #8 - strb r4, [r1], #1 - mov r4, r4, lsr #8 - b Lexit_r4 - -Ltoo_small: teq r2, #0 - LOADREGS(eqea,fp,{r4 - r8, fp, sp, pc}) - cmp r2, #2 - blt Ltoo_small1 - ldrb ip, [r0], #1 - ldrb r8, [r0], #1 - orr ip, ip, r8, lsl #8 - adds r3, r3, ip - strb ip, [r1], #1 - strb r8, [r1], #1 - tst r2, #1 -Ltoo_small1: ldrneb r4, [r0], #1 -Lexit_r4: tst r2, #1 - strneb r4, [r1], #1 - andne r4, r4, #255 - adcnes r3, r3, r4 - adcs r0, r3, #0 - LOADREGS(ea,fp,{r4 - r8, fp, sp, pc}) - -Lsrc_not_aligned: - cmp r2, #4 - blt Ltoo_small - and ip, r0, #3 - bic r0, r0, #3 - ldr r4, [r0], #4 - cmp ip, #2 - beq Lsrc2_aligned - bhi Lsrc3_aligned - mov r4, r4, lsr #8 - adds r3, r3, #0 - bics ip, r2, #15 - beq 2f -1: ldmia r0!, {r5, r6, r7, r8} - orr r4, r4, r5, lsl #24 - mov r5, r5, lsr #8 - orr r5, r5, r6, lsl #24 - mov r6, r6, lsr #8 - orr r6, r6, r7, lsl #24 - mov r7, r7, lsr #8 - orr r7, r7, r8, lsl #24 - stmia r1!, {r4, r5, r6, r7} - adcs r3, r3, r4 - adcs r3, r3, r5 - adcs r3, r3, r6 - adcs r3, r3, r7 - mov r4, r8, lsr #8 - sub ip, ip, #16 - teq ip, #0 - bne 1b -2: ands ip, r2, #12 - beq 4f - tst ip, #8 - beq 3f - ldmia r0!, {r5, r6} - orr r4, r4, r5, lsl #24 - mov r5, r5, lsr #8 - orr r5, r5, r6, lsl #24 - stmia r1!, {r4, r5} - adcs r3, r3, r4 - adcs r3, r3, r5 - mov r4, r6, lsr #8 - tst ip, #4 - beq 4f -3: ldr r5, [r0], #4 - orr r4, r4, r5, lsl #24 - str r4, [r1], #4 - adcs r3, r3, r4 - mov r4, r5, lsr #8 -4: ands r2, r2, #3 - adceq r0, r3, #0 - LOADREGS(eqea,fp,{r4 - r8, fp, sp, pc}) - tst r2, #2 - beq Lexit_r4 - adcs r3, r3, r4, lsl #16 - strb r4, [r1], #1 - mov r4, r4, lsr #8 - strb r4, [r1], #1 - mov r4, r4, lsr #8 - b Lexit_r4 - -Lsrc2_aligned: mov r4, r4, lsr #16 - adds r3, r3, #0 - bics ip, r2, #15 - beq 2f -1: ldmia r0!, {r5, r6, r7, r8} - orr r4, r4, r5, lsl #16 - mov r5, r5, lsr #16 - orr r5, r5, r6, lsl #16 - mov r6, r6, lsr #16 - orr r6, r6, r7, lsl #16 - mov r7, r7, lsr #16 - orr r7, r7, r8, lsl #16 - stmia r1!, {r4, r5, r6, r7} - adcs r3, r3, r4 - adcs r3, r3, r5 - adcs r3, r3, r6 - adcs r3, r3, r7 - mov r4, r8, lsr #16 - sub ip, ip, #16 - teq ip, #0 - bne 1b -2: ands ip, r2, #12 - beq 4f - tst ip, #8 - beq 3f - ldmia r0!, {r5, r6} - orr r4, r4, r5, lsl #16 - mov r5, r5, lsr #16 - orr r5, r5, r6, lsl #16 - stmia r1!, {r4, r5} - adcs r3, r3, r4 - adcs r3, r3, r5 - mov r4, r6, lsr #16 - tst ip, #4 - beq 4f -3: ldr r5, [r0], #4 - orr r4, r4, r5, lsl #16 - str r4, [r1], #4 - adcs r3, r3, r4 - mov r4, r5, lsr #16 -4: ands r2, r2, #3 - adceq r0, r3, #0 - LOADREGS(eqea,fp,{r4 - r8, fp, sp, pc}) - tst r2, #2 - beq Lexit_r4 - adcs r3, r3, r4, lsl #16 - strb r4, [r1], #1 - mov r4, r4, lsr #8 - strb r4, [r1], #1 - ldrb r4, [r0], #1 - b Lexit_r4 - -Lsrc3_aligned: mov r4, r4, lsr #24 - adds r3, r3, #0 - bics ip, r2, #15 - beq 2f -1: ldmia r0!, {r5, r6, r7, r8} - orr r4, r4, r5, lsl #8 - mov r5, r5, lsr #24 - orr r5, r5, r6, lsl #8 - mov r6, r6, lsr #24 - orr r6, r6, r7, lsl #8 - mov r7, r7, lsr #24 - orr r7, r7, r8, lsl #8 - stmia r1!, {r4, r5, r6, r7} - adcs r3, r3, r4 - adcs r3, r3, r5 - adcs r3, r3, r6 - adcs r3, r3, r7 - mov r4, r8, lsr #24 - sub ip, ip, #16 - teq ip, #0 - bne 1b -2: ands ip, r2, #12 - beq 4f - tst ip, #8 - beq 3f - ldmia r0!, {r5, r6} - orr r4, r4, r5, lsl #8 - mov r5, r5, lsr #24 - orr r5, r5, r6, lsl #8 - stmia r1!, {r4, r5} - adcs r3, r3, r4 - adcs r3, r3, r5 - mov r4, r6, lsr #24 - tst ip, #4 - beq 4f -3: ldr r5, [r0], #4 - orr r4, r4, r5, lsl #8 - str r4, [r1], #4 - adcs r3, r3, r4 - mov r4, r5, lsr #24 -4: ands r2, r2, #3 - adceq r0, r3, #0 - LOADREGS(eqea,fp,{r4 - r8, fp, sp, pc}) - tst r2, #2 - beq Lexit_r4 - adcs r3, r3, r4, lsl #16 - strb r4, [r1], #1 - ldr r4, [r0], #4 - strb r4, [r1], #1 - adcs r3, r3, r4, lsl #24 - mov r4, r4, lsr #8 - b Lexit_r4 - -ENTRY(__csum_ipv6_magic) - stmfd sp!, {lr} - adds ip, r2, r3 - ldmia r1, {r1 - r3, lr} - adcs ip, ip, r1 - adcs ip, ip, r2 - adcs ip, ip, r3 - adcs ip, ip, lr - ldmia r0, {r0 - r3} - adcs r0, ip, r0 - adcs r0, r0, r1 - adcs r0, r0, r2 - adcs r0, r0, r3 - ldr r3, [sp, #4] - adcs r0, r0, r3 - adcs r0, r0, #0 - LOADREGS(fd, sp!, {pc}) diff --git a/arch/arm/lib/findbit.S b/arch/arm/lib/findbit.S new file mode 100644 index 000000000000..e1651904f022 --- /dev/null +++ b/arch/arm/lib/findbit.S @@ -0,0 +1,65 @@ +/* + * linux/arch/arm/lib/bitops.S + * + * Copyright (C) 1995-1996 Russell King + */ + +#include +#include + .text + +@ Purpose : Find a 'zero' bit +@ Prototype: int find_first_zero_bit(char *addr,int maxbit); + +ENTRY(find_first_zero_bit) + mov r2, #0 @ Initialise bit position +Lfindzbit1lp: ldrb r3, [r0, r2, lsr #3] @ Check byte, if 0xFF, then all bits set + teq r3, #0xFF + bne Lfoundzbit + add r2, r2, #8 + cmp r2, r1 @ Check to see if we have come to the end + bcc Lfindzbit1lp + add r0, r1, #1 @ Make sure that we flag an error + RETINSTR(mov,pc,lr) +Lfoundzbit: tst r3, #1 @ Check individual bits + moveq r0, r2 + RETINSTR(moveq,pc,lr) + tst r3, #2 + addeq r0, r2, #1 + RETINSTR(moveq,pc,lr) + tst r3, #4 + addeq r0, r2, #2 + RETINSTR(moveq,pc,lr) + tst r3, #8 + addeq r0, r2, #3 + RETINSTR(moveq,pc,lr) + tst r3, #16 + addeq r0, r2, #4 + RETINSTR(moveq,pc,lr) + tst r3, #32 + addeq r0, r2, #5 + RETINSTR(moveq,pc,lr) + tst r3, #64 + addeq r0, r2, #6 + RETINSTR(moveq,pc,lr) + add r0, r2, #7 + RETINSTR(mov,pc,lr) + +@ Purpose : Find next 'zero' bit +@ Prototype: int find_next_zero_bit(char *addr,int maxbit,int offset) + +ENTRY(find_next_zero_bit) + tst r2, #7 + beq Lfindzbit1lp @ If new byte, goto old routine + ldrb r3, [r0, r2, lsr#3] + orr r3, r3, #0xFF00 @ Set top bits so we wont get confused + stmfd sp!, {r4} + and r4, r2, #7 + mov r3, r3, lsr r4 @ Shift right by no. of bits + ldmfd sp!, {r4} + and r3, r3, #0xFF + teq r3, #0xFF + orreq r2, r2, #7 + addeq r2, r2, #1 + beq Lfindzbit1lp @ If all bits are set, goto old routine + b Lfoundzbit diff --git a/arch/arm/lib/getconsdata.c b/arch/arm/lib/getconsdata.c index 5b46baad047f..aaa7a7ad202d 100644 --- a/arch/arm/lib/getconsdata.c +++ b/arch/arm/lib/getconsdata.c @@ -10,6 +10,16 @@ #include #include +/* + * Make sure that the compiler and target are compatible + */ +#if (defined(__APCS_32__) && defined(CONFIG_CPU_26)) +#error Your compiler targets APCS-32 but this kernel requires APCS-26. +#endif +#if (defined(__APCS_26__) && defined(CONFIG_CPU_32)) +#error Your compiler targets APCS-26 but this kernel requires APCS-32. +#endif + #undef PAGE_READONLY #define OFF_TSK(n) (unsigned long)&(((struct task_struct *)0)->n) diff --git a/arch/arm/lib/io-footbridge.S b/arch/arm/lib/io-footbridge.S index 0734c6042929..98f751258771 100644 --- a/arch/arm/lib/io-footbridge.S +++ b/arch/arm/lib/io-footbridge.S @@ -6,7 +6,9 @@ .macro ioaddr, rd,rn add \rd, \rn, #pcio_high + .if pcio_low add \rd, \rd, #pcio_low + .endif .endm ENTRY(insl) diff --git a/arch/arm/lib/memchr.S b/arch/arm/lib/memchr.S new file mode 100644 index 000000000000..d52abe57f6bc --- /dev/null +++ b/arch/arm/lib/memchr.S @@ -0,0 +1,24 @@ +/* + * linux/arch/arm/lib/memchr.S + * + * Copyright (C) 1995-1999 Russell King + * + * ASM optimised string functions + * + */ +#include +#include +#include "constants.h" + + .text +ENTRY(memchr) + str lr, [sp, #-4]! +1: ldrb r3, [r0], #1 + teq r3, r1 + beq 2f + subs r2, r2, #1 + bpl 1b +2: movne r0, #0 + subeq r0, r0, #1 + LOADREGS(fd, sp!, {pc}) + diff --git a/arch/arm/lib/string.S b/arch/arm/lib/memcpy.S similarity index 54% rename from arch/arm/lib/string.S rename to arch/arm/lib/memcpy.S index ff809fd510ac..ae5307d4bc61 100644 --- a/arch/arm/lib/string.S +++ b/arch/arm/lib/memcpy.S @@ -1,5 +1,5 @@ /* - * linux/arch/arm/lib/string.S + * linux/arch/arm/lib/memcpy.S * * Copyright (C) 1995-1999 Russell King * @@ -12,207 +12,6 @@ .text -/* - * Prototype: void memzero(void *d, size_t n) - */ -1: @ 4 <= r1 - cmp ip, #2 @ 1 - strltb r2, [r0], #1 @ 1 - strleb r2, [r0], #1 @ 1 - strb r2, [r0], #1 @ 1 - rsb ip, ip, #4 @ 1 - sub r1, r1, ip @ 1 - cmp r1, #3 @ 1 - bgt 2f @ 1 @ +8 - b 4f @ 1 @ +9 - - .align 5 - -ENTRY(__memzero) - mov r2, #0 @ 1 - cmp r1, #4 @ 1 - blt 4f @ 1 @ = 3 - - @ r1 >= 4 - - ands ip, r0, #3 @ 1 - bne 1b @ 1 @ = 5 - -2: @ r1 >= 4 && (r0 & 3) = 0 @ = 5 or 11 - - str lr, [sp, #-4]! @ 1 - mov r3, #0 @ 1 - mov ip, #0 @ 1 - mov lr, #0 @ 1 - - @ 4 <= r1 <= 32 @ = 9 or 15 - -3: subs r1, r1, #32 @ 1 - stmgeia r0!, {r2, r3, ip, lr} @ 4 - stmgeia r0!, {r2, r3, ip, lr} @ 4 - bgt 3b @ 1 - LOADREGS(eqfd, sp!, {pc}) @ 1/2 - - @ -28 <= r1 <= -1 - - cmp r1, #-16 @ 1 - stmgeia r0!, {r2, r3, ip, lr} @ 4 - ldr lr, [sp], #4 @ 1 - addlts r1, r1, #16 @ 1 - RETINSTR(moveq,pc,lr) @ 1 - - @ -12 <= r1 <= -1 - - cmp r1, #-8 @ 1 - stmgeia r0!, {r2, r3} @ 2 - addlts r1, r1, #8 @ 1 - RETINSTR(moveq,pc,lr) @ 1 - - @ -4 <= r1 <= -1 - - cmp r1, #-4 @ 1 - strge r2, [r0], #4 @ 1 - adds r1, r1, #4 @ 1 - RETINSTR(moveq,pc,lr) @ 1 - -4: @ 1 <= r1 <= 3 - cmp r1, #2 @ 1 - strgtb r2, [r0], #1 @ 1 - strgeb r2, [r0], #1 @ 1 - strb r2, [r0], #1 @ 1 - RETINSTR(mov,pc,lr) @ 1 - -/* - * StrongARM optimised copy_page routine - * now 1.72bytes/cycle, was 1.60 bytes/cycle - * (50MHz bus -> 86MB/s) - */ - -ENTRY(copy_page) - stmfd sp!, {r4, lr} @ 2 - mov r2, #PAGE_SZ/64 @ 1 -1: ldmia r1!, {r3, r4, ip, lr} @ 4 - subs r2, r2, #1 @ 1 - stmia r0!, {r3, r4, ip, lr} @ 4 - ldmia r1!, {r3, r4, ip, lr} @ 4+1 - stmia r0!, {r3, r4, ip, lr} @ 4 - ldmia r1!, {r3, r4, ip, lr} @ 4+1 - stmia r0!, {r3, r4, ip, lr} @ 4 - ldmia r1!, {r3, r4, ip, lr} @ 4+1 - stmia r0!, {r3, r4, ip, lr} @ 4 - bne 1b @ 1 - LOADREGS(fd, sp!, {r4, pc}) @ 3 - - .align 5 -ENTRY(memset) /* needed for some versions of gcc */ -ENTRY(__memset) - mov r3, r0 - cmp r2, #16 - blt 6f - ands ip, r3, #3 - beq 1f - cmp ip, #2 - strltb r1, [r3], #1 @ Align destination - strleb r1, [r3], #1 - strb r1, [r3], #1 - rsb ip, ip, #4 - sub r2, r2, ip -1: orr r1, r1, r1, lsl #8 - orr r1, r1, r1, lsl #16 - cmp r2, #256 - blt 4f - stmfd sp!, {r4, r5, lr} - mov r4, r1 - mov r5, r1 - mov lr, r1 - mov ip, r2, lsr #6 - sub r2, r2, ip, lsl #6 -2: stmia r3!, {r1, r4, r5, lr} @ 64 bytes at a time. - stmia r3!, {r1, r4, r5, lr} - stmia r3!, {r1, r4, r5, lr} - stmia r3!, {r1, r4, r5, lr} - subs ip, ip, #1 - bne 2b - teq r2, #0 - LOADREGS(eqfd, sp!, {r4, r5, pc}) @ Now <64 bytes to go. - tst r2, #32 - stmneia r3!, {r1, r4, r5, lr} - stmneia r3!, {r1, r4, r5, lr} - tst r2, #16 - stmneia r3!, {r1, r4, r5, lr} - ldmia sp!, {r4, r5} -3: tst r2, #8 - stmneia r3!, {r1, lr} - tst r2, #4 - strne r1, [r3], #4 - tst r2, #2 - strneb r1, [r3], #1 - strneb r1, [r3], #1 - tst r2, #1 - strneb r1, [r3], #1 - LOADREGS(fd, sp!, {pc}) - -4: movs ip, r2, lsr #3 - beq 3b - sub r2, r2, ip, lsl #3 - stmfd sp!, {lr} - mov lr, r1 - subs ip, ip, #4 -5: stmgeia r3!, {r1, lr} - stmgeia r3!, {r1, lr} - stmgeia r3!, {r1, lr} - stmgeia r3!, {r1, lr} - subges ip, ip, #4 - bge 5b - tst ip, #2 - stmneia r3!, {r1, lr} - stmneia r3!, {r1, lr} - tst ip, #1 - stmneia r3!, {r1, lr} - teq r2, #0 - LOADREGS(eqfd, sp!, {pc}) - b 3b - -6: subs r2, r2, #1 - strgeb r1, [r3], #1 - bgt 6b - RETINSTR(mov, pc, lr) - -ENTRY(strrchr) - stmfd sp!, {lr} - mov r3, #0 -1: ldrb r2, [r0], #1 - teq r2, r1 - moveq r3, r0 - teq r2, #0 - bne 1b - mov r0, r3 - LOADREGS(fd, sp!, {pc}) - -ENTRY(strchr) - stmfd sp!,{lr} - mov r3, #0 -1: ldrb r2, [r0], #1 - teq r2, r1 - teqne r2, #0 - bne 1b - teq r2, #0 - moveq r0, #0 - subne r0, r0, #1 - LOADREGS(fd, sp!, {pc}) - -ENTRY(memchr) - stmfd sp!, {lr} -1: ldrb r3, [r0], #1 - teq r3, r1 - beq 2f - subs r2, r2, #1 - bpl 1b -2: movne r0, #0 - subeq r0, r0, #1 - LOADREGS(fd, sp!, {pc}) - - #define ENTER \ mov ip,sp ;\ stmfd sp!,{r4-r9,fp,ip,lr,pc} ;\ @@ -261,30 +60,30 @@ ENTRY(memmove) blt 6f subs r2, r2, #4 ldrlt r3, [r1], #4 + ldmgeia r1!, {r4, r5} strlt r3, [r0], #4 - ldmgeia r1!, {r3, r4} - stmgeia r0!, {r3, r4} + stmgeia r0!, {r4, r5} subge r2, r2, #4 6: adds r2, r2, #4 EXITEQ cmp r2, #2 ldrb r3, [r1], #1 + ldrgeb r4, [r1], #1 + ldrgtb r5, [r1], #1 strb r3, [r0], #1 - ldrgeb r3, [r1], #1 - strgeb r3, [r0], #1 - ldrgtb r3, [r1], #1 - strgtb r3, [r0], #1 + strgeb r4, [r0], #1 + strgtb r5, [r0], #1 EXIT 7: rsb ip, ip, #4 cmp ip, #2 ldrb r3, [r1], #1 + ldrgeb r4, [r1], #1 + ldrgtb r5, [r1], #1 strb r3, [r0], #1 - ldrgeb r3, [r1], #1 - strgeb r3, [r0], #1 - ldrgtb r3, [r1], #1 - strgtb r3, [r0], #1 + strgeb r4, [r0], #1 + strgtb r5, [r0], #1 subs r2, r2, ip blt 6b ands ip, r1, #3 @@ -314,9 +113,9 @@ ENTRY(memmove) blt 100f 10: mov r3, r7, lsr #8 ldr r7, [r1], #4 + subs r2, r2, #4 orr r3, r3, r7, lsl #24 str r3, [r0], #4 - subs r2, r2, #4 bge 10b 100: sub r1, r1, #3 b 6b @@ -340,9 +139,9 @@ ENTRY(memmove) blt 14f 13: mov r3, r7, lsr #16 ldr r7, [r1], #4 + subs r2, r2, #4 orr r3, r3, r7, lsl #16 str r3, [r0], #4 - subs r2, r2, #4 bge 13b 14: sub r1, r1, #2 b 6b @@ -366,9 +165,9 @@ ENTRY(memmove) blt 18f 17: mov r3, r7, lsr #24 ldr r7, [r1], #4 + subs r2, r2, #4 orr r3, r3, r7, lsl#8 str r3, [r0], #4 - subs r2, r2, #4 bge 17b 18: sub r1, r1, #1 b 6b @@ -403,29 +202,29 @@ ENTRY(memmove) blt 24f subs r2, r2, #4 ldrlt r3, [r1, #-4]! + ldmgedb r1!, {r4, r5} strlt r3, [r0, #-4]! - ldmgedb r1!, {r3, r4} - stmgedb r0!, {r3, r4} + stmgedb r0!, {r4, r5} subge r2, r2, #4 24: adds r2, r2, #4 EXITEQ cmp r2, #2 ldrb r3, [r1, #-1]! + ldrgeb r4, [r1, #-1]! + ldrgtb r5, [r1, #-1]! strb r3, [r0, #-1]! - ldrgeb r3, [r1, #-1]! - strgeb r3, [r0, #-1]! - ldrgtb r3, [r1, #-1]! - strgtb r3, [r0, #-1]! + strgeb r4, [r0, #-1]! + strgtb r5, [r0, #-1]! EXIT 25: cmp ip, #2 ldrb r3, [r1, #-1]! + ldrgeb r4, [r1, #-1]! + ldrgtb r5, [r1, #-1]! strb r3, [r0, #-1]! - ldrgeb r3, [r1, #-1]! - strgeb r3, [r0, #-1]! - ldrgtb r3, [r1, #-1]! - strgtb r3, [r0, #-1]! + strgeb r4, [r0, #-1]! + strgtb r5, [r0, #-1]! subs r2, r2, ip blt 24b ands ip, r1, #3 @@ -455,9 +254,9 @@ ENTRY(memmove) blt 29f 28: mov ip, r3, lsl #8 ldr r3, [r1, #-4]! + subs r2, r2, #4 orr ip, ip, r3, lsr #24 str ip, [r0, #-4]! - subs r2, r2, #4 bge 28b 29: add r1, r1, #3 b 24b @@ -481,9 +280,9 @@ ENTRY(memmove) blt 33f 32: mov ip, r3, lsl #16 ldr r3, [r1, #-4]! + subs r2, r2, #4 orr ip, ip, r3, lsr #16 str ip, [r0, #-4]! - subs r2, r2, #4 bge 32b 33: add r1, r1, #2 b 24b @@ -507,9 +306,9 @@ ENTRY(memmove) blt 37f 36: mov ip, r3, lsl #24 ldr r3, [r1, #-4]! + subs r2, r2, #4 orr ip, ip, r3, lsr #8 str ip, [r0, #-4]! - subs r2, r2, #4 bge 36b 37: add r1, r1, #1 b 24b diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S new file mode 100644 index 000000000000..b7202e86783e --- /dev/null +++ b/arch/arm/lib/memset.S @@ -0,0 +1,88 @@ +/* + * linux/arch/arm/lib/memset.S + * + * Copyright (C) 1995-1999 Russell King + * + * ASM optimised string functions + * + */ +#include +#include +#include "constants.h" + + .text + .align 5 +ENTRY(memset) + mov r3, r0 + cmp r2, #16 + blt 6f + ands ip, r3, #3 + beq 1f + cmp ip, #2 + strltb r1, [r3], #1 @ Align destination + strleb r1, [r3], #1 + strb r1, [r3], #1 + rsb ip, ip, #4 + sub r2, r2, ip +1: orr r1, r1, r1, lsl #8 + orr r1, r1, r1, lsl #16 + cmp r2, #256 + blt 4f + stmfd sp!, {r4, r5, lr} + mov r4, r1 + mov r5, r1 + mov lr, r1 + mov ip, r2, lsr #6 + sub r2, r2, ip, lsl #6 +2: stmia r3!, {r1, r4, r5, lr} @ 64 bytes at a time. + stmia r3!, {r1, r4, r5, lr} + stmia r3!, {r1, r4, r5, lr} + stmia r3!, {r1, r4, r5, lr} + subs ip, ip, #1 + bne 2b + teq r2, #0 + LOADREGS(eqfd, sp!, {r4, r5, pc}) @ Now <64 bytes to go. + tst r2, #32 + stmneia r3!, {r1, r4, r5, lr} + stmneia r3!, {r1, r4, r5, lr} + tst r2, #16 + stmneia r3!, {r1, r4, r5, lr} + ldmia sp!, {r4, r5} +3: tst r2, #8 + stmneia r3!, {r1, lr} + tst r2, #4 + strne r1, [r3], #4 + tst r2, #2 + strneb r1, [r3], #1 + strneb r1, [r3], #1 + tst r2, #1 + strneb r1, [r3], #1 + LOADREGS(fd, sp!, {pc}) + +4: movs ip, r2, lsr #3 + beq 3b + sub r2, r2, ip, lsl #3 + str lr, [sp, #-4]! + mov lr, r1 + subs ip, ip, #4 +5: stmgeia r3!, {r1, lr} + stmgeia r3!, {r1, lr} + stmgeia r3!, {r1, lr} + stmgeia r3!, {r1, lr} + subges ip, ip, #4 + bge 5b + tst ip, #2 + stmneia r3!, {r1, lr} + stmneia r3!, {r1, lr} + tst ip, #1 + stmneia r3!, {r1, lr} + teq r2, #0 + LOADREGS(eqfd, sp!, {pc}) + b 3b + +6: subs r2, r2, #1 + strgeb r1, [r3], #1 + bgt 6b + RETINSTR(mov, pc, lr) + + diff --git a/arch/arm/lib/memzero.S b/arch/arm/lib/memzero.S new file mode 100644 index 000000000000..59ec365740ff --- /dev/null +++ b/arch/arm/lib/memzero.S @@ -0,0 +1,80 @@ +/* + * linux/arch/arm/lib/memzero.S + * + * Copyright (C) 1995-1999 Russell King + */ +#include +#include +#include "constants.h" + + .text + +/* + * Prototype: void memzero(void *d, size_t n) + */ +1: @ 4 <= r1 + cmp ip, #2 @ 1 + strltb r2, [r0], #1 @ 1 + strleb r2, [r0], #1 @ 1 + strb r2, [r0], #1 @ 1 + rsb ip, ip, #4 @ 1 + sub r1, r1, ip @ 1 + cmp r1, #3 @ 1 + bgt 2f @ 1 @ +8 + b 4f @ 1 @ +9 + + .align 5 + +ENTRY(__memzero) + mov r2, #0 @ 1 + cmp r1, #4 @ 1 + blt 4f @ 1 @ = 3 + + @ r1 >= 4 + + ands ip, r0, #3 @ 1 + bne 1b @ 1 @ = 5 + +2: @ r1 >= 4 && (r0 & 3) = 0 @ = 5 or 11 + + str lr, [sp, #-4]! @ 1 + mov r3, #0 @ 1 + mov ip, #0 @ 1 + mov lr, #0 @ 1 + + @ 4 <= r1 <= 32 @ = 9 or 15 + +3: subs r1, r1, #32 @ 1 + stmgeia r0!, {r2, r3, ip, lr} @ 4 + stmgeia r0!, {r2, r3, ip, lr} @ 4 + bgt 3b @ 1 + LOADREGS(eqfd, sp!, {pc}) @ 1/2 + + @ -28 <= r1 <= -1 + + cmp r1, #-16 @ 1 + stmgeia r0!, {r2, r3, ip, lr} @ 4 + ldr lr, [sp], #4 @ 1 + addlts r1, r1, #16 @ 1 + RETINSTR(moveq,pc,lr) @ 1 + + @ -12 <= r1 <= -1 + + cmp r1, #-8 @ 1 + stmgeia r0!, {r2, r3} @ 2 + addlts r1, r1, #8 @ 1 + RETINSTR(moveq,pc,lr) @ 1 + + @ -4 <= r1 <= -1 + + cmp r1, #-4 @ 1 + strge r2, [r0], #4 @ 1 + adds r1, r1, #4 @ 1 + RETINSTR(moveq,pc,lr) @ 1 + +4: @ 1 <= r1 <= 3 + cmp r1, #2 @ 1 + strgtb r2, [r0], #1 @ 1 + strgeb r2, [r0], #1 @ 1 + strb r2, [r0], #1 @ 1 + RETINSTR(mov,pc,lr) @ 1 diff --git a/arch/arm/lib/setbit.S b/arch/arm/lib/setbit.S new file mode 100644 index 000000000000..b4319b4c31fb --- /dev/null +++ b/arch/arm/lib/setbit.S @@ -0,0 +1,26 @@ +/* + * linux/arch/arm/lib/setbit.S + * + * Copyright (C) 1995-1996 Russell King + */ + +#include +#include + .text + +@ Purpose : Function to set a bit +@ Prototype: int set_bit(int bit,int *addr) + +ENTRY(set_bit) + and r2, r0, #7 + mov r3, #1 + mov r3, r3, lsl r2 + SAVEIRQS(ip) + DISABLEIRQS(ip) + ldrb r2, [r1, r0, lsr #3] + orr r2, r2, r3 + strb r2, [r1, r0, lsr #3] + RESTOREIRQS(ip) + RETINSTR(mov,pc,lr) + + diff --git a/arch/arm/lib/strchr.S b/arch/arm/lib/strchr.S new file mode 100644 index 000000000000..fbde2483f103 --- /dev/null +++ b/arch/arm/lib/strchr.S @@ -0,0 +1,26 @@ +/* + * linux/arch/arm/lib/strchr.S + * + * Copyright (C) 1995-1999 Russell King + * + * ASM optimised string functions + * + */ +#include +#include +#include "constants.h" + + .text +ENTRY(strchr) + str lr, [sp, #-4]! + mov r3, #0 +1: ldrb r2, [r0], #1 + teq r2, r1 + teqne r2, #0 + bne 1b + teq r2, #0 + moveq r0, #0 + subne r0, r0, #1 + LOADREGS(fd, sp!, {pc}) + + diff --git a/arch/arm/lib/strrchr.S b/arch/arm/lib/strrchr.S new file mode 100644 index 000000000000..ad5a46089d34 --- /dev/null +++ b/arch/arm/lib/strrchr.S @@ -0,0 +1,25 @@ +/* + * linux/arch/arm/lib/strrchr.S + * + * Copyright (C) 1995-1999 Russell King + * + * ASM optimised string functions + * + */ +#include +#include +#include "constants.h" + + .text +ENTRY(strrchr) + stmfd sp!, {lr} + mov r3, #0 +1: ldrb r2, [r0], #1 + teq r2, r1 + moveq r3, r0 + teq r2, #0 + bne 1b + mov r0, r3 + LOADREGS(fd, sp!, {pc}) + + diff --git a/arch/arm/lib/system.c b/arch/arm/lib/system.c deleted file mode 100644 index f3b32cd8299e..000000000000 --- a/arch/arm/lib/system.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * linux/arch/arm/lib/system.c - * - * Copyright (C) 1999 Russell King - * - * Converted from ASM version 04/09/1999 - */ -#include - -extern void abort(void) -{ - void *lr = __builtin_return_address(0); - - printk(KERN_CRIT "kernel abort from %p! (Please report to rmk@arm.linux.org.uk)\n", - lr); - - /* force an oops */ - *(int *)0 = 0; - - /* if that doesn't kill us, halt */ - panic("Oops failed to kill thread"); -} diff --git a/arch/arm/lib/testchangebit.S b/arch/arm/lib/testchangebit.S new file mode 100644 index 000000000000..d3dd48216535 --- /dev/null +++ b/arch/arm/lib/testchangebit.S @@ -0,0 +1,25 @@ +/* + * linux/arch/arm/lib/testchangebit.S + * + * Copyright (C) 1995-1996 Russell King + */ + +#include +#include + .text + +ENTRY(test_and_change_bit) + add r1, r1, r0, lsr #3 + and r3, r0, #7 + mov r0, #1 + SAVEIRQS(ip) + DISABLEIRQS(ip) + ldrb r2, [r1] + tst r2, r0, lsl r3 + eor r2, r2, r0, lsl r3 + moveq r0, #0 + strb r2, [r1] + RESTOREIRQS(ip) + RETINSTR(mov,pc,lr) + + diff --git a/arch/arm/lib/testclearbit.S b/arch/arm/lib/testclearbit.S new file mode 100644 index 000000000000..4318653027ba --- /dev/null +++ b/arch/arm/lib/testclearbit.S @@ -0,0 +1,25 @@ +/* + * linux/arch/arm/lib/testclearbit.S + * + * Copyright (C) 1995-1996 Russell King + */ + +#include +#include + .text + +ENTRY(test_and_clear_bit) + add r1, r1, r0, lsr #3 @ Get byte offset + and r3, r0, #7 @ Get bit offset + mov r0, #1 + SAVEIRQS(ip) + DISABLEIRQS(ip) + ldrb r2, [r1] + tst r2, r0, lsl r3 + bic r2, r2, r0, lsl r3 + moveq r0, #0 + strb r2, [r1] + RESTOREIRQS(ip) + RETINSTR(mov,pc,lr) + + diff --git a/arch/arm/lib/testsetbit.S b/arch/arm/lib/testsetbit.S new file mode 100644 index 000000000000..760b6649db90 --- /dev/null +++ b/arch/arm/lib/testsetbit.S @@ -0,0 +1,25 @@ +/* + * linux/arch/arm/lib/testsetbit.S + * + * Copyright (C) 1995-1996 Russell King + */ + +#include +#include + .text + +ENTRY(test_and_set_bit) + add r1, r1, r0, lsr #3 @ Get byte offset + and r3, r0, #7 @ Get bit offset + mov r0, #1 + SAVEIRQS(ip) + DISABLEIRQS(ip) + ldrb r2, [r1] + tst r2, r0, lsl r3 + orr r2, r2, r0, lsl r3 + moveq r0, #0 + strb r2, [r1] + RESTOREIRQS(ip) + RETINSTR(mov,pc,lr) + + diff --git a/arch/arm/lib/uaccess.S b/arch/arm/lib/uaccess.S index 898d2ef772d6..00f987b5f06f 100644 --- a/arch/arm/lib/uaccess.S +++ b/arch/arm/lib/uaccess.S @@ -12,21 +12,13 @@ #include .text -#ifdef ENTRY + #define USER(x...) \ 9999: x; \ .section __ex_table,"a"; \ .align 3; \ .long 9999b,9001f; \ .previous -#else -#define USER(x...) \ - x -#define ENTRY(x...) \ - .globl _##x; \ -_##x: -#define TESTING -#endif #define PAGE_SHIFT 12 @@ -285,12 +277,10 @@ USER( strgebt r3, [r0], #1) @ May fault USER( strgtbt r3, [r0], #1) @ May fault b .c2u_finished -#ifndef TESTING .section .fixup,"ax" .align 0 9001: LOADREGS(fd,sp!, {r0, r4 - r7, pc}) .previous -#endif /* Prototype: unsigned long __arch_copy_from_user(void *to,const void *from,unsigned long n); * Purpose : copy a block from user memory to kernel memory @@ -546,7 +536,6 @@ USER( ldrget r3, [r1], #0) @ May fault strgtb r3, [r0], #1 b .cfu_finished -#ifndef TESTING .section .fixup,"ax" .align 0 /* We took an exception. Zero out the buffer and pretend no @@ -557,7 +546,6 @@ USER( ldrget r3, [r1], #0) @ May fault blne SYMBOL_NAME(__memzero) LOADREGS(fd,sp!, {r0, r4 - r7, pc}) .previous -#endif /* Prototype: int __arch_clear_user(void *addr, size_t sz) * Purpose : clear some user memory @@ -592,7 +580,6 @@ USER( strnebt r2, [r0], #1) mov r0, #0 LOADREGS(fd,sp!, {r1, pc}) -#ifndef TESTING .section .fixup,"ax" .align 0 9001: LOADREGS(fd,sp!, {r0, pc}) @@ -656,5 +643,4 @@ USER( ldrbt r3, [r1], #1) .previous .align -#endif diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c index 8715ea271a95..5151591b8e80 100644 --- a/arch/arm/mm/fault-armv.c +++ b/arch/arm/mm/fault-armv.c @@ -29,6 +29,8 @@ #define DO_COW(m) (!((m) & FAULT_CODE_READ)) #define READ_FAULT(m) ((m) & FAULT_CODE_READ) +extern void die_if_kernel(const char *str, struct pt_regs *regs, int err); + #include "fault-common.c" #ifdef DEBUG @@ -118,17 +120,18 @@ static int proc_alignment_read(char *page, char **start, off_t off, * This needs to be done after sysctl_init, otherwise sys/ * will be overwritten. */ -void __init alignment_init(void) +static int __init alignment_init(void) { create_proc_read_entry("sys/debug/alignment", 0, NULL, - proc_alignment_read); + proc_alignment_read, NULL); + return 0; } __initcall(alignment_init); #endif /* CONFIG_SYSCTL */ static int -do_alignment_exception(struct pt_regs *regs) +do_alignment(unsigned long addr, int error_code, struct pt_regs *regs) { unsigned int instr, rd, rn, correction, nr_regs, regbits; unsigned long eaddr; @@ -308,116 +311,99 @@ do_alignment_exception(struct pt_regs *regs) return 0; } +#else + +#define do_alignment NULL + #endif -#define BUG_PROC_MSG \ - "Buggy processor (%08X), trying to continue.\n" \ - "Please read http://www.arm.linux.org.uk/state.html for more information" +#ifdef CONFIG_DEBUG_USER -asmlinkage void -do_DataAbort(unsigned long addr, int fsr, int error_code, struct pt_regs *regs) +static int +do_sect_fault(unsigned long addr, int error_code, struct pt_regs *regs) { if (user_mode(regs)) { - if (addr == regs->ARM_pc) { - static int first = 1; - if (first) { - /* - * I want statistical information on this problem! - */ - printk(KERN_ERR BUG_PROC_MSG, fsr); - first = 0; + printk("%s: permission fault on section, " + "address=0x%08lx, code %d\n", + current->comm, addr, error_code); +#ifdef DEBUG + { + unsigned int i, j; + unsigned long *sp; + + sp = (unsigned long *) (regs->ARM_sp - 128); + for (j = 0; j < 20 && sp_valid(sp); j++) { + printk("%p: ", sp); + for (i = 0; i < 8 && sp_valid(sp); i += 1, sp++) + printk("%08lx ", *sp); + printk("\n"); } - return; + show_regs(regs); + c_backtrace(regs->ARM_fp, regs->ARM_cpsr); } +#endif } + return 1; /* not fixed up */ +} +#else -#define DIE(signr,nam)\ - force_sig(signr, current);\ - die(nam, regs, fsr);\ - do_exit(signr);\ - break - - switch (fsr & 15) { - /* - * 0 - vector exception - */ - case 0: - force_sig(SIGSEGV, current); - if (!user_mode(regs)) { - die("vector exception", regs, fsr); - do_exit(SIGSEGV); - } - break; - - /* - * 15 - permission fault on page - * 5 - page-table entry descriptor fault - * 7 - first-level descriptor fault - */ - case 15: case 5: case 7: - do_page_fault(addr, error_code, regs); - break; +#define do_sect_fault NULL - /* - * 13 - permission fault on section - */ - case 13: - force_sig(SIGSEGV, current); - if (!user_mode(regs)) { - die("section permission fault", regs, fsr); - do_exit(SIGSEGV); - } else { -#ifdef CONFIG_DEBUG_USER - printk("%s: permission fault on section, " - "address=0x%08lx, code %d\n", - current->comm, addr, error_code); -#ifdef DEBUG - { - unsigned int i, j; - unsigned long *sp; - - sp = (unsigned long *) (regs->ARM_sp - 128); - for (j = 0; j < 20 && sp_valid(sp); j++) { - printk("%p: ", sp); - for (i = 0; i < 8 && sp_valid(sp); i += 1, sp++) - printk("%08lx ", *sp); - printk("\n"); - } - show_regs(regs); - c_backtrace(regs->ARM_fp, regs->ARM_cpsr); - } -#endif #endif + +static struct fsr_info { + int (*fn)(unsigned long addr, int error_code, struct pt_regs *regs); + int sig; + char *name; +} fsr_info[] = { + { NULL, SIGSEGV, "vector exception" }, + { do_alignment, SIGBUS, "alignment exception" }, + { NULL, SIGKILL, "terminal exception" }, + { do_alignment, SIGBUS, "alignment exception" }, + { NULL, SIGBUS, "external abort on linefetch" }, + { do_page_fault, SIGSEGV, "page fault" }, + { NULL, SIGBUS, "external abort on linefetch" }, + { do_page_fault, SIGSEGV, "page fault" }, + { NULL, SIGBUS, "external abort on non-linefetch" }, + { NULL, SIGSEGV, "domain fault" }, + { NULL, SIGBUS, "external abort on non-linefetch" }, + { NULL, SIGSEGV, "domain fault" }, + { NULL, SIGBUS, "external abort on translation" }, + { do_sect_fault, SIGSEGV, "section permission fault" }, + { NULL, SIGBUS, "external abort on translation" }, + { do_page_fault, SIGSEGV, "page permission fault" } +}; + +/* + * Currently dropped down to debug level + */ +#define BUG_PROC_MSG \ + KERN_DEBUG "Weird data abort (%08X).\n" \ + KERN_DEBUG "Please see http://www.arm.linux.org.uk/state.html for more information" + +asmlinkage void +do_DataAbort(unsigned long addr, int fsr, int error_code, struct pt_regs *regs) +{ + struct fsr_info *inf; + + if (user_mode(regs) && addr == regs->ARM_pc) { + static int first = 1; + if (first) { + /* + * I want statistical information on this problem, + * but we don't want to hastle the users too much. + */ + printk(BUG_PROC_MSG, fsr); + first = 0; } - break; + return; + } - case 1: - case 3: -#ifdef CONFIG_ALIGNMENT_TRAP - if (!do_alignment_exception(regs)) - break; -#endif - /* - * this should never happen - */ - DIE(SIGBUS, "Alignment exception"); - break; + inf = fsr_info + (fsr & 15); - case 2: - DIE(SIGKILL, "Terminal exception"); - case 12: - case 14: - DIE(SIGBUS, "External abort on translation"); - case 9: - case 11: - DIE(SIGSEGV, "Domain fault"); - - case 4: - case 6: - DIE(SIGBUS, "External abort on linefetch"); - case 8: - case 10: - DIE(SIGBUS, "External abort on non-linefetch"); + if (!inf->fn || inf->fn(addr, error_code, regs)) { + force_sig(inf->sig, current); + die_if_kernel(inf->name, regs, fsr); } } diff --git a/arch/arm/mm/fault-common.c b/arch/arm/mm/fault-common.c index e516261ed64f..d04808ffa2f3 100644 --- a/arch/arm/mm/fault-common.c +++ b/arch/arm/mm/fault-common.c @@ -6,7 +6,7 @@ */ #include -extern void die(char *msg, struct pt_regs *regs, unsigned int err); +extern void die(const char *msg, struct pt_regs *regs, unsigned int err); /* * This is useful to dump out the page tables associated with @@ -79,7 +79,7 @@ kernel_page_fault(unsigned long addr, int write_access, struct pt_regs *regs, do_exit(SIGKILL); } -static void do_page_fault(unsigned long addr, int mode, struct pt_regs *regs) +static int do_page_fault(unsigned long addr, int mode, struct pt_regs *regs) { struct task_struct *tsk; struct mm_struct *mm; @@ -127,7 +127,7 @@ good_area: goto do_sigbus; up(&mm->mmap_sem); - return; + return 0; /* * Something tried to access memory that isn't in our memory map.. @@ -138,6 +138,7 @@ bad_area: /* User mode accesses just cause a SIGSEGV */ if (user_mode(regs)) { + tsk->thread.address = addr; tsk->thread.error_code = mode; tsk->thread.trap_no = 14; #ifdef CONFIG_DEBUG_USER @@ -145,7 +146,7 @@ bad_area: tsk->comm, regs->ARM_pc, regs->ARM_lr, addr, mode); #endif force_sig(SIGSEGV, tsk); - return; + return 0; } no_context: @@ -156,11 +157,11 @@ no_context: tsk->comm, regs->ARM_pc, addr, fixup); #endif regs->ARM_pc = fixup; - return; + return 0; } kernel_page_fault(addr, mode, regs, tsk, mm); - return; + return 0; do_sigbus: /* @@ -173,6 +174,7 @@ do_sigbus: * Send a sigbus, regardless of whether we were in kernel * or user mode. */ + tsk->thread.address = addr; tsk->thread.error_code = mode; tsk->thread.trap_no = 14; force_sig(SIGBUS, tsk); @@ -180,6 +182,7 @@ do_sigbus: /* Kernel mode? Handle exceptions or die */ if (!user_mode(regs)) goto no_context; + return 0; } diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 17972e427a18..bc4cf1ed1818 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -168,7 +168,8 @@ void show_mem(void) void __init paging_init(void) { void *zero_page, *bad_page, *bad_table; - unsigned int zone_size[3]; + unsigned int zone_size[MAX_NR_ZONES]; + int i; #ifdef CONFIG_CPU_32 #define TABLE_OFFSET (PTRS_PER_PTE) @@ -193,7 +194,24 @@ void __init paging_init(void) /* * Initialise the zones and mem_map */ - zonesize_init(zone_size); + for (i = 0; i < MAX_NR_ZONES; i++) + zone_size[i] = 0; + + /* + * Calculate the size of the zones. On ARM, we don't have + * any problems with DMA or highmem, so all memory is + * allocated to the DMA zone. + */ + for (i = 0; i < meminfo.nr_banks; i++) { + if (meminfo.bank[i].size) { + unsigned int end; + + end = (meminfo.bank[i].start - PHYS_OFFSET + + meminfo.bank[i].size) >> PAGE_SHIFT; + if (zone_size[0] < end) + zone_size[0] = end; + } + } free_area_init(zone_size); /* @@ -339,10 +357,11 @@ void free_initmem(void) #ifdef CONFIG_BLK_DEV_INITRD void free_initrd_mem(unsigned long start, unsigned long end) { - for (; start < end; start += PAGE_SIZE) { - ClearPageReserved(mem_map + MAP_NR(start)); - set_page_count(mem_map+MAP_NR(start), 1); - free_page(start); + unsigned long addr; + for (addr = start; addr < end; addr += PAGE_SIZE) { + ClearPageReserved(mem_map + MAP_NR(addr)); + set_page_count(mem_map+MAP_NR(addr), 1); + free_page(addr); totalram_pages++; } printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10); diff --git a/arch/arm/mm/mm-armo.c b/arch/arm/mm/mm-armo.c index 680a52948bad..a5d4cdfe8958 100644 --- a/arch/arm/mm/mm-armo.c +++ b/arch/arm/mm/mm-armo.c @@ -134,20 +134,6 @@ pte_t *get_pte_slow(pmd_t *pmd, unsigned long offset) return (pte_t *) pmd_page(*pmd) + offset; } -/* - * Calculate the size of the DMA, normal and highmem zones. - * On 26-bit ARMs, we don't have any real DMA or highmem, - * so we allocate the whole memory as being DMA-capable. - */ -void __init zonesize_init(unsigned int *zone_size) -{ - int i; - - zone_size[0] = max_low_pfn; - zone_size[1] = 0; - zone_size[2] = 0; -} - /* * This contains the code to setup the memory map on an ARM2/ARM250/ARM3 * machine. This is both processor & architecture specific, and requires diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c index ee4750c626e6..76d101507799 100644 --- a/arch/arm/mm/mm-armv.c +++ b/arch/arm/mm/mm-armv.c @@ -46,6 +46,15 @@ static int __init nowrite_setup(char *__unused) return 1; } +static int __init noalign_setup(char *__unused) +{ + cr_alignment &= ~2; + cr_no_alignment &= ~2; + set_cr(cr_alignment); + return 1; +} + +__setup("noalign", noalign_setup); __setup("nocache", nocache_setup); __setup("nowb", nowrite_setup); @@ -218,7 +227,7 @@ alloc_init_page(unsigned long virt, unsigned long phys, int domain, int prot) * the clearance is done by the middle-level functions (pmd) * rather than the top-level (pgd) functions. */ -static inline void free_init_section(unsigned long virt) +static inline void clear_mapping(unsigned long virt) { pmd_clear(pmd_offset(pgd_offset_k(virt), virt)); } @@ -273,73 +282,76 @@ static void __init create_mapping(struct map_desc *md) } } -/* - * Initial boot-time mapping. This covers just the zero page, kernel and - * the flush area. NB: it must be sorted by virtual address, and no - * virtual address overlaps. - * init_map[2..4] are for architectures with banked memory. - */ -static struct map_desc init_map[] __initdata = { - { 0, 0, PAGE_SIZE, DOMAIN_USER, 0, 0, 1, 0 }, /* zero page */ - { 0, 0, 0, DOMAIN_KERNEL, 0, 1, 1, 1 }, /* kernel memory */ - { 0, 0, 0, DOMAIN_KERNEL, 0, 1, 1, 1 }, /* (4 banks) */ - { 0, 0, 0, DOMAIN_KERNEL, 0, 1, 1, 1 }, - { 0, 0, 0, DOMAIN_KERNEL, 0, 1, 1, 1 }, - { 0, 0, PGDIR_SIZE, DOMAIN_KERNEL, 1, 0, 1, 1 }, /* cache flush 1 */ - { 0, 0, 0, DOMAIN_KERNEL, 1, 0, 1, 0 } /* cache flush 2 */ -}; - -#define NR_INIT_MAPS (sizeof(init_map) / sizeof(init_map[0])) - -/* - * Calculate the size of the DMA, normal and highmem zones. - * On ARM, we don't have any problems with DMA, so all memory - * is allocated to the DMA zone. We also don't have any - * highmem either. - */ -void __init zonesize_init(unsigned int *zone_size) +void __init pagetable_init(void) { + struct map_desc *init_maps, *p; + unsigned long address = 0; int i; - zone_size[0] = 0; - zone_size[1] = 0; - zone_size[2] = 0; + /* + * Setup initial mappings. We use the page we allocated + * for zero page to hold the mappings, which will get + * overwritten by the vectors in traps_init(). The + * mappings must be in virtual address order. + */ + init_maps = p = alloc_bootmem_low_pages(PAGE_SIZE); + + p->physical = virt_to_phys(init_maps); + p->virtual = 0; + p->length = PAGE_SIZE; + p->domain = DOMAIN_USER; + p->prot_read = 0; + p->prot_write = 0; + p->cacheable = 1; + p->bufferable = 0; + + p ++; for (i = 0; i < meminfo.nr_banks; i++) { - if (meminfo.bank[i].size) { - unsigned int end; + if (meminfo.bank[i].size == 0) + continue; - end = (meminfo.bank[i].start - PHYS_OFFSET + - meminfo.bank[i].size) >> PAGE_SHIFT; - if (end > zone_size[0]) - zone_size[0] = end; - } + p->physical = meminfo.bank[i].start; + p->virtual = __phys_to_virt(p->physical); + p->length = meminfo.bank[i].size; + p->domain = DOMAIN_KERNEL; + p->prot_read = 0; + p->prot_write = 1; + p->cacheable = 1; + p->bufferable = 1; + + p ++; } -} -void __init pagetable_init(void) -{ - unsigned long address = 0; - int i; + p->physical = FLUSH_BASE_PHYS; + p->virtual = FLUSH_BASE; + p->length = PGDIR_SIZE; + p->domain = DOMAIN_KERNEL; + p->prot_read = 1; + p->prot_write = 0; + p->cacheable = 1; + p->bufferable = 1; + + p ++; - /* - * Setup the above mappings - */ - init_map[0].physical = virt_to_phys(alloc_bootmem_low_pages(PAGE_SIZE)); - init_map[5].physical = FLUSH_BASE_PHYS; - init_map[5].virtual = FLUSH_BASE; #ifdef FLUSH_BASE_MINICACHE - init_map[6].physical = FLUSH_BASE_PHYS + PGDIR_SIZE; - init_map[6].virtual = FLUSH_BASE_MINICACHE; - init_map[6].length = PGDIR_SIZE; + p->physical = FLUSH_BASE_PHYS + PGDIR_SIZE; + p->virtual = FLUSH_BASE_MINICACHE; + p->length = PGDIR_SIZE; + p->domain = DOMAIN_KERNEL; + p->prot_read = 1; + p->prot_write = 0; + p->cacheable = 1; + p->bufferable = 0; + + p ++; #endif - for (i = 0; i < meminfo.nr_banks; i++) { - init_map[i+1].physical = meminfo.bank[i].start; - init_map[i+1].virtual = meminfo.bank[i].start + - PAGE_OFFSET - PHYS_OFFSET; - init_map[i+1].length = meminfo.bank[i].size; - } + /* + * We may have a mapping in virtual address 0. + * Clear it out. + */ + clear_mapping(0); /* * Go through the initial mappings, but clear out any @@ -347,18 +359,16 @@ void __init pagetable_init(void) */ i = 0; do { - if (address < init_map[i].virtual || i == NR_INIT_MAPS) { - free_init_section(address); + if (address < init_maps->virtual || init_maps == p) { + clear_mapping(address); address += PGDIR_SIZE; } else { - create_mapping(init_map + i); + create_mapping(init_maps); - address = init_map[i].virtual + init_map[i].length; + address = init_maps->virtual + init_maps->length; address = (address + PGDIR_SIZE - 1) & PGDIR_MASK; - do { - i += 1; - } while (init_map[i].length == 0 && i < NR_INIT_MAPS); + init_maps ++; } } while (address != 0); @@ -382,6 +392,7 @@ void __init create_memmap_holes(void) unsigned int i; #define PFN(x) (((x) - PHYS_OFFSET) >> PAGE_SHIFT) +#define free_bootmem(s,sz) free_bootmem(((s)<> PAGE_SHIFT) + if (end_pfn != PFN(meminfo.end)) pg = mem_map + end_pfn; } diff --git a/arch/arm/mm/mm-sa1100.c b/arch/arm/mm/mm-sa1100.c index eba2984b6b18..c6f9f2e8b7ac 100644 --- a/arch/arm/mm/mm-sa1100.c +++ b/arch/arm/mm/mm-sa1100.c @@ -6,11 +6,11 @@ * Copyright (C) 1998-1999 Russell King * Copyright (C) 1999 Hugo Fiennes * - * 1999/09/12 Nicolas Pitre - * Specific RAM implementation details are in - * linux/include/asm/arch-sa1100/memory.h now. - * Allows for better macro optimisations when possible. + * 1999/12/04 Nicolas Pitre + * Converted memory definition for struct meminfo initialisations. + * Memory is listed physically now. */ + #include #include #include @@ -22,33 +22,37 @@ #define SIZE(x) (sizeof(x) / sizeof(x[0])) + /* - * These are the memory size mappings for the - * SA1100. Note that LART is a special case - - * it doesn't use physical address A23 on the - * DRAM, so we effectively have 4 * 8MB in - * two banks. + * These are the RAM memory mappings for SA1100 implementations. + * Note that LART is a special case - it doesn't use physical + * address line A23 on the DRAM, so we effectively have 4 * 8MB + * in two banks. */ -struct mem_desc mem_desc[] __initdata = { - /* virt start virt end */ +struct mem_desc { + unsigned long phys_start; + unsigned long length; +} mem_desc[] __initdata = { #if defined(CONFIG_SA1100_BRUTUS) - { 0xc0000000, 0xc0400000 }, /* 4MB */ - { 0xc1000000, 0xc1400000 }, /* 4MB */ - { 0xc2000000, 0xc2400000 }, /* 4MB */ - { 0xc3000000, 0xc3400000 } /* 4MB */ + { 0xc0000000, 0x00400000 }, /* 4MB */ + { 0xc8000000, 0x00400000 }, /* 4MB */ +#if 0 /* only two banks until the bootmem stuff is fixed... */ + { 0xd0000000, 0x00400000 }, /* 4MB */ + { 0xd8000000, 0x00400000 } /* 4MB */ +#endif #elif defined(CONFIG_SA1100_EMPEG) - { 0xc0000000, 0xc0400000 }, /* 4MB */ - { 0xc1000000, 0xc1400000 } /* 4MB */ + { 0xc0000000, 0x00400000 }, /* 4MB */ + { 0xc8000000, 0x00400000 } /* 4MB */ #elif defined(CONFIG_SA1100_LART) - { 0xc0000000, 0xc0800000 }, /* 16MB */ - { 0xc1000000, 0xc1800000 }, - { 0xc2000000, 0xc2800000 }, /* 16MB */ - { 0xc3000000, 0xc3800000 } + { 0xc0000000, 0x00800000 }, /* 8MB */ + { 0xc1000000, 0x00800000 }, /* 8MB */ + { 0xc8000000, 0x00800000 }, /* 8MB */ + { 0xc9000000, 0x00800000 } /* 8MB */ #elif defined(CONFIG_SA1100_VICTOR) - { 0xc0000000, 0xc0400000 } /* 4MB */ + { 0xc0000000, 0x00400000 } /* 4MB */ #elif defined(CONFIG_SA1100_TIFON) - { 0xc0000000, 0xc1000000 }, /* 16MB */ - { 0xc1000000, 0xc2000000 } /* 16MB */ + { 0xc0000000, 0x01000000 }, /* 16MB */ + { 0xc8000000, 0x01000000 } /* 16MB */ #else #error missing memory configuration #endif @@ -56,6 +60,7 @@ struct mem_desc mem_desc[] __initdata = { unsigned int __initdata mem_desc_size = SIZE(mem_desc); + struct map_desc io_desc[] __initdata = { /* virtual physical length domain r w c b */ #if defined(CONFIG_SA1100_VICTOR) diff --git a/arch/arm/mm/proc-arm6,7.S b/arch/arm/mm/proc-arm6,7.S index d453269d2ab5..23508c197ed1 100644 --- a/arch/arm/mm/proc-arm6,7.S +++ b/arch/arm/mm/proc-arm6,7.S @@ -134,14 +134,10 @@ ENTRY(cpu_arm7_data_abort) b Ldata_simple @ ldc rd, [rn, #m] b Ldata_unknown Ldata_unknown: @ Part of jumptable - ldr r3, [sp, #15 * 4] @ Get PC - str r3, [sp, #-4]! - mov r1, r1, lsr #2 - mov r3, r4 - mov r2, r0 - adr r0, Lukabttxt - bl SYMBOL_NAME(panic) -Lstop: b Lstop + mov r0, r1 + mov r1, r4 + mov r2, r3 + b baddataabort Ldata_ldmstm: tst r4, #1 << 21 @ check writeback bit beq Ldata_simple @@ -468,7 +464,7 @@ ENTRY(arm6_processor_functions) .word cpu_arm6_cache_wback_area .word cpu_arm6_cache_purge_area .word cpu_arm6_flush_tlb_page - .word cpu_arm7_do_idle + .word cpu_arm6_do_idle .size arm6_processor_functions, . - arm6_processor_functions /* diff --git a/arch/arm/mm/proc-sa110.S b/arch/arm/mm/proc-sa110.S index 2d57b1030536..5431f14a04ea 100644 --- a/arch/arm/mm/proc-sa110.S +++ b/arch/arm/mm/proc-sa110.S @@ -16,6 +16,7 @@ * is larger than this, then we flush the whole cache */ #define MAX_AREA_SIZE 32768 +#define FLUSH_OFFSET 32768 .macro flush_110_dcache rd, ra, re add \re, \ra, #16384 @ only necessary for 16k @@ -56,7 +57,7 @@ cpu_sa110_flush_cache_all_r2: ands r1, r1, #1 eor r1, r1, #1 str r1, [r3] - addne ip, ip, #32768 + addne ip, ip, #FLUSH_OFFSET flush_110_dcache r3, ip, r1 mov ip, #0 teq r2, #0 @@ -74,7 +75,7 @@ cpu_sa1100_flush_cache_all_r2: ands r1, r1, #1 eor r1, r1, #1 str r1, [r3] - addne ip, ip, #32768 + addne ip, ip, #FLUSH_OFFSET flush_1100_dcache r3, ip, r1 mov ip, #0 teq r2, #0 @@ -321,7 +322,7 @@ ENTRY(cpu_sa110_set_pgd) ands r2, r2, #1 eor r2, r2, #1 str r2, [r3] - addne ip, ip, #32768 + addne ip, ip, #FLUSH_OFFSET flush_110_dcache r3, ip, r1 mov r1, #0 mcr p15, 0, r1, c7, c5, 0 @ flush I cache @@ -338,7 +339,7 @@ ENTRY(cpu_sa1100_set_pgd) ands r2, r2, #1 eor r2, r2, #1 str r2, [r3] - addne ip, ip, #32768 + addne ip, ip, #FLUSH_OFFSET flush_1100_dcache r3, ip, r1 mov r1, #0 mcr p15, 0, r1, c7, c5, 0 @ flush I cache @@ -430,8 +431,12 @@ ENTRY(cpu_sa110_do_idle) ENTRY(cpu_sa1100_do_idle) mov r0, #0 mcr p15, 0, r0, c15, c2, 2 @ Disable clock switching - @ load from uncacheable loc? - mcr p15, 0, r0, c15, c8, 2 @ Wait for interrupt + ldr r1, =FLUSH_BASE+FLUSH_OFFSET*2 @ load from uncacheable loc + ldr r1, [r1, #0] + b 1f + + .align 5 +1: mcr p15, 0, r0, c15, c8, 2 @ Wait for interrupt mcr p15, 0, r0, c15, c1, 2 @ Enable clock switching mov pc, lr diff --git a/arch/arm/vmlinux-armv.lds.in b/arch/arm/vmlinux-armv.lds.in index f83109875daa..93b8946e7ec8 100644 --- a/arch/arm/vmlinux-armv.lds.in +++ b/arch/arm/vmlinux-armv.lds.in @@ -6,82 +6,84 @@ OUTPUT_ARCH(arm) ENTRY(stext) SECTIONS { - . = TEXTADDR; - .text : { } /* Set text start address */ - - __init_begin = .; /* Init code and data */ - .text.init : { *(.text.init) } - __proc_info_begin = .; - .proc.info : { *(.proc.info) } - __proc_info_end = .; - .data.init : { *(.data.init) } - . = ALIGN(16); - __setup_start = .; - .setup.init : { *(.setup.init) } - __setup_end = .; - __initcall_start = .; - .initcall.init : { *(.initcall.init) } - __initcall_end = .; - . = ALIGN(4096); - __init_end = .; - - __ebsa285_begin = .; - .text.ebsa285 : { *(.text.ebsa285) } - .data.ebsa285 : { *(.data.ebsa285) } - . = ALIGN(4096); - __ebsa285_end = .; - - __netwinder_begin = .; - .text.netwinder : { *(.text.netwinder) } - .data.netwinder : { *(.data.netwinder) } - . = ALIGN(4096); - __netwinder_end = .; - - _text = .; /* Text and read-only data */ - .text.real : { /* Real text segment */ - *(.text) - *(.fixup) - *(.gnu.warning) + . = TEXTADDR; + .init : { /* Init code and data */ + __init_begin = .; + *(.text.init) + __proc_info_begin = .; + *(.proc.info) + __proc_info_end = .; + *(.data.init) + . = ALIGN(16); + __setup_start = .; + *(.setup.init) + __setup_end = .; + __initcall_start = .; + *(.initcall.init) + __initcall_end = .; + . = ALIGN(4096); + __init_end = .; } - .text.lock : { *(.text.lock) } /* out-of-line lock text */ - .rodata : { *(.rodata) } - .kstrtab : { *(.kstrtab) } + .ebsa285 : { + __ebsa285_begin = .; + *(.text.ebsa285) + *(.data.ebsa285) + . = ALIGN(4096); + __ebsa285_end = .; + } - . = ALIGN(16); /* Exception table */ - __start___ex_table = .; - __ex_table : { *(__ex_table) } - __stop___ex_table = .; + .netwinder : { + __netwinder_begin = .; + *(.text.netwinder) + *(.data.netwinder) + . = ALIGN(4096); + __netwinder_end = .; + } - __start___ksymtab = .; /* Kernel symbol table */ - __ksymtab : { *(__ksymtab) } - __stop___ksymtab = .; + .text : { /* Real text segment */ + _text = .; /* Text and read-only data */ + *(.text) + *(.fixup) + *(.gnu.warning) + *(.text.lock) /* out-of-line lock text */ + *(.rodata) + *(.kstrtab) + . = ALIGN(16); /* Exception table */ + __start___ex_table = .; + *(__ex_table) + __stop___ex_table = .; - .got : { *(.got) } /* Global offset table */ + __start___ksymtab = .; /* Kernel symbol table */ + *(__ksymtab) + __stop___ksymtab = .; - _etext = .; /* End of text section */ + *(.got) /* Global offset table */ - . = ALIGN(8192); - .data : { /* Data */ - *(.init.task) - *(.data) - CONSTRUCTORS + _etext = .; /* End of text section */ } - _edata = .; /* End of data section */ + . = ALIGN(8192); - __bss_start = .; /* BSS */ - .bss : { - *(.bss) + .data : { /* Data */ + *(.init.task) + *(.data) + CONSTRUCTORS + _edata = .; /* End of data section */ } - _end = . ; - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } + .bss : { + __bss_start = .; /* BSS */ + *(.bss) + *(COMMON) + _end = . ; + } + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } } diff --git a/arch/i386/config.in b/arch/i386/config.in index 7d56f423d12a..bf0f961958df 100644 --- a/arch/i386/config.in +++ b/arch/i386/config.in @@ -7,6 +7,8 @@ mainmenu_name "Linux Kernel Configuration" define_bool CONFIG_X86 y define_bool CONFIG_ISA y +define_bool CONFIG_UID16 y + mainmenu_option next_comment comment 'Code maturity level options' bool 'Prompt for development and/or incomplete code/drivers' CONFIG_EXPERIMENTAL @@ -106,7 +108,7 @@ fi bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG if [ "$CONFIG_HOTPLUG" = "y" ] ; then -source drivers/pcmcia/Config.in + source drivers/pcmcia/Config.in fi bool 'System V IPC' CONFIG_SYSVIPC diff --git a/arch/i386/defconfig b/arch/i386/defconfig index dfc2249816da..fc9a921a5c78 100644 --- a/arch/i386/defconfig +++ b/arch/i386/defconfig @@ -398,11 +398,11 @@ CONFIG_PSMOUSE=y CONFIG_DRM=y CONFIG_DRM_TDFX=y # CONFIG_DRM_GAMMA is not set +CONFIG_PCMCIA_SERIAL=y # # PCMCIA character device support # -CONFIG_PCMCIA_SERIAL=y # CONFIG_PCMCIA_SERIAL_CS is not set # CONFIG_PCMCIA_SERIAL_CB is not set diff --git a/arch/i386/kernel/pci-i386.c b/arch/i386/kernel/pci-i386.c index 27715f16a6b4..ee2edca1e87b 100644 --- a/arch/i386/kernel/pci-i386.c +++ b/arch/i386/kernel/pci-i386.c @@ -108,13 +108,13 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root, res->flags |= PCI_ROM_ADDRESS_ENABLE; reg = dev->rom_base_reg; } else { - /* Bug? */ + /* Somebody might have asked allocation of a non-standard resource */ return; } pci_write_config_dword(dev, reg, new); pci_read_config_dword(dev, reg, &check); - if (new != check) { + if ((new ^ check) & ((new & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK)) { printk(KERN_ERR "PCI: Error while updating region " "%s/%d (%08x != %08x)\n", dev->slot_name, resource, new, check); diff --git a/arch/m68k/config.in b/arch/m68k/config.in index 2d6095694327..52a083750a13 100644 --- a/arch/m68k/config.in +++ b/arch/m68k/config.in @@ -2,6 +2,9 @@ # For a description of the syntax of this configuration file, # see the Configure script. # + +define_bool CONFIG_UID16 y + mainmenu_name "Linux/68k Kernel Configuration" mainmenu_option next_comment diff --git a/arch/ppc/config.in b/arch/ppc/config.in index 60373a13bbab..2f2f7977e2e3 100644 --- a/arch/ppc/config.in +++ b/arch/ppc/config.in @@ -112,7 +112,11 @@ tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC source drivers/pci/Config.in -source drivers/pcmcia/Config.in +bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG + +if [ "$CONFIG_HOTPLUG" = "y" ]; then + source drivers/pcmcia/Config.in +fi source drivers/parport/Config.in diff --git a/arch/ppc/configs/common_defconfig b/arch/ppc/configs/common_defconfig index 9776262747b0..795aa5b833e1 100644 --- a/arch/ppc/configs/common_defconfig +++ b/arch/ppc/configs/common_defconfig @@ -45,11 +45,7 @@ CONFIG_KCORE_ELF=y CONFIG_BINFMT_ELF=y CONFIG_KERNEL_ELF=y # CONFIG_BINFMT_MISC is not set - -# -# PCMCIA/CardBus support -# -# CONFIG_PCMCIA is not set +# CONFIG_HOTPLUG is not set # CONFIG_PARPORT is not set CONFIG_VGA_CONSOLE=y CONFIG_FB=y diff --git a/arch/ppc/configs/gemini_defconfig b/arch/ppc/configs/gemini_defconfig index ed12c36a14c8..9850f61d839a 100644 --- a/arch/ppc/configs/gemini_defconfig +++ b/arch/ppc/configs/gemini_defconfig @@ -47,11 +47,7 @@ CONFIG_BINFMT_ELF=y CONFIG_KERNEL_ELF=y # CONFIG_BINFMT_MISC is not set # CONFIG_PCI_NAMES is not set - -# -# PCMCIA/CardBus support -# -# CONFIG_PCMCIA is not set +# CONFIG_HOTPLUG is not set # CONFIG_PARPORT is not set # CONFIG_VGA_CONSOLE is not set # CONFIG_FB is not set diff --git a/arch/ppc/configs/oak_defconfig b/arch/ppc/configs/oak_defconfig index c24514195bf9..5fe9be3760f0 100644 --- a/arch/ppc/configs/oak_defconfig +++ b/arch/ppc/configs/oak_defconfig @@ -40,11 +40,7 @@ CONFIG_SYSVIPC=y CONFIG_BINFMT_ELF=y CONFIG_KERNEL_ELF=y # CONFIG_BINFMT_MISC is not set - -# -# PCMCIA/CardBus support -# -# CONFIG_PCMCIA is not set +# CONFIG_HOTPLUG is not set # CONFIG_PARPORT is not set # CONFIG_VGA_CONSOLE is not set # CONFIG_FB is not set diff --git a/arch/ppc/configs/pmac_defconfig b/arch/ppc/configs/pmac_defconfig index 514843d00c73..e2b7c31bd8b5 100644 --- a/arch/ppc/configs/pmac_defconfig +++ b/arch/ppc/configs/pmac_defconfig @@ -35,6 +35,7 @@ CONFIG_SYSVIPC=y CONFIG_BINFMT_ELF=y CONFIG_KERNEL_ELF=y CONFIG_BINFMT_MISC=m +CONFIG_HOTPLUG=y # # PCMCIA/Cardbus support diff --git a/arch/ppc/configs/walnut_defconfig b/arch/ppc/configs/walnut_defconfig index cdcb915bedb2..931e1a7a9036 100644 --- a/arch/ppc/configs/walnut_defconfig +++ b/arch/ppc/configs/walnut_defconfig @@ -40,11 +40,7 @@ CONFIG_SYSVIPC=y CONFIG_BINFMT_ELF=y CONFIG_KERNEL_ELF=y # CONFIG_BINFMT_MISC is not set - -# -# PCMCIA/CardBus support -# -# CONFIG_PCMCIA is not set +# CONFIG_HOTPLUG is not set # CONFIG_PARPORT is not set # CONFIG_VGA_CONSOLE is not set # CONFIG_FB is not set diff --git a/arch/ppc/defconfig b/arch/ppc/defconfig index 2a3aac0f73d0..08acbd87419f 100644 --- a/arch/ppc/defconfig +++ b/arch/ppc/defconfig @@ -45,11 +45,7 @@ CONFIG_KCORE_ELF=y CONFIG_BINFMT_ELF=y CONFIG_KERNEL_ELF=y # CONFIG_BINFMT_MISC is not set - -# -# PCMCIA/CardBus support -# -# CONFIG_PCMCIA is not set +# CONFIG_HOTPLUG is not set # CONFIG_PARPORT is not set CONFIG_VGA_CONSOLE=y CONFIG_FB=y diff --git a/arch/sparc/ap1000/apmmu.c b/arch/sparc/ap1000/apmmu.c index 1de5dc89a161..425f23b8cbd7 100644 --- a/arch/sparc/ap1000/apmmu.c +++ b/arch/sparc/ap1000/apmmu.c @@ -908,7 +908,6 @@ static void __init map_kernel(void) (phys>>12), APMMU_CACHE|APMMU_PRIV|APMMU_VALID); init_mm.mmap->vm_start = PAGE_OFFSET; - stack_top = PAGE_OFFSET - PAGE_SIZE; } extern unsigned long free_area_init(unsigned long, unsigned long); diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c index 195f26df5502..1be5a02e3990 100644 --- a/arch/sparc/kernel/process.c +++ b/arch/sparc/kernel/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.142 1999/12/27 06:08:31 anton Exp $ +/* $Id: process.c,v 1.143 2000/01/09 09:13:28 anton Exp $ * linux/arch/sparc/kernel/process.c * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -503,6 +503,9 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, #endif p->thread.kwim = current->thread.fork_kwim; + /* This is used for sun4c only */ + atomic_set(&p->thread.refcount, 1); + if(regs->psr & PSR_PS) { extern struct pt_regs fake_swapper_regs; diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c index 42c36eaa2b8e..6943aa4e6f6d 100644 --- a/arch/sparc/kernel/sparc_ksyms.c +++ b/arch/sparc/kernel/sparc_ksyms.c @@ -1,4 +1,4 @@ -/* $Id: sparc_ksyms.c,v 1.85 2000/01/08 16:38:18 anton Exp $ +/* $Id: sparc_ksyms.c,v 1.86 2000/01/09 10:46:49 anton Exp $ * arch/sparc/kernel/ksyms.c: Sparc specific ksyms support. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -125,10 +125,6 @@ EXPORT_SYMBOL_NOVERS(___up_write); EXPORT_SYMBOL(sparc_valid_addr_bitmap); -#ifndef CONFIG_SUN4 -EXPORT_SYMBOL(stack_top); -#endif - /* Atomic operations. */ EXPORT_SYMBOL_PRIVATE(_atomic_add); EXPORT_SYMBOL_PRIVATE(_atomic_sub); diff --git a/arch/sparc/kernel/sunos_asm.S b/arch/sparc/kernel/sunos_asm.S index 0c4e9a6732a1..913630e66b7c 100644 --- a/arch/sparc/kernel/sunos_asm.S +++ b/arch/sparc/kernel/sunos_asm.S @@ -1,4 +1,4 @@ -/* $Id: sunos_asm.S,v 1.14 1996/12/04 18:25:48 jj Exp $ +/* $Id: sunos_asm.S,v 1.15 2000/01/11 17:33:21 jj Exp $ * sunos_asm.S: SunOS system calls which must have a low-level * entry point to operate correctly. * @@ -33,10 +33,10 @@ C_LABEL(sunos_getpid): /* SunOS getuid() returns uid in %o0 and euid in %o1 */ .globl C_LABEL(sunos_getuid) C_LABEL(sunos_getuid): - call C_LABEL(sys_geteuid) + call C_LABEL(sys_geteuid16) nop - call C_LABEL(sys_getuid) + call C_LABEL(sys_getuid16) st %o0, [%sp + REGWIN_SZ + PT_I1] b C_LABEL(ret_sys_call) @@ -45,10 +45,10 @@ C_LABEL(sunos_getuid): /* SunOS getgid() returns gid in %o0 and egid in %o1 */ .globl C_LABEL(sunos_getgid) C_LABEL(sunos_getgid): - call C_LABEL(sys_getegid) + call C_LABEL(sys_getegid16) nop - call C_LABEL(sys_getgid) + call C_LABEL(sys_getgid16) st %o0, [%sp + REGWIN_SZ + PT_I1] b C_LABEL(ret_sys_call) diff --git a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S index d4be69030bec..6da3c3f2125c 100644 --- a/arch/sparc/kernel/systbls.S +++ b/arch/sparc/kernel/systbls.S @@ -1,4 +1,4 @@ -/* $Id: systbls.S,v 1.88 1999/12/21 14:09:06 jj Exp $ +/* $Id: systbls.S,v 1.90 2000/01/11 17:33:20 jj Exp $ * systbls.S: System call entry point tables for OS compatibility. * The native Linux system call table lives here also. * @@ -20,30 +20,30 @@ sys_call_table: /*0*/ .long sys_nis_syscall, sys_exit, sys_fork, sys_read, sys_write /*5*/ .long sys_open, sys_close, sys_wait4, sys_creat, sys_link -/*10*/ .long sys_unlink, sunos_execv, sys_chdir, sys_chown, sys_mknod -/*15*/ .long sys_chmod, sys_lchown, sparc_brk, sys_nis_syscall, sys_lseek -/*20*/ .long sys_getpid, sys_capget, sys_capset, sys_setuid, sys_getuid +/*10*/ .long sys_unlink, sunos_execv, sys_chdir, sys_chown16, sys_mknod +/*15*/ .long sys_chmod, sys_lchown16, sparc_brk, sys_nis_syscall, sys_lseek +/*20*/ .long sys_getpid, sys_capget, sys_capset, sys_setuid16, sys_getuid16 /*25*/ .long sys_time, sys_ptrace, sys_alarm, sys_sigaltstack, sys_pause -/*30*/ .long sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice -/*35*/ .long sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile -/*40*/ .long sys_newlstat, sys_dup, sys_pipe, sys_times, sys_nis_syscall -/*45*/ .long sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid -/*50*/ .long sys_getegid, sys_acct, sys_nis_syscall, sys_nis_syscall, sys_ioctl +/*30*/ .long sys_utime, sys_lchown, sys_fchown, sys_access, sys_nice +/*35*/ .long sys_chown, sys_sync, sys_kill, sys_newstat, sys_sendfile +/*40*/ .long sys_newlstat, sys_dup, sys_pipe, sys_times, sys_getuid +/*45*/ .long sys_umount, sys_setgid16, sys_getgid16, sys_signal, sys_geteuid16 +/*50*/ .long sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys_ioctl /*55*/ .long sys_reboot, sys_mmap2, sys_symlink, sys_readlink, sys_execve /*60*/ .long sys_umask, sys_chroot, sys_newfstat, sys_fstat64, sys_getpagesize -/*65*/ .long sys_msync, sys_vfork, sys_pread, sys_pwrite, sys_nis_syscall -/*70*/ .long sys_nis_syscall, sys_mmap, sys_nis_syscall, sys_munmap, sys_mprotect -/*75*/ .long sys_nis_syscall, sys_vhangup, sys_truncate64, sys_nis_syscall, sys_getgroups -/*80*/ .long sys_setgroups, sys_getpgrp, sys_nis_syscall, sys_setitimer, sys_ftruncate64 -/*85*/ .long sys_swapon, sys_getitimer, sys_nis_syscall, sys_sethostname, sys_nis_syscall -/*90*/ .long sys_dup2, sys_nis_syscall, sys_fcntl, sys_select, sys_nis_syscall +/*65*/ .long sys_msync, sys_vfork, sys_pread, sys_pwrite, sys_geteuid +/*70*/ .long sys_getegid, sys_mmap, sys_setreuid, sys_munmap, sys_mprotect +/*75*/ .long sys_setregid, sys_vhangup, sys_truncate64, sys_getgroups, sys_getgroups16 +/*80*/ .long sys_setgroups16, sys_getpgrp, sys_setgroups, sys_setitimer, sys_ftruncate64 +/*85*/ .long sys_swapon, sys_getitimer, sys_setuid, sys_sethostname, sys_setgid +/*90*/ .long sys_dup2, sys_setfsuid, sys_fcntl, sys_select, sys_setfsgid /*95*/ .long sys_fsync, sys_setpriority, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall /*100*/ .long sys_getpriority, sys_rt_sigreturn, sys_rt_sigaction, sys_rt_sigprocmask, sys_rt_sigpending -/*105*/ .long sys_rt_sigtimedwait, sys_rt_sigqueueinfo, sys_rt_sigsuspend, sys_nis_syscall, sys_nis_syscall -/*110*/ .long sys_nis_syscall, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall +/*105*/ .long sys_rt_sigtimedwait, sys_rt_sigqueueinfo, sys_rt_sigsuspend, sys_setresuid, sys_getresuid +/*110*/ .long sys_setresgid, sys_getresgid, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall /*115*/ .long sys_nis_syscall, sys_gettimeofday, sys_getrusage, sys_nis_syscall, sys_getcwd -/*120*/ .long sys_readv, sys_writev, sys_settimeofday, sys_fchown, sys_fchmod -/*125*/ .long sys_nis_syscall, sys_setreuid, sys_setregid, sys_rename, sys_truncate +/*120*/ .long sys_readv, sys_writev, sys_settimeofday, sys_fchown16, sys_fchmod +/*125*/ .long sys_nis_syscall, sys_setreuid16, sys_setregid16, sys_rename, sys_truncate /*130*/ .long sys_ftruncate, sys_flock, sys_lstat64, sys_nis_syscall, sys_nis_syscall /*135*/ .long sys_nis_syscall, sys_mkdir, sys_rmdir, sys_utimes, sys_stat64 /*140*/ .long sys_nis_syscall, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall, sys_getrlimit @@ -63,7 +63,7 @@ sys_call_table: /*210*/ .long sys_nis_syscall, sys_nis_syscall, sys_waitpid, sys_swapoff, sys_sysinfo /*215*/ .long sys_ipc, sys_sigreturn, sys_clone, sys_nis_syscall, sys_adjtimex /*220*/ .long sys_sigprocmask, sys_create_module, sys_delete_module, sys_get_kernel_syms, sys_getpgid -/*225*/ .long sys_bdflush, sys_sysfs, sys_nis_syscall, sys_setfsuid, sys_setfsgid +/*225*/ .long sys_bdflush, sys_sysfs, sys_nis_syscall, sys_setfsuid16, sys_setfsgid16 /*230*/ .long sys_select, sys_time, sys_nis_syscall, sys_stime, sys_nis_syscall /* "We are the Knights of the Forest of Ni!!" */ /*235*/ .long sys_nis_syscall, sys_llseek, sys_mlock, sys_munlock, sys_mlockall @@ -83,7 +83,7 @@ sunos_sys_table: .long sys_close, sunos_wait4, sys_creat .long sys_link, sys_unlink, sunos_execv .long sys_chdir, sunos_nosys, sys_mknod - .long sys_chmod, sys_lchown, sunos_brk + .long sys_chmod, sys_lchown16, sunos_brk .long sunos_nosys, sys_lseek, sunos_getpid .long sunos_nosys, sunos_nosys, sunos_nosys .long sunos_getuid, sunos_nosys, sys_ptrace @@ -104,8 +104,8 @@ sunos_sys_table: .long sunos_nosys, sunos_sbrk, sunos_sstk .long sunos_mmap, sunos_vadvise, sys_munmap .long sys_mprotect, sunos_madvise, sys_vhangup - .long sunos_nosys, sunos_mincore, sys_getgroups - .long sys_setgroups, sys_getpgrp, sunos_setpgrp + .long sunos_nosys, sunos_mincore, sys_getgroups16 + .long sys_setgroups16, sys_getpgrp, sunos_setpgrp .long sys_setitimer, sunos_nosys, sys_swapon .long sys_getitimer, sys_gethostname, sys_sethostname .long sunos_getdtablesize, sys_dup2, sunos_nop @@ -119,9 +119,9 @@ sunos_sys_table: .long sys_sigstack, sys_recvmsg, sys_sendmsg .long sunos_nosys, sys_gettimeofday, sys_getrusage .long sunos_getsockopt, sunos_nosys, sunos_readv - .long sunos_writev, sys_settimeofday, sys_fchown - .long sys_fchmod, sys_recvfrom, sys_setreuid - .long sys_setregid, sys_rename, sys_truncate + .long sunos_writev, sys_settimeofday, sys_fchown16 + .long sys_fchmod, sys_recvfrom, sys_setreuid16 + .long sys_setregid16, sys_rename, sys_truncate .long sys_ftruncate, sys_flock, sunos_nosys .long sys_sendto, sys_shutdown, sys_socketpair .long sys_mkdir, sys_rmdir, sys_utimes diff --git a/arch/sparc/mm/loadmmu.c b/arch/sparc/mm/loadmmu.c index 3b2074c76ee0..3338666e842f 100644 --- a/arch/sparc/mm/loadmmu.c +++ b/arch/sparc/mm/loadmmu.c @@ -1,4 +1,4 @@ -/* $Id: loadmmu.c,v 1.52 2000/01/08 16:38:20 anton Exp $ +/* $Id: loadmmu.c,v 1.53 2000/01/09 10:46:50 anton Exp $ * loadmmu.c: This code loads up all the mm function pointers once the * machine type has been determined. It also sets the static * mmu values such as PAGE_NONE, etc. @@ -19,8 +19,6 @@ #include #include -unsigned long stack_top = 0xf0000000 - PAGE_SIZE; - struct ctx_list *ctx_list_pool; struct ctx_list ctx_free; struct ctx_list ctx_used; diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index c365cf0d5bac..616fbe599be6 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c @@ -1,10 +1,11 @@ -/* $Id: srmmu.c,v 1.199 1999/12/23 02:00:51 davem Exp $ +/* $Id: srmmu.c,v 1.202 2000/01/09 10:46:50 anton Exp $ * srmmu.c: SRMMU specific routines for memory management. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1995 Pete Zaitcev * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + * Copyright (C) 1999 Anton Blanchard (anton@progsoc.uts.edu.au) */ #include @@ -16,8 +17,10 @@ #include #include #include +#include #include +#include #include #include #include @@ -44,9 +47,6 @@ #include -/* #define DEBUG_MAP_KERNEL */ -/* #define PAGESKIP_DEBUG */ - enum mbus_module srmmu_modtype; unsigned int hwbug_bitmask; int vac_cache_size; @@ -55,6 +55,8 @@ int vac_badbits; extern struct resource sparc_iomap; +extern unsigned long last_valid_pfn; + #ifdef __SMP__ #define FLUSH_BEGIN(mm) #define FLUSH_END @@ -63,9 +65,6 @@ extern struct resource sparc_iomap; #define FLUSH_END } #endif -static int phys_mem_contig; -BTFIXUPDEF_SETHI(page_contig_offset) - BTFIXUPDEF_CALL(void, ctxd_set, ctxd_t *, pgd_t *) BTFIXUPDEF_CALL(void, pmd_set, pmd_t *, pte_t *) @@ -96,95 +95,9 @@ char *srmmu_name; ctxd_t *srmmu_ctx_table_phys; ctxd_t *srmmu_context_table; -/* Don't change this without changing access to this - * in arch/sparc/mm/viking.S - */ -static struct srmmu_trans { - unsigned long vbase; - unsigned long pbase; - unsigned long size; -} srmmu_map[SPARC_PHYS_BANKS]; - -#define SRMMU_HASHSZ 256 - -/* Not static, viking.S uses it. */ -unsigned long srmmu_v2p_hash[SRMMU_HASHSZ]; -static unsigned long srmmu_p2v_hash[SRMMU_HASHSZ]; - -#define srmmu_ahashfn(addr) ((addr) >> 24) - int viking_mxcc_present = 0; static spinlock_t srmmu_context_spinlock = SPIN_LOCK_UNLOCKED; -/* Physical memory can be _very_ non-contiguous on the sun4m, especially - * the SS10/20 class machines and with the latest openprom revisions. - * So we have to do a quick lookup. - * We use the same for SS1000/SC2000 as a fall back, when phys memory is - * non-contiguous. - */ -static inline unsigned long srmmu_v2p(unsigned long vaddr) -{ - unsigned long off = srmmu_v2p_hash[srmmu_ahashfn(vaddr)]; - - return (vaddr + off); -} - -static inline unsigned long srmmu_p2v(unsigned long paddr) -{ - unsigned long off = srmmu_p2v_hash[srmmu_ahashfn(paddr)]; - - if (off != 0xffffffffUL) - return (paddr - off); - else - return 0xffffffffUL; -} - -/* Physical memory on most SS1000/SC2000 can be contiguous, so we handle that case - * as a special case to make things faster. - */ -/* FIXME: gcc is stupid here and generates very very bad code in this - * heavily used routine. So we help it a bit. */ -static inline unsigned long srmmu_c_v2p(unsigned long vaddr) -{ -#if KERNBASE != 0xf0000000 - if (vaddr >= KERNBASE) return vaddr - KERNBASE; - return vaddr - BTFIXUP_SETHI(page_contig_offset); -#else - register unsigned long kernbase; - - __asm__ ("sethi %%hi(0xf0000000), %0" : "=r"(kernbase)); - return vaddr - ((vaddr >= kernbase) ? kernbase : BTFIXUP_SETHI(page_contig_offset)); -#endif -} - -static inline unsigned long srmmu_c_p2v(unsigned long paddr) -{ -#if KERNBASE != 0xf0000000 - if (paddr < (0xfd000000 - KERNBASE)) return paddr + KERNBASE; - return (paddr + BTFIXUP_SETHI(page_contig_offset)); -#else - register unsigned long kernbase; - register unsigned long limit; - - __asm__ ("sethi %%hi(0x0d000000), %0" : "=r"(limit)); - __asm__ ("sethi %%hi(0xf0000000), %0" : "=r"(kernbase)); - - return paddr + ((paddr < limit) ? kernbase : BTFIXUP_SETHI(page_contig_offset)); -#endif -} - -/* On boxes where there is no lots_of_ram, KERNBASE is mapped to PA<0> and highest - PA is below 0x0d000000, we can optimize even more :) */ -static inline unsigned long srmmu_s_v2p(unsigned long vaddr) -{ - return vaddr - PAGE_OFFSET; -} - -static inline unsigned long srmmu_s_p2v(unsigned long paddr) -{ - return paddr + PAGE_OFFSET; -} - /* In general all page table modifications should use the V8 atomic * swap instruction. This insures the mmu and the cpu are in sync * with respect to ref/mod bits in the page tables. @@ -198,91 +111,6 @@ static inline unsigned long srmmu_swap(unsigned long *addr, unsigned long value) /* Functions really use this, not srmmu_swap directly. */ #define srmmu_set_entry(ptr, newentry) srmmu_swap((unsigned long *) (ptr), (newentry)) -#ifdef PAGESKIP_DEBUG -#define PGSKIP_DEBUG(from,to) prom_printf("PG_skip %ld->%ld\n", (long)(from), (long)(to)); printk("PG_skip %ld->%ld\n", (long)(from), (long)(to)) -#else -#define PGSKIP_DEBUG(from,to) do { } while (0) -#endif - -void __init srmmu_frob_mem_map(unsigned long start_mem) -{ - unsigned long bank_start, bank_end = 0; - unsigned long addr; - int i; - - /* First, mark all pages as invalid. */ - for(addr = PAGE_OFFSET; MAP_NR(addr) < max_mapnr; addr += PAGE_SIZE) - mem_map[MAP_NR(addr)].flags |= (1< 3 * PAGE_SIZE) { - mem_map[MAP_NR(bank_end)].flags |= (1< KERNBASE && bank_start < KERNBASE) { - mem_map[0].flags |= (1<> 8, sparc_valid_addr_bitmap); - if((bank_start >= KERNBASE) && - (bank_start < start_mem)) { - bank_start += PAGE_SIZE; - continue; - } - mem_map[MAP_NR(bank_start)].flags &= ~(1<> 4) | pgprot_val(pgprot)); } - -static pte_t srmmu_c_mk_pte(unsigned long page, pgprot_t pgprot) -{ return __pte(((srmmu_c_v2p(page)) >> 4) | pgprot_val(pgprot)); } - -static pte_t srmmu_s_mk_pte(unsigned long page, pgprot_t pgprot) -{ return __pte(((srmmu_s_v2p(page)) >> 4) | pgprot_val(pgprot)); } +{ return __pte(((__pa(page)) >> 4) | pgprot_val(pgprot)); } static pte_t srmmu_mk_pte_phys(unsigned long page, pgprot_t pgprot) { return __pte(((page) >> 4) | pgprot_val(pgprot)); } @@ -378,47 +182,17 @@ static pte_t srmmu_mk_pte_io(unsigned long page, pgprot_t pgprot, int space) static void srmmu_ctxd_set(ctxd_t *ctxp, pgd_t *pgdp) { - set_pte((pte_t *)ctxp, (SRMMU_ET_PTD | (srmmu_v2p((unsigned long) pgdp) >> 4))); + set_pte((pte_t *)ctxp, (SRMMU_ET_PTD | (__pa((unsigned long) pgdp) >> 4))); } static void srmmu_pgd_set(pgd_t * pgdp, pmd_t * pmdp) { - set_pte((pte_t *)pgdp, (SRMMU_ET_PTD | (srmmu_v2p((unsigned long) pmdp) >> 4))); + set_pte((pte_t *)pgdp, (SRMMU_ET_PTD | (__pa((unsigned long) pmdp) >> 4))); } static void srmmu_pmd_set(pmd_t * pmdp, pte_t * ptep) { - set_pte((pte_t *)pmdp, (SRMMU_ET_PTD | (srmmu_v2p((unsigned long) ptep) >> 4))); -} - -static void srmmu_c_ctxd_set(ctxd_t *ctxp, pgd_t *pgdp) -{ - set_pte((pte_t *)ctxp, (SRMMU_ET_PTD | (srmmu_c_v2p((unsigned long) pgdp) >> 4))); -} - -static void srmmu_c_pgd_set(pgd_t * pgdp, pmd_t * pmdp) -{ - set_pte((pte_t *)pgdp, (SRMMU_ET_PTD | (srmmu_c_v2p((unsigned long) pmdp) >> 4))); -} - -static void srmmu_c_pmd_set(pmd_t * pmdp, pte_t * ptep) -{ - set_pte((pte_t *)pmdp, (SRMMU_ET_PTD | (srmmu_c_v2p((unsigned long) ptep) >> 4))); -} - -static void srmmu_s_ctxd_set(ctxd_t *ctxp, pgd_t *pgdp) -{ - set_pte((pte_t *)ctxp, (SRMMU_ET_PTD | (srmmu_s_v2p((unsigned long) pgdp) >> 4))); -} - -static void srmmu_s_pgd_set(pgd_t * pgdp, pmd_t * pmdp) -{ - set_pte((pte_t *)pgdp, (SRMMU_ET_PTD | (srmmu_s_v2p((unsigned long) pmdp) >> 4))); -} - -static void srmmu_s_pmd_set(pmd_t * pmdp, pte_t * ptep) -{ - set_pte((pte_t *)pmdp, (SRMMU_ET_PTD | (srmmu_s_v2p((unsigned long) ptep) >> 4))); + set_pte((pte_t *)pmdp, (SRMMU_ET_PTD | (__pa((unsigned long) ptep) >> 4))); } static inline pte_t srmmu_pte_modify(pte_t pte, pgprot_t newprot) @@ -444,26 +218,6 @@ static inline pte_t *srmmu_pte_offset(pmd_t * dir, unsigned long address) return (pte_t *) srmmu_pmd_page(*dir) + ((address >> PAGE_SHIFT) & (SRMMU_PTRS_PER_PTE - 1)); } -static inline pmd_t *srmmu_c_pmd_offset(pgd_t * dir, unsigned long address) -{ - return (pmd_t *) srmmu_c_pgd_page(*dir) + ((address >> SRMMU_PMD_SHIFT) & (SRMMU_PTRS_PER_PMD - 1)); -} - -static inline pte_t *srmmu_c_pte_offset(pmd_t * dir, unsigned long address) -{ - return (pte_t *) srmmu_c_pmd_page(*dir) + ((address >> PAGE_SHIFT) & (SRMMU_PTRS_PER_PTE - 1)); -} - -static inline pmd_t *srmmu_s_pmd_offset(pgd_t * dir, unsigned long address) -{ - return (pmd_t *) srmmu_s_pgd_page(*dir) + ((address >> SRMMU_PMD_SHIFT) & (SRMMU_PTRS_PER_PMD - 1)); -} - -static inline pte_t *srmmu_s_pte_offset(pmd_t * dir, unsigned long address) -{ - return (pte_t *) srmmu_s_pmd_page(*dir) + ((address >> PAGE_SHIFT) & (SRMMU_PTRS_PER_PTE - 1)); -} - static inline pte_t *srmmu_get_pte_fast(void) { struct page *ret; @@ -857,7 +611,7 @@ void srmmu_unmapioaddr(unsigned long virt_addr) ptep = pte_offset(pmdp, virt_addr); /* No need to flush uncacheable page. */ - set_pte(ptep, mk_pte((unsigned long) EMPTY_PGE, PAGE_SHARED)); + pte_clear(ptep); flush_tlb_all(); } @@ -879,6 +633,11 @@ static void srmmu_free_task_struct(struct task_struct *tsk) free_pages((unsigned long)tsk, 1); } +static void srmmu_get_task_struct(struct task_struct *tsk) +{ + atomic_inc(&mem_map[MAP_NR(tsk)].count); +} + /* tsunami.S */ extern void tsunami_flush_cache_all(void); extern void tsunami_flush_cache_mm(struct mm_struct *mm); @@ -1235,8 +994,6 @@ extern void viking_flush_sig_insns(struct mm_struct *mm, unsigned long addr); extern void viking_flush_page(unsigned long page); extern void viking_mxcc_flush_page(unsigned long page); extern void viking_flush_chunk(unsigned long chunk); -extern void viking_c_flush_chunk(unsigned long chunk); -extern void viking_s_flush_chunk(unsigned long chunk); extern void viking_mxcc_flush_chunk(unsigned long chunk); extern void viking_flush_tlb_all(void); extern void viking_flush_tlb_mm(struct mm_struct *mm); @@ -1276,7 +1033,7 @@ static void srmmu_set_pte_nocache_hyper(pte_t *ptep, pte_t pteval) static void hypersparc_ctxd_set(ctxd_t *ctxp, pgd_t *pgdp) { - srmmu_set_entry((pte_t *)ctxp, __pte((SRMMU_ET_PTD | (srmmu_v2p((unsigned long) pgdp) >> 4)))); + srmmu_set_entry((pte_t *)ctxp, __pte((SRMMU_ET_PTD | (__pa((unsigned long) pgdp) >> 4)))); hypersparc_flush_page_to_ram((unsigned long)ctxp); hyper_flush_whole_icache(); } @@ -1291,57 +1048,23 @@ static void hypersparc_switch_mm(struct mm_struct *old_mm, alloc_context(old_mm, mm); spin_unlock(&srmmu_context_spinlock); ctxp = &srmmu_context_table[mm->context]; - srmmu_set_entry((pte_t *)ctxp, __pte((SRMMU_ET_PTD | (srmmu_v2p((unsigned long) mm->pgd) >> 4)))); + srmmu_set_entry((pte_t *)ctxp, __pte((SRMMU_ET_PTD | (__pa((unsigned long) mm->pgd) >> 4)))); hypersparc_flush_page_to_ram((unsigned long)ctxp); } hyper_flush_whole_icache(); srmmu_set_context(mm->context); } -static unsigned long mempool; - /* NOTE: All of this startup code assumes the low 16mb (approx.) of * kernel mappings are done with one single contiguous chunk of * ram. On small ram machines (classics mainly) we only get * around 8mb mapped for us. */ -static unsigned long kbpage; - -/* Some dirty hacks to abstract away the painful boot up init. */ -static inline unsigned long srmmu_early_paddr(unsigned long vaddr) -{ - return ((vaddr - KERNBASE) + kbpage); -} - -static inline void srmmu_early_pgd_set(pgd_t *pgdp, pmd_t *pmdp) +void __init early_pgtable_allocfail(char *type) { - set_pte((pte_t *)pgdp, __pte((SRMMU_ET_PTD | (srmmu_early_paddr((unsigned long) pmdp) >> 4)))); -} - -static inline void srmmu_early_pmd_set(pmd_t *pmdp, pte_t *ptep) -{ - set_pte((pte_t *)pmdp, __pte((SRMMU_ET_PTD | (srmmu_early_paddr((unsigned long) ptep) >> 4)))); -} - -static inline unsigned long srmmu_early_pgd_page(pgd_t pgd) -{ - return (((pgd_val(pgd) & SRMMU_PTD_PMASK) << 4) - kbpage) + KERNBASE; -} - -static inline unsigned long srmmu_early_pmd_page(pmd_t pmd) -{ - return (((pmd_val(pmd) & SRMMU_PTD_PMASK) << 4) - kbpage) + KERNBASE; -} - -static inline pmd_t *srmmu_early_pmd_offset(pgd_t *dir, unsigned long address) -{ - return (pmd_t *) srmmu_early_pgd_page(*dir) + ((address >> SRMMU_PMD_SHIFT) & (SRMMU_PTRS_PER_PMD - 1)); -} - -static inline pte_t *srmmu_early_pte_offset(pmd_t *dir, unsigned long address) -{ - return (pte_t *) srmmu_early_pmd_page(*dir) + ((address >> PAGE_SHIFT) & (SRMMU_PTRS_PER_PTE - 1)); + prom_printf("inherit_prom_mappings: Cannot alloc kernel %s.\n", type); + prom_halt(); } static inline void srmmu_allocate_ptable_skeleton(unsigned long start, unsigned long end) @@ -1353,13 +1076,20 @@ static inline void srmmu_allocate_ptable_skeleton(unsigned long start, unsigned while(start < end) { pgdp = srmmu_pgd_offset(&init_mm, start); if(srmmu_pgd_none(*pgdp)) { - pmdp = sparc_init_alloc(&mempool, SRMMU_PMD_TABLE_SIZE); - srmmu_early_pgd_set(pgdp, pmdp); + pmdp = __alloc_bootmem(SRMMU_PMD_TABLE_SIZE, + SRMMU_PMD_TABLE_SIZE, 0UL); + if (pmdp == NULL) + early_pgtable_allocfail("pmd"); + memset(pmdp, 0, SRMMU_PMD_TABLE_SIZE); + srmmu_pgd_set(pgdp, pmdp); } - pmdp = srmmu_early_pmd_offset(pgdp, start); + pmdp = srmmu_pmd_offset(pgdp, start); if(srmmu_pmd_none(*pmdp)) { - ptep = sparc_init_alloc(&mempool, SRMMU_PTE_TABLE_SIZE); - srmmu_early_pmd_set(pmdp, ptep); + ptep = __alloc_bootmem(SRMMU_PTE_TABLE_SIZE, SRMMU_PTE_TABLE_SIZE, 0UL); + if (ptep == NULL) + early_pgtable_allocfail("pte"); + memset(ptep, 0, SRMMU_PTE_TABLE_SIZE); + srmmu_pmd_set(pmdp, ptep); } start = (start + SRMMU_PMD_SIZE) & SRMMU_PMD_MASK; } @@ -1408,94 +1138,34 @@ void __init srmmu_inherit_prom_mappings(unsigned long start,unsigned long end) continue; } if(srmmu_pgd_none(*pgdp)) { - pmdp = sparc_init_alloc(&mempool, SRMMU_PMD_TABLE_SIZE); - srmmu_early_pgd_set(pgdp, pmdp); + pmdp = __alloc_bootmem(SRMMU_PMD_TABLE_SIZE, + SRMMU_PMD_TABLE_SIZE, 0UL); + if (pmdp == NULL) + early_pgtable_allocfail("pmd"); + memset(pmdp, 0, SRMMU_PMD_TABLE_SIZE); + srmmu_pgd_set(pgdp, pmdp); } - pmdp = srmmu_early_pmd_offset(pgdp, start); + pmdp = srmmu_pmd_offset(pgdp, start); if(what == 1) { *pmdp = __pmd(prompte); start += SRMMU_PMD_SIZE; continue; } if(srmmu_pmd_none(*pmdp)) { - ptep = sparc_init_alloc(&mempool, SRMMU_PTE_TABLE_SIZE); - srmmu_early_pmd_set(pmdp, ptep); + ptep = __alloc_bootmem(SRMMU_PTE_TABLE_SIZE, SRMMU_PTE_TABLE_SIZE, 0UL); + if (ptep == NULL) + early_pgtable_allocfail("pte"); + memset(ptep, 0, SRMMU_PTE_TABLE_SIZE); + srmmu_pmd_set(pmdp, ptep); } - ptep = srmmu_early_pte_offset(pmdp, start); + ptep = srmmu_pte_offset(pmdp, start); *ptep = __pte(prompte); start += PAGE_SIZE; } } -#ifdef DEBUG_MAP_KERNEL -#define MKTRACE(foo) prom_printf foo -#else -#define MKTRACE(foo) -#endif - -static int lots_of_ram __initdata = 0; -static int srmmu_low_pa __initdata = 0; static unsigned long end_of_phys_memory __initdata = 0; -void __init srmmu_end_memory(unsigned long memory_size, unsigned long *end_mem_p) -{ - unsigned int sum = 0; - unsigned long last = 0xff000000; - long first, cur; - unsigned long pa; - unsigned long total = 0; - int i; - - pa = srmmu_hwprobe(KERNBASE + PAGE_SIZE); - pa = (pa & SRMMU_PTE_PMASK) << 4; - if (!sp_banks[0].base_addr && pa == PAGE_SIZE) { - for(i = 0; sp_banks[i].num_bytes != 0; i++) { - if (sp_banks[i].base_addr + sp_banks[i].num_bytes > 0x0d000000) - break; - } - if (!sp_banks[i].num_bytes) { - srmmu_low_pa = 1; - end_of_phys_memory = SRMMU_PGDIR_ALIGN(sp_banks[i-1].base_addr + sp_banks[i-1].num_bytes); - *end_mem_p = KERNBASE + end_of_phys_memory; - if (sp_banks[0].num_bytes >= (6 * 1024 * 1024) || end_of_phys_memory <= 0x06000000) { - /* Make sure there will be enough memory for the whole mem_map (even if sparse) */ - return; - } - } - } - for(i = 0; sp_banks[i].num_bytes != 0; i++) { - pa = sp_banks[i].base_addr; - first = (pa & (~SRMMU_PGDIR_MASK)); - cur = (sp_banks[i].num_bytes + first - SRMMU_PGDIR_SIZE); - if (cur < 0) cur = 0; - if (!first || last != (pa & SRMMU_PGDIR_MASK)) - total += SRMMU_PGDIR_SIZE; - sum += sp_banks[i].num_bytes; - if (memory_size) { - if (sum > memory_size) { - sp_banks[i].num_bytes -= - (sum - memory_size); - cur = (sp_banks[i].num_bytes + first - SRMMU_PGDIR_SIZE); - if (cur < 0) cur = 0; - total += SRMMU_PGDIR_ALIGN(cur); - sum = memory_size; - sp_banks[++i].base_addr = 0xdeadbeef; - sp_banks[i].num_bytes = 0; - break; - } - } - total += SRMMU_PGDIR_ALIGN(cur); - last = (sp_banks[i].base_addr + sp_banks[i].num_bytes - 1) & SRMMU_PGDIR_MASK; - } - if (total <= 0x0d000000) - *end_mem_p = KERNBASE + total; - else { - *end_mem_p = 0xfd000000; - lots_of_ram = 1; - } - end_of_phys_memory = total; -} - #define KERNEL_PTE(page_shifted) ((page_shifted)|SRMMU_CACHE|SRMMU_PRIV|SRMMU_VALID) /* Create a third-level SRMMU 16MB page mapping. */ @@ -1504,44 +1174,10 @@ static void __init do_large_mapping(unsigned long vaddr, unsigned long phys_base pgd_t *pgdp = srmmu_pgd_offset(&init_mm, vaddr); unsigned long big_pte; - MKTRACE(("dlm[v<%08lx>-->p<%08lx>]", vaddr, phys_base)); big_pte = KERNEL_PTE(phys_base >> 4); *pgdp = __pgd(big_pte); } -/* Look in the sp_bank for the given physical page, return the - * index number the entry was found in, or -1 for not found. - */ -static inline int find_in_spbanks(unsigned long phys_page) -{ - int entry; - - for(entry = 0; sp_banks[entry].num_bytes; entry++) { - unsigned long start = sp_banks[entry].base_addr; - unsigned long end = start + sp_banks[entry].num_bytes; - - if((start <= phys_page) && (phys_page < end)) - return entry; - } - return -1; -} - -/* Find an spbank entry not mapped as of yet, TAKEN_VECTOR is an - * array of char's, each member indicating if that spbank is mapped - * yet or not. - */ -static int __init find_free_spbank(char *taken_vector) -{ - int entry; - - for(entry = 0; sp_banks[entry].num_bytes; entry++) - if(!taken_vector[entry]) - break; - return entry; -} - -static unsigned long map_spbank_last_pa __initdata = 0xff000000; - /* Map sp_bank entry SP_ENTRY, starting at virtual address VBASE. */ static unsigned long __init map_spbank(unsigned long vbase, int sp_entry) @@ -1549,20 +1185,11 @@ static unsigned long __init map_spbank(unsigned long vbase, int sp_entry) unsigned long pstart = (sp_banks[sp_entry].base_addr & SRMMU_PGDIR_MASK); unsigned long vstart = (vbase & SRMMU_PGDIR_MASK); unsigned long vend = SRMMU_PGDIR_ALIGN(vbase + sp_banks[sp_entry].num_bytes); - static int srmmu_bank = 0; - MKTRACE(("map_spbank %d[v<%08lx>p<%08lx>s<%08lx>]", sp_entry, vbase, sp_banks[sp_entry].base_addr, sp_banks[sp_entry].num_bytes)); - MKTRACE(("map_spbank2 %d[p%08lx v%08lx-%08lx]", sp_entry, pstart, vstart, vend)); while(vstart < vend) { do_large_mapping(vstart, pstart); vstart += SRMMU_PGDIR_SIZE; pstart += SRMMU_PGDIR_SIZE; } - srmmu_map[srmmu_bank].vbase = vbase; - srmmu_map[srmmu_bank].pbase = sp_banks[sp_entry].base_addr; - srmmu_map[srmmu_bank].size = sp_banks[sp_entry].num_bytes; - if (srmmu_map[srmmu_bank].size) - srmmu_bank++; - map_spbank_last_pa = pstart - SRMMU_PGDIR_SIZE; return vstart; } @@ -1579,245 +1206,35 @@ static inline void memprobe_error(char *msg) */ static inline void map_kernel(void) { - unsigned long raw_pte, physpage; - unsigned long vaddr, low_base; - char etaken[SPARC_PHYS_BANKS]; - int entry; - - /* Step 1: Clear out sp_banks taken map. */ - MKTRACE(("map_kernel: clearing etaken vector... ")); - for(entry = 0; entry < SPARC_PHYS_BANKS; entry++) - etaken[entry] = 0; - - low_base = KERNBASE; - - /* Step 2: Fill in KERNBASE base pgd. Lots of sanity checking here. */ - raw_pte = srmmu_hwprobe(KERNBASE + PAGE_SIZE); - if((raw_pte & SRMMU_ET_MASK) != SRMMU_ET_PTE) - memprobe_error("Wheee, kernel not mapped at all by boot loader.\n"); - physpage = (raw_pte & SRMMU_PTE_PMASK) << 4; - physpage -= PAGE_SIZE; - if(physpage & ~(SRMMU_PGDIR_MASK)) - memprobe_error("Wheee, kernel not mapped on 16MB physical boundry.\n"); - entry = find_in_spbanks(physpage); - if(entry == -1 || (sp_banks[entry].base_addr != physpage)) - memprobe_error("Kernel mapped in non-existant memory.\n"); - MKTRACE(("map_kernel: map_spbank(vbase=%08x, entry<%d>)[%08lx,%08lx]\n", KERNBASE, entry, sp_banks[entry].base_addr, sp_banks[entry].num_bytes)); - if (sp_banks[entry].num_bytes > 0x0d000000) { - unsigned long orig_base = sp_banks[entry].base_addr; - unsigned long orig_len = sp_banks[entry].num_bytes; - unsigned long can_map = 0x0d000000; - - /* Map a partial bank in this case, adjust the base - * and the length, but don't mark it used. - */ - sp_banks[entry].num_bytes = can_map; - MKTRACE(("wheee really big mapping [%08lx,%08lx]", orig_base, can_map)); - vaddr = map_spbank(KERNBASE, entry); - MKTRACE(("vaddr now %08lx ", vaddr)); - sp_banks[entry].base_addr = orig_base + can_map; - sp_banks[entry].num_bytes = orig_len - can_map; - MKTRACE(("adjust[%08lx,%08lx]\n", (orig_base + can_map), (orig_len - can_map))); - MKTRACE(("map_kernel: skipping first loop\n")); - goto loop_skip; - } - vaddr = map_spbank(KERNBASE, entry); - etaken[entry] = 1; - - /* Step 3: Map what we can above KERNBASE. */ - MKTRACE(("map_kernel: vaddr=%08lx, entering first loop\n", vaddr)); - for(;;) { - unsigned long bank_size; - - MKTRACE(("map_kernel: ffsp()")); - entry = find_free_spbank(&etaken[0]); - bank_size = sp_banks[entry].num_bytes; - MKTRACE(("<%d> base=%08lx bs=%08lx ", entry, sp_banks[entry].base_addr, bank_size)); - if(!bank_size) - break; - if (srmmu_low_pa) - vaddr = KERNBASE + sp_banks[entry].base_addr; - else if (sp_banks[entry].base_addr & (~SRMMU_PGDIR_MASK)) { - if (map_spbank_last_pa == (sp_banks[entry].base_addr & SRMMU_PGDIR_MASK)) - vaddr -= SRMMU_PGDIR_SIZE; - vaddr += (sp_banks[entry].base_addr & (~SRMMU_PGDIR_MASK)); - } - if ((vaddr + bank_size - KERNBASE) > 0x0d000000) { - unsigned long orig_base = sp_banks[entry].base_addr; - unsigned long orig_len = sp_banks[entry].num_bytes; - unsigned long can_map = (0xfd000000 - vaddr); - - /* Map a partial bank in this case, adjust the base - * and the length, but don't mark it used. - */ - sp_banks[entry].num_bytes = can_map; - MKTRACE(("wheee really big mapping [%08lx,%08lx]", orig_base, can_map)); - vaddr = map_spbank(vaddr, entry); - MKTRACE(("vaddr now %08lx ", vaddr)); - sp_banks[entry].base_addr = orig_base + can_map; - sp_banks[entry].num_bytes = orig_len - can_map; - MKTRACE(("adjust[%08lx,%08lx]\n", (orig_base + can_map), (orig_len - can_map))); - break; - } - - /* Ok, we can map this one, do it. */ - MKTRACE(("map_spbank(%08lx,entry<%d>) ", vaddr, entry)); - vaddr = map_spbank(vaddr, entry); - etaken[entry] = 1; - MKTRACE(("vaddr now %08lx\n", vaddr)); - } - MKTRACE(("\n")); - /* If not lots_of_ram, assume we did indeed map it all above. */ -loop_skip: - if(!lots_of_ram) - goto check_and_return; - - /* Step 4: Map the rest (if any) right below KERNBASE. */ - MKTRACE(("map_kernel: doing low mappings... ")); - low_base = (KERNBASE - end_of_phys_memory + 0x0d000000); - MKTRACE(("end_of_phys_memory=%08lx low_base=%08lx\n", end_of_phys_memory, low_base)); - - /* Ok, now map 'em. */ - MKTRACE(("map_kernel: Allocate pt skeleton (%08lx, %08x)\n",low_base,KERNBASE)); - srmmu_allocate_ptable_skeleton(low_base, KERNBASE); - vaddr = low_base; - map_spbank_last_pa = 0xff000000; - MKTRACE(("map_kernel: vaddr=%08lx Entering second loop for low maps.\n", vaddr)); - for(;;) { - unsigned long bank_size; - - entry = find_free_spbank(&etaken[0]); - bank_size = sp_banks[entry].num_bytes; - MKTRACE(("map_kernel: e<%d> base=%08lx bs=%08lx ", entry, sp_banks[entry].base_addr, bank_size)); - if(!bank_size) - break; - if (sp_banks[entry].base_addr & (~SRMMU_PGDIR_MASK)) { - if (map_spbank_last_pa == (sp_banks[entry].base_addr & SRMMU_PGDIR_MASK)) - vaddr -= SRMMU_PGDIR_SIZE; - vaddr += (sp_banks[entry].base_addr & (~SRMMU_PGDIR_MASK)); - } - if((vaddr + bank_size) > KERNBASE) - memprobe_error("Wheee, kernel low mapping overflow.\n"); - MKTRACE(("map_spbank(%08lx, %d) ", vaddr, entry)); - vaddr = map_spbank(vaddr, entry); - etaken[entry] = 1; - MKTRACE(("Now, vaddr=%08lx end_of_phys_memory=%08lx\n", vaddr, end_of_phys_memory)); - } - MKTRACE(("\n")); - -check_and_return: - /* Step 5: Sanity check, make sure we did it all. */ - MKTRACE(("check_and_return: ")); - for(entry = 0; sp_banks[entry].num_bytes; entry++) { - MKTRACE(("e[%d]=%d ", entry, etaken[entry])); - if(!etaken[entry]) { - MKTRACE(("oops\n")); - memprobe_error("Some bank did not get mapped.\n"); - } - } - MKTRACE(("success\n")); - init_mm.mmap->vm_start = page_offset = low_base; - stack_top = page_offset - PAGE_SIZE; - BTFIXUPSET_SETHI(page_offset, low_base); - BTFIXUPSET_SETHI(stack_top, page_offset - PAGE_SIZE); - BTFIXUPSET_SIMM13(user_ptrs_per_pgd, page_offset / SRMMU_PGDIR_SIZE); - -#if 1 - for(entry = 0; srmmu_map[entry].size; entry++) { - printk("[%d]: v[%08lx,%08lx](%lx) p[%08lx]\n", entry, - srmmu_map[entry].vbase, - srmmu_map[entry].vbase + srmmu_map[entry].size, - srmmu_map[entry].size, - srmmu_map[entry].pbase); - } -#endif + int i; - /* Now setup the p2v/v2p hash tables. */ - for(entry = 0; entry < SRMMU_HASHSZ; entry++) - srmmu_v2p_hash[entry] = ((0xff - entry) << 24); - for(entry = 0; entry < SRMMU_HASHSZ; entry++) - srmmu_p2v_hash[entry] = 0xffffffffUL; - for(entry = 0; srmmu_map[entry].size; entry++) { - unsigned long addr; - - for(addr = srmmu_map[entry].vbase; - addr < (srmmu_map[entry].vbase + srmmu_map[entry].size); - addr += (1 << 24)) - srmmu_v2p_hash[srmmu_ahashfn(addr)] = - srmmu_map[entry].pbase - srmmu_map[entry].vbase; - for(addr = srmmu_map[entry].pbase; - addr < (srmmu_map[entry].pbase + srmmu_map[entry].size); - addr += (1 << 24)) - srmmu_p2v_hash[srmmu_ahashfn(addr)] = - srmmu_map[entry].pbase - srmmu_map[entry].vbase; + for (i = 0; sp_banks[i].num_bytes != 0; i++) { + map_spbank(sp_banks[i].base_addr + PAGE_OFFSET, i); } - BTFIXUPSET_SETHI(page_contig_offset, page_offset - (0xfd000000 - KERNBASE)); - if (srmmu_low_pa) - phys_mem_contig = 0; - else { - phys_mem_contig = 1; - for(entry = 0; srmmu_map[entry].size; entry++) - if (srmmu_map[entry].pbase != srmmu_c_v2p (srmmu_map[entry].vbase)) { - phys_mem_contig = 0; - break; - } - } - if (phys_mem_contig) { - printk ("SRMMU: Physical memory is contiguous, bypassing VA<->PA hashes.\n"); - BTFIXUPSET_CALL(pte_page, srmmu_c_pte_page, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(pmd_page, srmmu_c_pmd_page, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(pgd_page, srmmu_c_pgd_page, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(mk_pte, srmmu_c_mk_pte, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(pte_offset, srmmu_c_pte_offset, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(pmd_offset, srmmu_c_pmd_offset, BTFIXUPCALL_NORM); - if (BTFIXUPVAL_CALL(ctxd_set) == (unsigned long)srmmu_ctxd_set) - BTFIXUPSET_CALL(ctxd_set, srmmu_c_ctxd_set, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(pgd_set, srmmu_c_pgd_set, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(pmd_set, srmmu_c_pmd_set, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(mmu_v2p, srmmu_c_v2p, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(mmu_p2v, srmmu_c_p2v, BTFIXUPCALL_NORM); - if (BTFIXUPVAL_CALL(flush_chunk) == (unsigned long)viking_flush_chunk) - BTFIXUPSET_CALL(flush_chunk, viking_c_flush_chunk, BTFIXUPCALL_NORM); - } else if (srmmu_low_pa) { - printk ("SRMMU: Compact physical memory. Using strightforward VA<->PA translations.\n"); - BTFIXUPSET_CALL(pte_page, srmmu_s_pte_page, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(pmd_page, srmmu_s_pmd_page, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(pgd_page, srmmu_s_pgd_page, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(mk_pte, srmmu_s_mk_pte, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(pte_offset, srmmu_s_pte_offset, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(pmd_offset, srmmu_s_pmd_offset, BTFIXUPCALL_NORM); - if (BTFIXUPVAL_CALL(ctxd_set) == (unsigned long)srmmu_ctxd_set) - BTFIXUPSET_CALL(ctxd_set, srmmu_s_ctxd_set, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(pgd_set, srmmu_s_pgd_set, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(pmd_set, srmmu_s_pmd_set, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(mmu_v2p, srmmu_s_v2p, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(mmu_p2v, srmmu_s_p2v, BTFIXUPCALL_NORM); - if (BTFIXUPVAL_CALL(flush_chunk) == (unsigned long)viking_flush_chunk) - BTFIXUPSET_CALL(flush_chunk, viking_s_flush_chunk, BTFIXUPCALL_NORM); - } - btfixup(); + init_mm.mmap->vm_start = PAGE_OFFSET; + BTFIXUPSET_SIMM13(user_ptrs_per_pgd, PAGE_OFFSET / SRMMU_PGDIR_SIZE); return; /* SUCCESS! */ } /* Paging initialization on the Sparc Reference MMU. */ -extern unsigned long free_area_init(unsigned long, unsigned long); -extern unsigned long sparc_context_init(unsigned long, int); +extern void sparc_context_init(int); -extern int physmem_mapped_contig; extern int linux_num_cpus; void (*poke_srmmu)(void) __initdata = NULL; -unsigned long __init srmmu_paging_init(unsigned long start_mem, unsigned long end_mem) +extern unsigned long bootmem_init(void); +extern void sun_serial_setup(void); + +void __init srmmu_paging_init(void) { - unsigned long ptables_start; int i, cpunode; char node_str[128]; + unsigned long end_pfn; sparc_iomap.start = 0xfd000000; /* 16MB of IOSPACE on all sun4m's. */ - physmem_mapped_contig = 0; /* for init.c:taint_real_pages() */ if (sparc_cpu_model == sun4d) num_contexts = 65536; /* We know it is Viking */ @@ -1840,32 +1257,33 @@ unsigned long __init srmmu_paging_init(unsigned long start_mem, unsigned long en prom_halt(); } - ptables_start = mempool = PAGE_ALIGN(start_mem); memset(swapper_pg_dir, 0, PAGE_SIZE); - kbpage = srmmu_hwprobe(KERNBASE + PAGE_SIZE); - kbpage = (kbpage & SRMMU_PTE_PMASK) << 4; - kbpage -= PAGE_SIZE; - srmmu_allocate_ptable_skeleton(KERNBASE, end_mem); + last_valid_pfn = end_pfn = bootmem_init(); + + srmmu_allocate_ptable_skeleton(KERNBASE, end_of_phys_memory + PAGE_OFFSET); #if CONFIG_SUN_IO srmmu_allocate_ptable_skeleton(sparc_iomap.start, IOBASE_END); srmmu_allocate_ptable_skeleton(DVMA_VADDR, DVMA_END); #endif - mempool = PAGE_ALIGN(mempool); + /* This does not logically belong here, but we need to + * call it at the moment we are able to use the bootmem + * allocator. + */ + sun_serial_setup(); + srmmu_inherit_prom_mappings(0xfe400000,(LINUX_OPPROM_ENDVM-PAGE_SIZE)); map_kernel(); - srmmu_context_table = sparc_init_alloc(&mempool, num_contexts*sizeof(ctxd_t)); - srmmu_ctx_table_phys = (ctxd_t *) srmmu_v2p((unsigned long) srmmu_context_table); + srmmu_context_table = __alloc_bootmem(num_contexts*sizeof(ctxd_t), SMP_CACHE_BYTES, 0UL); + srmmu_ctx_table_phys = (ctxd_t *) __pa((unsigned long) srmmu_context_table); for(i = 0; i < num_contexts; i++) ctxd_set(&srmmu_context_table[i], swapper_pg_dir); - start_mem = PAGE_ALIGN(mempool); - flush_cache_all(); if(BTFIXUPVAL_CALL(flush_page_for_dma) == (unsigned long)viking_flush_page) { - unsigned long start = ptables_start; - unsigned long end = start_mem; + unsigned long start = (unsigned long)srmmu_context_table; + unsigned long end = PAGE_ALIGN((unsigned long)srmmu_context_table + num_contexts*sizeof(ctxd_t)); while(start < end) { viking_flush_page(start); @@ -1876,22 +1294,27 @@ unsigned long __init srmmu_paging_init(unsigned long start_mem, unsigned long en flush_tlb_all(); poke_srmmu(); - start_mem = sparc_context_init(start_mem, num_contexts); - start_mem = free_area_init(start_mem, end_mem); + sparc_context_init(num_contexts); + + { + unsigned int zones_size[MAX_NR_ZONES] = { 0, 0, 0}; + + zones_size[ZONE_DMA] = end_pfn; + free_area_init(zones_size); + } #ifdef CONFIG_BLK_DEV_INITRD /* If initial ramdisk was specified with physical address, translate it here, as the p2v translation in srmmu is not straightforward. */ if (initrd_start && initrd_start < KERNBASE) { - initrd_start = srmmu_p2v(initrd_start); - initrd_end = srmmu_p2v(initrd_end); + initrd_start = __va(initrd_start); + initrd_end = __va(initrd_end); if (initrd_end <= initrd_start) initrd_start = 0; } #endif - return PAGE_ALIGN(start_mem); } static int srmmu_mmu_info(char *buf) @@ -2012,7 +1435,7 @@ static void hypersparc_destroy_context(struct mm_struct *mm) flush_cache_mm(mm); ctxp = &srmmu_context_table[mm->context]; - srmmu_set_entry((pte_t *)ctxp, __pte((SRMMU_ET_PTD | (srmmu_v2p((unsigned long) swapper_pg_dir) >> 4)))); + srmmu_set_entry((pte_t *)ctxp, __pte((SRMMU_ET_PTD | (__pa((unsigned long) swapper_pg_dir) >> 4)))); hypersparc_flush_page_to_ram((unsigned long)ctxp); flush_tlb_mm(mm); @@ -2883,7 +2306,7 @@ void __init ld_mmu_srmmu(void) BTFIXUPSET_CALL(set_pte, srmmu_set_pte_cacheable, BTFIXUPCALL_SWAPO0O1); BTFIXUPSET_CALL(switch_mm, srmmu_switch_mm, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(pte_page, srmmu_pte_page, BTFIXUPCALL_NORM); + BTFIXUPSET_CALL(pte_pagenr, srmmu_pte_pagenr, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(pmd_page, srmmu_pmd_page, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(pgd_page, srmmu_pgd_page, BTFIXUPCALL_NORM); @@ -2934,12 +2357,11 @@ void __init ld_mmu_srmmu(void) BTFIXUPSET_CALL(destroy_context, srmmu_destroy_context, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(mmu_info, srmmu_mmu_info, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(mmu_v2p, srmmu_v2p, BTFIXUPCALL_NORM); - BTFIXUPSET_CALL(mmu_p2v, srmmu_p2v, BTFIXUPCALL_NORM); /* Task struct and kernel stack allocating/freeing. */ BTFIXUPSET_CALL(alloc_task_struct, srmmu_alloc_task_struct, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(free_task_struct, srmmu_free_task_struct, BTFIXUPCALL_NORM); + BTFIXUPSET_CALL(get_task_struct, srmmu_get_task_struct, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(quick_kernel_fault, srmmu_quick_kernel_fault, BTFIXUPCALL_NORM); diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c index c450261e38d6..132a115a6147 100644 --- a/arch/sparc/mm/sun4c.c +++ b/arch/sparc/mm/sun4c.c @@ -1,4 +1,4 @@ -/* $Id: sun4c.c,v 1.183 2000/01/08 16:38:20 anton Exp $ +/* $Id: sun4c.c,v 1.184 2000/01/09 09:13:34 anton Exp $ * sun4c.c: Doing in software what should be done in hardware. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -1148,21 +1148,23 @@ static void sun4c_free_task_struct_hw(struct task_struct *tsk) unsigned long pages = BUCKET_PTE_PAGE(sun4c_get_pte(tsaddr)); int entry = BUCKET_NUM(tsaddr); - /* We are deleting a mapping, so the flush here is mandatory. */ - sun4c_flush_page_hw(tsaddr); + if (atomic_dec_and_test(&(tsk)->thread.refcount)) { + /* We are deleting a mapping, so the flush here is mandatory. */ + sun4c_flush_page_hw(tsaddr); #ifndef CONFIG_SUN4 - sun4c_flush_page_hw(tsaddr + PAGE_SIZE); + sun4c_flush_page_hw(tsaddr + PAGE_SIZE); #endif - sun4c_put_pte(tsaddr, 0); + sun4c_put_pte(tsaddr, 0); #ifndef CONFIG_SUN4 - sun4c_put_pte(tsaddr + PAGE_SIZE, 0); + sun4c_put_pte(tsaddr + PAGE_SIZE, 0); #endif - sun4c_bucket[entry] = BUCKET_EMPTY; - if (entry < sun4c_lowbucket_avail) - sun4c_lowbucket_avail = entry; + sun4c_bucket[entry] = BUCKET_EMPTY; + if (entry < sun4c_lowbucket_avail) + sun4c_lowbucket_avail = entry; - free_pages(pages, TASK_STRUCT_ORDER); - garbage_collect(entry); + free_pages(pages, TASK_STRUCT_ORDER); + garbage_collect(entry); + } } static void sun4c_free_task_struct_sw(struct task_struct *tsk) @@ -1171,21 +1173,28 @@ static void sun4c_free_task_struct_sw(struct task_struct *tsk) unsigned long pages = BUCKET_PTE_PAGE(sun4c_get_pte(tsaddr)); int entry = BUCKET_NUM(tsaddr); - /* We are deleting a mapping, so the flush here is mandatory. */ - sun4c_flush_page_sw(tsaddr); + if (atomic_dec_and_test(&(tsk)->thread.refcount)) { + /* We are deleting a mapping, so the flush here is mandatory. */ + sun4c_flush_page_sw(tsaddr); #ifndef CONFIG_SUN4 - sun4c_flush_page_sw(tsaddr + PAGE_SIZE); + sun4c_flush_page_sw(tsaddr + PAGE_SIZE); #endif - sun4c_put_pte(tsaddr, 0); + sun4c_put_pte(tsaddr, 0); #ifndef CONFIG_SUN4 - sun4c_put_pte(tsaddr + PAGE_SIZE, 0); + sun4c_put_pte(tsaddr + PAGE_SIZE, 0); #endif - sun4c_bucket[entry] = BUCKET_EMPTY; - if (entry < sun4c_lowbucket_avail) - sun4c_lowbucket_avail = entry; + sun4c_bucket[entry] = BUCKET_EMPTY; + if (entry < sun4c_lowbucket_avail) + sun4c_lowbucket_avail = entry; - free_pages(pages, TASK_STRUCT_ORDER); - garbage_collect(entry); + free_pages(pages, TASK_STRUCT_ORDER); + garbage_collect(entry); + } +} + +static void sun4c_get_task_struct(struct task_struct *tsk) +{ + atomic_inc(&(tsk)->thread.refcount); } static void __init sun4c_init_buckets(void) @@ -2719,6 +2728,7 @@ void __init ld_mmu_sun4c(void) /* Task struct and kernel stack allocating/freeing. */ BTFIXUPSET_CALL(alloc_task_struct, sun4c_alloc_task_struct, BTFIXUPCALL_NORM); + BTFIXUPSET_CALL(get_task_struct, sun4c_get_task_struct, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(quick_kernel_fault, sun4c_quick_kernel_fault, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(mmu_info, sun4c_mmu_info, BTFIXUPCALL_NORM); diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S index f62e3506d127..225780f9d148 100644 --- a/arch/sparc64/kernel/entry.S +++ b/arch/sparc64/kernel/entry.S @@ -1,4 +1,4 @@ -/* $Id: entry.S,v 1.110 1999/11/19 05:52:50 davem Exp $ +/* $Id: entry.S,v 1.111 2000/01/11 17:33:29 jj Exp $ * arch/sparc64/kernel/entry.S: Sparc64 trap low-level entry points. * * Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu) @@ -768,9 +768,9 @@ sunos_getpid: /* SunOS getuid() returns uid in %o0 and euid in %o1 */ .globl sunos_getuid sunos_getuid: - call sys_geteuid + call sys_geteuid16 nop - call sys_getuid + call sys_getuid16 stx %o0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I1] b,pt %xcc, ret_sys_call stx %o0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0] @@ -778,9 +778,9 @@ sunos_getuid: /* SunOS getgid() returns gid in %o0 and egid in %o1 */ .globl sunos_getgid sunos_getgid: - call sys_getegid + call sys_getegid16 nop - call sys_getgid + call sys_getgid16 stx %o0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I1] b,pt %xcc, ret_sys_call stx %o0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0] diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c index ef0fb3e94b4e..cba5cfac3bd2 100644 --- a/arch/sparc64/kernel/ioctl32.c +++ b/arch/sparc64/kernel/ioctl32.c @@ -1,4 +1,4 @@ -/* $Id: ioctl32.c,v 1.72 2000/01/04 15:43:45 davem Exp $ +/* $Id: ioctl32.c,v 1.73 2000/01/11 01:06:47 davem Exp $ * ioctl32.c: Conversion between 32bit and 64bit native ioctls. * * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -594,6 +594,8 @@ static inline int dev_ifsioc(unsigned int fd, unsigned int cmd, unsigned long ar err |= __put_user(ifr.ifr_map.irq, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_map.irq)); err |= __put_user(ifr.ifr_map.dma, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_map.dma)); err |= __put_user(ifr.ifr_map.port, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_map.port)); + if (err) + err = -EFAULT; break; } } @@ -667,7 +669,7 @@ static inline int hdio_getgeo(unsigned int fd, unsigned long arg) err = copy_to_user ((struct hd_geometry32 *)arg, &geo, 4); err |= __put_user (geo.start, &(((struct hd_geometry32 *)arg)->start)); } - return err; + return err ? -EFAULT : 0; } struct fbcmap32 { @@ -715,7 +717,7 @@ static inline int fbiogetputcmap(unsigned int fd, unsigned int cmd, unsigned lon ret |= copy_to_user ((char *)A(g), green, f.count); ret |= copy_to_user ((char *)A(b), blue, f.count); } - return ret; + return ret ? -EFAULT : 0; } struct fbcursor32 { @@ -826,8 +828,10 @@ static int fb_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) err |= __get_user(green, &((struct fb_cmap32 *)arg)->green); err |= __get_user(blue, &((struct fb_cmap32 *)arg)->blue); err |= __get_user(transp, &((struct fb_cmap32 *)arg)->transp); - if (err) + if (err) { + err = -EFAULT; goto out; + } err = -ENOMEM; cmap.red = kmalloc(cmap.len * sizeof(__u16), GFP_KERNEL); if (!cmap.red) @@ -851,8 +855,10 @@ static int fb_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) err |= __copy_from_user(cmap.green, (char *)A(green), cmap.len * sizeof(__u16)); err |= __copy_from_user(cmap.blue, (char *)A(blue), cmap.len * sizeof(__u16)); if (cmap.transp) err |= __copy_from_user(cmap.transp, (char *)A(transp), cmap.len * sizeof(__u16)); - if (err) + if (err) { + err = -EFAULT; goto out; + } break; default: do { @@ -896,6 +902,9 @@ static int fb_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) case FBIOPUTCMAP: break; } + if (err) + err = -EFAULT; + out: if (cmap.red) kfree(cmap.red); if (cmap.green) kfree(cmap.green); if (cmap.blue) kfree(cmap.blue); @@ -1064,8 +1073,10 @@ static int fd_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) err |= __get_user(f->spec1, &((struct floppy_struct32 *)arg)->spec1); err |= __get_user(f->fmt_gap, &((struct floppy_struct32 *)arg)->fmt_gap); err |= __get_user((u64)f->name, &((struct floppy_struct32 *)arg)->name); - if (err) + if (err) { + err = -EFAULT; goto out; + } break; } case FDSETDRVPRM32: @@ -1097,8 +1108,10 @@ static int fd_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) err |= __copy_from_user(f->autodetect, ((struct floppy_drive_params32 *)arg)->autodetect, sizeof(f->autodetect)); err |= __get_user(f->checkfreq, &((struct floppy_drive_params32 *)arg)->checkfreq); err |= __get_user(f->native_format, &((struct floppy_drive_params32 *)arg)->native_format); - if (err) + if (err) { + err = -EFAULT; goto out; + } break; } case FDGETDRVSTAT32: @@ -1221,6 +1234,9 @@ static int fd_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) default: break; } + if (err) + err = -EFAULT; + out: if (karg) kfree(karg); return err; } @@ -1396,8 +1412,7 @@ static int mt_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) return err; switch (cmd) { case MTIOCPOS32: - if (__put_user(pos.mt_blkno, &((struct mtpos32 *)arg)->mt_blkno)) - return -EFAULT; + err = __put_user(pos.mt_blkno, &((struct mtpos32 *)arg)->mt_blkno); break; case MTIOCGET32: err = __put_user(get.mt_type, &((struct mtget32 *)arg)->mt_type); @@ -1422,7 +1437,7 @@ static int mt_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) case MTIOCSETCONFIG32: break; } - return err; + return err ? -EFAULT: 0; } struct cdrom_read32 { @@ -1438,11 +1453,21 @@ struct cdrom_read_audio32 { __kernel_caddr_t32 buf; }; +struct cdrom_generic_command32 { + unsigned char cmd[CDROM_PACKET_SIZE]; + __kernel_caddr_t32 buffer; + unsigned int buflen; + int stat; + __kernel_caddr_t32 sense; + __kernel_caddr_t32 reserved[3]; +}; + static int cdrom_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) { mm_segment_t old_fs = get_fs(); struct cdrom_read cdread; struct cdrom_read_audio cdreadaudio; + struct cdrom_generic_command cgc; __kernel_caddr_t32 addr; char *data = 0; void *karg; @@ -1477,6 +1502,17 @@ static int cdrom_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long ar return -ENOMEM; cdreadaudio.buf = data; break; + case CDROM_SEND_PACKET: + karg = &cgc; + err = copy_from_user(cgc.cmd, &((struct cdrom_generic_command32 *)arg)->cmd, sizeof(cgc.cmd)); + err |= __get_user(addr, &((struct cdrom_generic_command32 *)arg)->buffer); + err |= __get_user(cgc.buflen, &((struct cdrom_generic_command32 *)arg)->buflen); + if (err) + return -EFAULT; + if ((data = kmalloc(cgc.buflen, GFP_KERNEL)) == NULL) + return -ENOMEM; + cgc.buffer = data; + break; default: do { static int count = 0; @@ -1502,11 +1538,15 @@ static int cdrom_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long ar case CDROMREADAUDIO: err = copy_to_user((char *)A(addr), data, cdreadaudio.nframes * 2352); break; + case CDROM_SEND_PACKET: + err = copy_to_user((char *)A(addr), data, cgc.buflen); + break; default: break; } -out: if (data) kfree(data); - return err; +out: if (data) + kfree(data); + return err ? -EFAULT : 0; } struct loop_info32 { @@ -1558,7 +1598,7 @@ static int loop_status(unsigned int fd, unsigned int cmd, unsigned long arg) } break; } - return err; + return err ? -EFAULT : 0; } extern int tty_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg); @@ -1835,6 +1875,7 @@ asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) case CDROMREADCOOKED: case CDROMREADAUDIO: case CDROMREADALL: + case CDROM_SEND_PACKET: error = cdrom_ioctl_trans(fd, cmd, arg); goto out; diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index c102a62058d1..01fea4f5961e 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c @@ -1,4 +1,4 @@ -/* $Id: pci.c,v 1.13 2000/01/06 23:51:49 davem Exp $ +/* $Id: pci.c,v 1.14 2000/01/13 00:05:43 davem Exp $ * pci.c: UltraSparc PCI controller support. * * Copyright (C) 1997, 1998, 1999 David S. Miller (davem@redhat.com) @@ -228,6 +228,11 @@ int pci_assign_resource(struct pci_dev *dev, int i) return -ENOSYS; /* :-)... actually implement this soon */ } +int pcibios_enable_device(struct pci_dev *pdev) +{ + return 0; +} + char * __init pcibios_setup(char *str) { if (!strcmp(str, "onboardfirst")) { diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c index d66086bfa9c8..c12b5182df17 100644 --- a/arch/sparc64/kernel/pci_psycho.c +++ b/arch/sparc64/kernel/pci_psycho.c @@ -1,4 +1,4 @@ -/* $Id: pci_psycho.c,v 1.7 1999/12/17 12:31:57 jj Exp $ +/* $Id: pci_psycho.c,v 1.9 2000/01/11 23:38:32 davem Exp $ * pci_psycho.c: PSYCHO/U2P specific PCI controller support. * * Copyright (C) 1997, 1998, 1999 David S. Miller (davem@caipfs.rutgers.edu) @@ -1278,6 +1278,11 @@ static void __init psycho_iommu_init(struct pci_controller_info *p) p->iommu.page_table = (iopte_t *)tsbbase; p->iommu.page_table_sz_bits = 17; p->iommu.page_table_map_base = 0xc0000000; +#ifndef NEW_PCI_DMA_MAP + memset((char *)tsbbase, 0, PAGE_SIZE << 5); +#else + memset((char *)tsbbase, 0, PAGE_SIZE << 7); +#endif #ifndef NEW_PCI_DMA_MAP iopte = (iopte_t *)tsbbase; diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c index 3788f71d3561..7409b3164cbf 100644 --- a/arch/sparc64/kernel/pci_sabre.c +++ b/arch/sparc64/kernel/pci_sabre.c @@ -1,4 +1,4 @@ -/* $Id: pci_sabre.c,v 1.8 2000/01/06 23:51:49 davem Exp $ +/* $Id: pci_sabre.c,v 1.10 2000/01/11 23:38:35 davem Exp $ * pci_sabre.c: Sabre specific PCI controller support. * * Copyright (C) 1997, 1998, 1999 David S. Miller (davem@caipfs.rutgers.edu) @@ -1148,6 +1148,7 @@ static void __init sabre_iommu_init(struct pci_controller_info *p, } p->iommu.page_table = (iopte_t *)tsbbase; p->iommu.page_table_map_base = dvma_offset; + memset((char *)tsbbase, 0, PAGE_SIZE << order); #ifndef NEW_PCI_DMA_MAP iopte = (iopte_t *)tsbbase; diff --git a/arch/sparc64/kernel/sys32.S b/arch/sparc64/kernel/sys32.S index 4b461fbeebe0..34db8d056aa2 100644 --- a/arch/sparc64/kernel/sys32.S +++ b/arch/sparc64/kernel/sys32.S @@ -1,4 +1,4 @@ -/* $Id: sys32.S,v 1.9 1999/12/21 14:09:18 jj Exp $ +/* $Id: sys32.S,v 1.11 2000/01/11 17:33:29 jj Exp $ * sys32.S: I-cache tricks for 32-bit compatability layer simple * conversions. * @@ -20,7 +20,7 @@ sys32_mmap: .align 32 .globl sys32_lseek - .globl sys32_chmod, sys32_chown, sys32_lchown, sys32_mknod + .globl sys32_chmod, sys32_mknod sys32_lseek: sra %o1, 0, %o1 sethi %hi(sys_lseek), %g1 @@ -32,20 +32,6 @@ sys32_chmod: orcc %g2, %lo(0xffff), %g2 jmpl %g1 + %lo(sys_chmod), %g0 and %o1, %g2, %o1 -sys32_chown: - sethi %hi(0xffff), %g2 - sethi %hi(sys_chown), %g1 - orcc %g2, %lo(0xffff), %g2 - and %o1, %g2, %o1 - jmpl %g1 + %lo(sys_chown), %g0 - and %o2, %g2, %o2 -sys32_lchown: - sethi %hi(0xffff), %g2 - sethi %hi(sys_lchown), %g1 - orcc %g2, %lo(0xffff), %g2 - and %o1, %g2, %o1 - jmpl %g1 + %lo(sys_lchown), %g0 - and %o2, %g2, %o2 sys32_mknod: sethi %hi(0xffff), %g2 sethi %hi(sys_mknod), %g1 diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c index 486a09d99152..af4743ec127a 100644 --- a/arch/sparc64/kernel/sys_sparc.c +++ b/arch/sparc64/kernel/sys_sparc.c @@ -1,4 +1,4 @@ -/* $Id: sys_sparc.c,v 1.32 2000/01/05 01:00:40 davem Exp $ +/* $Id: sys_sparc.c,v 1.33 2000/01/11 17:33:25 jj Exp $ * linux/arch/sparc64/kernel/sys_sparc.c * * This file contains various random system calls that @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -98,7 +99,7 @@ asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long thir err = -EFAULT; if(get_user(fourth.__pad, (void **)ptr)) goto out; - err = sys_semctl (first, second, (int)third, fourth); + err = sys_semctl (first, second | IPC_64, (int)third, fourth); goto out; } default: @@ -118,7 +119,7 @@ asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long thir err = sys_msgget ((key_t) first, second); goto out; case MSGCTL: - err = sys_msgctl (first, second, (struct msqid_ds *) ptr); + err = sys_msgctl (first, second | IPC_64, (struct msqid_ds *) ptr); goto out; default: err = -EINVAL; @@ -136,7 +137,7 @@ asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long thir err = sys_shmget (first, second, (int)third); goto out; case SHMCTL: - err = sys_shmctl (first, second, (struct shmid_ds *) ptr); + err = sys_shmctl (first, second | IPC_64, (struct shmid_ds *) ptr); goto out; default: err = -EINVAL; diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c index f9be1320ee4e..51e68a412a95 100644 --- a/arch/sparc64/kernel/sys_sparc32.c +++ b/arch/sparc64/kernel/sys_sparc32.c @@ -1,4 +1,4 @@ -/* $Id: sys_sparc32.c,v 1.127 2000/01/04 23:54:41 davem Exp $ +/* $Id: sys_sparc32.c,v 1.128 2000/01/11 17:33:25 jj Exp $ * sys_sparc32.c: Conversion between 32bit and 64bit native syscalls. * * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -191,6 +192,17 @@ struct semid_ds32 { unsigned short sem_nsems; /* no. of semaphores in array */ }; +struct semid64_ds32 { + struct ipc64_perm sem_perm; /* this structure is the same on sparc32 and sparc64 */ + unsigned int __pad1; + __kernel_time_t32 sem_otime; + unsigned int __pad2; + __kernel_time_t32 sem_ctime; + u32 sem_nsems; + u32 __unused1; + u32 __unused2; +}; + struct msqid_ds32 { struct ipc_perm32 msg_perm; @@ -208,16 +220,51 @@ struct msqid_ds32 __kernel_ipc_pid_t32 msg_lrpid; }; +struct msqid64_ds32 { + struct ipc64_perm msg_perm; + unsigned int __pad1; + __kernel_time_t32 msg_stime; + unsigned int __pad2; + __kernel_time_t32 msg_rtime; + unsigned int __pad3; + __kernel_time_t32 msg_ctime; + unsigned int msg_cbytes; + unsigned int msg_qnum; + unsigned int msg_qbytes; + __kernel_pid_t32 msg_lspid; + __kernel_pid_t32 msg_lrpid; + unsigned int __unused1; + unsigned int __unused2; +}; + + struct shmid_ds32 { - struct ipc_perm32 shm_perm; - int shm_segsz; - __kernel_time_t32 shm_atime; - __kernel_time_t32 shm_dtime; - __kernel_time_t32 shm_ctime; - __kernel_ipc_pid_t32 shm_cpid; - __kernel_ipc_pid_t32 shm_lpid; - unsigned short shm_nattch; + struct ipc_perm32 shm_perm; + int shm_segsz; + __kernel_time_t32 shm_atime; + __kernel_time_t32 shm_dtime; + __kernel_time_t32 shm_ctime; + __kernel_ipc_pid_t32 shm_cpid; + __kernel_ipc_pid_t32 shm_lpid; + unsigned short shm_nattch; }; + +struct shmid64_ds32 { + struct ipc64_perm shm_perm; + unsigned int __pad1; + __kernel_time_t32 shm_atime; + unsigned int __pad2; + __kernel_time_t32 shm_dtime; + unsigned int __pad3; + __kernel_time_t32 shm_ctime; + __kernel_size_t32 shm_segsz; + __kernel_pid_t32 shm_cpid; + __kernel_pid_t32 shm_lpid; + unsigned int shm_nattch; + unsigned int __unused1; + unsigned int __unused2; +}; + /* * sys32_ipc() is the de-multiplexer for the SysV IPC calls in 32bit emulation.. @@ -245,6 +292,34 @@ static int do_sys32_semctl(int first, int second, int third, void *uptr) IPCOP_MASK (GETPID) | IPCOP_MASK (GETNCNT) | IPCOP_MASK (GETZCNT) | IPCOP_MASK (GETALL) | IPCOP_MASK (SETALL) | IPCOP_MASK (IPC_RMID))) { err = sys_semctl (first, second, third, fourth); + } else if (third & IPC_64) { + struct semid64_ds s; + struct semid64_ds32 *usp = (struct semid64_ds32 *)A(pad); + mm_segment_t old_fs; + int need_back_translation; + + if (third == (IPC_SET|IPC_64)) { + err = get_user (s.sem_perm.uid, &usp->sem_perm.uid); + err |= __get_user (s.sem_perm.gid, &usp->sem_perm.gid); + err |= __get_user (s.sem_perm.mode, &usp->sem_perm.mode); + if (err) + goto out; + fourth.__pad = &s; + } + need_back_translation = + (IPCOP_MASK (third) & + (IPCOP_MASK (SEM_STAT) | IPCOP_MASK (IPC_STAT))) != 0; + if (need_back_translation) + fourth.__pad = &s; + old_fs = get_fs (); + set_fs (KERNEL_DS); + err = sys_semctl (first, second, third, fourth); + set_fs (old_fs); + if (need_back_translation) { + int err2 = copy_to_user (&usp->sem_perm, &s.sem_perm, sizeof(struct ipc64_perm) + 2*sizeof(time_t)); + err2 |= __put_user (s.sem_nsems, &usp->sem_nsems); + if (err2) err = -EFAULT; + } } else { struct semid_ds s; struct semid_ds32 *usp = (struct semid_ds32 *)A(pad); @@ -270,10 +345,10 @@ static int do_sys32_semctl(int first, int second, int third, void *uptr) set_fs (old_fs); if (need_back_translation) { int err2 = put_user (s.sem_perm.key, &usp->sem_perm.key); - err2 |= __put_user (s.sem_perm.uid, &usp->sem_perm.uid); - err2 |= __put_user (s.sem_perm.gid, &usp->sem_perm.gid); - err2 |= __put_user (s.sem_perm.cuid, &usp->sem_perm.cuid); - err2 |= __put_user (s.sem_perm.cgid, &usp->sem_perm.cgid); + err2 |= __put_user (high2lowuid(s.sem_perm.uid), &usp->sem_perm.uid); + err2 |= __put_user (high2lowgid(s.sem_perm.gid), &usp->sem_perm.gid); + err2 |= __put_user (high2lowuid(s.sem_perm.cuid), &usp->sem_perm.cuid); + err2 |= __put_user (high2lowgid(s.sem_perm.cgid), &usp->sem_perm.cgid); err2 |= __put_user (s.sem_perm.mode, &usp->sem_perm.mode); err2 |= __put_user (s.sem_perm.seq, &usp->sem_perm.seq); err2 |= __put_user (s.sem_otime, &usp->sem_otime); @@ -357,6 +432,34 @@ static int do_sys32_msgctl (int first, int second, void *uptr) (IPCOP_MASK (IPC_INFO) | IPCOP_MASK (MSG_INFO) | IPCOP_MASK (IPC_RMID))) { err = sys_msgctl (first, second, (struct msqid_ds *)uptr); + } else if (second & IPC_64) { + struct msqid64_ds m; + struct msqid64_ds32 *up = (struct msqid64_ds32 *)uptr; + mm_segment_t old_fs; + + if (second == (IPC_SET|IPC_64)) { + err = get_user (m.msg_perm.uid, &up->msg_perm.uid); + err |= __get_user (m.msg_perm.gid, &up->msg_perm.gid); + err |= __get_user (m.msg_perm.mode, &up->msg_perm.mode); + err |= __get_user (m.msg_qbytes, &up->msg_qbytes); + if (err) + goto out; + } + old_fs = get_fs (); + set_fs (KERNEL_DS); + err = sys_msgctl (first, second, (struct msqid_ds *)&m); + set_fs (old_fs); + if (IPCOP_MASK (second) & + (IPCOP_MASK (MSG_STAT) | IPCOP_MASK (IPC_STAT))) { + int err2 = copy_to_user(&up->msg_perm, &m.msg_perm, sizeof(struct ipc64_perm) + 3*sizeof(time_t)); + err2 |= __put_user (m.msg_cbytes, &up->msg_cbytes); + err2 |= __put_user (m.msg_qnum, &up->msg_qnum); + err2 |= __put_user (m.msg_qbytes, &up->msg_qbytes); + err2 |= __put_user (m.msg_lspid, &up->msg_lspid); + err2 |= __put_user (m.msg_lrpid, &up->msg_lrpid); + if (err2) + err = -EFAULT; + } } else { struct msqid_ds m; struct msqid_ds32 *up = (struct msqid_ds32 *)uptr; @@ -377,10 +480,10 @@ static int do_sys32_msgctl (int first, int second, void *uptr) if (IPCOP_MASK (second) & (IPCOP_MASK (MSG_STAT) | IPCOP_MASK (IPC_STAT))) { int err2 = put_user (m.msg_perm.key, &up->msg_perm.key); - err2 |= __put_user (m.msg_perm.uid, &up->msg_perm.uid); - err2 |= __put_user (m.msg_perm.gid, &up->msg_perm.gid); - err2 |= __put_user (m.msg_perm.cuid, &up->msg_perm.cuid); - err2 |= __put_user (m.msg_perm.cgid, &up->msg_perm.cgid); + err2 |= __put_user (high2lowuid(m.msg_perm.uid), &up->msg_perm.uid); + err2 |= __put_user (high2lowgid(m.msg_perm.gid), &up->msg_perm.gid); + err2 |= __put_user (high2lowuid(m.msg_perm.cuid), &up->msg_perm.cuid); + err2 |= __put_user (high2lowgid(m.msg_perm.cgid), &up->msg_perm.cgid); err2 |= __put_user (m.msg_perm.mode, &up->msg_perm.mode); err2 |= __put_user (m.msg_perm.seq, &up->msg_perm.seq); err2 |= __put_user (m.msg_stime, &up->msg_stime); @@ -423,12 +526,45 @@ static int do_sys32_shmctl (int first, int second, void *uptr) if (IPCOP_MASK (second) & (IPCOP_MASK (IPC_INFO) | IPCOP_MASK (SHM_LOCK) | IPCOP_MASK (SHM_UNLOCK) | IPCOP_MASK (IPC_RMID))) { + if (second == (IPC_INFO|IPC_64)) + second = IPC_INFO; /* So that we don't have to translate it */ err = sys_shmctl (first, second, (struct shmid_ds *)uptr); + } else if ((second & IPC_64) && second != (SHM_INFO|IPC_64)) { + struct shmid64_ds s; + struct shmid64_ds32 *up = (struct shmid64_ds32 *)uptr; + mm_segment_t old_fs; + + if (second == (IPC_SET|IPC_64)) { + err = get_user (s.shm_perm.uid, &up->shm_perm.uid); + err |= __get_user (s.shm_perm.gid, &up->shm_perm.gid); + err |= __get_user (s.shm_perm.mode, &up->shm_perm.mode); + if (err) + goto out; + } + old_fs = get_fs (); + set_fs (KERNEL_DS); + err = sys_shmctl (first, second, (struct shmid_ds *)&s); + set_fs (old_fs); + if (err < 0) + goto out; + + /* Mask it even in this case so it becomes a CSE. */ + if (IPCOP_MASK (second) & + (IPCOP_MASK (SHM_STAT) | IPCOP_MASK (IPC_STAT))) { + int err2 = copy_to_user (&up->shm_perm, &s.shm_perm, sizeof(struct ipc64_perm) + 3*sizeof(time_t)); + err2 |= __put_user (s.shm_segsz, &up->shm_segsz); + err2 |= __put_user (s.shm_nattch, &up->shm_nattch); + err2 |= __put_user (s.shm_cpid, &up->shm_cpid); + err2 |= __put_user (s.shm_lpid, &up->shm_lpid); + if (err2) + err = -EFAULT; + } } else { struct shmid_ds s; struct shmid_ds32 *up = (struct shmid_ds32 *)uptr; mm_segment_t old_fs; + second &= ~IPC_64; if (second == IPC_SET) { err = get_user (s.shm_perm.uid, &up->shm_perm.uid); err |= __get_user (s.shm_perm.gid, &up->shm_perm.gid); @@ -462,10 +598,10 @@ static int do_sys32_shmctl (int first, int second, void *uptr) } else if (IPCOP_MASK (second) & (IPCOP_MASK (SHM_STAT) | IPCOP_MASK (IPC_STAT))) { int err2 = put_user (s.shm_perm.key, &up->shm_perm.key); - err2 |= __put_user (s.shm_perm.uid, &up->shm_perm.uid); - err2 |= __put_user (s.shm_perm.gid, &up->shm_perm.gid); - err2 |= __put_user (s.shm_perm.cuid, &up->shm_perm.cuid); - err2 |= __put_user (s.shm_perm.cgid, &up->shm_perm.cgid); + err2 |= __put_user (high2lowuid(s.shm_perm.uid), &up->shm_perm.uid); + err2 |= __put_user (high2lowuid(s.shm_perm.gid), &up->shm_perm.gid); + err2 |= __put_user (high2lowuid(s.shm_perm.cuid), &up->shm_perm.cuid); + err2 |= __put_user (high2lowuid(s.shm_perm.cgid), &up->shm_perm.cgid); err2 |= __put_user (s.shm_perm.mode, &up->shm_perm.mode); err2 |= __put_user (s.shm_perm.seq, &up->shm_perm.seq); err2 |= __put_user (s.shm_atime, &up->shm_atime); @@ -1244,8 +1380,8 @@ static int cp_new_stat32(struct inode *inode, struct stat32 *statbuf) err |= put_user(ino, &statbuf->st_ino); err |= put_user(mode, &statbuf->st_mode); err |= put_user(nlink, &statbuf->st_nlink); - err |= put_user(uid, &statbuf->st_uid); - err |= put_user(gid, &statbuf->st_gid); + err |= put_user(high2lowuid(uid), &statbuf->st_uid); + err |= put_user(high2lowgid(gid), &statbuf->st_gid); err |= put_user(kdev_t_to_nr(rdev), &statbuf->st_rdev); err |= put_user(size, &statbuf->st_size); err |= put_user(atime, &statbuf->st_atime); @@ -1853,91 +1989,6 @@ sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 *uinfo) return ret; } -extern asmlinkage int sys_setreuid(uid_t ruid, uid_t euid); - -asmlinkage int sys32_setreuid(__kernel_uid_t32 ruid, __kernel_uid_t32 euid) -{ - uid_t sruid, seuid; - - sruid = (ruid == (__kernel_uid_t32)-1) ? ((uid_t)-1) : ((uid_t)ruid); - seuid = (euid == (__kernel_uid_t32)-1) ? ((uid_t)-1) : ((uid_t)euid); - return sys_setreuid(sruid, seuid); -} - -extern asmlinkage int sys_setresuid(uid_t ruid, uid_t euid, uid_t suid); - -asmlinkage int sys32_setresuid(__kernel_uid_t32 ruid, - __kernel_uid_t32 euid, - __kernel_uid_t32 suid) -{ - uid_t sruid, seuid, ssuid; - - sruid = (ruid == (__kernel_uid_t32)-1) ? ((uid_t)-1) : ((uid_t)ruid); - seuid = (euid == (__kernel_uid_t32)-1) ? ((uid_t)-1) : ((uid_t)euid); - ssuid = (suid == (__kernel_uid_t32)-1) ? ((uid_t)-1) : ((uid_t)suid); - return sys_setresuid(sruid, seuid, ssuid); -} - -extern asmlinkage int sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); - -asmlinkage int sys32_getresuid(__kernel_uid_t32 *ruid, __kernel_uid_t32 *euid, __kernel_uid_t32 *suid) -{ - uid_t a, b, c; - int ret; - mm_segment_t old_fs = get_fs(); - - set_fs (KERNEL_DS); - ret = sys_getresuid(&a, &b, &c); - set_fs (old_fs); - if (put_user (a, ruid) || put_user (b, euid) || put_user (c, suid)) - return -EFAULT; - return ret; -} - -extern asmlinkage int sys_setregid(gid_t rgid, gid_t egid); - -asmlinkage int sys32_setregid(__kernel_gid_t32 rgid, __kernel_gid_t32 egid) -{ - gid_t srgid, segid; - - srgid = (rgid == (__kernel_gid_t32)-1) ? ((gid_t)-1) : ((gid_t)rgid); - segid = (egid == (__kernel_gid_t32)-1) ? ((gid_t)-1) : ((gid_t)egid); - return sys_setregid(srgid, segid); -} - -extern asmlinkage int sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid); - -asmlinkage int sys32_setresgid(__kernel_gid_t32 rgid, - __kernel_gid_t32 egid, - __kernel_gid_t32 sgid) -{ - gid_t srgid, segid, ssgid; - - srgid = (rgid == (__kernel_gid_t32)-1) ? ((gid_t)-1) : ((gid_t)rgid); - segid = (egid == (__kernel_gid_t32)-1) ? ((gid_t)-1) : ((gid_t)egid); - ssgid = (sgid == (__kernel_gid_t32)-1) ? ((gid_t)-1) : ((gid_t)sgid); - return sys_setresgid(srgid, segid, ssgid); -} - -extern asmlinkage int sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); - -asmlinkage int sys32_getresgid(__kernel_gid_t32 *rgid, __kernel_gid_t32 *egid, __kernel_gid_t32 *sgid) -{ - gid_t a, b, c; - int ret; - mm_segment_t old_fs = get_fs(); - - set_fs (KERNEL_DS); - ret = sys_getresgid(&a, &b, &c); - set_fs (old_fs); - if (!ret) { - ret = put_user (a, rgid); - ret |= put_user (b, egid); - ret |= put_user (c, sgid); - } - return ret; -} - struct tms32 { __kernel_clock_t32 tms_utime; __kernel_clock_t32 tms_stime; @@ -1968,43 +2019,6 @@ asmlinkage long sys32_times(struct tms32 *tbuf) return ret; } -extern asmlinkage int sys_getgroups(int gidsetsize, gid_t *grouplist); - -asmlinkage int sys32_getgroups(int gidsetsize, __kernel_gid_t32 *grouplist) -{ - gid_t gl[NGROUPS]; - int ret, i; - mm_segment_t old_fs = get_fs (); - - set_fs (KERNEL_DS); - ret = sys_getgroups(gidsetsize, gl); - set_fs (old_fs); - if (gidsetsize && ret > 0 && ret <= NGROUPS) - for (i = 0; i < ret; i++, grouplist++) - if (__put_user (gl[i], grouplist)) - return -EFAULT; - return ret; -} - -extern asmlinkage int sys_setgroups(int gidsetsize, gid_t *grouplist); - -asmlinkage int sys32_setgroups(int gidsetsize, __kernel_gid_t32 *grouplist) -{ - gid_t gl[NGROUPS]; - int ret, i; - mm_segment_t old_fs = get_fs (); - - if ((unsigned) gidsetsize > NGROUPS) - return -EINVAL; - for (i = 0; i < gidsetsize; i++, grouplist++) - if (__get_user (gl[i], grouplist)) - return -EFAULT; - set_fs (KERNEL_DS); - ret = sys_setgroups(gidsetsize, gl); - set_fs (old_fs); - return ret; -} - #define RLIM_INFINITY32 0x7fffffff #define RESOURCE32(x) ((x > RLIM_INFINITY32) ? RLIM_INFINITY32 : x) diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S index 27355da96dde..073ba40a53b1 100644 --- a/arch/sparc64/kernel/systbls.S +++ b/arch/sparc64/kernel/systbls.S @@ -1,4 +1,4 @@ -/* $Id: systbls.S,v 1.62 2000/01/04 23:54:43 davem Exp $ +/* $Id: systbls.S,v 1.64 2000/01/11 17:33:28 jj Exp $ * systbls.S: System call entry point tables for OS compatibility. * The native Linux system call table lives here also. * @@ -21,30 +21,30 @@ sys_call_table32: /*0*/ .word sys_nis_syscall, sparc_exit, sys_fork, sys_read, sys_write /*5*/ .word sparc32_open, sys_close, sys32_wait4, sys_creat, sys_link -/*10*/ .word sys_unlink, sunos_execv, sys_chdir, sys32_chown, sys32_mknod -/*15*/ .word sys32_chmod, sys32_lchown, sparc_brk, sys_perfctr, sys32_lseek -/*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid, sys_getuid +/*10*/ .word sys_unlink, sunos_execv, sys_chdir, sys_chown16, sys32_mknod +/*15*/ .word sys32_chmod, sys_lchown16, sparc_brk, sys_perfctr, sys32_lseek +/*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid16, sys_getuid16 /*25*/ .word sys_time, sys_ptrace, sys_alarm, sys32_sigaltstack, sys32_pause -/*30*/ .word sys32_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice - .word sys_nis_syscall, sys_sync, sys_kill, sys32_newstat, sys32_sendfile -/*40*/ .word sys32_newlstat, sys_dup, sys_pipe, sys32_times, sys_nis_syscall - .word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid -/*50*/ .word sys_getegid, sys_acct, sys_nis_syscall, sys_nis_syscall, sys32_ioctl +/*30*/ .word sys32_utime, sys_lchown, sys_fchown, sys_access, sys_nice + .word sys_chown, sys_sync, sys_kill, sys32_newstat, sys32_sendfile +/*40*/ .word sys32_newlstat, sys_dup, sys_pipe, sys32_times, sys_getuid + .word sys_umount, sys_setgid16, sys_getgid16, sys_signal, sys_geteuid16 +/*50*/ .word sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys32_ioctl .word sys_reboot, sys32_mmap2, sys_symlink, sys_readlink, sys32_execve /*60*/ .word sys_umask, sys_chroot, sys32_newfstat, sys_fstat64, sys_getpagesize - .word sys_msync, sys_vfork, sys32_pread, sys32_pwrite, sys_nis_syscall -/*70*/ .word sys_nis_syscall, sys32_mmap, sys_nis_syscall, sys_munmap, sys_mprotect - .word sys_nis_syscall, sys_vhangup, sys32_truncate64, sys_nis_syscall, sys32_getgroups -/*80*/ .word sys32_setgroups, sys_getpgrp, sys_nis_syscall, sys32_setitimer, sys32_ftruncate64 - .word sys_swapon, sys32_getitimer, sys_nis_syscall, sys_sethostname, sys_nis_syscall -/*90*/ .word sys_dup2, sys_nis_syscall, sys32_fcntl, sys32_select, sys_nis_syscall + .word sys_msync, sys_vfork, sys32_pread, sys32_pwrite, sys_geteuid +/*70*/ .word sys_getegid, sys32_mmap, sys_setreuid, sys_munmap, sys_mprotect + .word sys_setregid, sys_vhangup, sys32_truncate64, sys_getgroups, sys_getgroups16 +/*80*/ .word sys_setgroups16, sys_getpgrp, sys_setgroups, sys32_setitimer, sys32_ftruncate64 + .word sys_swapon, sys32_getitimer, sys_setuid, sys_sethostname, sys_setgid +/*90*/ .word sys_dup2, sys_setfsuid, sys32_fcntl, sys32_select, sys_setfsgid .word sys_fsync, sys_setpriority, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall /*100*/ .word sys_getpriority, sys32_rt_sigreturn, sys32_rt_sigaction, sys32_rt_sigprocmask, sys32_rt_sigpending - .word sys32_rt_sigtimedwait, sys32_rt_sigqueueinfo, sys32_rt_sigsuspend, sys_nis_syscall, sys_nis_syscall -/*110*/ .word sys_nis_syscall, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall + .word sys32_rt_sigtimedwait, sys32_rt_sigqueueinfo, sys32_rt_sigsuspend, sys_setresuid, sys_getresuid +/*110*/ .word sys_setresgid, sys_getresgid, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall .word sys_nis_syscall, sys32_gettimeofday, sys32_getrusage, sys_nis_syscall, sys_getcwd -/*120*/ .word sys32_readv, sys32_writev, sys32_settimeofday, sys_fchown, sys_fchmod - .word sys_nis_syscall, sys32_setreuid, sys32_setregid, sys_rename, sys_truncate +/*120*/ .word sys32_readv, sys32_writev, sys32_settimeofday, sys_fchown16, sys_fchmod + .word sys_nis_syscall, sys_setreuid16, sys_setregid16, sys_rename, sys_truncate /*130*/ .word sys_ftruncate, sys_flock, sys_lstat64, sys_nis_syscall, sys_nis_syscall .word sys_nis_syscall, sys_mkdir, sys_rmdir, sys32_utimes, sys_stat64 /*140*/ .word sys_nis_syscall, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall, sys32_getrlimit @@ -64,7 +64,7 @@ sys_call_table32: /*210*/ .word sys_nis_syscall, sys_nis_syscall, sys_waitpid, sys_swapoff, sys32_sysinfo .word sys32_ipc, sys32_sigreturn, sys_clone, sys_nis_syscall, sys32_adjtimex /*220*/ .word sys32_sigprocmask, sys32_create_module, sys32_delete_module, sys32_get_kernel_syms, sys_getpgid - .word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys_setfsuid, sys_setfsgid + .word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys_setfsuid16, sys_setfsgid16 /*230*/ .word sys32_select, sys_time, sys_nis_syscall, sys_stime, sys_nis_syscall .word sys_nis_syscall, sys_llseek, sys_mlock, sys_munlock, sys_mlockall /*240*/ .word sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler @@ -99,8 +99,8 @@ sys_call_table: /*90*/ .word sys_dup2, sys_nis_syscall, sys_fcntl, sys_select, sys_nis_syscall .word sys_fsync, sys_setpriority, sys_socket, sys_connect, sys_accept /*100*/ .word sys_getpriority, sys_rt_sigreturn, sys_rt_sigaction, sys_rt_sigprocmask, sys_rt_sigpending - .word sys_rt_sigtimedwait, sys_rt_sigqueueinfo, sys_rt_sigsuspend, sys_nis_syscall, sys_nis_syscall -/*110*/ .word sys_nis_syscall, sys_nis_syscall, sys_nis_syscall, sys_recvmsg, sys_sendmsg + .word sys_rt_sigtimedwait, sys_rt_sigqueueinfo, sys_rt_sigsuspend, sys_setresuid, sys_getresuid +/*110*/ .word sys_setresgid, sys_getresgid, sys_nis_syscall, sys_recvmsg, sys_sendmsg .word sys_nis_syscall, sys_gettimeofday, sys_getrusage, sys_getsockopt, sys_getcwd /*120*/ .word sys_readv, sys_writev, sys_settimeofday, sys_fchown, sys_fchmod .word sys_recvfrom, sys_setreuid, sys_setregid, sys_rename, sys_truncate @@ -143,7 +143,7 @@ sunos_sys_table: .word sys_close, sunos_wait4, sys_creat .word sys_link, sys_unlink, sunos_execv .word sys_chdir, sunos_nosys, sys32_mknod - .word sys32_chmod, sys32_lchown, sunos_brk + .word sys32_chmod, sys_lchown16, sunos_brk .word sunos_nosys, sys32_lseek, sunos_getpid .word sunos_nosys, sunos_nosys, sunos_nosys .word sunos_getuid, sunos_nosys, sys_ptrace @@ -164,8 +164,8 @@ sunos_sys_table: .word sunos_nosys, sunos_sbrk, sunos_sstk .word sunos_mmap, sunos_vadvise, sys_munmap .word sys_mprotect, sunos_madvise, sys_vhangup - .word sunos_nosys, sunos_mincore, sys32_getgroups - .word sys32_setgroups, sys_getpgrp, sunos_setpgrp + .word sunos_nosys, sunos_mincore, sys_getgroups16 + .word sys_setgroups16, sys_getpgrp, sunos_setpgrp .word sys32_setitimer, sunos_nosys, sys_swapon .word sys32_getitimer, sys_gethostname, sys_sethostname .word sunos_getdtablesize, sys_dup2, sunos_nop @@ -179,9 +179,9 @@ sunos_sys_table: .word sys32_sigstack, sys32_recvmsg, sys32_sendmsg .word sunos_nosys, sys32_gettimeofday, sys32_getrusage .word sunos_getsockopt, sunos_nosys, sunos_readv - .word sunos_writev, sys32_settimeofday, sys_fchown - .word sys_fchmod, sys32_recvfrom, sys32_setreuid - .word sys_setregid, sys_rename, sys_truncate + .word sunos_writev, sys32_settimeofday, sys_fchown16 + .word sys_fchmod, sys32_recvfrom, sys_setreuid16 + .word sys_setregid16, sys_rename, sys_truncate .word sys_ftruncate, sys_flock, sunos_nosys .word sys32_sendto, sys_shutdown, sys_socketpair .word sys_mkdir, sys_rmdir, sys32_utimes diff --git a/arch/sparc64/solaris/entry64.S b/arch/sparc64/solaris/entry64.S index 53d825e6dfe5..eb9cf3d261f2 100644 --- a/arch/sparc64/solaris/entry64.S +++ b/arch/sparc64/solaris/entry64.S @@ -1,4 +1,4 @@ -/* $Id: entry64.S,v 1.5 1998/03/26 08:46:15 jj Exp $ +/* $Id: entry64.S,v 1.6 2000/01/12 02:59:26 davem Exp $ * entry64.S: Solaris syscall emulation entry point. * * Copyright (C) 1996,1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -183,15 +183,15 @@ solaris_getpid: .globl solaris_getuid solaris_getuid: - lduh [%g6 + AOFF_task_euid], %o1 - lduh [%g6 + AOFF_task_uid], %o0 + lduw [%g6 + AOFF_task_euid], %o1 + lduw [%g6 + AOFF_task_uid], %o0 b,pt %xcc, ret_from_solaris stx %o1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I1] .globl solaris_getgid solaris_getgid: - lduh [%g6 + AOFF_task_egid], %o1 - lduh [%g6 + AOFF_task_gid], %o0 + lduw [%g6 + AOFF_task_egid], %o1 + lduw [%g6 + AOFF_task_gid], %o0 b,pt %xcc, ret_from_solaris stx %o1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I1] diff --git a/arch/sparc64/solaris/fs.c b/arch/sparc64/solaris/fs.c index 86b0df2831a2..e15ef157c006 100644 --- a/arch/sparc64/solaris/fs.c +++ b/arch/sparc64/solaris/fs.c @@ -1,4 +1,4 @@ -/* $Id: fs.c,v 1.15 2000/01/04 23:54:47 davem Exp $ +/* $Id: fs.c,v 1.16 2000/01/12 02:59:27 davem Exp $ * fs.c: fs related syscall emulation for Solaris * * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -708,71 +708,6 @@ asmlinkage int solaris_ulimit(int cmd, int val) return -EINVAL; } -static int chown_common(struct dentry * dentry, uid_t user, gid_t group) -{ - struct inode * inode; - struct iattr newattrs; - int error; - - error = -ENOENT; - if (!(inode = dentry->d_inode)) { - printk("chown_common: NULL inode\n"); - goto out; - } - error = -EROFS; - if (IS_RDONLY(inode)) - goto out; - error = -EPERM; - if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) - goto out; - if (user == (uid_t) -1) - user = inode->i_uid; - if (group == (gid_t) -1) - group = inode->i_gid; - newattrs.ia_mode = inode->i_mode; - newattrs.ia_uid = user; - newattrs.ia_gid = group; - newattrs.ia_valid = ATTR_UID | ATTR_GID | ATTR_CTIME; - /* - * If the owner has been changed, remove the setuid bit - */ - if (inode->i_mode & S_ISUID) { - newattrs.ia_mode &= ~S_ISUID; - newattrs.ia_valid |= ATTR_MODE; - } - /* - * If the group has been changed, remove the setgid bit - * - * Don't remove the setgid bit if no group execute bit. - * This is a file marked for mandatory locking. - */ - if (((inode->i_mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP))) { - newattrs.ia_mode &= ~S_ISGID; - newattrs.ia_valid |= ATTR_MODE; - } - error = DQUOT_TRANSFER(dentry, &newattrs); -out: - return error; -} - -/* Linux chown works like Solaris lchown. Solaris chown does follow symlink */ -asmlinkage int solaris_chown(u32 filename, s32 user, s32 group) -{ - struct dentry * dentry; - int error; - - lock_kernel(); - dentry = namei((const char *)A(filename)); - - error = PTR_ERR(dentry); - if (!IS_ERR(dentry)) { - error = chown_common(dentry, user, group); - dput(dentry); - } - unlock_kernel(); - return error; -} - /* At least at the time I'm writing this, Linux doesn't have ACLs, so we just fake this */ asmlinkage int solaris_acl(u32 filename, int cmd, int nentries, u32 aclbufp) diff --git a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c index a07fc7cc2abd..04e67690767e 100644 --- a/arch/sparc64/solaris/misc.c +++ b/arch/sparc64/solaris/misc.c @@ -1,4 +1,4 @@ -/* $Id: misc.c,v 1.19 1999/12/15 17:51:25 jj Exp $ +/* $Id: misc.c,v 1.20 2000/01/12 02:59:26 davem Exp $ * misc.c: Miscelaneous syscall emulation for Solaris * * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -401,18 +401,6 @@ asmlinkage int solaris_sysconf(int id) } } -asmlinkage int solaris_setreuid(s32 ruid, s32 euid) -{ - int (*sys_setreuid)(uid_t, uid_t) = (int (*)(uid_t, uid_t))SYS(setreuid); - return sys_setreuid(ruid, euid); -} - -asmlinkage int solaris_setregid(s32 rgid, s32 egid) -{ - int (*sys_setregid)(gid_t, gid_t) = (int (*)(gid_t, gid_t))SYS(setregid); - return sys_setregid(rgid, egid); -} - asmlinkage int solaris_procids(int cmd, s32 pid, s32 pgid) { int ret; diff --git a/arch/sparc64/solaris/systbl.S b/arch/sparc64/solaris/systbl.S index 7c7c7b8b1092..17562bafd282 100644 --- a/arch/sparc64/solaris/systbl.S +++ b/arch/sparc64/solaris/systbl.S @@ -1,4 +1,4 @@ -/* $Id: systbl.S,v 1.8 1999/02/11 18:34:02 davem Exp $ +/* $Id: systbl.S,v 1.10 2000/01/12 02:59:26 davem Exp $ * systbl.S: System call entry point table for Solaris compatibility. * * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -40,7 +40,7 @@ solaris_sys_table: .word CHAIN(time) /* time 13 */ .word solaris_mknod /* mknod sox 14 */ .word CHAIN(chmod) /* chmod so 15 */ - .word solaris_chown /* chown sdd 16 */ + .word CHAIN(chown) /* chown sdd 16 */ .word solaris_brk /* brk/break x 17 */ .word solaris_stat /* stat sp 18 */ .word CHAIN(lseek) /* seek/lseek ddd 19 */ @@ -230,8 +230,8 @@ solaris_sys_table: .word CHAIN(nanosleep) /* nanosleep dd 199 */ .word solaris_facl /* facl dddp 200 */ .word solaris_unimplemented /* 201 */ - .word solaris_setreuid /* setreuid dd 202 */ - .word solaris_setregid /* setregid dd 203 */ + .word CHAIN(setreuid) /* setreuid dd 202 */ + .word CHAIN(setregid) /* setregid dd 203 */ .word solaris_unimplemented /* 204 */ .word solaris_unimplemented /* 205 */ .word solaris_unimplemented /* 206 */ diff --git a/drivers/acorn/block/mfmhd.c b/drivers/acorn/block/mfmhd.c index f9eef0987378..fb440ae10d15 100644 --- a/drivers/acorn/block/mfmhd.c +++ b/drivers/acorn/block/mfmhd.c @@ -115,6 +115,7 @@ #define MAJOR_NR MFM_ACORN_MAJOR #include +#include #include #include @@ -975,7 +976,7 @@ static void mfm_request(void) DBG("mfm_request: Dropping out bottom\n"); } -static void do_mfm_request(void) +static void do_mfm_request(request_queue_t *q) { DBG("do_mfm_request: about to mfm_request\n"); mfm_request(); @@ -1210,24 +1211,6 @@ static int mfm_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long a return -EFAULT; return 0; - case BLKFLSBUF: - if (!capable(CAP_SYS_ADMIN)) - return -EACCES; - fsync_dev(dev); - invalidate_buffers(dev); - return 0; - - case BLKRASET: - if (!capable(CAP_SYS_ADMIN)) - return -EACCES; - if (arg > 0xff) - return -EINVAL; - read_ahead[major] = arg; - return 0; - - case BLKRAGET: - return put_user(read_ahead[major], (long *)arg); - case BLKGETSIZE: return put_user (mfm[minor].nr_sects, (long *)arg); @@ -1248,7 +1231,13 @@ static int mfm_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long a return -EACCES; return mfm_reread_partitions(dev); - RO_IOCTLS(dev, arg); + case BLKFLSBUF: + case BLKROSET: + case BLKROGET: + case BLKRASET: + case BLKRAGET: + case BLKPG: + return blk_ioctl(dev, cmd, arg); default: return -EINVAL; @@ -1421,11 +1410,6 @@ int mfm_init (void) { unsigned char irqmask; - if (register_blkdev(MAJOR_NR, "mfm", &mfm_fops)) { - printk("mfm_init: unable to get major number %d\n", MAJOR_NR); - return -1; - } - if (mfm_probecontroller(ONBOARD_MFM_ADDRESS)) { mfm_addr = ONBOARD_MFM_ADDRESS; mfm_IRQPollLoc = IOC_IRQSTATB; @@ -1448,6 +1432,12 @@ int mfm_init (void) ecard_claim(ecs); } + if (register_blkdev(MAJOR_NR, "mfm", &mfm_fops)) { + printk("mfm_init: unable to get major number %d\n", MAJOR_NR); + ecard_release(ecs); + return -1; + } + printk("mfm: found at address %08X, interrupt %d\n", mfm_addr, mfm_irq); request_region (mfm_addr, 10, "mfm"); @@ -1456,7 +1446,7 @@ int mfm_init (void) hdc63463_irqpolladdress = ioaddr(mfm_IRQPollLoc); hdc63463_irqpollmask = irqmask; - blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST; + blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST); read_ahead[MAJOR_NR] = 8; /* 8 sector (4kB?) read ahread */ #ifndef MODULE diff --git a/drivers/acorn/scsi/Config.in b/drivers/acorn/scsi/Config.in index 28030bc32d1f..60a5e0a805e5 100644 --- a/drivers/acorn/scsi/Config.in +++ b/drivers/acorn/scsi/Config.in @@ -6,12 +6,12 @@ if [ "$CONFIG_SCSI_ACORNSCSI_3" != "n" ]; then bool ' Support SCSI 2 Tagged queueing' CONFIG_SCSI_ACORNSCSI_TAGGED_QUEUE bool ' Support SCSI 2 Synchronous Transfers' CONFIG_SCSI_ACORNSCSI_SYNC fi -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - dep_tristate 'ARXE SCSI support (EXPERIMENTAL)' CONFIG_SCSI_ARXESCSI $CONFIG_SCSI - dep_tristate 'CumanaSCSI II support (EXPERIMENTAL)' CONFIG_SCSI_CUMANA_2 $CONFIG_SCSI - dep_tristate 'EESOX support (EXPERIMENTAL)' CONFIG_SCSI_EESOXSCSI $CONFIG_SCSI - dep_tristate 'PowerTec support (EXPERIMENTAL)' CONFIG_SCSI_POWERTECSCSI $CONFIG_SCSI +dep_tristate 'ARXE SCSI support' CONFIG_SCSI_ARXESCSI $CONFIG_SCSI +dep_tristate 'CumanaSCSI II support' CONFIG_SCSI_CUMANA_2 $CONFIG_SCSI +dep_tristate 'EESOX support' CONFIG_SCSI_EESOXSCSI $CONFIG_SCSI +dep_tristate 'PowerTec support' CONFIG_SCSI_POWERTECSCSI $CONFIG_SCSI +if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then comment 'The following drivers are not fully supported' dep_tristate 'CumanaSCSI I support' CONFIG_SCSI_CUMANA_1 $CONFIG_SCSI diff --git a/drivers/char/Config.in b/drivers/char/Config.in index 7d2d0c8e7cf0..9eaf6ba9af3d 100644 --- a/drivers/char/Config.in +++ b/drivers/char/Config.in @@ -216,7 +216,7 @@ if [ "$CONFIG_DRM" = "y" ]; then dep_tristate ' 3dlabs GMX 2000' CONFIG_DRM_GAMMA m fi -if [ "$CONFIG_PCMCIA" != "n" ]; then +if [ "$CONFIG_HOTPLUG" = "y" -a "$CONFIG_PCMCIA" != "n" ]; then source drivers/char/pcmcia/Config.in fi diff --git a/drivers/char/pcmcia/Config.in b/drivers/char/pcmcia/Config.in index 7a32e5d553b9..484d537649cf 100644 --- a/drivers/char/pcmcia/Config.in +++ b/drivers/char/pcmcia/Config.in @@ -2,10 +2,8 @@ # PCMCIA character device configuration # -mainmenu_option next_comment -comment 'PCMCIA character device support' - -if [ "$CONFIG_SERIAL" = "n" -o "$CONFIG_PCMCIA" = "n" ]; then +if [ "$CONFIG_SERIAL" = "n" -o "$CONFIG_PCMCIA" = "n" -o \ + "$CONFIG_HOTPLUG" = "n" ]; then define_bool CONFIG_PCMCIA_SERIAL n else if [ "$CONFIG_SERIAL" = "m" -o "$CONFIG_PCMCIA" = "m" ]; then @@ -15,14 +13,19 @@ else fi fi -dep_tristate ' PCMCIA serial device support' CONFIG_PCMCIA_SERIAL_CS $CONFIG_PCMCIA_SERIAL -if [ "$CONFIG_CARDBUS" = "y" ]; then - dep_tristate ' CardBus serial device support' CONFIG_PCMCIA_SERIAL_CB $CONFIG_PCMCIA_SERIAL +if [ "$CONFIG_PCMCIA_SERIAL" != "n" ]; then + mainmenu_option next_comment + comment 'PCMCIA character device support' + + dep_tristate 'PCMCIA serial device support' CONFIG_PCMCIA_SERIAL_CS $CONFIG_PCMCIA_SERIAL + if [ "$CONFIG_CARDBUS" = "y" ]; then + dep_tristate 'CardBus serial device support' CONFIG_PCMCIA_SERIAL_CB $CONFIG_PCMCIA_SERIAL + fi + + endmenu fi if [ "$CONFIG_PCMCIA_SERIAL_CS" = "y" -o \ "$CONFIG_PCMCIA_SERIAL_CB" = "y" ]; then define_bool CONFIG_PCMCIA_CHRDEV y fi - -endmenu diff --git a/drivers/net/Config.in b/drivers/net/Config.in index 20dce7ec45a8..03bdfcbe6917 100644 --- a/drivers/net/Config.in +++ b/drivers/net/Config.in @@ -261,6 +261,6 @@ fi source drivers/net/wan/Config.in -if [ "$CONFIG_PCMCIA" != "n" ]; then +if [ "$CONFIG_HOTPLUG" = "y" -a "$CONFIG_PCMCIA" != "n" ]; then source drivers/net/pcmcia/Config.in fi diff --git a/drivers/net/pcmcia/Config.in b/drivers/net/pcmcia/Config.in index 243b5c89648a..d9164e476990 100644 --- a/drivers/net/pcmcia/Config.in +++ b/drivers/net/pcmcia/Config.in @@ -31,12 +31,14 @@ if [ "$CONFIG_NET_PCMCIA" = "y" ]; then fi fi +endmenu + if [ "$CONFIG_PCMCIA_3C589" = "y" -o "$CONFIG_PCMCIA_3C574" = "y" -o \ "$CONFIG_PCMCIA_FMVJ18X" = "y" -o "$CONFIG_PCMCIA_PCNET" = "y" -o \ "$CONFIG_PCMCIA_NMCLAN" = "y" -o "$CONFIG_PCMCIA_SMC91C92" = "y" -o \ "$CONFIG_PCMCIA_XIRC2PS" = "y" -o "$CONFIG_PCMCIA_RAYCS" = "y" -o \ "$CONFIG_PCMCIA_NETWAVE" = "y" -o "$CONFIG_PCMCIA_WAVELAN" = "y" ]; then define_bool CONFIG_PCMCIA_NETCARD y +else + define_bool CONFIG_PCMCIA_NETCARD n fi - -endmenu diff --git a/drivers/net/pcmcia/tulip_cb.c b/drivers/net/pcmcia/tulip_cb.c index 37e05bfd3567..e982eb4e9d22 100644 --- a/drivers/net/pcmcia/tulip_cb.c +++ b/drivers/net/pcmcia/tulip_cb.c @@ -3161,27 +3161,20 @@ struct pci_driver tulip_ops = { resume: tulip_resume }; -#ifdef MODULE - -int module_init(void) +int tulip_init(void) { pci_register_driver(&tulip_ops); return 0; } -void module_cleanup(void) +void tulip_exit(void) { pci_unregister_driver(&tulip_ops); } -#else - -void tulip_probe(void) -{ - pci_register_driver(&tulip_ops); -} +module_init(tulip_init) +module_exit(tulip_exit) -#endif /* * Local variables: diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c index 8f1f6cce018d..1c9dbdc10c69 100644 --- a/drivers/net/tokenring/olympic.c +++ b/drivers/net/tokenring/olympic.c @@ -25,10 +25,11 @@ * 8/18/99 - Updated driver for 2.3.13 kernel to use new pci * resource. Driver also reports the card name returned by * the pci resource. + * 1/11/00 - Added spinlocks for smp * * To Do: * - * Sanitize for smp + * IPv6 Multicast * * If Problems do Occur * Most problems can be rectified by either closing and opening the interface @@ -69,6 +70,7 @@ #include #include #include +#include #include #include @@ -86,7 +88,7 @@ */ static char *version = -"Olympic.c v0.3.0 8/18/99 - Peter De Schrijver & Mike Phillips" ; +"Olympic.c v0.3.1 1/11/00 - Peter De Schrijver & Mike Phillips" ; static char *open_maj_error[] = {"No error", "Lobe Media Test", "Physical Insertion", "Address Verification", "Neighbor Notification (Ring Poll)", @@ -251,6 +253,8 @@ static int __init olympic_init(struct net_device *dev) } } + spin_lock_init(&olympic_priv->olympic_lock) ; + #if OLYMPIC_DEBUG printk("BCTL: %x\n",readl(olympic_mmio+BCTL)); printk("GPR: %x\n",readw(olympic_mmio+GPR)); @@ -757,6 +761,8 @@ static void olympic_interrupt(int irq, void *dev_id, struct pt_regs *regs) if (!(sisr & SISR_MI)) /* Interrupt isn't for us */ return ; + spin_lock(&olympic_priv->olympic_lock); + if (dev->interrupt) printk(KERN_WARNING "%s: Re-entering interrupt \n",dev->name) ; @@ -835,15 +841,20 @@ static void olympic_interrupt(int irq, void *dev_id, struct pt_regs *regs) dev->interrupt = 0 ; writel(SISR_MI,olympic_mmio+SISR_MASK_SUM); - + + spin_unlock(&olympic_priv->olympic_lock) ; } static int olympic_xmit(struct sk_buff *skb, struct net_device *dev) { struct olympic_private *olympic_priv=(struct olympic_private *)dev->priv; - __u8 *olympic_mmio=olympic_priv->olympic_mmio; + __u8 *olympic_mmio=olympic_priv->olympic_mmio; + unsigned long flags ; + + spin_lock_irqsave(&olympic_priv->olympic_lock, flags); if (test_and_set_bit(0, (void*)&dev->tbusy) != 0) { + spin_unlock_irqrestore(&olympic_priv->olympic_lock,flags); return 1; } @@ -860,10 +871,12 @@ static int olympic_xmit(struct sk_buff *skb, struct net_device *dev) writew((((readw(olympic_mmio+TXENQ_1)) & 0x8000) ^ 0x8000) | 1,olympic_mmio+TXENQ_1); dev->tbusy=0; - + spin_unlock_irqrestore(&olympic_priv->olympic_lock,flags); return 0; - } else + } else { + spin_unlock_irqrestore(&olympic_priv->olympic_lock,flags); return 1; + } } diff --git a/drivers/net/tokenring/olympic.h b/drivers/net/tokenring/olympic.h index d5a06423abcf..293438128d76 100644 --- a/drivers/net/tokenring/olympic.h +++ b/drivers/net/tokenring/olympic.h @@ -245,6 +245,8 @@ struct olympic_private { __u8 *olympic_lap; char *olympic_card_name ; + spinlock_t olympic_lock ; + volatile int srb_queued; /* True if an SRB is still posted */ wait_queue_head_t srb_wait; diff --git a/drivers/parport/Config.in b/drivers/parport/Config.in index 3297568f0f06..d2af7d8f6756 100644 --- a/drivers/parport/Config.in +++ b/drivers/parport/Config.in @@ -14,7 +14,7 @@ if [ "$CONFIG_PARPORT" != "n" ]; then if [ "$CONFIG_PARPORT_PC" = "y" ]; then # Don't bother with this if parport_pc is a module; it only affects # the presence or not of some __init's, which are no-ops for modules. - if [ "$CONFIG_PCMCIA" != "n" ]; then + if [ "$CONFIG_HOTPLUG" = "y" -a "$CONFIG_PCMCIA" != "n" ]; then bool ' Support for PCMCIA management for PC-style ports' CONFIG_PARPORT_PC_PCMCIA fi fi diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index 3b7b80b5e20c..57e6ac684190 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c @@ -740,7 +740,7 @@ size_t parport_pc_ecp_write_block_pio (struct parport *port, printk (KERN_DEBUG "%s: FIFO is stuck\n", port->name); /* Prevent further data transfer. */ - frob_econtrol (port, 0xe0, ECR_TST); + frob_econtrol (port, 0xe0, ECR_TST << 5); /* Adjust for the contents of the FIFO. */ for (written -= priv->fifo_depth; ; written++) { diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile index f1709045fd7b..945b19bd4997 100644 --- a/drivers/pci/Makefile +++ b/drivers/pci/Makefile @@ -24,7 +24,7 @@ ifdef CONFIG_PROC_FS O_OBJS += proc.o endif -L_OBJS += compat.o names.o helper.o setup-res.o setup-bus.o setup-irq.o +L_OBJS += compat.o names.o setup-res.o setup-bus.o setup-irq.o ifndef CONFIG_X86 L_OBJS += syscall.o diff --git a/drivers/pci/helper.c b/drivers/pci/helper.c deleted file mode 100644 index cd21631e3d36..000000000000 --- a/drivers/pci/helper.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * $Id$ - * - * drivers/pci/helper.c - * - * Copyright 1999 Jeff Garzik - * This software is free. See the file COPYING for licensing details. - * - */ - -#include -#include - - -int pci_simple_probe (const struct pci_simple_probe_entry *list, - size_t match_limit, pci_simple_probe_callback cb, - void *drvr_data) -{ - struct pci_dev *dev; - const struct pci_simple_probe_entry *ent; - size_t matches = 0; - unsigned short vendor, device; - int rc; - - if (!list || !cb) - return -1; - - dev = pci_find_device (PCI_ANY_ID, PCI_ANY_ID, NULL); - while (dev) { - ent = list; - while (ent->vendor && ent->device) { - vendor = ent->vendor; - device = ent->device; - - if (((vendor != 0xFFFF) && - (vendor != dev->vendor)) || - ((device != 0xFFFF) && - (device != dev->device))) { - ent++; - continue; - } - - if (((ent->subsys_vendor) && - (ent->subsys_vendor != dev->subsystem_vendor)) || - ((ent->subsys_device) && - (ent->subsys_device != dev->subsystem_device))) { - ent++; - continue; - } - - rc = (* cb) (dev, matches, ent, drvr_data); - if (rc < 0) - return rc; - - matches++; - - if (match_limit && match_limit == matches) - return matches; - - break; /* stop list search on first match */ - } - - dev = pci_find_device (PCI_ANY_ID, PCI_ANY_ID, dev); - } - - return matches; -} - - diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index b2767548e2b3..3725563e9ce3 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -202,7 +202,7 @@ pci_enable_device(struct pci_dev *dev) static LIST_HEAD(pci_drivers); -static struct pci_device_id * +struct pci_device_id * pci_match_device(struct pci_device_id *ids, struct pci_dev *dev) { while (ids->vendor || ids->subvendor || ids->class_mask) { diff --git a/drivers/pci/pcisyms.c b/drivers/pci/pcisyms.c index fb38bede2a50..64b6a0f3eca6 100644 --- a/drivers/pci/pcisyms.c +++ b/drivers/pci/pcisyms.c @@ -6,6 +6,7 @@ * Copyright 1998 Martin Mares */ +#include #include #include #include /* isa_dma_bridge_buggy */ @@ -23,7 +24,6 @@ EXPORT_SYMBOL(pci_find_class); EXPORT_SYMBOL(pci_find_device); EXPORT_SYMBOL(pci_find_slot); EXPORT_SYMBOL(pci_set_master); -EXPORT_SYMBOL(pci_simple_probe); EXPORT_SYMBOL(pci_set_power_state); EXPORT_SYMBOL(pci_assign_resource); EXPORT_SYMBOL(pci_register_driver); diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 1284c9aa8762..84639a5a2a81 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -69,7 +69,6 @@ pci_assign_resource(struct pci_dev *dev, int i) } min = (res->flags & IORESOURCE_IO ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM); - min += root->start; size = res->end + 1; DBGC((" for root[%lx:%lx] min[%lx] size[%lx]\n", root->start, root->end, min, size)); diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c index a58098024c47..c935efd9a933 100644 --- a/drivers/pci/syscall.c +++ b/drivers/pci/syscall.c @@ -120,7 +120,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn, err = get_user(word, (u16 *)buf); if (err) break; - err = pci_write_config_byte(dev, off, word); + err = pci_write_config_word(dev, off, word); if (err != PCIBIOS_SUCCESSFUL) err = -EIO; break; @@ -129,7 +129,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn, err = get_user(dword, (u32 *)buf); if (err) break; - pci_write_config_byte(dev, off, dword); + err = pci_write_config_dword(dev, off, dword); if (err != PCIBIOS_SUCCESSFUL) err = -EIO; break; diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c index a04245762eb2..af28f4ef5cb5 100644 --- a/drivers/pcmcia/cs.c +++ b/drivers/pcmcia/cs.c @@ -743,7 +743,7 @@ static int alloc_io_space(socket_info_t *s, u_int attr, ioaddr_t *base, else while (align && (align < num)) align <<= 1; } - if (*base & ~(align-1)) { + if (align && (*base & (align-1))) { printk(KERN_INFO "odd IO request: base %04x align %04x\n", *base, align); align = 0; diff --git a/drivers/pcmcia/ricoh.h b/drivers/pcmcia/ricoh.h index 2228b4769d91..b3c3bfd687ea 100644 --- a/drivers/pcmcia/ricoh.h +++ b/drivers/pcmcia/ricoh.h @@ -30,6 +30,8 @@ #ifndef _LINUX_RICOH_H #define _LINUX_RICOH_H +#include + #define RF5C_MODE_CTL 0x1f /* Mode control */ #define RF5C_PWR_CTL 0x2f /* Mixed voltage control */ #define RF5C_CHIP_ID 0x3a /* Chip identification */ diff --git a/drivers/pcmcia/ti113x.h b/drivers/pcmcia/ti113x.h index 5564462ab65d..b8664c6b5495 100644 --- a/drivers/pcmcia/ti113x.h +++ b/drivers/pcmcia/ti113x.h @@ -30,6 +30,7 @@ #ifndef _LINUX_TI113X_H #define _LINUX_TI113X_H +#include /* Register definitions for TI 113X PCI-to-CardBus bridges */ diff --git a/drivers/pcmcia/yenta.c b/drivers/pcmcia/yenta.c index 465df600251a..68cf713cef1e 100644 --- a/drivers/pcmcia/yenta.c +++ b/drivers/pcmcia/yenta.c @@ -603,11 +603,11 @@ static void yenta_allocate_res(pci_socket_t *socket, int nr, unsigned type) } align = size = 4*1024*1024; - min = 0x10000000; max = ~0U; + min = PCIBIOS_MIN_MEM; max = ~0U; if (type & IORESOURCE_IO) { align = 1024; size = 256; - min = 0x1000; + min = PCIBIOS_MIN_IO; max = 0xffff; } diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c index 92f064f2594f..602c7b670796 100644 --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c @@ -1,4 +1,4 @@ -/* $Id: envctrl.c,v 1.13 1999/12/19 23:28:07 davem Exp $ +/* $Id: envctrl.c,v 1.14 2000/01/09 15:43:45 ecd Exp $ * envctrl.c: Temperature and Fan monitoring on Machines providing it. * * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be) @@ -29,8 +29,8 @@ #undef U450_SUPPORT /* might fry you machine, careful here !!! */ -#define DEBUG 1 -#define DEBUG_BUS_SCAN 1 +#undef DEBUG +#undef DEBUG_BUS_SCAN #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0) diff --git a/drivers/usb/Config.in b/drivers/usb/Config.in index 13b426c9d3ff..2125f4e114bd 100644 --- a/drivers/usb/Config.in +++ b/drivers/usb/Config.in @@ -23,6 +23,13 @@ comment 'USB Devices' dep_tristate ' USB Audio support' CONFIG_USB_AUDIO $CONFIG_USB dep_tristate ' USB Modem (CDC ACM) support' CONFIG_USB_ACM $CONFIG_USB dep_tristate ' USB Serial Converter support' CONFIG_USB_SERIAL $CONFIG_USB + if [ "$CONFIG_USB_SERIAL" != "n" ]; then + bool ' USB Generic Serial Driver' CONFIG_USB_SERIAL_GENERIC + bool ' USB ConnectTech WhiteHEAT Serial Driver' CONFIG_USB_SERIAL_WHITEHEAT + bool ' USB Handspring Visor Driver' CONFIG_USB_SERIAL_VISOR + bool ' USB Belkin Single Port Serial Driver' CONFIG_USB_SERIAL_BELKIN + bool ' USB Peracom Single Port Serial Driver' CONFIG_USB_SERIAL_PERACOM + fi dep_tristate ' USB CPiA Camera support' CONFIG_USB_CPIA $CONFIG_USB dep_tristate ' USB OV511 Camera support' CONFIG_USB_OV511 $CONFIG_USB dep_tristate ' USB Kodak DC-2xx Camera support' CONFIG_USB_DC2XX $CONFIG_USB diff --git a/drivers/usb/acm.c b/drivers/usb/acm.c index 70a4d593d726..9f759baf83d3 100644 --- a/drivers/usb/acm.c +++ b/drivers/usb/acm.c @@ -51,6 +51,14 @@ #include "usb.h" +/* + * CMSPAR, some architectures can't have space and mark parity. + */ + +#ifndef CMSPAR +#define CMSPAR 0 +#endif + /* * Major and minor numbers. */ @@ -180,7 +188,7 @@ static void acm_ctrl_irq(struct urb *urb) case ACM_IRQ_LINE_STATE: - newctrl = le16_to_cpup(data); + newctrl = le16_to_cpup((__u16 *) data); if (acm->tty && !acm->clocal && (acm->ctrlin & ~newctrl & ACM_CTRL_DCD)) { dbg("calling hangup"); diff --git a/drivers/usb/hub.c b/drivers/usb/hub.c index de7c65674e9e..c066c3c43291 100644 --- a/drivers/usb/hub.c +++ b/drivers/usb/hub.c @@ -48,13 +48,11 @@ static int usb_get_hub_descriptor(struct usb_device *dev, void *data, int size) USB_DT_HUB << 8, 0, data, size, HZ); } -#if 0 -static int usb_clear_hub_feature(struct usb_device *dev, int feature) +static int usb_clear_hub_feature(struct usb_device *dev, int feature) { return usb_control_msg(dev, usb_sndctrlpipe(dev, 0), - USB_REQ_CLEAR_FEATURE, USB_RT_HUB, feature, 0 , NULL, 0, HZ); + USB_REQ_CLEAR_FEATURE, USB_RT_HUB, feature, 0, NULL, 0, HZ); } -#endif static int usb_clear_port_feature(struct usb_device *dev, int port, int feature) { @@ -359,7 +357,8 @@ static void usb_hub_port_connect_change(struct usb_device *hub, int port) } if (tries==MAX_TRIES) { - err("can not enable port %i after %i retries, disabling port", port+1, MAX_TRIES); + err("Cannot enable port %i after %i retries, disabling port.", port+1, MAX_TRIES); + err("Maybe the USB cable is bad?"); return; } /* Allocate a new device struct for it */ @@ -392,6 +391,8 @@ static void usb_hub_events(void) struct list_head *tmp; struct usb_device *dev; struct usb_hub *hub; + struct usb_hub_status hubsts; + unsigned short hubstatus, hubchange; /* * We restart the list everytime to avoid a deadlock with @@ -444,14 +445,32 @@ static void usb_hub_events(void) if (portchange & USB_PORT_STAT_C_SUSPEND) dbg("port %d suspend change", i + 1); - if (portchange & USB_PORT_STAT_C_OVERCURRENT) + if (portchange & USB_PORT_STAT_C_OVERCURRENT) { dbg("port %d over-current change", i + 1); + usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_OVER_CURRENT); + } if (portchange & USB_PORT_STAT_C_RESET) { dbg("port %d reset change", i + 1); usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_RESET); } } /* end for i */ + + /* deal with hub status changes */ + if (usb_get_hub_status(dev, &hubsts) < 0) { + err("get_hub_status failed"); + } else { + hubstatus = le16_to_cpup(&hubsts.wHubStatus); + hubchange = le16_to_cpup(&hubsts.wHubChange); + if (hubchange & HUB_CHANGE_LOCAL_POWER) { + dbg("hub power change"); + usb_clear_hub_feature(dev, C_HUB_LOCAL_POWER); + } + if (hubchange & HUB_CHANGE_OVERCURRENT) { + dbg("hub overcurrent change"); + usb_clear_hub_feature(dev, C_HUB_OVER_CURRENT); + } + } } /* end while (1) */ he_unlock: diff --git a/drivers/usb/mousedev.c b/drivers/usb/mousedev.c index 3d3a76caf025..c10b76557b91 100644 --- a/drivers/usb/mousedev.c +++ b/drivers/usb/mousedev.c @@ -53,7 +53,7 @@ struct mousedev_list { struct mousedev_list *next; int dx, dy, dz; unsigned char ps2[6]; - unsigned char buttons; + unsigned long buttons; unsigned char ready, buffer, bufsiz; unsigned char mode, genseq, impseq; }; diff --git a/drivers/usb/ohci-hcd.c b/drivers/usb/ohci-hcd.c index e95d66e961b0..b084489ed040 100644 --- a/drivers/usb/ohci-hcd.c +++ b/drivers/usb/ohci-hcd.c @@ -47,6 +47,7 @@ #include #undef DEBUG +#define OHCI_USE_NPS #include "usb.h" #include "ohci-hcd.h" @@ -154,8 +155,9 @@ void ep_print_int_eds (ohci_t * ohci, char * str) { printk (KERN_DEBUG __FILE__ " %s branch int %2d(%2x):", str, i, i); ed_p = &(ohci->hcca.int_table [i]); while (*ed_p != 0 && j--) { - printk (" ed: %4x;", (((ed_t *) bus_to_virt (*ed_p))->hwINFO)); - ed_p = &(((ed_t *) bus_to_virt (*ed_p))->hwNextED); + ed_t *ed = (ed_t *) bus_to_virt(le32_to_cpup(ed_p)); + printk (" ed: %4x;", ed->hwINFO); + ed_p = &ed->hwNextED; } printk ("\n"); } @@ -174,7 +176,7 @@ static int sohci_return_urb (urb_t * urb) { urb_priv_t * urb_priv = urb->hcpriv; urb_t * urbt; - unsigned int flags; + unsigned long flags; int i; /* just to be sure */ @@ -245,7 +247,7 @@ static int sohci_submit_urb (urb_t * urb) urb_priv_t * urb_priv; unsigned int pipe = urb->pipe; int i, size = 0; - unsigned int flags; + unsigned long flags; if (!urb->dev || !urb->dev->bus) return -EINVAL; @@ -346,7 +348,7 @@ static int sohci_submit_urb (urb_t * urb) static int sohci_unlink_urb (urb_t * urb) { - unsigned int flags; + unsigned long flags; ohci_t * ohci; DECLARE_WAITQUEUE (wait, current); @@ -412,7 +414,7 @@ static int sohci_alloc_dev (struct usb_device *usb_dev) static int sohci_free_dev (struct usb_device * usb_dev) { - unsigned int flags; + unsigned long flags; int i, cnt = 0; ed_t * ed; DECLARE_WAITQUEUE (wait, current); @@ -566,9 +568,9 @@ static int ep_link (ohci_t * ohci, ed_t * edi) for (i = 0; i < ep_rev (6, interval); i += inter) { inter = 1; for (ed_p = &(ohci->hcca.int_table[ep_rev (5, i) + int_branch]); - (*ed_p != 0) && (((ed_t *) bus_to_virt (le32_to_cpu (*ed_p)))->int_interval >= interval); - ed_p = &(((ed_t *) bus_to_virt (le32_to_cpu (*ed_p)))->hwNextED)) - inter = ep_rev (6, ((ed_t *) bus_to_virt (le32_to_cpu (*ed_p)))->int_interval); + (*ed_p != 0) && (((ed_t *) bus_to_virt (le32_to_cpup (ed_p)))->int_interval >= interval); + ed_p = &(((ed_t *) bus_to_virt (le32_to_cpup (ed_p)))->hwNextED)) + inter = ep_rev (6, ((ed_t *) bus_to_virt (le32_to_cpup (ed_p)))->int_interval); ed->hwNextED = *ed_p; *ed_p = cpu_to_le32 (virt_to_bus (ed)); } @@ -588,8 +590,8 @@ static int ep_link (ohci_t * ohci, ed_t * edi) inter = 1; for (ed_p = &(ohci->hcca.int_table[ep_rev (5, i)]); *ed_p != 0; - ed_p = &(((ed_t *) bus_to_virt (le32_to_cpu (*ed_p)))->hwNextED)) - inter = ep_rev (6, ((ed_t *) bus_to_virt (le32_to_cpu (*ed_p)))->int_interval); + ed_p = &(((ed_t *) bus_to_virt (le32_to_cpup (ed_p)))->hwNextED)) + inter = ep_rev (6, ((ed_t *) bus_to_virt (le32_to_cpup (ed_p)))->int_interval); *ed_p = cpu_to_le32 (virt_to_bus (ed)); } ed->ed_prev = NULL; @@ -622,27 +624,27 @@ static int ep_unlink (ohci_t * ohci, ed_t * ed) switch (ed->type) { case CTRL: if (ed->ed_prev == NULL) { - writel (le32_to_cpu (ed->hwNextED), &ohci->regs->ed_controlhead); + writel (le32_to_cpup (&ed->hwNextED), &ohci->regs->ed_controlhead); } else { ed->ed_prev->hwNextED = ed->hwNextED; } if(ohci->ed_controltail == ed) { ohci->ed_controltail = ed->ed_prev; } else { - ((ed_t *) bus_to_virt (le32_to_cpu (ed->hwNextED)))->ed_prev = ed->ed_prev; + ((ed_t *) bus_to_virt (le32_to_cpup (&ed->hwNextED)))->ed_prev = ed->ed_prev; } break; case BULK: if (ed->ed_prev == NULL) { - writel (le32_to_cpu (ed->hwNextED), &ohci->regs->ed_bulkhead); + writel (le32_to_cpup (&ed->hwNextED), &ohci->regs->ed_bulkhead); } else { ed->ed_prev->hwNextED = ed->hwNextED; } if (ohci->ed_bulktail == ed) { ohci->ed_bulktail = ed->ed_prev; } else { - ((ed_t *) bus_to_virt (le32_to_cpu (ed->hwNextED)))->ed_prev = ed->ed_prev; + ((ed_t *) bus_to_virt (le32_to_cpup (&ed->hwNextED)))->ed_prev = ed->ed_prev; } break; @@ -653,9 +655,9 @@ static int ep_unlink (ohci_t * ohci, ed_t * ed) for (i = 0; i < ep_rev (6, interval); i += inter) { for (ed_p = &(ohci->hcca.int_table[ep_rev (5, i) + int_branch]), inter = 1; (*ed_p != 0) && (*ed_p != ed->hwNextED); - ed_p = &(((ed_t *) bus_to_virt (le32_to_cpu (*ed_p)))->hwNextED), - inter = ep_rev (6, ((ed_t *) bus_to_virt (le32_to_cpu (*ed_p)))->int_interval)) { - if(((ed_t *) bus_to_virt (le32_to_cpu (*ed_p))) == ed) { + ed_p = &(((ed_t *) bus_to_virt (le32_to_cpup (ed_p)))->hwNextED), + inter = ep_rev (6, ((ed_t *) bus_to_virt (le32_to_cpup (ed_p)))->int_interval)) { + if(((ed_t *) bus_to_virt (le32_to_cpup (ed_p))) == ed) { *ed_p = ed->hwNextED; break; } @@ -670,7 +672,7 @@ static int ep_unlink (ohci_t * ohci, ed_t * ed) if (ohci->ed_isotail == ed) ohci->ed_isotail = ed->ed_prev; if (ed->hwNextED != 0) - ((ed_t *) bus_to_virt (le32_to_cpu (ed->hwNextED)))->ed_prev = ed->ed_prev; + ((ed_t *) bus_to_virt (le32_to_cpup (&ed->hwNextED)))->ed_prev = ed->ed_prev; if (ed->ed_prev != NULL) { ed->ed_prev->hwNextED = ed->hwNextED; @@ -679,9 +681,9 @@ static int ep_unlink (ohci_t * ohci, ed_t * ed) inter = 1; for (ed_p = &(ohci->hcca.int_table[ep_rev (5, i)]); *ed_p != 0; - ed_p = &(((ed_t *) bus_to_virt (le32_to_cpu (*ed_p)))->hwNextED)) { - inter = ep_rev (6, ((ed_t *) bus_to_virt (le32_to_cpu (*ed_p)))->int_interval); - if(((ed_t *) bus_to_virt (le32_to_cpu (*ed_p))) == ed) { + ed_p = &(((ed_t *) bus_to_virt (le32_to_cpup (ed_p)))->hwNextED)) { + inter = ep_rev (6, ((ed_t *) bus_to_virt (le32_to_cpup (ed_p)))->int_interval); + if(((ed_t *) bus_to_virt (le32_to_cpup (ed_p))) == ed) { *ed_p = ed->hwNextED; break; } @@ -800,7 +802,7 @@ static void td_fill (unsigned int info, void * data, int len, urb_t * urb, int t td_pt = urb_priv->td [index]; /* fill the old dummy TD */ - td = (td_t *) bus_to_virt (le32_to_cpu (urb_priv->ed->hwTailP) & 0xfffffff0); + td = (td_t *) bus_to_virt (le32_to_cpup (&urb_priv->ed->hwTailP) & 0xfffffff0); td->ed = urb_priv->ed; td->index = index; td->urb = urb; @@ -900,7 +902,7 @@ static td_t * dl_reverse_done_list (ohci_t * ohci) td_t * td_rev = NULL; td_t * td_list = NULL; urb_priv_t * urb_priv = NULL; - unsigned int flags; + unsigned long flags; spin_lock_irqsave (&usb_ed_lock, flags); @@ -927,7 +929,7 @@ static td_t * dl_reverse_done_list (ohci_t * ohci) td_list->next_dl_td = td_rev; td_rev = td_list; - td_list_hc = le32_to_cpu (td_list->hwNextTD) & 0xfffffff0; + td_list_hc = le32_to_cpup (&td_list->hwNextTD) & 0xfffffff0; } spin_unlock_irqrestore (&usb_ed_lock, flags); return td_list; @@ -941,7 +943,7 @@ static td_t * dl_reverse_done_list (ohci_t * ohci) static void dl_del_list (ohci_t * ohci, unsigned int frame) { - unsigned int flags; + unsigned long flags; ed_t * ed; __u32 edINFO; td_t * td = NULL, * td_next = NULL, * tdHeadP = NULL, * tdTailP; @@ -951,16 +953,16 @@ static void dl_del_list (ohci_t * ohci, unsigned int frame) spin_lock_irqsave (&usb_ed_lock, flags); for (ed = ohci->ed_rm_list[frame]; ed != NULL; ed = ed->ed_rm_list) { - tdTailP = bus_to_virt (le32_to_cpu (ed->hwTailP) & 0xfffffff0); - tdHeadP = bus_to_virt (le32_to_cpu (ed->hwHeadP) & 0xfffffff0); - edINFO = le32_to_cpu (ed->hwINFO); + tdTailP = bus_to_virt (le32_to_cpup (&ed->hwTailP) & 0xfffffff0); + tdHeadP = bus_to_virt (le32_to_cpup (&ed->hwHeadP) & 0xfffffff0); + edINFO = le32_to_cpup (&ed->hwINFO); td_p = &ed->hwHeadP; for (td = tdHeadP; td != tdTailP; td = td_next) { urb_t * urb = td->urb; urb_priv_t * urb_priv = td->urb->hcpriv; - td_next = bus_to_virt (le32_to_cpu (td->hwNextTD) & 0xfffffff0); + td_next = bus_to_virt (le32_to_cpup (&td->hwNextTD) & 0xfffffff0); if ((urb_priv->state == URB_DEL) || (ed->state & ED_DEL)) { *td_p = td->hwNextTD | (*td_p & cpu_to_le32 (0x3)); if(++ (urb_priv->td_cnt) == urb_priv->length) @@ -1013,7 +1015,7 @@ static void dl_done_list (ohci_t * ohci, td_t * td_list) urb_priv_t * urb_priv; __u32 tdINFO, tdBE, tdCBP, edHeadP, edTailP; __u16 tdPSW; - unsigned int flags; + unsigned long flags; while (td_list) { td_list_next = td_list->next_dl_td; @@ -1071,8 +1073,8 @@ static void dl_done_list (ohci_t * ohci, td_t * td_list) spin_lock_irqsave (&usb_ed_lock, flags); if (ed->state != ED_NEW) { - edHeadP = le32_to_cpu (ed->hwHeadP) & 0xfffffff0; - edTailP = le32_to_cpu (ed->hwTailP); + edHeadP = le32_to_cpup (&ed->hwHeadP) & 0xfffffff0; + edTailP = le32_to_cpup (&ed->hwTailP); if((edHeadP == edTailP) && (ed->state == ED_OPER)) ep_unlink (ohci, ed); /* unlink eds if they are not busy */ @@ -1185,9 +1187,9 @@ static int rh_send_irq (ohci_t * ohci, void * rh_data, int rh_len) ret = *(__u8 *) data; for ( i = 0; i < num_ports; i++) { - *(__u8 *) (data + i / 8) |= + *(__u8 *) (data + (i + 1) / 8) |= ((readl (&ohci->regs->roothub.portstatus[i]) & 0x001f0000) > 0? 1: 0) << ((i + 1) % 8); - ret += *(__u8 *) (data + i / 8); + ret += *(__u8 *) (data + (i + 1) / 8); } len = i/8 + 1; @@ -1313,8 +1315,10 @@ static int rh_submit_urb (urb_t * urb) case RH_CLEAR_FEATURE | RH_CLASS: switch (wValue) { + case RH_C_HUB_LOCAL_POWER: + OK(0); case (RH_C_HUB_OVER_CURRENT): - WR_RH_STAT(RH_PS_OCIC); OK (0); + WR_RH_STAT(RH_HS_OCIC); OK (0); } break; @@ -1489,6 +1493,13 @@ static int hc_start (ohci_t * ohci) writel (ohci->hc_control = 0xBF, &ohci->regs->control); /* USB Operational */ writel (mask, &ohci->regs->intrenable); writel (mask, &ohci->regs->intrstatus); + +#ifdef OHCI_USE_NPS + writel ((readl(&ohci->regs->roothub.a) | 0x200) & ~0x100, + &ohci->regs->roothub.a); + writel (0x10000, &ohci->regs->roothub.status); + mdelay ((readl(&ohci->regs->roothub.a) >> 23) & 0x1fe); +#endif /* OHCI_USE_NPS */ /* connect the virtual root hub */ @@ -1516,7 +1527,7 @@ static void hc_interrupt (int irq, void * __ohci, struct pt_regs * r) struct ohci_regs * regs = ohci->regs; int ints; - if ((ohci->hcca.done_head != 0) && !(le32_to_cpu (ohci->hcca.done_head) & 0x01)) { + if ((ohci->hcca.done_head != 0) && !(le32_to_cpup (&ohci->hcca.done_head) & 0x01)) { ints = OHCI_INTR_WDH; } else { if ((ints = (readl (®s->intrstatus) & readl (®s->intrenable))) == 0) @@ -1578,7 +1589,7 @@ static ohci_t * hc_alloc_ohci (void * mem_base) bus = usb_alloc_bus (&sohci_device_operations); if (!bus) { - free_pages ((unsigned int) ohci, 1); + free_pages ((unsigned long) ohci, 1); return NULL; } @@ -1614,7 +1625,7 @@ static void hc_release_ohci (ohci_t * ohci) /* unmap the IO address space */ iounmap (ohci->regs); - free_pages ((unsigned int) ohci, 1); + free_pages ((unsigned long) ohci, 1); } /*-------------------------------------------------------------------------*/ @@ -1625,7 +1636,7 @@ static void hc_release_ohci (ohci_t * ohci) static int hc_found_ohci (int irq, void * mem_base) { ohci_t * ohci; - dbg("USB HC found: irq= %d membase= %x", irq, (int) mem_base); + dbg("USB HC found: irq= %d membase= %lx", irq, (unsigned long) mem_base); ohci = hc_alloc_ohci (mem_base); if (!ohci) { @@ -1655,15 +1666,15 @@ static int hc_found_ohci (int irq, void * mem_base) static int hc_start_ohci (struct pci_dev * dev) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0) - unsigned int mem_base = dev->resource[0].start; + unsigned long mem_base = dev->resource[0].start; #else - unsigned int mem_base = dev->base_address[0]; + unsigned long mem_base = dev->base_address[0]; if (mem_base & PCI_BASE_ADDRESS_SPACE_IO) return -ENODEV; mem_base &= PCI_BASE_ADDRESS_MEM_MASK; #endif pci_set_master (dev); - mem_base = (unsigned int) ioremap_nocache (mem_base, 4096); + mem_base = (unsigned long) ioremap_nocache (mem_base, 4096); if (!mem_base) { err("Error mapping OHCI memory"); diff --git a/drivers/usb/ohci-hcd.h b/drivers/usb/ohci-hcd.h index c9267f53351f..f3d71154f0af 100644 --- a/drivers/usb/ohci-hcd.h +++ b/drivers/usb/ohci-hcd.h @@ -314,6 +314,13 @@ struct virt_root_hub { #define RH_PS_OCIC 0x00080000 #define RH_PS_PRSC 0x00100000 +/* Root hub status bits */ +#define RH_HS_LPS 0x00000001 +#define RH_HS_OCI 0x00000002 +#define RH_HS_DRWE 0x00008000 +#define RH_HS_LPSC 0x00010000 +#define RH_HS_OCIC 0x00020000 +#define RH_HS_CRWE 0x80000000 #define min(a,b) (((a)<(b))?(a):(b)) diff --git a/drivers/usb/ov511.c b/drivers/usb/ov511.c index 8657eaa93bc7..d4647844541f 100644 --- a/drivers/usb/ov511.c +++ b/drivers/usb/ov511.c @@ -326,12 +326,16 @@ int ov511_i2c_read(struct usb_device *dev, unsigned char reg) return (value); } +#if 0 static void ov511_dump_i2c_range( struct usb_device *dev, int reg1, int regn) { int i; int rc; for(i=reg1; i<=regn; i++) { rc = ov511_i2c_read(dev, i); +#if 0 + PDEBUG("OV7610[0x%X] = 0x%X\n", i, rc); +#endif } } @@ -373,6 +377,19 @@ static void ov511_dump_regs( struct usb_device *dev) ov511_dump_reg_range(dev, 0xa0, 0xbf); } +#endif + +int ov511_i2c_reset(struct usb_device *dev) +{ + int rc; + + PDEBUG("Reset 7610\n"); + rc = ov511_i2c_write(dev, 0x12, 0x80); + if (rc < 0) + printk(KERN_ERR "ov511: i2c reset: command failed\n"); + + return rc; +} int ov511_reset(struct usb_device *dev, unsigned char reset_type) { @@ -394,7 +411,9 @@ int ov511_set_packet_size(struct usb_ov511 *ov511, int size) { int alt, multiplier, err; +#if 0 PDEBUG("set packet size: %d\n", size); +#endif switch (size) { case 992: @@ -455,21 +474,116 @@ int ov511_set_packet_size(struct usb_ov511 *ov511, int size) return 0; } +static int ov511_mode_init_regs(struct usb_ov511 *ov511, + int width, int height, int mode) +{ + int rc = 0; + struct usb_device *dev = ov511->dev; + +#if 0 + PDEBUG("ov511_mode_init_regs(ov511, %d, %d, %d)\n", + width, height, mode); +#endif + ov511_set_packet_size(ov511, 0); + + /* Set mode consistent registers */ + ov511_i2c_write(dev, 0x0f, 0x03); + ov511_i2c_write(dev, 0x10, 0xff); + ov511_i2c_write(dev, 0x13, 0x01); + ov511_i2c_write(dev, 0x16, 0x06); + ov511_i2c_write(dev, 0x20, 0x1c); + ov511_i2c_write(dev, 0x24, 0x2e); /* 10 */ + ov511_i2c_write(dev, 0x25, 0x7c); /* 8a */ + ov511_i2c_write(dev, 0x26, 0x70); + ov511_i2c_write(dev, 0x28, 0x24); /* 24 */ + ov511_i2c_write(dev, 0x2b, 0xac); + ov511_i2c_write(dev, 0x2c, 0xfe); + ov511_i2c_write(dev, 0x2d, 0x93); + ov511_i2c_write(dev, 0x34, 0x8b); + + if (width == 640 && height == 480) { + ov511_reg_write(dev, 0x12, 0x4f); + ov511_reg_write(dev, 0x13, 0x3d); + ov511_reg_write(dev, 0x14, 0x00); + ov511_reg_write(dev, 0x15, 0x00); + ov511_reg_write(dev, 0x18, 0x03); + + ov511_i2c_write(dev, 0x11, 0x01); + ov511_i2c_write(dev, 0x12, 0x24); + ov511_i2c_write(dev, 0x14, 0x04); + ov511_i2c_write(dev, 0x35, 0x9e); + } else if (width == 320 && height == 240) { + ov511_reg_write(dev, 0x12, 0x27); + ov511_reg_write(dev, 0x13, 0x1f); + ov511_reg_write(dev, 0x14, 0x00); + ov511_reg_write(dev, 0x15, 0x00); + ov511_reg_write(dev, 0x18, 0x03); + + ov511_i2c_write(dev, 0x11, 0x00); + ov511_i2c_write(dev, 0x12, 0x04); + ov511_i2c_write(dev, 0x14, 0x24); + ov511_i2c_write(dev, 0x35, 0x1e); + } else { + PDEBUG("ov511: Unknown mode (%d, %d): %d\n", + width, height, mode); + rc = -EINVAL; + } + ov511_set_packet_size(ov511, 993); + + return rc; +} + + +/************************************************************* + +Turn a YUV4:2:0 block into an RGB block + +*************************************************************/ +#define LIMIT(x) ((((x)>0xffffff)?0xff0000:(((x)<=0xffff)?0:(x)&0xff0000))>>16) +static inline void ov511_move_420_block(int y00, int y01, int y10, int y11, + int u, int v, int w, + unsigned char * pOut) +{ + int r = 68911 * v; + int g = -16915 * u + -35101 * v; + int b = 87097 * u; + y00 *= 49152; + y01 *= 49152; + y10 *= 49152; + y11 *= 49152; + *(pOut+w*3) = LIMIT(r + y10); + *pOut++ = LIMIT(r + y00); + *(pOut+w*3) = LIMIT(g + y10); + *pOut++ = LIMIT(g + y00); + *(pOut+w*3) = LIMIT(b + y10); + *pOut++ = LIMIT(b + y00); + *(pOut+w*3) = LIMIT(r + y11); + *pOut++ = LIMIT(r + y01); + *(pOut+w*3) = LIMIT(g + y11); + *pOut++ = LIMIT(g + y01); + *(pOut+w*3) = LIMIT(b + y11); + *pOut++ = LIMIT(b + y01); +} + /*************************************************************** -For a 640x480 images, data shows up in 1200 384 byte segments. The -first 128 bytes of each segment are probably some combo of UV but I -haven't figured it out yet. The next 256 bytes are apparently Y -data and represent 4 squares of 8x8 pixels as follows: +For a 640x480 YUV4:2:0 images, data shows up in 1200 384 byte segments. The +first 64 bytes of each segment are V, the next 64 are U. The V and +U are arranged as follows: + + 0 1 ... 7 + 8 9 ... 15 + ... + 56 57 ... 63 + +The next 256 bytes are Y data and represent 4 squares of 8x8 pixels as +follows: 0 1 ... 7 64 65 ... 71 ... 192 193 ... 199 8 9 ... 15 72 73 ... 79 200 201 ... 207 ... ... ... 56 57 ... 63 120 121 127 248 249 ... 255 -Right now I'm only moving the Y data and haven't figured out -the UV data. - If OV511_DUMPPIX is defined, _parse_data just dumps the incoming segments, verbatim, in order, into the frame. When used with vidcat -f ppm -s 640x480 this puts the data @@ -478,42 +592,102 @@ utility I wrote. That's a much faster way for figuring out how this data is scrambled. ****************************************************************/ +#define HDIV 8 +#define WDIV (256/HDIV) -static void ov511_parse_data(unsigned char * pIn, - unsigned char * pOut, - int iSegment) +static void ov511_parse_data(unsigned char * pIn0, + unsigned char * pOut0, + int iWidth, + int iSegment) { - #ifndef OV511_DUMPPIX - int i, j, k, l, m; - int iOut; - unsigned char * pOut1; -#define HDIV 8 -#define WDIV (256/HDIV) - i = iSegment / (DEFAULT_WIDTH/ WDIV); - j = iSegment - i * (DEFAULT_WIDTH/ WDIV); - iOut = (i*HDIV*DEFAULT_WIDTH + j*WDIV) * 3; - pOut += iOut; - pIn += 128; + int k, l, m; + unsigned char * pIn; + unsigned char * pOut, * pOut1; + + int iHalf = (iSegment / (iWidth / 32)) & 1; + int iY = iSegment / (iWidth / WDIV); + int jY = iSegment - iY * (iWidth / WDIV); + int iOutY = (iY*HDIV*iWidth + jY*WDIV) * 3; + int iUV = iSegment / (iWidth / WDIV * 2); + int jUV = iSegment - iUV * (iWidth / WDIV * 2); + int iOutUV = (iUV*HDIV*2*iWidth + jUV*WDIV/2) * 3; + + /* Just copy the Y's if in the first stripe */ + if (!iHalf) { + pIn = pIn0 + 128; + pOut = pOut0 + iOutY; for(k=0; k<4; k++) { pOut1 = pOut; for(l=0; l<8; l++) { for(m=0; m<8; m++) { - *pOut1++ = *pIn; - *pOut1++ = *pIn; - *pOut1++ = *pIn++; + *pOut1 = *pIn++; + pOut1 += 3; } - pOut1 += (DEFAULT_WIDTH - 8) * 3; + pOut1 += (iWidth - 8) * 3; } pOut += 8 * 3; } + } + + /* Use the first half of VUs to calculate value */ + pIn = pIn0; + pOut = pOut0 + iOutUV; + for(l=0; l<4; l++) { + for(m=0; m<8; m++) { + int y00 = *(pOut); + int y01 = *(pOut+3); + int y10 = *(pOut+iWidth*3); + int y11 = *(pOut+iWidth*3+3); + int u = *(pIn+64) - 128; + int v = *pIn++ - 128; + ov511_move_420_block(y00, y01, y10, y11, u, v, iWidth, pOut); + pOut += 6; + } + pOut += (iWidth*2 - 16) * 3; + } + + /* Just copy the other UV rows */ + for(l=0; l<4; l++) { + for(m=0; m<8; m++) { + *pOut++ = *(pIn + 64); + *pOut = *pIn++; + pOut += 5; + } + pOut += (iWidth*2 - 16) * 3; + } + + /* Calculate values if it's the second half */ + if (iHalf) { + pIn = pIn0 + 128; + pOut = pOut0 + iOutY; + for(k=0; k<4; k++) { + pOut1 = pOut; + for(l=0; l<4; l++) { + for(m=0; m<4; m++) { + int y10 = *(pIn+8); + int y00 = *pIn++; + int y11 = *(pIn+8); + int y01 = *pIn++; + int u = *pOut1 - 128; + int v = *(pOut1+1) - 128; + ov511_move_420_block(y00, y01, y10, y11, u, v, iWidth, pOut1); + pOut1 += 6; + } + pOut1 += (iWidth*2 - 8) * 3; + pIn += 8; + } + pOut += 8 * 3; + } + } + #else /* Just dump pix data straight out for debug */ int i; - pOut += iSegment * 384; + pOut0 += iSegment * 384; for(i=0; i<384; i++) { - *pOut++ = *pIn++; + *pOut0++ = *pIn0++; } #endif } @@ -552,13 +726,18 @@ static int ov511_move_data(struct usb_ov511 *ov511, urb_t *urb) cdata[4] | cdata[5] | cdata[6] | cdata[7]) == 0 && (cdata[8] & 8) && (cdata[8] & 0x80)) { +#if 0 PDEBUG("Found Frame End!, packnum = %d\n", (int)(cdata[992])); PDEBUG("Current frame = %d\n", ov511->curframe); +#endif if (frame->scanstate == STATE_LINES) { if (waitqueue_active(&frame->wq)) { +#if 0 PDEBUG("About to wake up waiting processes\n"); +#endif frame->grabstate = FRAME_DONE; + ov511->curframe = -1; wake_up_interruptible(&frame->wq); } } @@ -568,8 +747,10 @@ static int ov511_move_data(struct usb_ov511 *ov511, urb_t *urb) else if ((cdata[0] | cdata[1] | cdata[2] | cdata[3] | cdata[4] | cdata[5] | cdata[6] | cdata[7]) == 0 && (cdata[8] & 8)) { +#if 0 PDEBUG("ov511: Found Frame Start!, packnum = %d\n", (int)(cdata[992])); PDEBUG("ov511: Frame Header Byte = 0x%x\n", (int)(cdata[8])); +#endif frame->scanstate = STATE_LINES; frame->segment = 0; } @@ -589,15 +770,18 @@ static int ov511_move_data(struct usb_ov511 *ov511, urb_t *urb) } /* Parse the segments */ - while(iPix <= 992 - 384 && frame->segment < 1200) { - ov511_parse_data(pData, frame->data, frame->segment); + while(iPix <= 992 - 384 && + frame->segment < frame->width * frame->height / 256) { + ov511_parse_data(pData, frame->data, + frame->width, + frame->segment); frame->segment++; iPix += 384; pData = &cdata[iPix]; } /* Save extra data for next time */ - if (frame->segment < 1200) { + if (frame->segment < frame->width * frame->height / 256) { memmove(ov511->scratch, pData, 992 - iPix); ov511->scratchlen = 992 - iPix; } @@ -619,18 +803,6 @@ static void ov511_isoc_irq(struct urb *urb) struct ov511_sbuf *sbuf; int i; -#if 0 - static int last_status, last_error_count, last_actual_length; - if (last_status != urb->status || - last_error_count != urb->error_count || - last_actual_length != urb->actual_length) { - PDEBUG("ov511_isoc_irq: %p status %d, errcount = %d, length = %d\n", urb, urb->status, urb->error_count, urb->actual_length); - last_status = urb->status; - last_error_count = urb->error_count; - last_actual_length = urb->actual_length; - } -#endif - if (!ov511->streaming) { PDEBUG("hmmm... not streaming, but got interrupt\n"); return; @@ -639,17 +811,10 @@ static void ov511_isoc_irq(struct urb *urb) sbuf = &ov511->sbuf[ov511->cursbuf]; /* Copy the data received into our scratch buffer */ - len = ov511_move_data(ov511, urb); -#if 0 - /* If we don't have a frame we're current working on, complain */ - if (ov511->scratchlen) { - if (ov511->curframe < 0) { - // Macro - must be in braces!! - PDEBUG("received data, but no frame available\n"); - } else - ov511_parse_data(ov511); + if (ov511->curframe >= 0) { + len = ov511_move_data(ov511, urb); } -#endif + for (i = 0; i < FRAMES_PER_DESC; i++) { sbuf->urb->iso_frame_desc[i].status = 0; sbuf->urb->iso_frame_desc[i].actual_length = 0; @@ -672,178 +837,6 @@ static int ov511_init_isoc(struct usb_ov511 *ov511) ov511->cursbuf = 0; ov511->scratchlen = 0; - ov511_reg_write(ov511->dev, 0x10, 0x00); - ov511_reg_write(ov511->dev, 0x11, 0x01); - ov511_reg_write(ov511->dev, 0x12, 0x4f); - ov511_reg_write(ov511->dev, 0x13, 0x3d); - ov511_reg_write(ov511->dev, 0x14, 0x00); - ov511_reg_write(ov511->dev, 0x15, 0x00); - ov511_reg_write(ov511->dev, 0x16, 0x01); /* 01 */ - ov511_reg_write(ov511->dev, 0x17, 0x00); - ov511_reg_write(ov511->dev, 0x18, 0x03); - ov511_reg_write(ov511->dev, 0x19, 0x00); - ov511_reg_write(ov511->dev, 0x1a, 0x4f); - ov511_reg_write(ov511->dev, 0x1b, 0x3b); - ov511_reg_write(ov511->dev, 0x1c, 0x00); - ov511_reg_write(ov511->dev, 0x1d, 0x00); - ov511_reg_write(ov511->dev, 0x1e, 0x01); - ov511_reg_write(ov511->dev, 0x1f, 0x06); - - ov511_reg_write(ov511->dev, 0x20, 0x01); - ov511_reg_write(ov511->dev, 0x21, 0x01); - ov511_reg_write(ov511->dev, 0x22, 0x01); - ov511_reg_write(ov511->dev, 0x23, 0x1a); - - ov511_reg_write(ov511->dev, 0x30, 0x1f); - ov511_reg_write(ov511->dev, 0x31, 0x03); - ov511_reg_write(ov511->dev, 0x38, 0x00); - ov511_reg_write(ov511->dev, 0x39, 0x00); - ov511_reg_write(ov511->dev, 0x3e, 0x00); - - ov511_reg_write(ov511->dev, 0x50, 0x00); - ov511_reg_write(ov511->dev, 0x51, 0x00); - ov511_reg_write(ov511->dev, 0x52, 0x01); - ov511_reg_write(ov511->dev, 0x53, 0x01); - ov511_reg_write(ov511->dev, 0x5e, 0x5a); - ov511_reg_write(ov511->dev, 0x5f, 0x00); - - ov511_reg_write(ov511->dev, 0x70, 0x01); /* 3f */ - ov511_reg_write(ov511->dev, 0x71, 0x01); /* 3f */ - ov511_reg_write(ov511->dev, 0x72, 0x01); - ov511_reg_write(ov511->dev, 0x73, 0x01); - ov511_reg_write(ov511->dev, 0x74, 0x01); - ov511_reg_write(ov511->dev, 0x75, 0x01); - ov511_reg_write(ov511->dev, 0x76, 0x01); - ov511_reg_write(ov511->dev, 0x77, 0x01); - ov511_reg_write(ov511->dev, 0x78, 0x00); - ov511_reg_write(ov511->dev, 0x79, 0x00); /* 03 */ - - ov511_reg_write(ov511->dev, 0x80, 0x10); - ov511_reg_write(ov511->dev, 0x81, 0x21); - ov511_reg_write(ov511->dev, 0x82, 0x32); - ov511_reg_write(ov511->dev, 0x83, 0x43); - ov511_reg_write(ov511->dev, 0x84, 0x11); - ov511_reg_write(ov511->dev, 0x85, 0x21); - ov511_reg_write(ov511->dev, 0x86, 0x32); - ov511_reg_write(ov511->dev, 0x87, 0x44); - ov511_reg_write(ov511->dev, 0x88, 0x11); - ov511_reg_write(ov511->dev, 0x89, 0x22); - ov511_reg_write(ov511->dev, 0x8a, 0x43); - ov511_reg_write(ov511->dev, 0x8b, 0x44); - ov511_reg_write(ov511->dev, 0x8c, 0x22); - ov511_reg_write(ov511->dev, 0x8d, 0x32); - ov511_reg_write(ov511->dev, 0x8e, 0x44); - ov511_reg_write(ov511->dev, 0x8f, 0x44); - ov511_reg_write(ov511->dev, 0x90, 0x22); - ov511_reg_write(ov511->dev, 0x91, 0x43); - ov511_reg_write(ov511->dev, 0x92, 0x54); - ov511_reg_write(ov511->dev, 0x93, 0x55); - ov511_reg_write(ov511->dev, 0x94, 0x33); - ov511_reg_write(ov511->dev, 0x95, 0x44); - ov511_reg_write(ov511->dev, 0x96, 0x55); - ov511_reg_write(ov511->dev, 0x97, 0x55); - ov511_reg_write(ov511->dev, 0x98, 0x43); - ov511_reg_write(ov511->dev, 0x99, 0x44); - ov511_reg_write(ov511->dev, 0x9a, 0x55); - ov511_reg_write(ov511->dev, 0x9b, 0x55); - ov511_reg_write(ov511->dev, 0x9c, 0x44); - ov511_reg_write(ov511->dev, 0x9d, 0x44); - ov511_reg_write(ov511->dev, 0x9e, 0x55); - ov511_reg_write(ov511->dev, 0x9f, 0x55); - - ov511_reg_write(ov511->dev, 0xa0, 0x20); - ov511_reg_write(ov511->dev, 0xa1, 0x32); - ov511_reg_write(ov511->dev, 0xa2, 0x44); - ov511_reg_write(ov511->dev, 0xa3, 0x44); - ov511_reg_write(ov511->dev, 0xa4, 0x22); - ov511_reg_write(ov511->dev, 0xa5, 0x42); - ov511_reg_write(ov511->dev, 0xa6, 0x44); - ov511_reg_write(ov511->dev, 0xa7, 0x44); - ov511_reg_write(ov511->dev, 0xa8, 0x22); - ov511_reg_write(ov511->dev, 0xa9, 0x43); - ov511_reg_write(ov511->dev, 0xaa, 0x44); - ov511_reg_write(ov511->dev, 0xab, 0x44); - ov511_reg_write(ov511->dev, 0xac, 0x43); - ov511_reg_write(ov511->dev, 0xad, 0x44); - ov511_reg_write(ov511->dev, 0xae, 0x44); - ov511_reg_write(ov511->dev, 0xaf, 0x44); - ov511_reg_write(ov511->dev, 0xb0, 0x44); - ov511_reg_write(ov511->dev, 0xb1, 0x44); - ov511_reg_write(ov511->dev, 0xb2, 0x44); - ov511_reg_write(ov511->dev, 0xb3, 0x44); - ov511_reg_write(ov511->dev, 0xb4, 0x44); - ov511_reg_write(ov511->dev, 0xb5, 0x44); - ov511_reg_write(ov511->dev, 0xb6, 0x44); - ov511_reg_write(ov511->dev, 0xb7, 0x44); - ov511_reg_write(ov511->dev, 0xb8, 0x44); - ov511_reg_write(ov511->dev, 0xb9, 0x44); - ov511_reg_write(ov511->dev, 0xba, 0x44); - ov511_reg_write(ov511->dev, 0xbb, 0x44); - ov511_reg_write(ov511->dev, 0xbc, 0x44); - ov511_reg_write(ov511->dev, 0xbd, 0x44); - ov511_reg_write(ov511->dev, 0xbe, 0x44); - ov511_reg_write(ov511->dev, 0xbf, 0x44); - - ov511_i2c_write(ov511->dev, 0x13, 0x01); /* 01 */ - ov511_i2c_write(ov511->dev, 0x00, 0x1E); /* 1E */ - ov511_i2c_write(ov511->dev, 0x01, 0x80); /* 80 */ - ov511_i2c_write(ov511->dev, 0x02, 0x80); /* 80 */ - ov511_i2c_write(ov511->dev, 0x03, 0x86); /* 86 */ - ov511_i2c_write(ov511->dev, 0x04, 0x80); - ov511_i2c_write(ov511->dev, 0x05, 0xff); /* ff */ - ov511_i2c_write(ov511->dev, 0x06, 0x5a); - ov511_i2c_write(ov511->dev, 0x07, 0xd4); - ov511_i2c_write(ov511->dev, 0x08, 0x80); - ov511_i2c_write(ov511->dev, 0x09, 0x80); - ov511_i2c_write(ov511->dev, 0x0a, 0x80); - ov511_i2c_write(ov511->dev, 0x0b, 0xe0); - ov511_i2c_write(ov511->dev, 0x0c, 0x1f); /* 1f */ - ov511_i2c_write(ov511->dev, 0x0d, 0x1f); /* 1f */ - ov511_i2c_write(ov511->dev, 0x0e, 0x15); /* 15 */ - ov511_i2c_write(ov511->dev, 0x0f, 0x03); - ov511_i2c_write(ov511->dev, 0x10, 0xff); - ov511_i2c_write(ov511->dev, 0x11, 0x01); - ov511_i2c_write(ov511->dev, 0x12, 0x24); /* 24 */ - ov511_i2c_write(ov511->dev, 0x14, 0x04); - ov511_i2c_write(ov511->dev, 0x15, 0x01); - ov511_i2c_write(ov511->dev, 0x16, 0x06); - ov511_i2c_write(ov511->dev, 0x17, 0x38); - ov511_i2c_write(ov511->dev, 0x18, 0x03); - ov511_i2c_write(ov511->dev, 0x19, 0x05); - ov511_i2c_write(ov511->dev, 0x1a, 0xf4); - ov511_i2c_write(ov511->dev, 0x1b, 0x28); - ov511_i2c_write(ov511->dev, 0x1c, 0x7f); - ov511_i2c_write(ov511->dev, 0x1d, 0xa2); - ov511_i2c_write(ov511->dev, 0x1e, 0xc4); - ov511_i2c_write(ov511->dev, 0x1f, 0x04); - ov511_i2c_write(ov511->dev, 0x20, 0x1c); - ov511_i2c_write(ov511->dev, 0x21, 0x80); - ov511_i2c_write(ov511->dev, 0x22, 0x80); - ov511_i2c_write(ov511->dev, 0x23, 0x2a); - ov511_i2c_write(ov511->dev, 0x24, 0x10); /* 10 */ - ov511_i2c_write(ov511->dev, 0x25, 0x8a); /* 8a */ - ov511_i2c_write(ov511->dev, 0x26, 0x70); - ov511_i2c_write(ov511->dev, 0x27, 0xc2); - ov511_i2c_write(ov511->dev, 0x28, 0x24); - ov511_i2c_write(ov511->dev, 0x29, 0x11); - ov511_i2c_write(ov511->dev, 0x2a, 0x04); - ov511_i2c_write(ov511->dev, 0x2b, 0xac); - ov511_i2c_write(ov511->dev, 0x2c, 0xfe); - ov511_i2c_write(ov511->dev, 0x2d, 0x93); - ov511_i2c_write(ov511->dev, 0x2e, 0x80); - ov511_i2c_write(ov511->dev, 0x2f, 0xb0); - ov511_i2c_write(ov511->dev, 0x30, 0x71); - ov511_i2c_write(ov511->dev, 0x31, 0x90); - ov511_i2c_write(ov511->dev, 0x32, 0x22); - ov511_i2c_write(ov511->dev, 0x33, 0x20); - ov511_i2c_write(ov511->dev, 0x34, 0x8b); - ov511_i2c_write(ov511->dev, 0x35, 0x9e); - ov511_i2c_write(ov511->dev, 0x36, 0x7f); - ov511_i2c_write(ov511->dev, 0x37, 0x7f); - ov511_i2c_write(ov511->dev, 0x38, 0x81); - - ov511_dump_i2c_regs(ov511->dev); - ov511_set_packet_size(ov511, 993); /* We double buffer the Iso lists */ @@ -1000,15 +993,6 @@ static int ov511_open(struct video_device *dev, int flags) PDEBUG("sbuf[0] @ %p\n", ov511->sbuf[0].data); PDEBUG("sbuf[1] @ %p\n", ov511->sbuf[1].data); - /* Set default sizes in case IOCTL (VIDIOCMCAPTURE) is not used - * (using read() instead). */ - ov511->frame[0].width = DEFAULT_WIDTH; - ov511->frame[0].height = DEFAULT_HEIGHT; - ov511->frame[0].bytes_read = 0; - ov511->frame[1].width = DEFAULT_WIDTH; - ov511->frame[1].height = DEFAULT_HEIGHT; - ov511->frame[1].bytes_read = 0; - err = ov511_init_isoc(ov511); if (err) goto open_err_on2; @@ -1069,9 +1053,9 @@ static long ov511_write(struct video_device *dev, const char *buf, unsigned long static int ov511_ioctl(struct video_device *dev, unsigned int cmd, void *arg) { struct usb_ov511 *ov511 = (struct usb_ov511 *)dev; - +#if 0 PDEBUG("IOCtl: 0x%X\n", cmd); - +#endif switch (cmd) { case VIDIOCGCAP: { @@ -1127,7 +1111,7 @@ static int ov511_ioctl(struct video_device *dev, unsigned int cmd, void *arg) { struct video_picture p; - p.colour = 0x8000; /* Damn British people :) */ + p.colour = 0x8000; p.hue = 0x8000; p.brightness = 180 << 8; /* XXX */ p.contrast = 192 << 8; /* XXX */ @@ -1206,9 +1190,11 @@ static int ov511_ioctl(struct video_device *dev, unsigned int cmd, void *arg) if (copy_from_user((void *)&vm, (void *)arg, sizeof(vm))) return -EFAULT; +#if 0 PDEBUG("MCAPTURE\n"); PDEBUG("frame: %d, size: %dx%d, format: %d\n", vm.frame, vm.width, vm.height, vm.format); +#endif if (vm.format != VIDEO_PALETTE_RGB24) return -EINVAL; @@ -1221,8 +1207,15 @@ static int ov511_ioctl(struct video_device *dev, unsigned int cmd, void *arg) /* Don't compress if the size changed */ if ((ov511->frame[vm.frame].width != vm.width) || - (ov511->frame[vm.frame].height != vm.height)) + (ov511->frame[vm.frame].height != vm.height)) { ov511->compress = 0; + ov511_mode_init_regs(ov511, + vm.width, vm.height, 0); +#if 0 + PDEBUG("ov511: Setting frame %d to (%d, %d) : %d\n", + vm.frame, vm.width, vm.height, 0); +#endif + } ov511->frame[vm.frame].width = vm.width; ov511->frame[vm.frame].height = vm.height; @@ -1239,8 +1232,9 @@ static int ov511_ioctl(struct video_device *dev, unsigned int cmd, void *arg) if (copy_from_user((void *)&frame, arg, sizeof(int))) return -EFAULT; +#if 0 PDEBUG("syncing to frame %d\n", frame); - +#endif switch (ov511->frame[frame].grabstate) { case FRAME_UNUSED: return -EINVAL; @@ -1343,7 +1337,7 @@ static long ov511_read(struct video_device *dev, char *buf, unsigned long count, restart: while (frame->grabstate == FRAME_GRABBING) { - interruptible_sleep_on(&frame->wq); + interruptible_sleep_on(&ov511->frame[frmx].wq); if (signal_pending(current)) return -EINTR; } @@ -1428,10 +1422,49 @@ static struct video_device ov511_template = { 0 }; +static int ov7610_configure(struct usb_device *dev) +{ + if(ov511_reg_write(dev, OV511_REG_I2C_SLAVE_ID_WRITE, + OV7610_I2C_WRITE_ID) < 0) + return -1; + + if(ov511_reg_write(dev, OV511_REG_I2C_SLAVE_ID_READ, + OV7610_I2C_READ_ID) < 0) + return -1; + + /* Reset the camera chip */ + if (ov511_i2c_reset(dev) < 0) + return -1; + +#if 0 + if(usb_ov511_reg_write(dev, OV511_REG_I2C_CLOCK_PRESCALER, + OV511_I2C_CLOCK_PRESCALER)) + return -1; +#endif + + if (ov511_reset(dev, OV511_RESET_NOREGS) < 0) + return -1; + + /* Dummy read to sync I2C */ + if(ov511_i2c_read(dev, 0x00) < 0) + return -1; + + + if((ov511_i2c_read(dev, 0x1C) != 0x7F) || + (ov511_i2c_read(dev, 0x1D) != 0xA2)) { + printk(KERN_ERR "ov511: Failed to read OV7610 ID. You might\n"); + printk(KERN_ERR "ov511: not have an OV7610, or it may be\n"); + printk(KERN_ERR "ov511: not responding. Report this to\n"); + printk(KERN_ERR "ov511: mmcclelland@delphi.com\n"); + return -1; + } + + return 0; +} + static int ov511_configure(struct usb_ov511 *ov511) { struct usb_device *dev = ov511->dev; - int temprc; // DEBUG CODE /* Set altsetting 0 */ if (usb_set_interface(dev, ov511->iface, 0) < 0) { @@ -1463,36 +1496,31 @@ static int ov511_configure(struct usb_ov511 *ov511) if (ov511_reset(dev, OV511_RESET_ALL) < 0) goto error; + if(ov7610_configure(dev) < 0) { + printk(KERN_ERR "ov511: failed to configure OV7610\n"); + goto error; + } + /* Disable compression */ if (ov511_reg_write(dev, OV511_OMNICE_ENABLE, 0x00) < 0) { printk(KERN_ERR "ov511: disable compression: command failed\n"); goto error; } -// FIXME - error checking needed - ov511_reg_write(dev, OV511_REG_I2C_SLAVE_ID_WRITE, - OV7610_I2C_WRITE_ID); - ov511_reg_write(dev, OV511_REG_I2C_SLAVE_ID_READ, - OV7610_I2C_READ_ID); - -// DEBUG CODE -// usb_ov511_reg_write(dev, OV511_REG_I2C_CLOCK_PRESCALER, -// OV511_I2C_CLOCK_PRESCALER); - - if (ov511_reset(dev, OV511_RESET_NOREGS) < 0) - goto error; - - /* Dummy read to sync I2C */ - ov511_i2c_read(dev, 0x1C); - -// DEBUG - TEST CODE FOR CAMERA REG READ - temprc = ov511_i2c_read(dev, 0x1C); - - temprc = ov511_i2c_read(dev, 0x1D); -// END DEBUG CODE - ov511->compress = 0; + /* Set default sizes in case IOCTL (VIDIOCMCAPTURE) is not used + * (using read() instead). */ + ov511->frame[0].width = DEFAULT_WIDTH; + ov511->frame[0].height = DEFAULT_HEIGHT; + ov511->frame[0].bytes_read = 0; + ov511->frame[1].width = DEFAULT_WIDTH; + ov511->frame[1].height = DEFAULT_HEIGHT; + ov511->frame[1].bytes_read = 0; + + /* Initialize to DEFAULT_WIDTH, DEFAULT_HEIGHT, YUV4:2:0 */ + ov511_mode_init_regs(ov511, DEFAULT_WIDTH, DEFAULT_HEIGHT, 0); + return 0; error: diff --git a/drivers/usb/usb-serial.c b/drivers/usb/usb-serial.c index 78e3ecdb3fa7..5666a10f7ed7 100644 --- a/drivers/usb/usb-serial.c +++ b/drivers/usb/usb-serial.c @@ -85,31 +85,27 @@ #include #include -#include "whiteheat.h" +#ifdef CONFIG_USB_SERIAL_WHITEHEAT +#include "whiteheat.h" /* firmware for the ConnectTech WhiteHEAT device */ +#endif #define DEBUG #include "usb.h" -/* different configuration options to cut down on code size if you wish */ -#define CONFIG_BELKIN_SERIAL -#define CONFIG_PERACOM_SERIAL -#define CONFIG_VISOR_SERIAL -#define CONFIG_WHITEHEAT_SERIAL -#define CONFIG_GENERIC_SERIAL - /* Module information */ MODULE_AUTHOR("Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux-usb/"); MODULE_DESCRIPTION("USB Serial Driver"); -static __u16 vendor = 0; -static __u16 product = 0; +#ifdef CONFIG_USB_SERIAL_GENERIC +static __u16 vendor = 0x05f7; +static __u16 product = 0xffff; MODULE_PARM(vendor, "i"); MODULE_PARM_DESC(vendor, "User specified USB idVendor"); MODULE_PARM(product, "i"); MODULE_PARM_DESC(product, "User specified USB idProduct"); - +#endif /* USB Serial devices vendor ids and device ids that this driver supports */ #define BELKIN_VENDOR_ID 0x056c @@ -221,6 +217,7 @@ struct usb_serial_device_type { /* function prototypes for a "generic" type serial converter (no flow control, not all endpoints needed) */ +/* need to always compile these in, as some of the other devices use these functions as their own. */ static int generic_serial_open (struct tty_struct *tty, struct file *filp); static void generic_serial_close (struct tty_struct *tty, struct file *filp); static int generic_serial_write (struct tty_struct *tty, int from_user, const unsigned char *buf, int count); @@ -228,6 +225,7 @@ static void generic_serial_put_char (struct tty_struct *tty, unsigned char ch); static int generic_write_room (struct tty_struct *tty); static int generic_chars_in_buffer (struct tty_struct *tty); +#ifdef CONFIG_USB_SERIAL_GENERIC /* All of the device info needed for the Generic Serial Converter */ static struct usb_serial_device_type generic_device = { name: "Generic", @@ -246,15 +244,15 @@ static struct usb_serial_device_type generic_device = { write_room: generic_write_room, chars_in_buffer: generic_chars_in_buffer, }; +#endif - -#if defined(CONFIG_BELKIN_SERIAL) || defined(CONFIG_PERACOM_SERIAL) +#if defined(CONFIG_USB_SERIAL_BELKIN) || defined(CONFIG_USB_SERIAL_PERACOM) /* function prototypes for the eTek type converters (this includes Belkin and Peracom) */ static int etek_serial_open (struct tty_struct *tty, struct file *filp); static void etek_serial_close (struct tty_struct *tty, struct file *filp); #endif -#ifdef CONFIG_BELKIN_SERIAL +#ifdef CONFIG_USB_SERIAL_BELKIN /* All of the device info needed for the Belkin Serial Converter */ static __u16 belkin_vendor_id = BELKIN_VENDOR_ID; static __u16 belkin_product_id = BELKIN_SERIAL_CONVERTER; @@ -278,7 +276,7 @@ static struct usb_serial_device_type belkin_device = { #endif -#ifdef CONFIG_PERACOM_SERIAL +#ifdef CONFIG_USB_SERIAL_PERACOM /* All of the device info needed for the Peracom Serial Converter */ static __u16 peracom_vendor_id = PERACOM_VENDOR_ID; static __u16 peracom_product_id = PERACOM_SERIAL_CONVERTER; @@ -302,7 +300,7 @@ static struct usb_serial_device_type peracom_device = { #endif -#ifdef CONFIG_WHITEHEAT_SERIAL +#ifdef CONFIG_USB_SERIAL_WHITEHEAT /* function prototypes for the Connect Tech WhiteHEAT serial converter */ static int whiteheat_serial_open (struct tty_struct *tty, struct file *filp); static void whiteheat_serial_close (struct tty_struct *tty, struct file *filp); @@ -348,7 +346,7 @@ static struct usb_serial_device_type whiteheat_device = { #endif -#ifdef CONFIG_VISOR_SERIAL +#ifdef CONFIG_USB_SERIAL_VISOR /* function prototypes for a handspring visor */ static int visor_serial_open (struct tty_struct *tty, struct file *filp); static void visor_serial_close (struct tty_struct *tty, struct file *filp); @@ -383,18 +381,20 @@ static struct usb_serial_device_type handspring_device = { structure for that device, and add it to this list, making sure that the last entry is NULL. */ static struct usb_serial_device_type *usb_serial_devices[] = { +#ifdef CONFIG_USB_SERIAL_GENERIC &generic_device, -#ifdef CONFIG_WHITEHEAT_SERIAL +#endif +#ifdef CONFIG_USB_SERIAL_WHITEHEAT &whiteheat_fake_device, &whiteheat_device, #endif -#ifdef CONFIG_BELKIN_SERIAL +#ifdef CONFIG_USB_SERIAL_BELKIN &belkin_device, #endif -#ifdef CONFIG_PERACOM_SERIAL +#ifdef CONFIG_USB_SERIAL_PERACOM &peracom_device, #endif -#ifdef CONFIG_VISOR_SERIAL +#ifdef CONFIG_USB_SERIAL_VISOR &handspring_device, #endif NULL @@ -735,7 +735,7 @@ static void serial_unthrottle (struct tty_struct * tty) } -#if defined(CONFIG_BELKIN_SERIAL) || defined(CONFIG_PERACOM_SERIAL) +#if defined(CONFIG_USB_SERIAL_BELKIN) || defined(CONFIG_USB_SERIAL_PERACOM) /***************************************************************************** * eTek specific driver functions *****************************************************************************/ @@ -780,11 +780,11 @@ static void etek_serial_close(struct tty_struct *tty, struct file * filp) usb_unlink_urb (&serial->read_urb); serial->active = 0; } -#endif /* defined(CONFIG_BELKIN_SERIAL) || defined(CONFIG_PERACOM_SERIAL) */ +#endif /* defined(CONFIG_USB_SERIAL_BELKIN) || defined(CONFIG_USB_SERIAL_PERACOM) */ -#ifdef CONFIG_WHITEHEAT_SERIAL +#ifdef CONFIG_USB_SERIAL_WHITEHEAT /***************************************************************************** * Connect Tech's White Heat specific driver functions *****************************************************************************/ @@ -947,10 +947,10 @@ static int whiteheat_startup (struct usb_serial_state *serial) /* we want this device to fail to have a driver assigned to it. */ return (1); } -#endif /* CONFIG_WHITEHEAT_SERIAL */ +#endif /* CONFIG_USB_SERIAL_WHITEHEAT */ -#ifdef CONFIG_VISOR_SERIAL +#ifdef CONFIG_USB_SERIAL_VISOR /****************************************************************************** * Handspring Visor specific driver functions ******************************************************************************/ @@ -1014,7 +1014,7 @@ static void visor_unthrottle (struct tty_struct * tty) return; } -#endif /* CONFIG_VISOR_SERIAL*/ +#endif /* CONFIG_USB_SERIAL_VISOR*/ /***************************************************************************** diff --git a/drivers/usb/usb.h b/drivers/usb/usb.h index 51da03940572..96a1bf07584f 100644 --- a/drivers/usb/usb.h +++ b/drivers/usb/usb.h @@ -788,13 +788,13 @@ void usb_show_device(struct usb_device *); void usb_show_string(struct usb_device *dev, char *id, int index); #ifdef DEBUG -#define dbg(format, arg...) printk(KERN_DEBUG __FILE__ ": " format "\n", ## arg) +#define dbg(format, arg...) printk(KERN_DEBUG __FILE__ ": " format "\n" , ## arg) #else #define dbg(format, arg...) do {} while (0) #endif -#define err(format, arg...) printk(KERN_ERR __FILE__ ": " format "\n", ## arg) -#define info(format, arg...) printk(KERN_INFO __FILE__ ": " format "\n", ## arg) -#define warn(format, arg...) printk(KERN_WARNING __FILE__ ": " format "\n", ## arg) +#define err(format, arg...) printk(KERN_ERR __FILE__ ": " format "\n" , ## arg) +#define info(format, arg...) printk(KERN_INFO __FILE__ ": " format "\n" , ## arg) +#define warn(format, arg...) printk(KERN_WARNING __FILE__ ": " format "\n" , ## arg) /* diff --git a/drivers/video/dummycon.c b/drivers/video/dummycon.c index 05b2b73eac2b..9b54b6a76448 100644 --- a/drivers/video/dummycon.c +++ b/drivers/video/dummycon.c @@ -25,7 +25,7 @@ #define DUMMY_ROWS 25 #endif -static const char *__init dummycon_startup(void) +static const char *dummycon_startup(void) { return "dummy device"; } diff --git a/fs/hfs/ChangeLog b/fs/hfs/ChangeLog index 11c7d8506302..723f2232d8fa 100644 --- a/fs/hfs/ChangeLog +++ b/fs/hfs/ChangeLog @@ -1,3 +1,7 @@ +2000-01-02 a sun + + * file.c (hfs_get_block): added hfs_get_block for regular files. + 1999-04-12 a sun * file_hdr.c (hdr_read): added rootinfo behaviour for DID header. diff --git a/fs/hfs/extent.c b/fs/hfs/extent.c index 3c92e7defa54..eca17bc6360a 100644 --- a/fs/hfs/extent.c +++ b/fs/hfs/extent.c @@ -523,7 +523,7 @@ static void shrink_fork(struct hfs_fork *fork, int ablocks) * Try to add enough allocation blocks to 'fork' * so that it is 'ablock' allocation blocks long. */ -static void grow_fork(struct hfs_fork *fork, int ablocks) +static int grow_fork(struct hfs_fork *fork, int ablocks) { struct hfs_cat_entry *entry = fork->entry; struct hfs_mdb *mdb = entry->mdb; @@ -535,8 +535,8 @@ static void grow_fork(struct hfs_fork *fork, int ablocks) blocks = fork->psize; need = ablocks - blocks/ablksz; - if (need < 1) { - return; + if (need < 1) { /* no need to grow the fork */ + return 0; } /* round up to clumpsize */ @@ -550,7 +550,7 @@ static void grow_fork(struct hfs_fork *fork, int ablocks) /* find last extent record and try to extend it */ if (!(ext = find_ext(fork, blocks/ablksz - 1))) { /* somehow we couldn't find the end of the file! */ - return; + return -1; } /* determine which is the last used extent in the record */ @@ -574,7 +574,7 @@ static void grow_fork(struct hfs_fork *fork, int ablocks) unlock_bitmap(mdb); if (err) { relse_ext(ext); - return; + return -1; } zero_blocks(mdb, start, len); @@ -600,7 +600,7 @@ more_extents: unlock_bitmap(mdb); if (!len || err) { relse_ext(ext); - return; + return -1; } zero_blocks(mdb, start, len); @@ -617,7 +617,7 @@ more_extents: lock_bitmap(mdb); hfs_clear_vbm_bits(mdb, start, len); unlock_bitmap(mdb); - return; + return -1; } } blocks = (fork->psize += len * ablksz); @@ -625,7 +625,7 @@ more_extents: } set_cache(fork, ext); relse_ext(ext); - return; + return 0; } /*================ Global functions ================*/ @@ -738,11 +738,8 @@ int hfs_extent_map(struct hfs_fork *fork, int block, int create) ablock = block / ablksz; if (block >= fork->psize) { - if (create) { - grow_fork(fork, ablock + 1); - } else { + if (!create || (grow_fork(fork, ablock + 1) < 0)) return 0; - } } #if defined(DEBUG_EXTENTS) || defined(DEBUG_ALL) diff --git a/fs/hfs/file.c b/fs/hfs/file.c index 943249478c09..d5edeac45f44 100644 --- a/fs/hfs/file.c +++ b/fs/hfs/file.c @@ -28,7 +28,7 @@ static hfs_rwret_t hfs_file_read(struct file *, char *, hfs_rwarg_t, static hfs_rwret_t hfs_file_write(struct file *, const char *, hfs_rwarg_t, loff_t *); static void hfs_file_truncate(struct inode *); -static int hfs_bmap(struct inode *, int); +static int hfs_get_block(struct inode *, long, struct buffer_head *, int); /*================ Global variables ================*/ @@ -61,7 +61,7 @@ struct inode_operations hfs_file_inode_operations = { NULL, /* rename */ NULL, /* readlink */ NULL, /* follow_link */ - hfs_bmap, /* get_block */ + hfs_get_block, /* get_block */ block_read_full_page, /* readpage */ NULL, /* writepage */ hfs_file_truncate, /* truncate */ @@ -124,19 +124,37 @@ struct buffer_head *hfs_getblk(struct hfs_fork *fork, int block, int create) } /* - * hfs_bmap() + * hfs_get_block * - * This is the bmap() field in the inode_operations structure for + * This is the hfs_get_block() field in the inode_operations structure for * "regular" (non-header) files. The purpose is to translate an inode * and a block number within the corresponding file into a physical * block number. This function just calls hfs_extent_map() to do the - * real work. + * real work and then stuffs the appropriate info into the buffer_head. */ -static int hfs_bmap(struct inode * inode, int block) +int hfs_get_block(struct inode *inode, long iblock, struct buffer_head *bh_result, int create) { - return hfs_extent_map(HFS_I(inode)->fork, block, 0); + unsigned long phys; + + phys = hfs_extent_map(HFS_I(inode)->fork, iblock, create); + if (phys) { + bh_result->b_dev = inode->i_dev; + bh_result->b_blocknr = phys; + bh_result->b_state |= (1UL << BH_Mapped); + if (create) + bh_result->b_state |= (1UL << BH_New); + return 0; + } + + if (!create) + return 0; + + /* we tried to add stuff, but we couldn't. send back an out-of-space + * error. */ + return -ENOSPC; } + /* * hfs_file_read() * @@ -146,8 +164,7 @@ static int hfs_bmap(struct inode * inode, int block) * 'filp->offset' bytes into the file. The data is transfered to * user-space at the address 'buf'. Returns the number of bytes * successfully transfered. This function checks the arguments, does - * some setup and then calls hfs_do_read() to do the actual transfer. - */ + * some setup and then calls hfs_do_read() to do the actual transfer. */ static hfs_rwret_t hfs_file_read(struct file * filp, char * buf, hfs_rwarg_t count, loff_t *ppos) { diff --git a/fs/hfs/hfs_btree.h b/fs/hfs/hfs_btree.h index 7f7aea600755..97423b350179 100644 --- a/fs/hfs/hfs_btree.h +++ b/fs/hfs/hfs_btree.h @@ -34,6 +34,20 @@ #define ndMapNode 0x02 /* Holds part of the bitmap of used nodes */ #define ndLeafNode 0xFF /* A leaf (ndNHeight==1) node */ +/* + * Legal values for the bthAtrb field of a (struct BTHdrRec) + * + * Reference: TN 1150 + */ +#define bthBadClose 0x00000001 /* b-tree not closed properly. not + used by hfsplus. */ +#define bthBigKeys 0x00000002 /* key length is u16 instead of u8. + used by hfsplus. */ +#define bthVarIndxKeys 0x00000004 /* variable key length instead of + max key length. use din catalog + b-tree but not in extents + b-tree (hfsplus). */ + /*================ Function-like macros ================*/ /* Access the cache slot which should contain the desired node */ @@ -70,7 +84,12 @@ struct BTHdrRec { hfs_word_t bthKeyLen; /* (F) The length of a key in an index node */ hfs_lword_t bthNNodes; /* (V) The total number of nodes */ hfs_lword_t bthFree; /* (V) The number of unused nodes */ - hfs_byte_t bthResv[76]; /* Reserved */ + hfs_word_t bthResv1; /* reserved */ + hfs_lword_t bthClpSiz; /* (F) clump size. not usually used. */ + hfs_byte_t bthType; /* (F) BTree type */ + hfs_byte_t bthResv2; /* reserved */ + hfs_lword_t bthAtrb; /* (F) attributes */ + hfs_lword_t bthResv3[16]; /* Reserved */ }; /* @@ -129,6 +148,8 @@ struct hfs_bnode { this node in-core (set for root and head) */ hfs_u32 node; /* Node number */ + hfs_u16 nodeSize; /* node size */ + hfs_u16 keyLen; /* key length */ /* locking related fields: */ hfs_wait_queue wqueue; /* Wait queue for write access */ hfs_wait_queue rqueue; /* Wait queue for read or reserve @@ -176,6 +197,7 @@ struct hfs_btree { int lock; hfs_wait_queue wait; int dirt; + int keySize; /* Fields from the BTHdrRec in native byte-order: */ hfs_u32 bthRoot; hfs_u32 bthNRecs; diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index 8fde9117d83d..af09655a0a6d 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c @@ -44,14 +44,18 @@ static void init_file_inode(struct inode *inode, hfs_u8 fork) } if (fork == HFS_FK_DATA) { +#if 0 /* XXX: disable crlf translations for now */ hfs_u32 type = hfs_get_nl(entry->info.file.finfo.fdType); - fk = &entry->u.file.data_fork; HFS_I(inode)->convert = ((HFS_SB(inode->i_sb)->s_conv == 't') || ((HFS_SB(inode->i_sb)->s_conv == 'a') && ((type == htonl(0x54455854)) || /* "TEXT" */ (type == htonl(0x7474726f))))); /* "ttro" */ +#else + HFS_I(inode)->convert = 0; +#endif + fk = &entry->u.file.data_fork; } else { fk = &entry->u.file.rsrc_fork; HFS_I(inode)->convert = 0; diff --git a/fs/namei.c b/fs/namei.c index 599c873e6b3b..97f8232d4dc2 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -780,16 +780,14 @@ asmlinkage long sys_mknod(const char * filename, int mode, dev_t dev) char * tmp; struct dentry * dentry; - lock_kernel(); - error = -EPERM; if (S_ISDIR(mode) || (!S_ISFIFO(mode) && !capable(CAP_MKNOD))) - goto out; + return -EPERM; tmp = getname(filename); - error = PTR_ERR(tmp); if (IS_ERR(tmp)) - goto out; + return PTR_ERR(tmp); error = -EINVAL; + lock_kernel(); switch (mode & S_IFMT) { case 0: mode |= S_IFREG; /* fallthrough */ @@ -815,10 +813,9 @@ asmlinkage long sys_mknod(const char * filename, int mode, dev_t dev) } break; } + unlock_kernel(); putname(tmp); -out: - unlock_kernel(); return error; } @@ -870,14 +867,14 @@ asmlinkage long sys_mkdir(const char * pathname, int mode) int error; char * tmp; - lock_kernel(); tmp = getname(pathname); - error = PTR_ERR(tmp); - if (!IS_ERR(tmp)) { - error = do_mkdir(tmp,mode); - putname(tmp); - } + if(IS_ERR(tmp)) + return PTR_ERR(tmp); + lock_kernel(); + error = do_mkdir(tmp,mode); unlock_kernel(); + putname(tmp); + return error; } @@ -965,14 +962,15 @@ asmlinkage long sys_rmdir(const char * pathname) int error; char * tmp; - lock_kernel(); tmp = getname(pathname); - error = PTR_ERR(tmp); - if (!IS_ERR(tmp)) { - error = do_rmdir(tmp); - putname(tmp); - } + if(IS_ERR(tmp)) + return PTR_ERR(tmp); + lock_kernel(); + error = do_rmdir(tmp); unlock_kernel(); + + putname(tmp); + return error; } @@ -1018,14 +1016,14 @@ asmlinkage long sys_unlink(const char * pathname) int error; char * tmp; - lock_kernel(); tmp = getname(pathname); - error = PTR_ERR(tmp); - if (!IS_ERR(tmp)) { - error = do_unlink(tmp); - putname(tmp); - } + if(IS_ERR(tmp)) + return PTR_ERR(tmp); + lock_kernel(); + error = do_unlink(tmp); unlock_kernel(); + putname(tmp); + return error; } @@ -1068,21 +1066,20 @@ asmlinkage long sys_symlink(const char * oldname, const char * newname) { int error; char * from; + char * to; - lock_kernel(); from = getname(oldname); - error = PTR_ERR(from); - if (!IS_ERR(from)) { - char * to; - to = getname(newname); - error = PTR_ERR(to); - if (!IS_ERR(to)) { - error = do_symlink(from,to); - putname(to); - } - putname(from); + if(IS_ERR(from)) + return PTR_ERR(from); + to = getname(newname); + error = PTR_ERR(to); + if (!IS_ERR(to)) { + lock_kernel(); + error = do_symlink(from,to); + unlock_kernel(); + putname(to); } - unlock_kernel(); + putname(from); return error; } @@ -1156,21 +1153,21 @@ asmlinkage long sys_link(const char * oldname, const char * newname) { int error; char * from; + char * to; - lock_kernel(); from = getname(oldname); - error = PTR_ERR(from); - if (!IS_ERR(from)) { - char * to; - to = getname(newname); - error = PTR_ERR(to); - if (!IS_ERR(to)) { - error = do_link(from,to); - putname(to); - } - putname(from); + if(IS_ERR(from)) + return PTR_ERR(from); + to = getname(newname); + error = PTR_ERR(to); + if (!IS_ERR(to)) { + lock_kernel(); + error = do_link(from,to); + unlock_kernel(); + putname(to); } - unlock_kernel(); + putname(from); + return error; } @@ -1327,21 +1324,20 @@ asmlinkage long sys_rename(const char * oldname, const char * newname) { int error; char * from; + char * to; - lock_kernel(); from = getname(oldname); - error = PTR_ERR(from); - if (!IS_ERR(from)) { - char * to; - to = getname(newname); - error = PTR_ERR(to); - if (!IS_ERR(to)) { - error = do_rename(from,to); - putname(to); - } - putname(from); + if(IS_ERR(from)) + return PTR_ERR(from); + to = getname(newname); + error = PTR_ERR(to); + if (!IS_ERR(to)) { + lock_kernel(); + error = do_rename(from,to); + unlock_kernel(); + putname(to); } - unlock_kernel(); + putname(from); return error; } diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c index 7ab0d889aead..0a361b6c3b71 100644 --- a/fs/ncpfs/ioctl.c +++ b/fs/ncpfs/ioctl.c @@ -144,7 +144,7 @@ int ncp_ioctl(struct inode *inode, struct file *filp, && (current->uid != server->m.mounted_uid)) { return -EACCES; } - put_user(high2lowuid(server->m.mounted_uid), (old_uid_t *) arg); + put_user(NEW_TO_OLD_UID(server->m.mounted_uid), (old_uid_t *) arg); return 0; case NCP_IOC_GETMOUNTUID32: diff --git a/fs/smbfs/ioctl.c b/fs/smbfs/ioctl.c index b721b7785d67..6ea26fe25565 100644 --- a/fs/smbfs/ioctl.c +++ b/fs/smbfs/ioctl.c @@ -28,7 +28,7 @@ smb_ioctl(struct inode *inode, struct file *filp, switch (cmd) { case SMB_IOC_GETMOUNTUID: - result = put_user(high2lowuid(server->mnt->mounted_uid), (old_uid_t *) arg); + result = put_user(NEW_TO_OLD_UID(server->mnt->mounted_uid), (old_uid_t *) arg); break; case SMB_IOC_GETMOUNTUID32: result = put_user(server->mnt->mounted_uid, (uid_t *) arg); diff --git a/include/asm-alpha/posix_types.h b/include/asm-alpha/posix_types.h index 6bbf1e5f4c94..431f8d7af63e 100644 --- a/include/asm-alpha/posix_types.h +++ b/include/asm-alpha/posix_types.h @@ -28,13 +28,18 @@ typedef char * __kernel_caddr_t; typedef unsigned long __kernel_sigset_t; /* at least 32 bits */ typedef unsigned short __kernel_uid16_t; typedef unsigned short __kernel_gid16_t; -typedef unsigned int __kernel_uid32_t; -typedef unsigned int __kernel_gid32_t; typedef struct { int val[2]; } __kernel_fsid_t; +#ifdef __KERNEL__ +typedef __kernel_uid_t __kernel_old_uid_t; +typedef __kernel_gid_t __kernel_old_gid_t; +typedef __kernel_uid_t __kernel_uid32_t; +typedef __kernel_gid_t __kernel_gid32_t; +#endif /* __KERNEL__ */ + #ifdef __KERNEL__ #ifndef __GNUC__ diff --git a/include/asm-arm/arch-arc/serial.h b/include/asm-arm/arch-arc/serial.h index c068ac62ff51..16d5bd73be89 100644 --- a/include/asm-arm/arch-arc/serial.h +++ b/include/asm-arm/arch-arc/serial.h @@ -28,13 +28,13 @@ #if defined(CONFIG_ARCH_A5K) /* UART CLK PORT IRQ FLAGS */ -#define STD_SERIAL_PORT_DEFNS +#define STD_SERIAL_PORT_DEFNS \ { 0, BASE_BAUD, 0x3F8, 10, STD_COM_FLAGS }, /* ttyS0 */ \ { 0, BASE_BAUD, 0x2F8, 10, STD_COM_FLAGS }, /* ttyS1 */ #else -#define STD_SERIAL_PORT_DEFNS +#define STD_SERIAL_PORT_DEFNS \ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS0 */ \ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS1 */ diff --git a/include/asm-arm/arch-arc/system.h b/include/asm-arm/arch-arc/system.h index e881146168be..7f204b1f5a41 100644 --- a/include/asm-arm/arch-arc/system.h +++ b/include/asm-arm/arch-arc/system.h @@ -20,7 +20,8 @@ #endif -#define arch_do_idle() do { } while (0) +#define arch_do_idle() do { } while (0) +#define arch_power_off() do { } while (0) extern __inline__ void arch_reset(char mode) { diff --git a/include/asm-arm/arch-cl7500/system.h b/include/asm-arm/arch-cl7500/system.h index 767730a4cdad..201c5c30594c 100644 --- a/include/asm-arm/arch-cl7500/system.h +++ b/include/asm-arm/arch-cl7500/system.h @@ -24,4 +24,6 @@ #define arch_do_idle() \ outb(0, IOMD_SUSMODE) +#define arch_power_off() do { } while (0) + #endif diff --git a/include/asm-arm/arch-ebsa110/system.h b/include/asm-arm/arch-ebsa110/system.h index 05e2be70719c..39f4c84a4c64 100644 --- a/include/asm-arm/arch-ebsa110/system.h +++ b/include/asm-arm/arch-ebsa110/system.h @@ -7,6 +7,7 @@ #define __ASM_ARCH_SYSTEM_H #define arch_do_idle() cpu_do_idle() +#define arch_power_off() do { } while (0) extern __inline__ void arch_reset(char mode) { diff --git a/include/asm-arm/arch-ebsa285/io.h b/include/asm-arm/arch-ebsa285/io.h index 7861f8470aef..877625fa8aa8 100644 --- a/include/asm-arm/arch-ebsa285/io.h +++ b/include/asm-arm/arch-ebsa285/io.h @@ -16,7 +16,7 @@ * Translation of various region addresses to virtual addresses */ #define __io_pci(a) (PCIO_BASE + (a)) -#if 0 +#if 1 #define __mem_pci(a) ((unsigned long)(a)) #define __mem_isa(a) (PCIMEM_BASE + (unsigned long)(a)) #else @@ -91,7 +91,7 @@ extern __inline__ void __arch_putw(unsigned int value, unsigned long a) #define __arch_ioremap(off,size,nocache) \ ({ \ unsigned long _off = (off), _size = (size); \ - void *_ret = NULL; \ + void *_ret = (void *)0; \ if (valid_ioaddr(_off, _size)) \ _ret = __ioremap(io_to_phys(_off), _size, 0); \ _ret; \ diff --git a/include/asm-arm/arch-ebsa285/irq.h b/include/asm-arm/arch-ebsa285/irq.h index 195aad743e12..3a4faaf24c53 100644 --- a/include/asm-arm/arch-ebsa285/irq.h +++ b/include/asm-arm/arch-ebsa285/irq.h @@ -44,8 +44,19 @@ static int isa_irq = -1; static inline int fixup_irq(unsigned int irq) { #ifdef CONFIG_HOST_FOOTBRIDGE - if (irq == isa_irq) + if (irq == isa_irq) { irq = *(unsigned char *)PCIIACK_BASE; + + /* + * The NetWinder appears to randomly give wrong interrupt + * numbers from time to time. When it does, map them to + * the unused IRQ 13 + */ + if (irq >= NR_IRQS) { + printk(KERN_ERR "Strange interrupt %d?\n", irq); + irq = _ISA_IRQ(13); + } + } #endif return irq; diff --git a/include/asm-arm/arch-ebsa285/system.h b/include/asm-arm/arch-ebsa285/system.h index ee7573804c7c..ace6afbd6efc 100644 --- a/include/asm-arm/arch-ebsa285/system.h +++ b/include/asm-arm/arch-ebsa285/system.h @@ -9,6 +9,7 @@ #include #define arch_do_idle() cpu_do_idle() +#define arch_power_off() do { } while (0) extern __inline__ void arch_reset(char mode) { diff --git a/include/asm-arm/arch-nexuspci/system.h b/include/asm-arm/arch-nexuspci/system.h index c1605d3fa325..2f8fc9eacc4b 100644 --- a/include/asm-arm/arch-nexuspci/system.h +++ b/include/asm-arm/arch-nexuspci/system.h @@ -8,5 +8,6 @@ #define arch_do_idle() do { } while (0) #define arch_reset(mode) do { } while (0) +#define arch_power_off() do { } while (0) #endif diff --git a/include/asm-arm/arch-rpc/system.h b/include/asm-arm/arch-rpc/system.h index c40aadcadecf..c5100fd1ad39 100644 --- a/include/asm-arm/arch-rpc/system.h +++ b/include/asm-arm/arch-rpc/system.h @@ -7,7 +7,8 @@ #include #include -#define arch_do_idle() cpu_do_idle() +#define arch_do_idle() cpu_do_idle() +#define arch_power_off() do { } while (0) extern __inline__ void arch_reset(char mode) { diff --git a/include/asm-arm/arch-sa1100/hardware.h b/include/asm-arm/arch-sa1100/hardware.h index 407641aa9b50..86358d96b48c 100644 --- a/include/asm-arm/arch-sa1100/hardware.h +++ b/include/asm-arm/arch-sa1100/hardware.h @@ -1,7 +1,7 @@ /* * linux/include/asm-arm/arch-brutus/hardware.h * - * Copyright (C) 1998 Nicolas Pitre + * Copyright (C) 1998 Nicolas Pitre * * This file contains the hardware definitions for SA1100 architecture */ @@ -12,7 +12,7 @@ /* Flushing areas */ #define FLUSH_BASE_PHYS 0xe0000000 /* SA1100 zero bank */ #define FLUSH_BASE 0xdf000000 -#define FLUSH_BASE_MINICACHE 0xde000000 +#define FLUSH_BASE_MINICACHE 0xdf800000 /* * PCMCIA IO is mapped to 0xe0000000. We are likely to use in*()/out*() diff --git a/include/asm-arm/arch-sa1100/ide.h b/include/asm-arm/arch-sa1100/ide.h new file mode 100644 index 000000000000..3c39c1d7cc97 --- /dev/null +++ b/include/asm-arm/arch-sa1100/ide.h @@ -0,0 +1,96 @@ +/* + * linux/include/asm-arm/arch-sa1100/ide.h + * + * Copyright (c) 1998 Hugo Fiennes & Nicolas Pitre + * + */ + +#ifdef CONFIG_BLK_DEV_IDE + +#include +#include + +/* + * Set up a hw structure for a specified data port, control port and IRQ. + * This should follow whatever the default interface uses. + */ +static __inline__ void +ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int irq) +{ + ide_ioreg_t reg; + int i; + + memset(hw, 0, sizeof(*hw)); + +#ifdef CONFIG_SA1100_EMPEG +/* The Empeg board has the first two address lines unused */ +#define IO_SHIFT 2 +#else +#define IO_SHIFT 0 +#endif + + reg = (ide_ioreg_t) (data_port << IO_SHIFT); + for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { + hw->io_ports[i] = reg; + reg += (1 << IO_SHIFT); + } + hw->io_ports[IDE_CONTROL_OFFSET] = (ide_ioreg_t) (ctrl_port << IO_SHIFT); + hw->irq = irq; +} + +/* + * This registers the standard ports for this architecture with the IDE + * driver. + */ +static __inline__ void +ide_init_default_hwifs(void) +{ + hw_regs_t hw; + +#if defined( CONFIG_SA1100_EMPEG ) + /* First, do the SA1100 setup */ + + /* PCMCIA IO space */ + MECR=0x21062106; + + /* Issue 3 is much neater than issue 2 */ + GPDR&=~(EMPEG_IDE1IRQ|EMPEG_IDE2IRQ); + + /* Interrupts on rising edge: lines are inverted before they get to + the SA */ + GRER&=~(EMPEG_IDE1IRQ|EMPEG_IDE2IRQ); + GFER|=(EMPEG_IDE1IRQ|EMPEG_IDE2IRQ); + + /* Take hard drives out of reset */ + GPSR=(EMPEG_IDERESET); + + /* Clear GEDR */ + GEDR=0xffffffff; + + /* Sonja and her successors have two IDE ports. */ + /* MAC 23/4/1999, swap these round so that the left hand + hard disk is hda when viewed from the front. This + doesn't match the silkscreen however. */ + ide_init_hwif_ports(&hw,0x10,0x1e,EMPEG_IRQ_IDE2); + ide_register_hw(&hw, NULL); + ide_init_hwif_ports(&hw,0x00,0x0e,EMPEG_IRQ_IDE1); + ide_register_hw(&hw, NULL); + +#elif defined( CONFIG_SA1100_VICTOR ) + /* Enable appropriate GPIOs as interrupt lines */ + GPDR &= ~GPIO_GPIO7; + GRER |= GPIO_GPIO7; + GFER &= ~GPIO_GPIO7; + GEDR = GPIO_GPIO7; + /* set the pcmcia interface timing */ + MECR = 0x00060006; + + ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, IRQ_GPIO7); + ide_register_hw(&hw, NULL); +#else +#error Missing IDE interface definition in include/asm/arch/ide.h +#endif +} + +#endif + diff --git a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h index 884157c86405..4c2126208ef5 100644 --- a/include/asm-arm/arch-sa1100/memory.h +++ b/include/asm-arm/arch-sa1100/memory.h @@ -1,7 +1,7 @@ /* * linux/include/asm-arm/arch-sa1100/memory.h * - * Copyright (c) 1999 Nicolas Pitre + * Copyright (c) 1999 Nicolas Pitre */ #ifndef __ASM_ARCH_MEMORY_H @@ -12,23 +12,27 @@ * Task size: 3GB */ #define TASK_SIZE (0xc0000000UL) +#define TASK_SIZE_26 (0x04000000UL) /* * Page offset: 3GB */ #define PAGE_OFFSET (0xc0000000UL) -#define PHYS_OFFSET (0x00000000UL) + +/* + * Physical DRAM offset is 0xc0000000 on the SA1100 + */ +#define PHYS_OFFSET (0xc0000000UL) + #define __virt_to_phys__is_a_macro #define __phys_to_virt__is_a_macro /* * The following gives a maximum memory size of 128MB (32MB in each bank). - * - * Does this still need to be optimised for one bank machines? */ -#define __virt_to_phys(x) (((x) & 0xe0ffffff) | ((x) & 0x06000000) << 2) -#define __phys_to_virt(x) (((x) & 0xe7ffffff) | ((x) & 0x30000000) >> 2) +#define __virt_to_phys(x) (((x) & 0xf9ffffff) | ((x) & 0x06000000) << 2) +#define __phys_to_virt(x) (((x) & 0xe7ffffff) | ((x) & 0x18000000) >> 2) /* * Virtual view <-> DMA view memory address translations diff --git a/include/asm-arm/arch-sa1100/param.h b/include/asm-arm/arch-sa1100/param.h index 3444dc74cda4..f0ea52b17da2 100644 --- a/include/asm-arm/arch-sa1100/param.h +++ b/include/asm-arm/arch-sa1100/param.h @@ -1,3 +1,3 @@ /* - * linux/include/asm-arm/arch-ebsa110/param.h + * linux/include/asm-arm/arch-sa1100/param.h */ diff --git a/include/asm-arm/arch-sa1100/serial.h b/include/asm-arm/arch-sa1100/serial.h index f57de7f4a75e..83db935a5d10 100644 --- a/include/asm-arm/arch-sa1100/serial.h +++ b/include/asm-arm/arch-sa1100/serial.h @@ -1,6 +1,6 @@ /* * include/asm-arm/arch-sa1100/serial.h - * (C) 1999 Nicolas Pitre + * (C) 1999 Nicolas Pitre * * All this is intended to be used with a 16550-like UART on the SA1100's * PCMCIA bus. It has nothing to do with the SA1100's internal serial ports. diff --git a/include/asm-arm/arch-sa1100/system.h b/include/asm-arm/arch-sa1100/system.h index 24072c298d67..49b4bdca29b8 100644 --- a/include/asm-arm/arch-sa1100/system.h +++ b/include/asm-arm/arch-sa1100/system.h @@ -1,7 +1,7 @@ /* * linux/include/asm-arm/arch-sa1100/system.h * - * Copyright (c) 1999 Nicolas Pitre + * Copyright (c) 1999 Nicolas Pitre */ #include @@ -25,6 +25,9 @@ #endif +#if 0 +#define arch_do_idle() cpu_do_idle() +#else /* Enter SA1100 idle mode (see data sheet sec 9.5). * It seems that the wait-on-interrupt just hang the CPU forever if it's * on the end of a cache line. Workaround: we force an explicit alignment @@ -41,3 +44,7 @@ " mcr p15, 0, %0, c15, c1, 2 @ Reenable clock switching \n" \ : : "r" (&ICIP) : "cc" ); \ } while (0) +#endif + +#define arch_power_off() do { } while (0) + diff --git a/include/asm-arm/arch-sa1100/uncompress.h b/include/asm-arm/arch-sa1100/uncompress.h new file mode 100644 index 000000000000..0fa4a10a2a62 --- /dev/null +++ b/include/asm-arm/arch-sa1100/uncompress.h @@ -0,0 +1,51 @@ +/* + * linux/include/asm-arm/arch-brutus/uncompress.h + * + * (C) 1999 Nicolas Pitre + */ + + +#if defined(CONFIG_SA1100_EMPEG) || \ + defined(CONFIG_SA1100_VICTOR) || \ + defined(CONFIG_SA1100_LART) + +#include "hardware.h" +#include "serial_reg.h" + +static volatile unsigned long* serial_port = (unsigned long*)_Ser3UTCR0; + +/* + * The following code assumes the serial port has already been + * initialized by the bootloader or such... + */ + +static void puts( const char *s ) +{ + int i; + + for (i = 0; *s; i++, s++) { + /* wait for space in the UART's transmiter */ + while( !(serial_port[UTSR1] & UTSR1_TNF) ); + + /* send the character out. */ + serial_port[UART_TX] = *s; + + /* if a LF, also do CR... */ + if (*s == 10) { + while( !(serial_port[UTSR1] & UTSR1_TNF) ); + serial_port[UART_TX] = 13; + } + } +} + +#else + +#define puts( x ) + +#endif + + +/* Nothing to do for these */ +#define arch_decomp_setup() +#define arch_decomp_wdog() + diff --git a/include/asm-arm/checksum.h b/include/asm-arm/checksum.h index b827c490ceb9..5e1fb8792943 100644 --- a/include/asm-arm/checksum.h +++ b/include/asm-arm/checksum.h @@ -4,7 +4,7 @@ * IP checksum routines * * Copyright (C) Original authors of ../asm-i386/checksum.h - * Copyright (C) 1996,1997,1998 Russell King + * Copyright (C) 1996-1999 Russell King */ #ifndef __ASM_ARM_CHECKSUM_H #define __ASM_ARM_CHECKSUM_H @@ -37,37 +37,25 @@ csum_partial_copy_nocheck(const char *src, char *dst, int len, int sum); unsigned int csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *err_ptr); -#if 0 -/* - * This combination is currently not used, but possible: - */ -unsigned int -csum_partial_copy_to_user(const char *src, char *dst, int len, int sum, int *err_ptr); -#endif - /* * These are the old (and unsafe) way of doing checksums, a warning message will be * printed if they are used and an exception occurs. * * these functions should go away after some time. */ -#define csum_partial_copy_fromuser csum_partial_copy -unsigned int -csum_partial_copy(const char *src, char *dst, int len, int sum); +#define csum_partial_copy(src,dst,len,sum) csum_partial_copy_nocheck(src,dst,len,sum) /* * This is a version of ip_compute_csum() optimized for IP headers, * which always checksum on 4 octet boundaries. - * - * Converted and optimised for ARM by R. M. King. */ static inline unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl) { unsigned int sum, tmp1; - __asm__ __volatile__( - "sub %2, %2, #5 @ ip_fast_csum + __asm__ __volatile__( + "sub %2, %2, #5 @ ip_fast_csum ldr %0, [%1], #4 ldr %3, [%1], #4 adds %0, %0, %3 @@ -86,10 +74,10 @@ ip_fast_csum(unsigned char * iph, unsigned int ihl) mvn %0, %0 mov %0, %0, lsr #16 " - : "=&r" (sum), "=&r" (iph), "=&r" (ihl), "=&r" (tmp1) + : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1) : "1" (iph), "2" (ihl) : "cc"); - return(sum); + return sum; } /* @@ -130,7 +118,17 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, unsigned int proto, unsigned int sum) { - return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); + __asm__( + "adds %0, %1, %2 @ csum_tcpudp_magic + adcs %0, %0, %3 + adcs %0, %0, %4 + adcs %0, %0, %5 + adds %0, %0, %0, lsl #16 + addcs %0, %0, #0x10000" + : "=&r"(sum) + : "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len) << 16), "Ir" (proto << 8) + : "cc"); + return (~sum) >> 16; } diff --git a/include/asm-arm/div64.h b/include/asm-arm/div64.h index fc473b6f0603..27fec4ee6aed 100644 --- a/include/asm-arm/div64.h +++ b/include/asm-arm/div64.h @@ -1,32 +1,13 @@ #ifndef __ASM_ARM_DIV64 #define __ASM_ARM_DIV64 -/* - * unsigned long long division. Yuck Yuck! What is Linux coming to? - * This is 100% disgusting - */ -#define do_div(n,base) \ -({ \ - unsigned long __low, __low2, __high, __rem; \ - __low = (n) & 0xffffffff; \ - __high = (n) >> 32; \ - if (__high) { \ - __rem = __high % (unsigned long)base; \ - __high = __high / (unsigned long)base; \ - __low2 = __low >> 16; \ - __low2 += __rem << 16; \ - __rem = __low2 % (unsigned long)base; \ - __low2 = __low2 / (unsigned long)base; \ - __low = __low & 0xffff; \ - __low += __rem << 16; \ - __rem = __low % (unsigned long)base; \ - __low = __low / (unsigned long)base; \ - n = __low + (__low2 << 16) + (__high << 32); \ - } else { \ - __rem = __low % (unsigned long)base; \ - n = (__low / (unsigned long)base); \ - } \ - __rem; \ +/* We're not 64-bit, but... */ +#define do_div(n,base) \ +({ \ + int __res; \ + __res = ((unsigned long)n) % (unsigned int)base; \ + n = ((unsigned long)n) / (unsigned int)base; \ + __res; \ }) #endif diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index 96dc9883de56..7e2192902fca 100644 --- a/include/asm-arm/io.h +++ b/include/asm-arm/io.h @@ -42,10 +42,6 @@ extern void insl(unsigned int port, void *from, int len); #ifdef __KERNEL__ -#ifndef NULL -#define NULL ((void *) 0) -#endif - #include extern __inline__ unsigned long virt_to_phys(volatile void *x) @@ -86,6 +82,14 @@ extern void _memcpy_fromio(void *, unsigned long, unsigned long); extern void _memcpy_toio(unsigned long, const void *, unsigned long); extern void _memset_io(unsigned long, int, unsigned long); +#define __raw_writeb(val,addr) __arch_putb(val,addr) +#define __raw_writew(val,addr) __arch_putw(val,addr) +#define __raw_writel(val,addr) __arch_putl(val,addr) + +#define __raw_readb(addr) __arch_getb(addr) +#define __raw_readw(addr) __arch_getw(addr) +#define __raw_readl(addr) __arch_getl(addr) + /* * If this architecture has PCI memory IO, then define the read/write * macros. @@ -151,11 +155,11 @@ out: #define isa_writew(val,addr) __arch_putw(val,__mem_isa(addr)) #define isa_writel(val,addr) __arch_putl(val,__mem_isa(addr)) #define isa_memset_io(a,b,c) _memset_io(__mem_isa(a),(b),(c)) -#define isa_memcpy_fromio(a,b,c) _memcpy_fromio((a),__mem_isa((b)),(c)) +#define isa_memcpy_fromio(a,b,c) _memcpy_fromio((a),__mem_isa(b),(c)) #define isa_memcpy_toio(a,b,c) _memcpy_toio(__mem_isa((a)),(b),(c)) #define isa_eth_io_copy_and_sum(a,b,c,d) \ - eth_copy_and_sum((a),__mem_isa((b),(c),(d)) + eth_copy_and_sum((a),__mem_isa(b),(c),(d)) static inline int isa_check_signature(unsigned long io_addr, const unsigned char *signature, diff --git a/include/asm-arm/iomd.h b/include/asm-arm/iomd.h index 299b4c5a089e..9726cd55ded0 100644 --- a/include/asm-arm/iomd.h +++ b/include/asm-arm/iomd.h @@ -11,7 +11,7 @@ #define IOMD_KARTRX __IOMD(0x004) #define IOMD_KCTRL __IOMD(0x008) -#ifdef CONFIG_ARCH_CL7500 +#ifdef CONFIG_ARCH_CLPS7500 #define IOMD_IOLINES __IOMD(0x00C) #endif @@ -20,6 +20,10 @@ #define IOMD_IRQCLRA __IOMD(0x014) #define IOMD_IRQMASKA __IOMD(0x018) +#ifdef CONFIG_ARCH_CLPS7500 +#define IOMD_SUSMODE __IOMD(0x01C) +#endif + #define IOMD_IRQSTATB __IOMD(0x020) #define IOMD_IRQREQB __IOMD(0x024) #define IOMD_IRQMASKB __IOMD(0x028) @@ -28,6 +32,10 @@ #define IOMD_FIQREQ __IOMD(0x034) #define IOMD_FIQMASK __IOMD(0x038) +#ifdef CONFIG_ARCH_CLPS7500 +#define IOMD_CLKCTL __IOMD(0x03C) +#endif + #define IOMD_T0CNTL __IOMD(0x040) #define IOMD_T0LTCHL __IOMD(0x040) #define IOMD_T0CNTH __IOMD(0x044) @@ -42,7 +50,7 @@ #define IOMD_T1GO __IOMD(0x058) #define IOMD_T1LATCH __IOMD(0x05c) -#ifdef CONFIG_ARCH_CL7500 +#ifdef CONFIG_ARCH_CLPS7500 #define IOMD_IRQSTATC __IOMD(0x060) #define IOMD_IRQREQC __IOMD(0x064) #define IOMD_IRQMASKC __IOMD(0x068) @@ -59,7 +67,7 @@ #ifdef CONFIG_ARCH_RPC #define IOMD_DRAMCR __IOMD(0x088) #endif -#define IOMD_VREFCR __IOMD(0x08C) +#define IOMD_REFCR __IOMD(0x08C) #define IOMD_FSIZE __IOMD(0x090) #define IOMD_ID0 __IOMD(0x094) @@ -71,7 +79,7 @@ #define IOMD_MOUSEY __IOMD(0x0A4) #endif -#ifdef CONFIG_ARCH_CL7500 +#ifdef CONFIG_ARCH_CLPS7500 #define IOMD_MSEDAT __IOMD(0x0A8) #define IOMD_MSECTL __IOMD(0x0Ac) #endif @@ -84,7 +92,7 @@ #ifdef CONFIG_ARCH_RPC #define IOMD_DMAEXT __IOMD(0x0CC) #endif -#ifdef CONFIG_ARCH_CL7500 +#ifdef CONFIG_ARCH_CLPS7500 #define IOMD_ASTCR __IOMD(0x0CC) #define IOMD_DRAMCR __IOMD(0x0D0) #define IOMD_SELFREF __IOMD(0x0D4) diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h index 7ea5157ec6e9..f46fadbb8a58 100644 --- a/include/asm-arm/page.h +++ b/include/asm-arm/page.h @@ -69,9 +69,9 @@ extern void __bug(const char *file, int line, void *data); #include -#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET) -#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET)) -#define MAP_NR(addr) (((unsigned long)(addr) - PAGE_OFFSET) >> PAGE_SHIFT) +#define __pa(x) __virt_to_phys((unsigned long)(x)) +#define __va(x) ((void *)__phys_to_virt((unsigned long)(x))) +#define MAP_NR(addr) ((__pa(addr) - PHYS_OFFSET) >> PAGE_SHIFT) #endif diff --git a/include/asm-arm/posix_types.h b/include/asm-arm/posix_types.h index 284c7f6ffe1e..bb383ff4ea9e 100644 --- a/include/asm-arm/posix_types.h +++ b/include/asm-arm/posix_types.h @@ -9,6 +9,10 @@ #ifndef __ARCH_ARM_POSIX_TYPES_H #define __ARCH_ARM_POSIX_TYPES_H +#if defined(__KERNEL__) +#include +#endif /* __KERNEL__ */ + /* * This file is generally used by user-level software, so you need to * be a little careful about namespace pollution etc. Also, we cannot @@ -37,11 +41,10 @@ typedef unsigned short __kernel_gid16_t; typedef unsigned int __kernel_uid32_t; typedef unsigned int __kernel_gid32_t; -#ifdef __KERNEL__ -#define UID16_COMPAT_NEEDED +#if defined(__KERNEL__) && defined(CONFIG_UID16) typedef unsigned short __kernel_old_uid_t; typedef unsigned short __kernel_old_gid_t; -#endif /* __KERNEL__ */ +#endif /* __KERNEL__ && CONFIG_UID16 */ #ifdef __GNUC__ typedef long long __kernel_loff_t; diff --git a/include/asm-arm/proc-armv/uncompress.h b/include/asm-arm/proc-armv/uncompress.h index acce2de35e44..e67566d5d40b 100644 --- a/include/asm-arm/proc-armv/uncompress.h +++ b/include/asm-arm/proc-armv/uncompress.h @@ -11,7 +11,7 @@ static inline void proc_decomp_setup (void) eor r0, r0, #0x44 << 24 eor r0, r0, #0x01 << 16 eor r0, r0, #0xA1 << 8 - movs r0, r0, lsr #4 + movs r0, r0, lsr #5 mcreq p15, 0, r0, c7, c5, 0 @ flush I cache mrceq p15, 0, r0, c1, c0 orreq r0, r0, #1 << 12 diff --git a/include/asm-arm/proc-fns.h b/include/asm-arm/proc-fns.h index 6bbe53e7c7fa..703f653b8f5c 100644 --- a/include/asm-arm/proc-fns.h +++ b/include/asm-arm/proc-fns.h @@ -47,6 +47,14 @@ # define CPU_NAME sa110 # endif # endif +# ifdef CONFIG_CPU_SA1100 +# ifdef CPU_NAME +# undef MULTI_CPU +# define MULTI_CPU +# else +# define CPU_NAME sa1100 +# endif +# endif #endif #ifndef MULTI_CPU diff --git a/include/asm-arm/sigcontext.h b/include/asm-arm/sigcontext.h index 6ce49457fd29..fc0b80b6a6fc 100644 --- a/include/asm-arm/sigcontext.h +++ b/include/asm-arm/sigcontext.h @@ -27,6 +27,7 @@ struct sigcontext { unsigned long arm_lr; unsigned long arm_pc; unsigned long arm_cpsr; + unsigned long fault_address; }; diff --git a/include/asm-arm/stat.h b/include/asm-arm/stat.h index 970e0eb62565..5346b0223687 100644 --- a/include/asm-arm/stat.h +++ b/include/asm-arm/stat.h @@ -38,5 +38,40 @@ struct stat { unsigned long __unused5; }; -/* Someone please add a glibc/arm compatible stat64 struct here. */ +/* This matches struct stat64 in glibc2.1, hence the absolutely + * insane amounts of padding around dev_t's. + */ +struct stat64 { + unsigned short st_dev; + unsigned char __pad0[10]; + + unsigned long st_ino; + unsigned int st_mode; + unsigned int st_nlink; + + unsigned long st_uid; + unsigned long st_gid; + + unsigned short st_rdev; + unsigned char __pad3[10]; + + long long st_size; + unsigned long st_blksize; + + unsigned long st_blocks; /* Number 512-byte blocks allocated. */ + unsigned long __pad4; /* future possible st_blocks high bits */ + + unsigned long st_atime; + unsigned long __pad5; + + unsigned long st_mtime; + unsigned long __pad6; + + unsigned long st_ctime; + unsigned long __pad7; /* will be high 32 bits of ctime someday */ + + unsigned long __unused1; + unsigned long __unused2; +}; + #endif diff --git a/include/asm-arm/string.h b/include/asm-arm/string.h index 5d631341e82e..72b89fa70e4e 100644 --- a/include/asm-arm/string.h +++ b/include/asm-arm/string.h @@ -19,7 +19,6 @@ extern char * strchr(const char * s, int c); #define __HAVE_ARCH_MEMSET extern void __memzero(void *ptr, __kernel_size_t n); -extern void __memset(void *ptr, int v, __kernel_size_t n); #define memset(p,v,n) \ ({ \ @@ -27,7 +26,7 @@ extern void __memset(void *ptr, int v, __kernel_size_t n); if (__builtin_constant_p((v)) && (v) == 0) \ __memzero((p),(n)); \ else \ - __memset((p),(v),(n)); \ + memset((p),(v),(n)); \ } \ (p); \ }) diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index 8725ad8066ab..9c9b95d8ae01 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h @@ -42,6 +42,7 @@ extern unsigned int __machine_arch_type; #define MACH_TYPE_LACIE_NAS 13 #define MACH_TYPE_CLPS7500 14 #define MACH_TYPE_SHARK 15 +#define MACH_TYPE_SA1100 16 /* * Sort out a definition for machine_arch_type @@ -124,6 +125,18 @@ extern unsigned int __machine_arch_type; # define machine_is_co285() (0) #endif +#ifdef CONFIG_ARCH_SA1100 +# ifdef machine_arch_type +# undef machine_arch_type +# define machine_arch_type __machine_arch_type +# else +# define machine_arch_type MACH_TYPE_SA1100 +# endif +# define machine_is_sa1100() (machine_arch_type == MACH_TYPE_SA1100 +#else +# define machine_is_sa1100() (0) +#endif + #ifndef machine_arch_type #define machine_arch_type __machine_arch_type #endif diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h index 95d6384431e2..ca6da3e13207 100644 --- a/include/asm-arm/unistd.h +++ b/include/asm-arm/unistd.h @@ -7,7 +7,6 @@ * This file contains the system call numbers. */ -#define __NR_setup (__NR_SYSCALL_BASE+ 0) /* used only by init, to get system going */ #define __NR_exit (__NR_SYSCALL_BASE+ 1) #define __NR_fork (__NR_SYSCALL_BASE+ 2) #define __NR_read (__NR_SYSCALL_BASE+ 3) @@ -25,7 +24,7 @@ #define __NR_chmod (__NR_SYSCALL_BASE+ 15) #define __NR_lchown (__NR_SYSCALL_BASE+ 16) #define __NR_break (__NR_SYSCALL_BASE+ 17) -#define __NR_oldstat (__NR_SYSCALL_BASE+ 18) + #define __NR_lseek (__NR_SYSCALL_BASE+ 19) #define __NR_getpid (__NR_SYSCALL_BASE+ 20) #define __NR_mount (__NR_SYSCALL_BASE+ 21) @@ -35,7 +34,7 @@ #define __NR_stime (__NR_SYSCALL_BASE+ 25) #define __NR_ptrace (__NR_SYSCALL_BASE+ 26) #define __NR_alarm (__NR_SYSCALL_BASE+ 27) -#define __NR_oldfstat (__NR_SYSCALL_BASE+ 28) + #define __NR_pause (__NR_SYSCALL_BASE+ 29) #define __NR_utime (__NR_SYSCALL_BASE+ 30) #define __NR_stty (__NR_SYSCALL_BASE+ 31) @@ -83,7 +82,7 @@ #define __NR_sigpending (__NR_SYSCALL_BASE+ 73) #define __NR_sethostname (__NR_SYSCALL_BASE+ 74) #define __NR_setrlimit (__NR_SYSCALL_BASE+ 75) -#define __NR_old_getrlimit (__NR_SYSCALL_BASE+ 76) +#define __NR_old_getrlimit (__NR_SYSCALL_BASE+ 76) /* Back compat 2GB limited rlimit */ #define __NR_getrusage (__NR_SYSCALL_BASE+ 77) #define __NR_gettimeofday (__NR_SYSCALL_BASE+ 78) #define __NR_settimeofday (__NR_SYSCALL_BASE+ 79) @@ -91,7 +90,7 @@ #define __NR_setgroups (__NR_SYSCALL_BASE+ 81) #define __NR_select (__NR_SYSCALL_BASE+ 82) #define __NR_symlink (__NR_SYSCALL_BASE+ 83) -#define __NR_oldlstat (__NR_SYSCALL_BASE+ 84) + #define __NR_readlink (__NR_SYSCALL_BASE+ 85) #define __NR_uselib (__NR_SYSCALL_BASE+ 86) #define __NR_swapon (__NR_SYSCALL_BASE+ 87) @@ -198,7 +197,7 @@ /* 188 reserved */ /* 189 reserved */ #define __NR_vfork (__NR_SYSCALL_BASE+190) -#define __NR_getrlimit (__NR_SYSCALL_BASE+191) +#define __NR_getrlimit (__NR_SYSCALL_BASE+191) /* SuS compliant getrlimit */ #define __NR_mmap2 (__NR_SYSCALL_BASE+192) #define __NR_truncate64 (__NR_SYSCALL_BASE+193) #define __NR_ftruncate64 (__NR_SYSCALL_BASE+194) diff --git a/include/asm-i386/posix_types.h b/include/asm-i386/posix_types.h index a2a4e32bc5b7..071373138202 100644 --- a/include/asm-i386/posix_types.h +++ b/include/asm-i386/posix_types.h @@ -1,6 +1,10 @@ #ifndef __ARCH_I386_POSIX_TYPES_H #define __ARCH_I386_POSIX_TYPES_H +#if defined(__KERNEL__) +#include +#endif /* __KERNEL__ */ + /* * This file is generally used by user-level software, so you need to * be a little careful about namespace pollution etc. Also, we cannot @@ -29,8 +33,7 @@ typedef unsigned short __kernel_gid16_t; typedef unsigned int __kernel_uid32_t; typedef unsigned int __kernel_gid32_t; -#ifdef __KERNEL__ -#define UID16_COMPAT_NEEDED +#if defined(__KERNEL__) && defined(CONFIG_UID16) typedef unsigned short __kernel_old_uid_t; typedef unsigned short __kernel_old_gid_t; #endif /* __KERNEL__ */ diff --git a/include/asm-m68k/posix_types.h b/include/asm-m68k/posix_types.h index 8e2bfff70734..60718fdea9a1 100644 --- a/include/asm-m68k/posix_types.h +++ b/include/asm-m68k/posix_types.h @@ -1,6 +1,10 @@ #ifndef __ARCH_M68K_POSIX_TYPES_H #define __ARCH_M68K_POSIX_TYPES_H +#if defined(__KERNEL__) +#include +#endif /* __KERNEL__ */ + /* * This file is generally used by user-level software, so you need to * be a little careful about namespace pollution etc. Also, we cannot @@ -29,8 +33,7 @@ typedef unsigned short __kernel_gid16_t; typedef unsigned int __kernel_uid32_t; typedef unsigned int __kernel_gid32_t; -#ifdef __KERNEL__ -#define UID16_COMPAT_NEEDED +#if defined(__KERNEL__) && defined(CONFIG_UID16) typedef unsigned short __kernel_old_uid_t; typedef unsigned short __kernel_old_gid_t; #endif /* __KERNEL__ */ diff --git a/include/asm-sparc/a.out.h b/include/asm-sparc/a.out.h index 25ddaf086515..e4e83eb0161e 100644 --- a/include/asm-sparc/a.out.h +++ b/include/asm-sparc/a.out.h @@ -1,4 +1,4 @@ -/* $Id: a.out.h,v 1.12 1998/02/05 14:20:00 jj Exp $ */ +/* $Id: a.out.h,v 1.13 2000/01/09 10:46:53 anton Exp $ */ #ifndef __SPARC_A_OUT_H__ #define __SPARC_A_OUT_H__ @@ -89,30 +89,9 @@ struct relocation_info /* used when header.a_machtype == M_SPARC */ #ifdef __KERNEL__ -#include -#include +#include -#ifdef CONFIG_SUN4 - -#define STACK_TOP (0xefffe000UL) - -#else - -extern unsigned long stack_top; - -# ifndef MODULE - - BTFIXUPDEF_SETHI_INIT(stack_top,0xeffff000) - -# define STACK_TOP ((unsigned long)BTFIXUP_SETHI(stack_top)) - -# else /* MODULE */ - -# define STACK_TOP (stack_top) - -# endif /* MODULE */ - -#endif /* !CONFIG_SUN4 */ +#define STACK_TOP (PAGE_OFFSET - PAGE_SIZE) #endif /* __KERNEL__ */ diff --git a/include/asm-sparc/asm_offsets.h b/include/asm-sparc/asm_offsets.h index 1eda0d28069b..58f26364cd22 100644 --- a/include/asm-sparc/asm_offsets.h +++ b/include/asm-sparc/asm_offsets.h @@ -18,168 +18,174 @@ #define ASIZ_task_exec_domain 0x00000004 #define AOFF_task_need_resched 0x00000014 #define ASIZ_task_need_resched 0x00000004 -#define AOFF_task_counter 0x00000018 +#define AOFF_task_avg_slice 0x00000018 +#define ASIZ_task_avg_slice 0x00000004 +#define AOFF_task_lock_depth 0x0000001c +#define ASIZ_task_lock_depth 0x00000004 +#define AOFF_task_counter 0x00000020 #define ASIZ_task_counter 0x00000004 -#define AOFF_task_priority 0x0000001c +#define AOFF_task_priority 0x00000024 #define ASIZ_task_priority 0x00000004 -#define AOFF_task_avg_slice 0x00000020 -#define ASIZ_task_avg_slice 0x00000004 -#define AOFF_task_has_cpu 0x00000024 +#define AOFF_task_policy 0x00000028 +#define ASIZ_task_policy 0x00000004 +#define AOFF_task_mm 0x0000002c +#define ASIZ_task_mm 0x00000004 +#define AOFF_task_active_mm 0x00000030 +#define ASIZ_task_active_mm 0x00000004 +#define AOFF_task_has_cpu 0x00000034 #define ASIZ_task_has_cpu 0x00000004 -#define AOFF_task_processor 0x00000028 +#define AOFF_task_processor 0x00000038 #define ASIZ_task_processor 0x00000004 -#define AOFF_task_last_processor 0x0000002c -#define ASIZ_task_last_processor 0x00000004 -#define AOFF_task_lock_depth 0x00000030 -#define ASIZ_task_lock_depth 0x00000004 -#define AOFF_task_next_task 0x00000034 -#define ASIZ_task_next_task 0x00000004 -#define AOFF_task_prev_task 0x00000038 -#define ASIZ_task_prev_task 0x00000004 #define AOFF_task_run_list 0x0000003c #define ASIZ_task_run_list 0x00000008 -#define AOFF_task_binfmt 0x00000044 +#define AOFF_task_next_task 0x00000044 +#define ASIZ_task_next_task 0x00000004 +#define AOFF_task_prev_task 0x00000048 +#define ASIZ_task_prev_task 0x00000004 +#define AOFF_task_last_processor 0x0000004c +#define ASIZ_task_last_processor 0x00000004 +#define AOFF_task_binfmt 0x00000050 #define ASIZ_task_binfmt 0x00000004 -#define AOFF_task_exit_code 0x00000048 +#define AOFF_task_exit_code 0x00000054 #define ASIZ_task_exit_code 0x00000004 -#define AOFF_task_exit_signal 0x0000004c +#define AOFF_task_exit_signal 0x00000058 #define ASIZ_task_exit_signal 0x00000004 -#define AOFF_task_pdeath_signal 0x00000050 +#define AOFF_task_pdeath_signal 0x0000005c #define ASIZ_task_pdeath_signal 0x00000004 -#define AOFF_task_personality 0x00000054 +#define AOFF_task_personality 0x00000060 #define ASIZ_task_personality 0x00000004 -#define AOFF_task_pid 0x0000005c +#define AOFF_task_pid 0x00000068 #define ASIZ_task_pid 0x00000004 -#define AOFF_task_pgrp 0x00000060 +#define AOFF_task_pgrp 0x0000006c #define ASIZ_task_pgrp 0x00000004 -#define AOFF_task_tty_old_pgrp 0x00000064 +#define AOFF_task_tty_old_pgrp 0x00000070 #define ASIZ_task_tty_old_pgrp 0x00000004 -#define AOFF_task_session 0x00000068 +#define AOFF_task_session 0x00000074 #define ASIZ_task_session 0x00000004 -#define AOFF_task_leader 0x0000006c +#define AOFF_task_leader 0x00000078 #define ASIZ_task_leader 0x00000004 -#define AOFF_task_p_opptr 0x00000070 +#define AOFF_task_p_opptr 0x0000007c #define ASIZ_task_p_opptr 0x00000004 -#define AOFF_task_p_pptr 0x00000074 +#define AOFF_task_p_pptr 0x00000080 #define ASIZ_task_p_pptr 0x00000004 -#define AOFF_task_p_cptr 0x00000078 +#define AOFF_task_p_cptr 0x00000084 #define ASIZ_task_p_cptr 0x00000004 -#define AOFF_task_p_ysptr 0x0000007c +#define AOFF_task_p_ysptr 0x00000088 #define ASIZ_task_p_ysptr 0x00000004 -#define AOFF_task_p_osptr 0x00000080 +#define AOFF_task_p_osptr 0x0000008c #define ASIZ_task_p_osptr 0x00000004 -#define AOFF_task_pidhash_next 0x00000084 +#define AOFF_task_pidhash_next 0x00000090 #define ASIZ_task_pidhash_next 0x00000004 -#define AOFF_task_pidhash_pprev 0x00000088 +#define AOFF_task_pidhash_pprev 0x00000094 #define ASIZ_task_pidhash_pprev 0x00000004 -#define AOFF_task_wait_chldexit 0x0000008c +#define AOFF_task_wait_chldexit 0x00000098 #define ASIZ_task_wait_chldexit 0x00000010 -#define AOFF_task_vfork_sem 0x0000009c +#define AOFF_task_vfork_sem 0x000000a8 #define ASIZ_task_vfork_sem 0x00000004 -#define AOFF_task_policy 0x000000a0 -#define ASIZ_task_policy 0x00000004 -#define AOFF_task_rt_priority 0x000000a4 +#define AOFF_task_rt_priority 0x000000ac #define ASIZ_task_rt_priority 0x00000004 -#define AOFF_task_it_real_value 0x000000a8 +#define AOFF_task_it_real_value 0x000000b0 #define ASIZ_task_it_real_value 0x00000004 -#define AOFF_task_it_prof_value 0x000000ac +#define AOFF_task_it_prof_value 0x000000b4 #define ASIZ_task_it_prof_value 0x00000004 -#define AOFF_task_it_virt_value 0x000000b0 +#define AOFF_task_it_virt_value 0x000000b8 #define ASIZ_task_it_virt_value 0x00000004 -#define AOFF_task_it_real_incr 0x000000b4 +#define AOFF_task_it_real_incr 0x000000bc #define ASIZ_task_it_real_incr 0x00000004 -#define AOFF_task_it_prof_incr 0x000000b8 +#define AOFF_task_it_prof_incr 0x000000c0 #define ASIZ_task_it_prof_incr 0x00000004 -#define AOFF_task_it_virt_incr 0x000000bc +#define AOFF_task_it_virt_incr 0x000000c4 #define ASIZ_task_it_virt_incr 0x00000004 -#define AOFF_task_real_timer 0x000000c0 +#define AOFF_task_real_timer 0x000000c8 #define ASIZ_task_real_timer 0x00000014 -#define AOFF_task_times 0x000000d4 +#define AOFF_task_times 0x000000dc #define ASIZ_task_times 0x00000010 -#define AOFF_task_start_time 0x000000e4 +#define AOFF_task_start_time 0x000000ec #define ASIZ_task_start_time 0x00000004 -#define AOFF_task_per_cpu_utime 0x000000e8 +#define AOFF_task_per_cpu_utime 0x000000f0 #define ASIZ_task_per_cpu_utime 0x00000004 -#define AOFF_task_min_flt 0x000000f0 +#define AOFF_task_min_flt 0x000000f8 #define ASIZ_task_min_flt 0x00000004 -#define AOFF_task_maj_flt 0x000000f4 +#define AOFF_task_maj_flt 0x000000fc #define ASIZ_task_maj_flt 0x00000004 -#define AOFF_task_nswap 0x000000f8 +#define AOFF_task_nswap 0x00000100 #define ASIZ_task_nswap 0x00000004 -#define AOFF_task_cmin_flt 0x000000fc +#define AOFF_task_cmin_flt 0x00000104 #define ASIZ_task_cmin_flt 0x00000004 -#define AOFF_task_cmaj_flt 0x00000100 +#define AOFF_task_cmaj_flt 0x00000108 #define ASIZ_task_cmaj_flt 0x00000004 -#define AOFF_task_cnswap 0x00000104 +#define AOFF_task_cnswap 0x0000010c #define ASIZ_task_cnswap 0x00000004 -#define AOFF_task_uid 0x0000010a -#define ASIZ_task_uid 0x00000002 -#define AOFF_task_euid 0x0000010c -#define ASIZ_task_euid 0x00000002 -#define AOFF_task_suid 0x0000010e -#define ASIZ_task_suid 0x00000002 -#define AOFF_task_fsuid 0x00000110 -#define ASIZ_task_fsuid 0x00000002 -#define AOFF_task_gid 0x00000112 -#define ASIZ_task_gid 0x00000002 -#define AOFF_task_egid 0x00000114 -#define ASIZ_task_egid 0x00000002 -#define AOFF_task_sgid 0x00000116 -#define ASIZ_task_sgid 0x00000002 -#define AOFF_task_fsgid 0x00000118 -#define ASIZ_task_fsgid 0x00000002 -#define AOFF_task_ngroups 0x0000011c +#define AOFF_task_uid 0x00000114 +#define ASIZ_task_uid 0x00000004 +#define AOFF_task_euid 0x00000118 +#define ASIZ_task_euid 0x00000004 +#define AOFF_task_suid 0x0000011c +#define ASIZ_task_suid 0x00000004 +#define AOFF_task_fsuid 0x00000120 +#define ASIZ_task_fsuid 0x00000004 +#define AOFF_task_gid 0x00000124 +#define ASIZ_task_gid 0x00000004 +#define AOFF_task_egid 0x00000128 +#define ASIZ_task_egid 0x00000004 +#define AOFF_task_sgid 0x0000012c +#define ASIZ_task_sgid 0x00000004 +#define AOFF_task_fsgid 0x00000130 +#define ASIZ_task_fsgid 0x00000004 +#define AOFF_task_ngroups 0x00000134 #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x00000120 -#define ASIZ_task_groups 0x00000040 -#define AOFF_task_cap_effective 0x00000160 +#define AOFF_task_groups 0x00000138 +#define ASIZ_task_groups 0x00000080 +#define AOFF_task_cap_effective 0x000001b8 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x00000164 +#define AOFF_task_cap_inheritable 0x000001bc #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x00000168 +#define AOFF_task_cap_permitted 0x000001c0 #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_user 0x0000016c +#define AOFF_task_user 0x000001c4 #define ASIZ_task_user 0x00000004 -#define AOFF_task_rlim 0x00000170 +#define AOFF_task_rlim 0x000001c8 #define ASIZ_task_rlim 0x00000050 -#define AOFF_task_used_math 0x000001c0 +#define AOFF_task_used_math 0x00000218 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x000001c2 +#define AOFF_task_comm 0x0000021a #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x000001d4 +#define AOFF_task_link_count 0x0000022c #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x000001d8 +#define AOFF_task_tty 0x00000230 #define ASIZ_task_tty 0x00000004 -#define AOFF_task_semundo 0x000001dc +#define AOFF_task_semundo 0x00000234 #define ASIZ_task_semundo 0x00000004 -#define AOFF_task_semsleeping 0x000001e0 +#define AOFF_task_semsleeping 0x00000238 #define ASIZ_task_semsleeping 0x00000004 -#define AOFF_task_thread 0x000001e8 +#define AOFF_task_thread 0x00000240 #define ASIZ_task_thread 0x00000388 -#define AOFF_task_fs 0x00000570 +#define AOFF_task_fs 0x000005c8 #define ASIZ_task_fs 0x00000004 -#define AOFF_task_files 0x00000574 +#define AOFF_task_files 0x000005cc #define ASIZ_task_files 0x00000004 -#define AOFF_task_mm 0x00000578 -#define ASIZ_task_mm 0x00000004 -#define AOFF_task_active_mm 0x0000057c -#define ASIZ_task_active_mm 0x00000004 -#define AOFF_task_sigmask_lock 0x00000580 +#define AOFF_task_sigmask_lock 0x000005d0 #define ASIZ_task_sigmask_lock 0x00000000 -#define AOFF_task_sig 0x00000580 +#define AOFF_task_sig 0x000005d0 #define ASIZ_task_sig 0x00000004 -#define AOFF_task_signal 0x00000584 +#define AOFF_task_signal 0x000005d4 #define ASIZ_task_signal 0x00000008 -#define AOFF_task_blocked 0x0000058c +#define AOFF_task_blocked 0x000005dc #define ASIZ_task_blocked 0x00000008 -#define AOFF_task_sigqueue 0x00000594 +#define AOFF_task_sigqueue 0x000005e4 #define ASIZ_task_sigqueue 0x00000004 -#define AOFF_task_sigqueue_tail 0x00000598 +#define AOFF_task_sigqueue_tail 0x000005e8 #define ASIZ_task_sigqueue_tail 0x00000004 -#define AOFF_task_sas_ss_sp 0x0000059c +#define AOFF_task_sas_ss_sp 0x000005ec #define ASIZ_task_sas_ss_sp 0x00000004 -#define AOFF_task_sas_ss_size 0x000005a0 +#define AOFF_task_sas_ss_size 0x000005f0 #define ASIZ_task_sas_ss_size 0x00000004 +#define AOFF_task_parent_exec_id 0x000005f4 +#define ASIZ_task_parent_exec_id 0x00000004 +#define AOFF_task_self_exec_id 0x000005f8 +#define ASIZ_task_self_exec_id 0x00000004 +#define AOFF_task_exit_sem 0x000005fc +#define ASIZ_task_exit_sem 0x0000001c #define AOFF_mm_mmap 0x00000000 #define ASIZ_mm_mmap 0x00000004 #define AOFF_mm_mmap_avl 0x00000004 @@ -280,6 +286,8 @@ #define ASIZ_thread_core_exec 0x00000020 #define AOFF_thread_new_signal 0x00000380 #define ASIZ_thread_new_signal 0x00000004 +#define AOFF_thread_refcount 0x00000384 +#define ASIZ_thread_refcount 0x00000004 #else /* CONFIG_SMP */ @@ -295,168 +303,174 @@ #define ASIZ_task_exec_domain 0x00000004 #define AOFF_task_need_resched 0x00000014 #define ASIZ_task_need_resched 0x00000004 -#define AOFF_task_counter 0x00000018 +#define AOFF_task_avg_slice 0x00000018 +#define ASIZ_task_avg_slice 0x00000004 +#define AOFF_task_lock_depth 0x0000001c +#define ASIZ_task_lock_depth 0x00000004 +#define AOFF_task_counter 0x00000020 #define ASIZ_task_counter 0x00000004 -#define AOFF_task_priority 0x0000001c +#define AOFF_task_priority 0x00000024 #define ASIZ_task_priority 0x00000004 -#define AOFF_task_avg_slice 0x00000020 -#define ASIZ_task_avg_slice 0x00000004 -#define AOFF_task_has_cpu 0x00000024 +#define AOFF_task_policy 0x00000028 +#define ASIZ_task_policy 0x00000004 +#define AOFF_task_mm 0x0000002c +#define ASIZ_task_mm 0x00000004 +#define AOFF_task_active_mm 0x00000030 +#define ASIZ_task_active_mm 0x00000004 +#define AOFF_task_has_cpu 0x00000034 #define ASIZ_task_has_cpu 0x00000004 -#define AOFF_task_processor 0x00000028 +#define AOFF_task_processor 0x00000038 #define ASIZ_task_processor 0x00000004 -#define AOFF_task_last_processor 0x0000002c -#define ASIZ_task_last_processor 0x00000004 -#define AOFF_task_lock_depth 0x00000030 -#define ASIZ_task_lock_depth 0x00000004 -#define AOFF_task_next_task 0x00000034 -#define ASIZ_task_next_task 0x00000004 -#define AOFF_task_prev_task 0x00000038 -#define ASIZ_task_prev_task 0x00000004 #define AOFF_task_run_list 0x0000003c #define ASIZ_task_run_list 0x00000008 -#define AOFF_task_binfmt 0x00000044 +#define AOFF_task_next_task 0x00000044 +#define ASIZ_task_next_task 0x00000004 +#define AOFF_task_prev_task 0x00000048 +#define ASIZ_task_prev_task 0x00000004 +#define AOFF_task_last_processor 0x0000004c +#define ASIZ_task_last_processor 0x00000004 +#define AOFF_task_binfmt 0x00000050 #define ASIZ_task_binfmt 0x00000004 -#define AOFF_task_exit_code 0x00000048 +#define AOFF_task_exit_code 0x00000054 #define ASIZ_task_exit_code 0x00000004 -#define AOFF_task_exit_signal 0x0000004c +#define AOFF_task_exit_signal 0x00000058 #define ASIZ_task_exit_signal 0x00000004 -#define AOFF_task_pdeath_signal 0x00000050 +#define AOFF_task_pdeath_signal 0x0000005c #define ASIZ_task_pdeath_signal 0x00000004 -#define AOFF_task_personality 0x00000054 +#define AOFF_task_personality 0x00000060 #define ASIZ_task_personality 0x00000004 -#define AOFF_task_pid 0x0000005c +#define AOFF_task_pid 0x00000068 #define ASIZ_task_pid 0x00000004 -#define AOFF_task_pgrp 0x00000060 +#define AOFF_task_pgrp 0x0000006c #define ASIZ_task_pgrp 0x00000004 -#define AOFF_task_tty_old_pgrp 0x00000064 +#define AOFF_task_tty_old_pgrp 0x00000070 #define ASIZ_task_tty_old_pgrp 0x00000004 -#define AOFF_task_session 0x00000068 +#define AOFF_task_session 0x00000074 #define ASIZ_task_session 0x00000004 -#define AOFF_task_leader 0x0000006c +#define AOFF_task_leader 0x00000078 #define ASIZ_task_leader 0x00000004 -#define AOFF_task_p_opptr 0x00000070 +#define AOFF_task_p_opptr 0x0000007c #define ASIZ_task_p_opptr 0x00000004 -#define AOFF_task_p_pptr 0x00000074 +#define AOFF_task_p_pptr 0x00000080 #define ASIZ_task_p_pptr 0x00000004 -#define AOFF_task_p_cptr 0x00000078 +#define AOFF_task_p_cptr 0x00000084 #define ASIZ_task_p_cptr 0x00000004 -#define AOFF_task_p_ysptr 0x0000007c +#define AOFF_task_p_ysptr 0x00000088 #define ASIZ_task_p_ysptr 0x00000004 -#define AOFF_task_p_osptr 0x00000080 +#define AOFF_task_p_osptr 0x0000008c #define ASIZ_task_p_osptr 0x00000004 -#define AOFF_task_pidhash_next 0x00000084 +#define AOFF_task_pidhash_next 0x00000090 #define ASIZ_task_pidhash_next 0x00000004 -#define AOFF_task_pidhash_pprev 0x00000088 +#define AOFF_task_pidhash_pprev 0x00000094 #define ASIZ_task_pidhash_pprev 0x00000004 -#define AOFF_task_wait_chldexit 0x0000008c +#define AOFF_task_wait_chldexit 0x00000098 #define ASIZ_task_wait_chldexit 0x00000018 -#define AOFF_task_vfork_sem 0x000000a4 +#define AOFF_task_vfork_sem 0x000000b0 #define ASIZ_task_vfork_sem 0x00000004 -#define AOFF_task_policy 0x000000a8 -#define ASIZ_task_policy 0x00000004 -#define AOFF_task_rt_priority 0x000000ac +#define AOFF_task_rt_priority 0x000000b4 #define ASIZ_task_rt_priority 0x00000004 -#define AOFF_task_it_real_value 0x000000b0 +#define AOFF_task_it_real_value 0x000000b8 #define ASIZ_task_it_real_value 0x00000004 -#define AOFF_task_it_prof_value 0x000000b4 +#define AOFF_task_it_prof_value 0x000000bc #define ASIZ_task_it_prof_value 0x00000004 -#define AOFF_task_it_virt_value 0x000000b8 +#define AOFF_task_it_virt_value 0x000000c0 #define ASIZ_task_it_virt_value 0x00000004 -#define AOFF_task_it_real_incr 0x000000bc +#define AOFF_task_it_real_incr 0x000000c4 #define ASIZ_task_it_real_incr 0x00000004 -#define AOFF_task_it_prof_incr 0x000000c0 +#define AOFF_task_it_prof_incr 0x000000c8 #define ASIZ_task_it_prof_incr 0x00000004 -#define AOFF_task_it_virt_incr 0x000000c4 +#define AOFF_task_it_virt_incr 0x000000cc #define ASIZ_task_it_virt_incr 0x00000004 -#define AOFF_task_real_timer 0x000000c8 +#define AOFF_task_real_timer 0x000000d0 #define ASIZ_task_real_timer 0x00000014 -#define AOFF_task_times 0x000000dc +#define AOFF_task_times 0x000000e4 #define ASIZ_task_times 0x00000010 -#define AOFF_task_start_time 0x000000ec +#define AOFF_task_start_time 0x000000f4 #define ASIZ_task_start_time 0x00000004 -#define AOFF_task_per_cpu_utime 0x000000f0 +#define AOFF_task_per_cpu_utime 0x000000f8 #define ASIZ_task_per_cpu_utime 0x00000080 -#define AOFF_task_min_flt 0x000001f0 +#define AOFF_task_min_flt 0x000001f8 #define ASIZ_task_min_flt 0x00000004 -#define AOFF_task_maj_flt 0x000001f4 +#define AOFF_task_maj_flt 0x000001fc #define ASIZ_task_maj_flt 0x00000004 -#define AOFF_task_nswap 0x000001f8 +#define AOFF_task_nswap 0x00000200 #define ASIZ_task_nswap 0x00000004 -#define AOFF_task_cmin_flt 0x000001fc +#define AOFF_task_cmin_flt 0x00000204 #define ASIZ_task_cmin_flt 0x00000004 -#define AOFF_task_cmaj_flt 0x00000200 +#define AOFF_task_cmaj_flt 0x00000208 #define ASIZ_task_cmaj_flt 0x00000004 -#define AOFF_task_cnswap 0x00000204 +#define AOFF_task_cnswap 0x0000020c #define ASIZ_task_cnswap 0x00000004 -#define AOFF_task_uid 0x0000020a -#define ASIZ_task_uid 0x00000002 -#define AOFF_task_euid 0x0000020c -#define ASIZ_task_euid 0x00000002 -#define AOFF_task_suid 0x0000020e -#define ASIZ_task_suid 0x00000002 -#define AOFF_task_fsuid 0x00000210 -#define ASIZ_task_fsuid 0x00000002 -#define AOFF_task_gid 0x00000212 -#define ASIZ_task_gid 0x00000002 -#define AOFF_task_egid 0x00000214 -#define ASIZ_task_egid 0x00000002 -#define AOFF_task_sgid 0x00000216 -#define ASIZ_task_sgid 0x00000002 -#define AOFF_task_fsgid 0x00000218 -#define ASIZ_task_fsgid 0x00000002 -#define AOFF_task_ngroups 0x0000021c +#define AOFF_task_uid 0x00000214 +#define ASIZ_task_uid 0x00000004 +#define AOFF_task_euid 0x00000218 +#define ASIZ_task_euid 0x00000004 +#define AOFF_task_suid 0x0000021c +#define ASIZ_task_suid 0x00000004 +#define AOFF_task_fsuid 0x00000220 +#define ASIZ_task_fsuid 0x00000004 +#define AOFF_task_gid 0x00000224 +#define ASIZ_task_gid 0x00000004 +#define AOFF_task_egid 0x00000228 +#define ASIZ_task_egid 0x00000004 +#define AOFF_task_sgid 0x0000022c +#define ASIZ_task_sgid 0x00000004 +#define AOFF_task_fsgid 0x00000230 +#define ASIZ_task_fsgid 0x00000004 +#define AOFF_task_ngroups 0x00000234 #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x00000220 -#define ASIZ_task_groups 0x00000040 -#define AOFF_task_cap_effective 0x00000260 +#define AOFF_task_groups 0x00000238 +#define ASIZ_task_groups 0x00000080 +#define AOFF_task_cap_effective 0x000002b8 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x00000264 +#define AOFF_task_cap_inheritable 0x000002bc #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x00000268 +#define AOFF_task_cap_permitted 0x000002c0 #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_user 0x0000026c +#define AOFF_task_user 0x000002c4 #define ASIZ_task_user 0x00000004 -#define AOFF_task_rlim 0x00000270 +#define AOFF_task_rlim 0x000002c8 #define ASIZ_task_rlim 0x00000050 -#define AOFF_task_used_math 0x000002c0 +#define AOFF_task_used_math 0x00000318 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x000002c2 +#define AOFF_task_comm 0x0000031a #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x000002d4 +#define AOFF_task_link_count 0x0000032c #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x000002d8 +#define AOFF_task_tty 0x00000330 #define ASIZ_task_tty 0x00000004 -#define AOFF_task_semundo 0x000002dc +#define AOFF_task_semundo 0x00000334 #define ASIZ_task_semundo 0x00000004 -#define AOFF_task_semsleeping 0x000002e0 +#define AOFF_task_semsleeping 0x00000338 #define ASIZ_task_semsleeping 0x00000004 -#define AOFF_task_thread 0x000002e8 +#define AOFF_task_thread 0x00000340 #define ASIZ_task_thread 0x00000388 -#define AOFF_task_fs 0x00000670 +#define AOFF_task_fs 0x000006c8 #define ASIZ_task_fs 0x00000004 -#define AOFF_task_files 0x00000674 +#define AOFF_task_files 0x000006cc #define ASIZ_task_files 0x00000004 -#define AOFF_task_mm 0x00000678 -#define ASIZ_task_mm 0x00000004 -#define AOFF_task_active_mm 0x0000067c -#define ASIZ_task_active_mm 0x00000004 -#define AOFF_task_sigmask_lock 0x00000680 +#define AOFF_task_sigmask_lock 0x000006d0 #define ASIZ_task_sigmask_lock 0x00000008 -#define AOFF_task_sig 0x00000688 +#define AOFF_task_sig 0x000006d8 #define ASIZ_task_sig 0x00000004 -#define AOFF_task_signal 0x0000068c +#define AOFF_task_signal 0x000006dc #define ASIZ_task_signal 0x00000008 -#define AOFF_task_blocked 0x00000694 +#define AOFF_task_blocked 0x000006e4 #define ASIZ_task_blocked 0x00000008 -#define AOFF_task_sigqueue 0x0000069c +#define AOFF_task_sigqueue 0x000006ec #define ASIZ_task_sigqueue 0x00000004 -#define AOFF_task_sigqueue_tail 0x000006a0 +#define AOFF_task_sigqueue_tail 0x000006f0 #define ASIZ_task_sigqueue_tail 0x00000004 -#define AOFF_task_sas_ss_sp 0x000006a4 +#define AOFF_task_sas_ss_sp 0x000006f4 #define ASIZ_task_sas_ss_sp 0x00000004 -#define AOFF_task_sas_ss_size 0x000006a8 +#define AOFF_task_sas_ss_size 0x000006f8 #define ASIZ_task_sas_ss_size 0x00000004 +#define AOFF_task_parent_exec_id 0x000006fc +#define ASIZ_task_parent_exec_id 0x00000004 +#define AOFF_task_self_exec_id 0x00000700 +#define ASIZ_task_self_exec_id 0x00000004 +#define AOFF_task_exit_sem 0x00000704 +#define ASIZ_task_exit_sem 0x00000024 #define AOFF_mm_mmap 0x00000000 #define ASIZ_mm_mmap 0x00000004 #define AOFF_mm_mmap_avl 0x00000004 @@ -557,6 +571,8 @@ #define ASIZ_thread_core_exec 0x00000020 #define AOFF_thread_new_signal 0x00000380 #define ASIZ_thread_new_signal 0x00000004 +#define AOFF_thread_refcount 0x00000384 +#define ASIZ_thread_refcount 0x00000004 #endif /* CONFIG_SMP */ diff --git a/include/asm-sparc/ipcbuf.h b/include/asm-sparc/ipcbuf.h new file mode 100644 index 000000000000..9bef02d04e4b --- /dev/null +++ b/include/asm-sparc/ipcbuf.h @@ -0,0 +1,31 @@ +#ifndef _SPARC_IPCBUF_H +#define _SPARC_IPCBUF_H + +/* + * The ipc64_perm structure for sparc architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 32-bit mode + * - 32-bit seq + * - 2 miscellaneous 64-bit values (so that this structure matches + * sparc64 ipc64_perm) + */ + +struct ipc64_perm +{ + __kernel_key_t key; + __kernel_uid32_t uid; + __kernel_gid32_t gid; + __kernel_uid32_t cuid; + __kernel_gid32_t cgid; + unsigned short __pad1; + __kernel_mode_t mode; + unsigned short __pad2; + unsigned short seq; + unsigned long long __unused1; + unsigned long long __unused2; +}; + +#endif /* _SPARC_IPCBUF_H */ diff --git a/include/asm-sparc/msgbuf.h b/include/asm-sparc/msgbuf.h new file mode 100644 index 000000000000..8cec9ad0b825 --- /dev/null +++ b/include/asm-sparc/msgbuf.h @@ -0,0 +1,31 @@ +#ifndef _SPARC64_MSGBUF_H +#define _SPARC64_MSGBUF_H + +/* + * The msqid64_ds structure for sparc64 architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 64-bit time_t to solve y2038 problem + * - 2 miscellaneous 32-bit values + */ + +struct msqid64_ds { + struct ipc64_perm msg_perm; + unsigned int __pad1; + __kernel_time_t msg_stime; /* last msgsnd time */ + unsigned int __pad2; + __kernel_time_t msg_rtime; /* last msgrcv time */ + unsigned int __pad3; + __kernel_time_t msg_ctime; /* last change time */ + unsigned long msg_cbytes; /* current number of bytes on queue */ + unsigned long msg_qnum; /* number of messages in queue */ + unsigned long msg_qbytes; /* max number of bytes on queue */ + __kernel_pid_t msg_lspid; /* pid of last msgsnd */ + __kernel_pid_t msg_lrpid; /* last receive pid */ + unsigned long __unused1; + unsigned long __unused2; +}; + +#endif /* _SPARC64_MSGBUF_H */ diff --git a/include/asm-sparc/posix_types.h b/include/asm-sparc/posix_types.h index 4ec1751504c0..ec8ad3f747bd 100644 --- a/include/asm-sparc/posix_types.h +++ b/include/asm-sparc/posix_types.h @@ -7,13 +7,7 @@ * assume GCC is being used. */ -/* When cross-compilation is no longer an issue, fix this. */ -#if defined(__svr4__) || defined(__ELF__) typedef unsigned int __kernel_size_t; -#else -typedef long unsigned int __kernel_size_t; -#endif /* !(__svr4__ || __ELF__) */ - typedef int __kernel_ssize_t; typedef long int __kernel_ptrdiff_t; typedef long __kernel_time_t; @@ -31,6 +25,15 @@ typedef short __kernel_nlink_t; typedef long __kernel_daddr_t; typedef long __kernel_off_t; typedef char * __kernel_caddr_t; +typedef unsigned short __kernel_uid16_t; +typedef unsigned short __kernel_gid16_t; +typedef unsigned int __kernel_uid32_t; +typedef unsigned int __kernel_gid32_t; +#ifdef __KERNEL__ +#define UID16_COMPAT_NEEDED +typedef unsigned short __kernel_old_uid_t; +typedef unsigned short __kernel_old_gid_t; +#endif /* __KERNEL__ */ #ifdef __GNUC__ typedef long long __kernel_loff_t; diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h index 8505ce5d4900..a74493500b35 100644 --- a/include/asm-sparc/processor.h +++ b/include/asm-sparc/processor.h @@ -1,4 +1,4 @@ -/* $Id: processor.h,v 1.75 2000/01/07 20:21:42 davem Exp $ +/* $Id: processor.h,v 1.76 2000/01/09 09:13:38 anton Exp $ * include/asm-sparc/processor.h * * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu) @@ -22,6 +22,7 @@ #include #include #include +#include /* * Bus types @@ -88,6 +89,7 @@ struct thread_struct { mm_segment_t current_ds; struct exec core_exec; /* just what it says. */ int new_signal; + atomic_t refcount; /* used for sun4c only */ }; #define SPARC_FLAG_KTHREAD 0x1 /* task is a kernel thread */ @@ -201,11 +203,11 @@ extern struct task_struct *last_task_used_math; /* Allocation and freeing of basic task resources. */ BTFIXUPDEF_CALL(struct task_struct *, alloc_task_struct, void) BTFIXUPDEF_CALL(void, free_task_struct, struct task_struct *) +BTFIXUPDEF_CALL(void, get_task_struct, struct task_struct *) #define alloc_task_struct() BTFIXUP_CALL(alloc_task_struct)() #define free_task_struct(tsk) BTFIXUP_CALL(free_task_struct)(tsk) - -/* XXX Anton, here is where you implement get_task_struct et al. */ +#define get_task_struct(tsk) BTFIXUP_CALL(get_task_struct)(tsk) #define init_task (init_task_union.task) #define init_stack (init_task_union.stack) diff --git a/include/asm-sparc/sembuf.h b/include/asm-sparc/sembuf.h new file mode 100644 index 000000000000..47b2ef9bcd95 --- /dev/null +++ b/include/asm-sparc/sembuf.h @@ -0,0 +1,25 @@ +#ifndef _SPARC_SEMBUF_H +#define _SPARC_SEMBUF_H + +/* + * The semid64_ds structure for sparc architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 64-bit time_t to solve y2038 problem + * - 2 miscellaneous 64-bit values + */ + +struct semid64_ds { + struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ + unsigned int __pad1; + __kernel_time_t sem_otime; /* last semop time */ + unsigned int __pad2; + __kernel_time_t sem_ctime; /* last change time */ + unsigned long sem_nsems; /* no. of semaphores in array */ + unsigned long __unused1; + unsigned long __unused2; +}; + +#endif /* _SPARC64_SEMBUF_H */ diff --git a/include/asm-sparc/shmbuf.h b/include/asm-sparc/shmbuf.h new file mode 100644 index 000000000000..1ff9da8bec73 --- /dev/null +++ b/include/asm-sparc/shmbuf.h @@ -0,0 +1,42 @@ +#ifndef _SPARC_SHMBUF_H +#define _SPARC_SHMBUF_H + +/* + * The shmid64_ds structure for sparc architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 64-bit time_t to solve y2038 problem + * - 2 miscellaneous 32-bit values + */ + +struct shmid64_ds { + struct ipc64_perm shm_perm; /* operation perms */ + unsigned int __pad1; + __kernel_time_t shm_atime; /* last attach time */ + unsigned int __pad2; + __kernel_time_t shm_dtime; /* last detach time */ + unsigned int __pad3; + __kernel_time_t shm_ctime; /* last change time */ + size_t shm_segsz; /* size of segment (bytes) */ + __kernel_pid_t shm_cpid; /* pid of creator */ + __kernel_pid_t shm_lpid; /* pid of last operator */ + unsigned long shm_nattch; /* no. of current attaches */ + unsigned long __unused1; + unsigned long __unused2; +}; + +struct shminfo64 { + unsigned long shmmax; + unsigned long shmmin; + unsigned long shmmni; + unsigned long shmseg; + unsigned long shmall; + unsigned long __unused1; + unsigned long __unused2; + unsigned long __unused3; + unsigned long __unused4; +}; + +#endif /* _SPARC_SHMBUF_H */ diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h index 757012fc546d..ed2de7ca9ce5 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h @@ -1,4 +1,4 @@ -/* $Id: unistd.h,v 1.60 2000/01/05 07:37:50 jj Exp $ */ +/* $Id: unistd.h,v 1.63 2000/01/12 11:47:40 anton Exp $ */ #ifndef _SPARC_UNISTD_H #define _SPARC_UNISTD_H @@ -46,11 +46,11 @@ #define __NR_sigaltstack 28 /* Common */ #define __NR_pause 29 /* Is sigblock(0)->sigpause() in SunOS */ #define __NR_utime 30 /* Implemented via utimes() under SunOS */ -/* #define __NR_stty 31 Implemented via ioctl() under SunOS */ -/* #define __NR_gtty 32 Implemented via ioctl() under SunOS */ +#define __NR_lchown32 31 /* Linux sparc32 specific */ +#define __NR_fchown32 32 /* Linux sparc32 specific */ #define __NR_access 33 /* Common */ #define __NR_nice 34 /* Implemented via get/setpriority() in SunOS */ -/* #define __NR_ftime 35 Implemented via gettimeofday() in SunOS */ +#define __NR_chown32 35 /* Linux sparc32 specific */ #define __NR_sync 36 /* Common */ #define __NR_kill 37 /* Common */ #define __NR_stat 38 /* Common */ @@ -59,7 +59,7 @@ #define __NR_dup 41 /* Common */ #define __NR_pipe 42 /* Common */ #define __NR_times 43 /* Implemented via getrusage() in SunOS */ -/* #define __NR_profil 44 Common */ +#define __NR_getuid32 44 /* Linux sparc32 specific */ #define __NR_umount2 45 /* Linux Specific */ #define __NR_setgid 46 /* Implemented via setregid() in SunOS */ #define __NR_getgid 47 /* Common */ @@ -68,7 +68,7 @@ #define __NR_getegid 50 /* SunOS calls getgid() */ #define __NR_acct 51 /* Common */ /* #define __NR_ni_syscall 52 ENOSYS under SunOS */ -/* #define __NR_mctl 53 SunOS specific */ +#define __NR_getgid32 53 /* Linux sparc32 specific */ #define __NR_ioctl 54 /* Common */ #define __NR_reboot 55 /* Common */ #define __NR_mmap2 56 /* Linux sparc32 Specific */ @@ -84,32 +84,32 @@ #define __NR_vfork 66 /* Common */ #define __NR_pread 67 /* Linux Specific */ #define __NR_pwrite 68 /* Linux Specific */ -/* #define __NR_sbrk 69 SunOS Specific */ -/* #define __NR_sstk 70 SunOS Specific */ +#define __NR_geteuid32 69 /* Linux sparc32, sbrk under SunOS */ +#define __NR_getegid32 70 /* Linux sparc32, sstk under SunOS */ #define __NR_mmap 71 /* Common */ -/* #define __NR_vadvise 72 SunOS Specific */ +#define __NR_setreuid32 72 /* Linux sparc32, vadvise under SunOS */ #define __NR_munmap 73 /* Common */ #define __NR_mprotect 74 /* Common */ -/* #define __NR_madvise 75 SunOS Specific */ +#define __NR_setregid32 75 /* Linux sparc32, madvise under SunOS */ #define __NR_vhangup 76 /* Common */ #define __NR_truncate64 77 /* Linux sparc32 Specific */ -/* #define __NR_mincore 78 SunOS Specific */ +#define __NR_getgroups32 78 /* Linux sparc32, mincore under SunOS */ #define __NR_getgroups 79 /* Common */ #define __NR_setgroups 80 /* Common */ #define __NR_getpgrp 81 /* Common */ -/* #define __NR_setpgrp 82 setpgid, same difference... */ +#define __NR_setgroups32 82 /* Linux sparc32, setpgrp under SunOS */ #define __NR_setitimer 83 /* Common */ #define __NR_ftruncate64 84 /* Linux sparc32 Specific */ #define __NR_swapon 85 /* Common */ #define __NR_getitimer 86 /* Common */ -/* #define __NR_gethostname 87 SunOS Specific */ +#define __NR_setuid32 87 /* Linux sparc32, gethostname under SunOS */ #define __NR_sethostname 88 /* Common */ -/* #define __NR_getdtablesize 89 SunOS Specific */ +#define __NR_setgid32 89 /* Linux sparc32, getdtablesize under SunOS */ #define __NR_dup2 90 /* Common */ -/* #define __NR_getdopt 91 SunOS Specific */ +#define __NR_setfsuid32 91 /* Linux sparc32, getdopt under SunOS */ #define __NR_fcntl 92 /* Common */ #define __NR_select 93 /* Common */ -/* #define __NR_setdopt 94 SunOS Specific */ +#define __NR_setfsgid32 94 /* Linux sparc32, setdopt under SunOS */ #define __NR_fsync 95 /* Common */ #define __NR_setpriority 96 /* Common */ #define __NR_socket 97 /* Common */ @@ -123,10 +123,10 @@ #define __NR_rt_sigtimedwait 105 /* Linux Specific */ #define __NR_rt_sigqueueinfo 106 /* Linux Specific */ #define __NR_rt_sigsuspend 107 /* Linux Specific */ -/* #define __NR_sigvec 108 SunOS Specific */ -/* #define __NR_sigblock 109 SunOS Specific */ -/* #define __NR_sigsetmask 110 SunOS Specific */ -/* #define __NR_sigpause 111 SunOS Specific */ +#define __NR_setresuid32 108 /* Linux Specific, sigvec under SunOS */ +#define __NR_getresuid32 109 /* Linux Specific, sigblock under SunOS */ +#define __NR_setresgid32 110 /* Linux Specific, sigsetmask under SunOS */ +#define __NR_getresgid32 111 /* Linux Specific, sigpause under SunOS */ /* #define __NR_sigstack 112 SunOS Specific */ #define __NR_recvmsg 113 /* Common */ #define __NR_sendmsg 114 /* Common */ @@ -225,7 +225,7 @@ #define __NR_syslog 207 /* Linux Specific */ /* #define __NR_olduname 208 Linux Specific */ /* #define __NR_iopl 209 Linux Specific - i386 specific, unused */ -#define __NR_idle 210 /* Linux Specific */ +/* #define __NR_idle 210 Linux Specific - was sys_idle, now unused */ /* #define __NR_vm86 211 Linux Specific - i386 specific, unused */ #define __NR_waitpid 212 /* Linux Specific */ #define __NR_swapoff 213 /* Linux Specific */ @@ -416,7 +416,6 @@ return -1; \ * some others too. */ #define __NR__exit __NR_exit -static __inline__ _syscall0(int,idle) static __inline__ _syscall0(int,pause) static __inline__ _syscall0(int,sync) static __inline__ _syscall0(pid_t,setsid) diff --git a/include/asm-sparc64/asm_offsets.h b/include/asm-sparc64/asm_offsets.h index 8c36daca1276..07dfc1d30b00 100644 --- a/include/asm-sparc64/asm_offsets.h +++ b/include/asm-sparc64/asm_offsets.h @@ -24,152 +24,152 @@ #define ASIZ_task_exec_domain 0x00000008 #define AOFF_task_need_resched 0x00000020 #define ASIZ_task_need_resched 0x00000008 -#define AOFF_task_counter 0x00000028 +#define AOFF_task_avg_slice 0x00000028 +#define ASIZ_task_avg_slice 0x00000008 +#define AOFF_task_lock_depth 0x00000030 +#define ASIZ_task_lock_depth 0x00000004 +#define AOFF_task_counter 0x00000038 #define ASIZ_task_counter 0x00000008 -#define AOFF_task_priority 0x00000030 +#define AOFF_task_priority 0x00000040 #define ASIZ_task_priority 0x00000008 -#define AOFF_task_avg_slice 0x00000038 -#define ASIZ_task_avg_slice 0x00000008 -#define AOFF_task_has_cpu 0x00000040 +#define AOFF_task_policy 0x00000048 +#define ASIZ_task_policy 0x00000008 +#define AOFF_task_mm 0x00000050 +#define ASIZ_task_mm 0x00000008 +#define AOFF_task_active_mm 0x00000058 +#define ASIZ_task_active_mm 0x00000008 +#define AOFF_task_has_cpu 0x00000060 #define ASIZ_task_has_cpu 0x00000004 -#define AOFF_task_processor 0x00000044 +#define AOFF_task_processor 0x00000064 #define ASIZ_task_processor 0x00000004 -#define AOFF_task_last_processor 0x00000048 -#define ASIZ_task_last_processor 0x00000004 -#define AOFF_task_lock_depth 0x0000004c -#define ASIZ_task_lock_depth 0x00000004 -#define AOFF_task_next_task 0x00000050 +#define AOFF_task_run_list 0x00000068 +#define ASIZ_task_run_list 0x00000010 +#define AOFF_task_next_task 0x00000078 #define ASIZ_task_next_task 0x00000008 -#define AOFF_task_prev_task 0x00000058 +#define AOFF_task_prev_task 0x00000080 #define ASIZ_task_prev_task 0x00000008 -#define AOFF_task_run_list 0x00000060 -#define ASIZ_task_run_list 0x00000010 -#define AOFF_task_binfmt 0x00000070 +#define AOFF_task_last_processor 0x00000088 +#define ASIZ_task_last_processor 0x00000004 +#define AOFF_task_binfmt 0x00000090 #define ASIZ_task_binfmt 0x00000008 -#define AOFF_task_exit_code 0x00000078 +#define AOFF_task_exit_code 0x00000098 #define ASIZ_task_exit_code 0x00000004 -#define AOFF_task_exit_signal 0x0000007c +#define AOFF_task_exit_signal 0x0000009c #define ASIZ_task_exit_signal 0x00000004 -#define AOFF_task_pdeath_signal 0x00000080 +#define AOFF_task_pdeath_signal 0x000000a0 #define ASIZ_task_pdeath_signal 0x00000004 -#define AOFF_task_personality 0x00000088 +#define AOFF_task_personality 0x000000a8 #define ASIZ_task_personality 0x00000008 -#define AOFF_task_pid 0x00000094 +#define AOFF_task_pid 0x000000b4 #define ASIZ_task_pid 0x00000004 -#define AOFF_task_pgrp 0x00000098 +#define AOFF_task_pgrp 0x000000b8 #define ASIZ_task_pgrp 0x00000004 -#define AOFF_task_tty_old_pgrp 0x0000009c +#define AOFF_task_tty_old_pgrp 0x000000bc #define ASIZ_task_tty_old_pgrp 0x00000004 -#define AOFF_task_session 0x000000a0 +#define AOFF_task_session 0x000000c0 #define ASIZ_task_session 0x00000004 -#define AOFF_task_leader 0x000000a4 +#define AOFF_task_leader 0x000000c4 #define ASIZ_task_leader 0x00000004 -#define AOFF_task_p_opptr 0x000000a8 +#define AOFF_task_p_opptr 0x000000c8 #define ASIZ_task_p_opptr 0x00000008 -#define AOFF_task_p_pptr 0x000000b0 +#define AOFF_task_p_pptr 0x000000d0 #define ASIZ_task_p_pptr 0x00000008 -#define AOFF_task_p_cptr 0x000000b8 +#define AOFF_task_p_cptr 0x000000d8 #define ASIZ_task_p_cptr 0x00000008 -#define AOFF_task_p_ysptr 0x000000c0 +#define AOFF_task_p_ysptr 0x000000e0 #define ASIZ_task_p_ysptr 0x00000008 -#define AOFF_task_p_osptr 0x000000c8 +#define AOFF_task_p_osptr 0x000000e8 #define ASIZ_task_p_osptr 0x00000008 -#define AOFF_task_pidhash_next 0x000000d0 +#define AOFF_task_pidhash_next 0x000000f0 #define ASIZ_task_pidhash_next 0x00000008 -#define AOFF_task_pidhash_pprev 0x000000d8 +#define AOFF_task_pidhash_pprev 0x000000f8 #define ASIZ_task_pidhash_pprev 0x00000008 -#define AOFF_task_wait_chldexit 0x000000e0 +#define AOFF_task_wait_chldexit 0x00000100 #define ASIZ_task_wait_chldexit 0x00000020 -#define AOFF_task_vfork_sem 0x00000100 +#define AOFF_task_vfork_sem 0x00000120 #define ASIZ_task_vfork_sem 0x00000008 -#define AOFF_task_policy 0x00000108 -#define ASIZ_task_policy 0x00000008 -#define AOFF_task_rt_priority 0x00000110 +#define AOFF_task_rt_priority 0x00000128 #define ASIZ_task_rt_priority 0x00000008 -#define AOFF_task_it_real_value 0x00000118 +#define AOFF_task_it_real_value 0x00000130 #define ASIZ_task_it_real_value 0x00000008 -#define AOFF_task_it_prof_value 0x00000120 +#define AOFF_task_it_prof_value 0x00000138 #define ASIZ_task_it_prof_value 0x00000008 -#define AOFF_task_it_virt_value 0x00000128 +#define AOFF_task_it_virt_value 0x00000140 #define ASIZ_task_it_virt_value 0x00000008 -#define AOFF_task_it_real_incr 0x00000130 +#define AOFF_task_it_real_incr 0x00000148 #define ASIZ_task_it_real_incr 0x00000008 -#define AOFF_task_it_prof_incr 0x00000138 +#define AOFF_task_it_prof_incr 0x00000150 #define ASIZ_task_it_prof_incr 0x00000008 -#define AOFF_task_it_virt_incr 0x00000140 +#define AOFF_task_it_virt_incr 0x00000158 #define ASIZ_task_it_virt_incr 0x00000008 -#define AOFF_task_real_timer 0x00000148 +#define AOFF_task_real_timer 0x00000160 #define ASIZ_task_real_timer 0x00000028 -#define AOFF_task_times 0x00000170 +#define AOFF_task_times 0x00000188 #define ASIZ_task_times 0x00000020 -#define AOFF_task_start_time 0x00000190 +#define AOFF_task_start_time 0x000001a8 #define ASIZ_task_start_time 0x00000008 -#define AOFF_task_per_cpu_utime 0x00000198 +#define AOFF_task_per_cpu_utime 0x000001b0 #define ASIZ_task_per_cpu_utime 0x00000008 -#define AOFF_task_min_flt 0x000001a8 +#define AOFF_task_min_flt 0x000001c0 #define ASIZ_task_min_flt 0x00000008 -#define AOFF_task_maj_flt 0x000001b0 +#define AOFF_task_maj_flt 0x000001c8 #define ASIZ_task_maj_flt 0x00000008 -#define AOFF_task_nswap 0x000001b8 +#define AOFF_task_nswap 0x000001d0 #define ASIZ_task_nswap 0x00000008 -#define AOFF_task_cmin_flt 0x000001c0 +#define AOFF_task_cmin_flt 0x000001d8 #define ASIZ_task_cmin_flt 0x00000008 -#define AOFF_task_cmaj_flt 0x000001c8 +#define AOFF_task_cmaj_flt 0x000001e0 #define ASIZ_task_cmaj_flt 0x00000008 -#define AOFF_task_cnswap 0x000001d0 +#define AOFF_task_cnswap 0x000001e8 #define ASIZ_task_cnswap 0x00000008 -#define AOFF_task_uid 0x000001dc +#define AOFF_task_uid 0x000001f4 #define ASIZ_task_uid 0x00000004 -#define AOFF_task_euid 0x000001e0 +#define AOFF_task_euid 0x000001f8 #define ASIZ_task_euid 0x00000004 -#define AOFF_task_suid 0x000001e4 +#define AOFF_task_suid 0x000001fc #define ASIZ_task_suid 0x00000004 -#define AOFF_task_fsuid 0x000001e8 +#define AOFF_task_fsuid 0x00000200 #define ASIZ_task_fsuid 0x00000004 -#define AOFF_task_gid 0x000001ec +#define AOFF_task_gid 0x00000204 #define ASIZ_task_gid 0x00000004 -#define AOFF_task_egid 0x000001f0 +#define AOFF_task_egid 0x00000208 #define ASIZ_task_egid 0x00000004 -#define AOFF_task_sgid 0x000001f4 +#define AOFF_task_sgid 0x0000020c #define ASIZ_task_sgid 0x00000004 -#define AOFF_task_fsgid 0x000001f8 +#define AOFF_task_fsgid 0x00000210 #define ASIZ_task_fsgid 0x00000004 -#define AOFF_task_ngroups 0x000001fc +#define AOFF_task_ngroups 0x00000214 #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x00000200 +#define AOFF_task_groups 0x00000218 #define ASIZ_task_groups 0x00000080 -#define AOFF_task_cap_effective 0x00000280 +#define AOFF_task_cap_effective 0x00000298 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x00000284 +#define AOFF_task_cap_inheritable 0x0000029c #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x00000288 +#define AOFF_task_cap_permitted 0x000002a0 #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_user 0x00000290 +#define AOFF_task_user 0x000002a8 #define ASIZ_task_user 0x00000008 -#define AOFF_task_rlim 0x00000298 +#define AOFF_task_rlim 0x000002b0 #define ASIZ_task_rlim 0x000000a0 -#define AOFF_task_used_math 0x00000338 +#define AOFF_task_used_math 0x00000350 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x0000033a +#define AOFF_task_comm 0x00000352 #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x0000034c +#define AOFF_task_link_count 0x00000364 #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x00000350 +#define AOFF_task_tty 0x00000368 #define ASIZ_task_tty 0x00000008 -#define AOFF_task_semundo 0x00000358 +#define AOFF_task_semundo 0x00000370 #define ASIZ_task_semundo 0x00000008 -#define AOFF_task_semsleeping 0x00000360 +#define AOFF_task_semsleeping 0x00000378 #define ASIZ_task_semsleeping 0x00000008 -#define AOFF_task_thread 0x00000370 +#define AOFF_task_thread 0x00000380 #define ASIZ_task_thread 0x00000460 -#define AOFF_task_fs 0x000007d0 +#define AOFF_task_fs 0x000007e0 #define ASIZ_task_fs 0x00000008 -#define AOFF_task_files 0x000007d8 +#define AOFF_task_files 0x000007e8 #define ASIZ_task_files 0x00000008 -#define AOFF_task_mm 0x000007e0 -#define ASIZ_task_mm 0x00000008 -#define AOFF_task_active_mm 0x000007e8 -#define ASIZ_task_active_mm 0x00000008 #define AOFF_task_sigmask_lock 0x000007f0 #define ASIZ_task_sigmask_lock 0x00000000 #define AOFF_task_sig 0x000007f0 @@ -318,175 +318,175 @@ #define ASIZ_task_exec_domain 0x00000008 #define AOFF_task_need_resched 0x00000020 #define ASIZ_task_need_resched 0x00000008 -#define AOFF_task_counter 0x00000028 +#define AOFF_task_avg_slice 0x00000028 +#define ASIZ_task_avg_slice 0x00000008 +#define AOFF_task_lock_depth 0x00000030 +#define ASIZ_task_lock_depth 0x00000004 +#define AOFF_task_counter 0x00000038 #define ASIZ_task_counter 0x00000008 -#define AOFF_task_priority 0x00000030 +#define AOFF_task_priority 0x00000040 #define ASIZ_task_priority 0x00000008 -#define AOFF_task_avg_slice 0x00000038 -#define ASIZ_task_avg_slice 0x00000008 -#define AOFF_task_has_cpu 0x00000040 +#define AOFF_task_policy 0x00000048 +#define ASIZ_task_policy 0x00000008 +#define AOFF_task_mm 0x00000050 +#define ASIZ_task_mm 0x00000008 +#define AOFF_task_active_mm 0x00000058 +#define ASIZ_task_active_mm 0x00000008 +#define AOFF_task_has_cpu 0x00000060 #define ASIZ_task_has_cpu 0x00000004 -#define AOFF_task_processor 0x00000044 +#define AOFF_task_processor 0x00000064 #define ASIZ_task_processor 0x00000004 -#define AOFF_task_last_processor 0x00000048 -#define ASIZ_task_last_processor 0x00000004 -#define AOFF_task_lock_depth 0x0000004c -#define ASIZ_task_lock_depth 0x00000004 -#define AOFF_task_next_task 0x00000050 +#define AOFF_task_run_list 0x00000068 +#define ASIZ_task_run_list 0x00000010 +#define AOFF_task_next_task 0x00000078 #define ASIZ_task_next_task 0x00000008 -#define AOFF_task_prev_task 0x00000058 +#define AOFF_task_prev_task 0x00000080 #define ASIZ_task_prev_task 0x00000008 -#define AOFF_task_run_list 0x00000060 -#define ASIZ_task_run_list 0x00000010 -#define AOFF_task_binfmt 0x00000070 +#define AOFF_task_last_processor 0x00000088 +#define ASIZ_task_last_processor 0x00000004 +#define AOFF_task_binfmt 0x00000090 #define ASIZ_task_binfmt 0x00000008 -#define AOFF_task_exit_code 0x00000078 +#define AOFF_task_exit_code 0x00000098 #define ASIZ_task_exit_code 0x00000004 -#define AOFF_task_exit_signal 0x0000007c +#define AOFF_task_exit_signal 0x0000009c #define ASIZ_task_exit_signal 0x00000004 -#define AOFF_task_pdeath_signal 0x00000080 +#define AOFF_task_pdeath_signal 0x000000a0 #define ASIZ_task_pdeath_signal 0x00000004 -#define AOFF_task_personality 0x00000088 +#define AOFF_task_personality 0x000000a8 #define ASIZ_task_personality 0x00000008 -#define AOFF_task_pid 0x00000094 +#define AOFF_task_pid 0x000000b4 #define ASIZ_task_pid 0x00000004 -#define AOFF_task_pgrp 0x00000098 +#define AOFF_task_pgrp 0x000000b8 #define ASIZ_task_pgrp 0x00000004 -#define AOFF_task_tty_old_pgrp 0x0000009c +#define AOFF_task_tty_old_pgrp 0x000000bc #define ASIZ_task_tty_old_pgrp 0x00000004 -#define AOFF_task_session 0x000000a0 +#define AOFF_task_session 0x000000c0 #define ASIZ_task_session 0x00000004 -#define AOFF_task_leader 0x000000a4 +#define AOFF_task_leader 0x000000c4 #define ASIZ_task_leader 0x00000004 -#define AOFF_task_p_opptr 0x000000a8 +#define AOFF_task_p_opptr 0x000000c8 #define ASIZ_task_p_opptr 0x00000008 -#define AOFF_task_p_pptr 0x000000b0 +#define AOFF_task_p_pptr 0x000000d0 #define ASIZ_task_p_pptr 0x00000008 -#define AOFF_task_p_cptr 0x000000b8 +#define AOFF_task_p_cptr 0x000000d8 #define ASIZ_task_p_cptr 0x00000008 -#define AOFF_task_p_ysptr 0x000000c0 +#define AOFF_task_p_ysptr 0x000000e0 #define ASIZ_task_p_ysptr 0x00000008 -#define AOFF_task_p_osptr 0x000000c8 +#define AOFF_task_p_osptr 0x000000e8 #define ASIZ_task_p_osptr 0x00000008 -#define AOFF_task_pidhash_next 0x000000d0 +#define AOFF_task_pidhash_next 0x000000f0 #define ASIZ_task_pidhash_next 0x00000008 -#define AOFF_task_pidhash_pprev 0x000000d8 +#define AOFF_task_pidhash_pprev 0x000000f8 #define ASIZ_task_pidhash_pprev 0x00000008 -#define AOFF_task_wait_chldexit 0x000000e0 +#define AOFF_task_wait_chldexit 0x00000100 #define ASIZ_task_wait_chldexit 0x00000028 -#define AOFF_task_vfork_sem 0x00000108 +#define AOFF_task_vfork_sem 0x00000128 #define ASIZ_task_vfork_sem 0x00000008 -#define AOFF_task_policy 0x00000110 -#define ASIZ_task_policy 0x00000008 -#define AOFF_task_rt_priority 0x00000118 +#define AOFF_task_rt_priority 0x00000130 #define ASIZ_task_rt_priority 0x00000008 -#define AOFF_task_it_real_value 0x00000120 +#define AOFF_task_it_real_value 0x00000138 #define ASIZ_task_it_real_value 0x00000008 -#define AOFF_task_it_prof_value 0x00000128 +#define AOFF_task_it_prof_value 0x00000140 #define ASIZ_task_it_prof_value 0x00000008 -#define AOFF_task_it_virt_value 0x00000130 +#define AOFF_task_it_virt_value 0x00000148 #define ASIZ_task_it_virt_value 0x00000008 -#define AOFF_task_it_real_incr 0x00000138 +#define AOFF_task_it_real_incr 0x00000150 #define ASIZ_task_it_real_incr 0x00000008 -#define AOFF_task_it_prof_incr 0x00000140 +#define AOFF_task_it_prof_incr 0x00000158 #define ASIZ_task_it_prof_incr 0x00000008 -#define AOFF_task_it_virt_incr 0x00000148 +#define AOFF_task_it_virt_incr 0x00000160 #define ASIZ_task_it_virt_incr 0x00000008 -#define AOFF_task_real_timer 0x00000150 +#define AOFF_task_real_timer 0x00000168 #define ASIZ_task_real_timer 0x00000028 -#define AOFF_task_times 0x00000178 +#define AOFF_task_times 0x00000190 #define ASIZ_task_times 0x00000020 -#define AOFF_task_start_time 0x00000198 +#define AOFF_task_start_time 0x000001b0 #define ASIZ_task_start_time 0x00000008 -#define AOFF_task_per_cpu_utime 0x000001a0 +#define AOFF_task_per_cpu_utime 0x000001b8 #define ASIZ_task_per_cpu_utime 0x00000100 -#define AOFF_task_min_flt 0x000003a0 +#define AOFF_task_min_flt 0x000003b8 #define ASIZ_task_min_flt 0x00000008 -#define AOFF_task_maj_flt 0x000003a8 +#define AOFF_task_maj_flt 0x000003c0 #define ASIZ_task_maj_flt 0x00000008 -#define AOFF_task_nswap 0x000003b0 +#define AOFF_task_nswap 0x000003c8 #define ASIZ_task_nswap 0x00000008 -#define AOFF_task_cmin_flt 0x000003b8 +#define AOFF_task_cmin_flt 0x000003d0 #define ASIZ_task_cmin_flt 0x00000008 -#define AOFF_task_cmaj_flt 0x000003c0 +#define AOFF_task_cmaj_flt 0x000003d8 #define ASIZ_task_cmaj_flt 0x00000008 -#define AOFF_task_cnswap 0x000003c8 +#define AOFF_task_cnswap 0x000003e0 #define ASIZ_task_cnswap 0x00000008 -#define AOFF_task_uid 0x000003d4 +#define AOFF_task_uid 0x000003ec #define ASIZ_task_uid 0x00000004 -#define AOFF_task_euid 0x000003d8 +#define AOFF_task_euid 0x000003f0 #define ASIZ_task_euid 0x00000004 -#define AOFF_task_suid 0x000003dc +#define AOFF_task_suid 0x000003f4 #define ASIZ_task_suid 0x00000004 -#define AOFF_task_fsuid 0x000003e0 +#define AOFF_task_fsuid 0x000003f8 #define ASIZ_task_fsuid 0x00000004 -#define AOFF_task_gid 0x000003e4 +#define AOFF_task_gid 0x000003fc #define ASIZ_task_gid 0x00000004 -#define AOFF_task_egid 0x000003e8 +#define AOFF_task_egid 0x00000400 #define ASIZ_task_egid 0x00000004 -#define AOFF_task_sgid 0x000003ec +#define AOFF_task_sgid 0x00000404 #define ASIZ_task_sgid 0x00000004 -#define AOFF_task_fsgid 0x000003f0 +#define AOFF_task_fsgid 0x00000408 #define ASIZ_task_fsgid 0x00000004 -#define AOFF_task_ngroups 0x000003f4 +#define AOFF_task_ngroups 0x0000040c #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x000003f8 +#define AOFF_task_groups 0x00000410 #define ASIZ_task_groups 0x00000080 -#define AOFF_task_cap_effective 0x00000478 +#define AOFF_task_cap_effective 0x00000490 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x0000047c +#define AOFF_task_cap_inheritable 0x00000494 #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x00000480 +#define AOFF_task_cap_permitted 0x00000498 #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_user 0x00000488 +#define AOFF_task_user 0x000004a0 #define ASIZ_task_user 0x00000008 -#define AOFF_task_rlim 0x00000490 +#define AOFF_task_rlim 0x000004a8 #define ASIZ_task_rlim 0x000000a0 -#define AOFF_task_used_math 0x00000530 +#define AOFF_task_used_math 0x00000548 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x00000532 +#define AOFF_task_comm 0x0000054a #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x00000544 +#define AOFF_task_link_count 0x0000055c #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x00000548 +#define AOFF_task_tty 0x00000560 #define ASIZ_task_tty 0x00000008 -#define AOFF_task_semundo 0x00000550 +#define AOFF_task_semundo 0x00000568 #define ASIZ_task_semundo 0x00000008 -#define AOFF_task_semsleeping 0x00000558 +#define AOFF_task_semsleeping 0x00000570 #define ASIZ_task_semsleeping 0x00000008 -#define AOFF_task_thread 0x00000560 +#define AOFF_task_thread 0x00000580 #define ASIZ_task_thread 0x00000460 -#define AOFF_task_fs 0x000009c0 +#define AOFF_task_fs 0x000009e0 #define ASIZ_task_fs 0x00000008 -#define AOFF_task_files 0x000009c8 +#define AOFF_task_files 0x000009e8 #define ASIZ_task_files 0x00000008 -#define AOFF_task_mm 0x000009d0 -#define ASIZ_task_mm 0x00000008 -#define AOFF_task_active_mm 0x000009d8 -#define ASIZ_task_active_mm 0x00000008 -#define AOFF_task_sigmask_lock 0x000009e0 +#define AOFF_task_sigmask_lock 0x000009f0 #define ASIZ_task_sigmask_lock 0x00000001 -#define AOFF_task_sig 0x000009e8 +#define AOFF_task_sig 0x000009f8 #define ASIZ_task_sig 0x00000008 -#define AOFF_task_signal 0x000009f0 +#define AOFF_task_signal 0x00000a00 #define ASIZ_task_signal 0x00000008 -#define AOFF_task_blocked 0x000009f8 +#define AOFF_task_blocked 0x00000a08 #define ASIZ_task_blocked 0x00000008 -#define AOFF_task_sigqueue 0x00000a00 +#define AOFF_task_sigqueue 0x00000a10 #define ASIZ_task_sigqueue 0x00000008 -#define AOFF_task_sigqueue_tail 0x00000a08 +#define AOFF_task_sigqueue_tail 0x00000a18 #define ASIZ_task_sigqueue_tail 0x00000008 -#define AOFF_task_sas_ss_sp 0x00000a10 +#define AOFF_task_sas_ss_sp 0x00000a20 #define ASIZ_task_sas_ss_sp 0x00000008 -#define AOFF_task_sas_ss_size 0x00000a18 +#define AOFF_task_sas_ss_size 0x00000a28 #define ASIZ_task_sas_ss_size 0x00000008 -#define AOFF_task_parent_exec_id 0x00000a20 +#define AOFF_task_parent_exec_id 0x00000a30 #define ASIZ_task_parent_exec_id 0x00000004 -#define AOFF_task_self_exec_id 0x00000a24 +#define AOFF_task_self_exec_id 0x00000a34 #define ASIZ_task_self_exec_id 0x00000004 -#define AOFF_task_exit_sem 0x00000a28 +#define AOFF_task_exit_sem 0x00000a38 #define ASIZ_task_exit_sem 0x00000038 -#define ASIZ_task 0x00000a60 +#define ASIZ_task 0x00000a70 #define AOFF_mm_mmap 0x00000000 #define ASIZ_mm_mmap 0x00000008 #define AOFF_mm_mmap_avl 0x00000008 @@ -610,152 +610,152 @@ #define ASIZ_task_exec_domain 0x00000008 #define AOFF_task_need_resched 0x00000020 #define ASIZ_task_need_resched 0x00000008 -#define AOFF_task_counter 0x00000028 +#define AOFF_task_avg_slice 0x00000028 +#define ASIZ_task_avg_slice 0x00000008 +#define AOFF_task_lock_depth 0x00000030 +#define ASIZ_task_lock_depth 0x00000004 +#define AOFF_task_counter 0x00000038 #define ASIZ_task_counter 0x00000008 -#define AOFF_task_priority 0x00000030 +#define AOFF_task_priority 0x00000040 #define ASIZ_task_priority 0x00000008 -#define AOFF_task_avg_slice 0x00000038 -#define ASIZ_task_avg_slice 0x00000008 -#define AOFF_task_has_cpu 0x00000040 +#define AOFF_task_policy 0x00000048 +#define ASIZ_task_policy 0x00000008 +#define AOFF_task_mm 0x00000050 +#define ASIZ_task_mm 0x00000008 +#define AOFF_task_active_mm 0x00000058 +#define ASIZ_task_active_mm 0x00000008 +#define AOFF_task_has_cpu 0x00000060 #define ASIZ_task_has_cpu 0x00000004 -#define AOFF_task_processor 0x00000044 +#define AOFF_task_processor 0x00000064 #define ASIZ_task_processor 0x00000004 -#define AOFF_task_last_processor 0x00000048 -#define ASIZ_task_last_processor 0x00000004 -#define AOFF_task_lock_depth 0x0000004c -#define ASIZ_task_lock_depth 0x00000004 -#define AOFF_task_next_task 0x00000050 +#define AOFF_task_run_list 0x00000068 +#define ASIZ_task_run_list 0x00000010 +#define AOFF_task_next_task 0x00000078 #define ASIZ_task_next_task 0x00000008 -#define AOFF_task_prev_task 0x00000058 +#define AOFF_task_prev_task 0x00000080 #define ASIZ_task_prev_task 0x00000008 -#define AOFF_task_run_list 0x00000060 -#define ASIZ_task_run_list 0x00000010 -#define AOFF_task_binfmt 0x00000070 +#define AOFF_task_last_processor 0x00000088 +#define ASIZ_task_last_processor 0x00000004 +#define AOFF_task_binfmt 0x00000090 #define ASIZ_task_binfmt 0x00000008 -#define AOFF_task_exit_code 0x00000078 +#define AOFF_task_exit_code 0x00000098 #define ASIZ_task_exit_code 0x00000004 -#define AOFF_task_exit_signal 0x0000007c +#define AOFF_task_exit_signal 0x0000009c #define ASIZ_task_exit_signal 0x00000004 -#define AOFF_task_pdeath_signal 0x00000080 +#define AOFF_task_pdeath_signal 0x000000a0 #define ASIZ_task_pdeath_signal 0x00000004 -#define AOFF_task_personality 0x00000088 +#define AOFF_task_personality 0x000000a8 #define ASIZ_task_personality 0x00000008 -#define AOFF_task_pid 0x00000094 +#define AOFF_task_pid 0x000000b4 #define ASIZ_task_pid 0x00000004 -#define AOFF_task_pgrp 0x00000098 +#define AOFF_task_pgrp 0x000000b8 #define ASIZ_task_pgrp 0x00000004 -#define AOFF_task_tty_old_pgrp 0x0000009c +#define AOFF_task_tty_old_pgrp 0x000000bc #define ASIZ_task_tty_old_pgrp 0x00000004 -#define AOFF_task_session 0x000000a0 +#define AOFF_task_session 0x000000c0 #define ASIZ_task_session 0x00000004 -#define AOFF_task_leader 0x000000a4 +#define AOFF_task_leader 0x000000c4 #define ASIZ_task_leader 0x00000004 -#define AOFF_task_p_opptr 0x000000a8 +#define AOFF_task_p_opptr 0x000000c8 #define ASIZ_task_p_opptr 0x00000008 -#define AOFF_task_p_pptr 0x000000b0 +#define AOFF_task_p_pptr 0x000000d0 #define ASIZ_task_p_pptr 0x00000008 -#define AOFF_task_p_cptr 0x000000b8 +#define AOFF_task_p_cptr 0x000000d8 #define ASIZ_task_p_cptr 0x00000008 -#define AOFF_task_p_ysptr 0x000000c0 +#define AOFF_task_p_ysptr 0x000000e0 #define ASIZ_task_p_ysptr 0x00000008 -#define AOFF_task_p_osptr 0x000000c8 +#define AOFF_task_p_osptr 0x000000e8 #define ASIZ_task_p_osptr 0x00000008 -#define AOFF_task_pidhash_next 0x000000d0 +#define AOFF_task_pidhash_next 0x000000f0 #define ASIZ_task_pidhash_next 0x00000008 -#define AOFF_task_pidhash_pprev 0x000000d8 +#define AOFF_task_pidhash_pprev 0x000000f8 #define ASIZ_task_pidhash_pprev 0x00000008 -#define AOFF_task_wait_chldexit 0x000000e0 +#define AOFF_task_wait_chldexit 0x00000100 #define ASIZ_task_wait_chldexit 0x00000030 -#define AOFF_task_vfork_sem 0x00000110 +#define AOFF_task_vfork_sem 0x00000130 #define ASIZ_task_vfork_sem 0x00000008 -#define AOFF_task_policy 0x00000118 -#define ASIZ_task_policy 0x00000008 -#define AOFF_task_rt_priority 0x00000120 +#define AOFF_task_rt_priority 0x00000138 #define ASIZ_task_rt_priority 0x00000008 -#define AOFF_task_it_real_value 0x00000128 +#define AOFF_task_it_real_value 0x00000140 #define ASIZ_task_it_real_value 0x00000008 -#define AOFF_task_it_prof_value 0x00000130 +#define AOFF_task_it_prof_value 0x00000148 #define ASIZ_task_it_prof_value 0x00000008 -#define AOFF_task_it_virt_value 0x00000138 +#define AOFF_task_it_virt_value 0x00000150 #define ASIZ_task_it_virt_value 0x00000008 -#define AOFF_task_it_real_incr 0x00000140 +#define AOFF_task_it_real_incr 0x00000158 #define ASIZ_task_it_real_incr 0x00000008 -#define AOFF_task_it_prof_incr 0x00000148 +#define AOFF_task_it_prof_incr 0x00000160 #define ASIZ_task_it_prof_incr 0x00000008 -#define AOFF_task_it_virt_incr 0x00000150 +#define AOFF_task_it_virt_incr 0x00000168 #define ASIZ_task_it_virt_incr 0x00000008 -#define AOFF_task_real_timer 0x00000158 +#define AOFF_task_real_timer 0x00000170 #define ASIZ_task_real_timer 0x00000028 -#define AOFF_task_times 0x00000180 +#define AOFF_task_times 0x00000198 #define ASIZ_task_times 0x00000020 -#define AOFF_task_start_time 0x000001a0 +#define AOFF_task_start_time 0x000001b8 #define ASIZ_task_start_time 0x00000008 -#define AOFF_task_per_cpu_utime 0x000001a8 +#define AOFF_task_per_cpu_utime 0x000001c0 #define ASIZ_task_per_cpu_utime 0x00000100 -#define AOFF_task_min_flt 0x000003a8 +#define AOFF_task_min_flt 0x000003c0 #define ASIZ_task_min_flt 0x00000008 -#define AOFF_task_maj_flt 0x000003b0 +#define AOFF_task_maj_flt 0x000003c8 #define ASIZ_task_maj_flt 0x00000008 -#define AOFF_task_nswap 0x000003b8 +#define AOFF_task_nswap 0x000003d0 #define ASIZ_task_nswap 0x00000008 -#define AOFF_task_cmin_flt 0x000003c0 +#define AOFF_task_cmin_flt 0x000003d8 #define ASIZ_task_cmin_flt 0x00000008 -#define AOFF_task_cmaj_flt 0x000003c8 +#define AOFF_task_cmaj_flt 0x000003e0 #define ASIZ_task_cmaj_flt 0x00000008 -#define AOFF_task_cnswap 0x000003d0 +#define AOFF_task_cnswap 0x000003e8 #define ASIZ_task_cnswap 0x00000008 -#define AOFF_task_uid 0x000003dc +#define AOFF_task_uid 0x000003f4 #define ASIZ_task_uid 0x00000004 -#define AOFF_task_euid 0x000003e0 +#define AOFF_task_euid 0x000003f8 #define ASIZ_task_euid 0x00000004 -#define AOFF_task_suid 0x000003e4 +#define AOFF_task_suid 0x000003fc #define ASIZ_task_suid 0x00000004 -#define AOFF_task_fsuid 0x000003e8 +#define AOFF_task_fsuid 0x00000400 #define ASIZ_task_fsuid 0x00000004 -#define AOFF_task_gid 0x000003ec +#define AOFF_task_gid 0x00000404 #define ASIZ_task_gid 0x00000004 -#define AOFF_task_egid 0x000003f0 +#define AOFF_task_egid 0x00000408 #define ASIZ_task_egid 0x00000004 -#define AOFF_task_sgid 0x000003f4 +#define AOFF_task_sgid 0x0000040c #define ASIZ_task_sgid 0x00000004 -#define AOFF_task_fsgid 0x000003f8 +#define AOFF_task_fsgid 0x00000410 #define ASIZ_task_fsgid 0x00000004 -#define AOFF_task_ngroups 0x000003fc +#define AOFF_task_ngroups 0x00000414 #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x00000400 +#define AOFF_task_groups 0x00000418 #define ASIZ_task_groups 0x00000080 -#define AOFF_task_cap_effective 0x00000480 +#define AOFF_task_cap_effective 0x00000498 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x00000484 +#define AOFF_task_cap_inheritable 0x0000049c #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x00000488 +#define AOFF_task_cap_permitted 0x000004a0 #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_user 0x00000490 +#define AOFF_task_user 0x000004a8 #define ASIZ_task_user 0x00000008 -#define AOFF_task_rlim 0x00000498 +#define AOFF_task_rlim 0x000004b0 #define ASIZ_task_rlim 0x000000a0 -#define AOFF_task_used_math 0x00000538 +#define AOFF_task_used_math 0x00000550 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x0000053a +#define AOFF_task_comm 0x00000552 #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x0000054c +#define AOFF_task_link_count 0x00000564 #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x00000550 +#define AOFF_task_tty 0x00000568 #define ASIZ_task_tty 0x00000008 -#define AOFF_task_semundo 0x00000558 +#define AOFF_task_semundo 0x00000570 #define ASIZ_task_semundo 0x00000008 -#define AOFF_task_semsleeping 0x00000560 +#define AOFF_task_semsleeping 0x00000578 #define ASIZ_task_semsleeping 0x00000008 -#define AOFF_task_thread 0x00000570 +#define AOFF_task_thread 0x00000580 #define ASIZ_task_thread 0x00000460 -#define AOFF_task_fs 0x000009d0 +#define AOFF_task_fs 0x000009e0 #define ASIZ_task_fs 0x00000008 -#define AOFF_task_files 0x000009d8 +#define AOFF_task_files 0x000009e8 #define ASIZ_task_files 0x00000008 -#define AOFF_task_mm 0x000009e0 -#define ASIZ_task_mm 0x00000008 -#define AOFF_task_active_mm 0x000009e8 -#define ASIZ_task_active_mm 0x00000008 #define AOFF_task_sigmask_lock 0x000009f0 #define ASIZ_task_sigmask_lock 0x0000000c #define AOFF_task_sig 0x00000a00 diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h index fda381c48457..9a7fd950a941 100644 --- a/include/asm-sparc64/floppy.h +++ b/include/asm-sparc64/floppy.h @@ -1,4 +1,4 @@ -/* $Id: floppy.h,v 1.23 1999/09/21 14:39:34 davem Exp $ +/* $Id: floppy.h,v 1.24 2000/01/09 15:16:34 ecd Exp $ * asm-sparc64/floppy.h: Sparc specific parts of the Floppy driver. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -574,7 +574,6 @@ static unsigned long __init sun_floppy_init(void) struct linux_ebus_device *edev = 0; unsigned long config = 0; unsigned long auxio_reg; - unsigned char cfg; for_each_ebus(ebus) { for_each_ebusdev(edev, ebus) { @@ -669,9 +668,7 @@ static unsigned long __init sun_floppy_init(void) return sun_floppy_types[0]; /* Enable PC-AT mode. */ - cfg = ns87303_readb(config, ASC); - cfg |= 0xc0; - ns87303_writeb(config, ASC, cfg); + ns87303_modify(config, ASC, 0, 0xc0); #ifdef PCI_FDC_SWAP_DRIVES /* @@ -682,15 +679,9 @@ static unsigned long __init sun_floppy_init(void) * Set the drive exchange bit in FCR on NS87303, * make shure other bits are sane before doing so. */ - cfg = ns87303_readb(config, FER); - cfg &= ~(FER_EDM); - ns87303_writeb(config, FER, cfg); - cfg = ns87303_readb(config, ASC); - cfg &= ~(ASC_DRV2_SEL); - ns87303_writeb(config, ASC, cfg); - cfg = ns87303_readb(config, FCR); - cfg |= FCR_LDE; - ns87303_writeb(config, FCR, cfg); + ns87303_modify(config, FER, FER_EDM, 0); + ns87303_modify(config, ASC, ASC_DRV2_SEL, 0); + ns87303_modify(config, FCR, 0, FCR_LDE); cfg = sun_floppy_types[0]; sun_floppy_types[0] = sun_floppy_types[1]; diff --git a/include/asm-sparc64/ipcbuf.h b/include/asm-sparc64/ipcbuf.h new file mode 100644 index 000000000000..9c5bf1bc423f --- /dev/null +++ b/include/asm-sparc64/ipcbuf.h @@ -0,0 +1,28 @@ +#ifndef _SPARC64_IPCBUF_H +#define _SPARC64_IPCBUF_H + +/* + * The ipc64_perm structure for sparc64 architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 32-bit seq + * - 2 miscellaneous 64-bit values + */ + +struct ipc64_perm +{ + __kernel_key_t key; + __kernel_uid_t uid; + __kernel_gid_t gid; + __kernel_uid_t cuid; + __kernel_gid_t cgid; + __kernel_mode_t mode; + unsigned short __pad1; + unsigned short seq; + unsigned long __unused1; + unsigned long __unused2; +}; + +#endif /* _SPARC64_IPCBUF_H */ diff --git a/include/asm-sparc64/msgbuf.h b/include/asm-sparc64/msgbuf.h new file mode 100644 index 000000000000..55c101bd0e7d --- /dev/null +++ b/include/asm-sparc64/msgbuf.h @@ -0,0 +1,27 @@ +#ifndef _SPARC64_MSGBUF_H +#define _SPARC64_MSGBUF_H + +/* + * The msqid64_ds structure for sparc64 architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 2 miscellaneous 64-bit values + */ + +struct msqid64_ds { + struct ipc64_perm msg_perm; + __kernel_time_t msg_stime; /* last msgsnd time */ + __kernel_time_t msg_rtime; /* last msgrcv time */ + __kernel_time_t msg_ctime; /* last change time */ + unsigned long msg_cbytes; /* current number of bytes on queue */ + unsigned long msg_qnum; /* number of messages in queue */ + unsigned long msg_qbytes; /* max number of bytes on queue */ + __kernel_pid_t msg_lspid; /* pid of last msgsnd */ + __kernel_pid_t msg_lrpid; /* last receive pid */ + unsigned long __unused1; + unsigned long __unused2; +}; + +#endif /* _SPARC64_MSGBUF_H */ diff --git a/include/asm-sparc64/ns87303.h b/include/asm-sparc64/ns87303.h index cfd159a5a80b..89ac8c4ad36d 100644 --- a/include/asm-sparc64/ns87303.h +++ b/include/asm-sparc64/ns87303.h @@ -1,4 +1,4 @@ -/* $Id: ns87303.h,v 1.2 1998/09/13 15:38:50 ecd Exp $ +/* $Id: ns87303.h,v 1.3 2000/01/09 15:16:34 ecd Exp $ * ns87303.h: Configuration Register Description for the * National Semiconductor PC87303 (SuperIO). * @@ -45,7 +45,7 @@ #define FCR_LDE 0x10 /* Logical Drive Exchange */ #define FCR_ZWS_ENA 0x20 /* Enable short host read/write in ECP/EPP */ -/* Printer Controll Register (PCR) bits */ +/* Printer Control Register (PCR) bits */ #define PCR_EPP_ENABLE 0x01 #define PCR_EPP_IEEE 0x02 /* Enable EPP Version 1.9 (IEEE 1284) */ #define PCR_ECP_ENABLE 0x04 @@ -61,27 +61,51 @@ #define ASC_LPT_IRQ7 0x01 /* Allways use IRQ7 for LPT */ #define ASC_DRV2_SEL 0x02 /* Logical Drive Exchange controlled by TDR */ +#define FER_RESERVED 0x00 +#define FAR_RESERVED 0x00 +#define PTR_RESERVED 0x73 +#define FCR_RESERVED 0xc4 +#define PCR_RESERVED 0x10 +#define KRR_RESERVED 0x00 +#define PMC_RESERVED 0x98 +#define TUP_RESERVED 0xfb +#define SIP_RESERVED 0x00 +#define ASC_RESERVED 0x18 +#define CS0CF0_RESERVED 0x00 +#define CS0CF1_RESERVED 0x08 +#define CS1CF0_RESERVED 0x00 +#define CS1CF1_RESERVED 0x08 + #ifdef __KERNEL__ #include #include -static __inline__ void ns87303_writeb(unsigned long port, int index, - unsigned char value) +static __inline__ int ns87303_modify(unsigned long port, unsigned int index, + unsigned char clr, unsigned char set) { + static unsigned char reserved[] = { + FER_RESERVED, FAR_RESERVED, PTR_RESERVED, FCR_RESERVED, + PCR_RESERVED, KRR_RESERVED, PMC_RESERVED, TUP_RESERVED, + SIP_RESERVED, ASC_RESERVED, CS0CF0_RESERVED, CS0CF1_RESERVED, + CS1CF0_RESERVED, CS1CF1_RESERVED + }; unsigned long flags; + unsigned char value; + + if (index > 0x0d) + return -EINVAL; save_flags(flags); cli(); outb(index, port); + value = inb(port + 1); + value &= ~(reserved[index] | clr); + value |= set; outb(value, port + 1); outb(value, port + 1); restore_flags(flags); -} -static __inline__ unsigned char ns87303_readb(unsigned long port, int index) -{ - outb(index, port); - return inb(port + 1); + return 0; } #endif /* __KERNEL__ */ diff --git a/include/asm-sparc64/parport.h b/include/asm-sparc64/parport.h index 67a0da1fa13b..97aeaf7f6ebb 100644 --- a/include/asm-sparc64/parport.h +++ b/include/asm-sparc64/parport.h @@ -1,4 +1,4 @@ -/* $Id: parport.h,v 1.5 1999/08/30 10:14:52 davem Exp $ +/* $Id: parport.h,v 1.6 2000/01/09 15:16:34 ecd Exp $ * parport.h: sparc64 specific parport initialization and dma. * * Copyright (C) 1999 Eddie C. Dost (ecd@skynet.be) @@ -19,8 +19,6 @@ #define __maybe_initdata __initdata #endif -#undef HAVE_SLOW_DEVICES - #define PARPORT_PC_MAX_PORTS PARPORT_MAX static struct linux_ebus_dma *sparc_ebus_dmas[PARPORT_PC_MAX_PORTS]; @@ -33,7 +31,7 @@ reset_dma(unsigned int dmanr) writel(EBUS_DCSR_RESET, &sparc_ebus_dmas[dmanr]->dcsr); udelay(1); dcsr = EBUS_DCSR_BURST_SZ_16 | EBUS_DCSR_TCI_DIS | - EBUS_DCSR_EN_CNT; + EBUS_DCSR_EN_CNT | EBUS_DCSR_INT_EN; writel(dcsr, &sparc_ebus_dmas[dmanr]->dcsr); } @@ -62,11 +60,8 @@ disable_dma(unsigned int dmanr) writel(dcsr, &sparc_ebus_dmas[dmanr]->dcsr); dcsr = readl(&sparc_ebus_dmas[dmanr]->dcsr); - if (dcsr & EBUS_DCSR_ERR_PEND) { + if (dcsr & EBUS_DCSR_ERR_PEND) reset_dma(dmanr); - dcsr &= ~(EBUS_DCSR_ERR_PEND); - } - writel(dcsr, &sparc_ebus_dmas[dmanr]->dcsr); } } @@ -105,15 +100,11 @@ set_dma_count(unsigned int dmanr, unsigned int count) static __inline__ int get_dma_residue(unsigned int dmanr) { - unsigned int dcsr; int res; res = readl(&sparc_ebus_dmas[dmanr]->dbcr); - if (res != 0) { - dcsr = readl(&sparc_ebus_dmas[dmanr]->dcsr); + if (res != 0) reset_dma(dmanr); - writel(dcsr, &sparc_ebus_dmas[dmanr]->dcsr); - } return res; } @@ -136,36 +127,25 @@ parport_pc_init(int *io, int *io_hi, int *irq, int *dma) if (!strcmp(edev->prom_name, "ecpp")) { unsigned long base = edev->resource[0].start; unsigned long config = edev->resource[1].start; - unsigned char cfg; sparc_ebus_dmas[count] = (struct linux_ebus_dma *) edev->resource[2].start; reset_dma(count); + /* Configure IRQ to Push Pull, Level Low */ /* Enable ECP, set bit 2 of the CTR first */ outb(0x04, base + 0x02); - cfg = ns87303_readb(config, PCR); - cfg |= (PCR_ECP_ENABLE | PCR_ECP_CLK_ENA); - ns87303_writeb(config, PCR, cfg); + ns87303_modify(config, PCR, + PCR_EPP_ENABLE | + PCR_IRQ_ODRAIN, + PCR_ECP_ENABLE | + PCR_ECP_CLK_ENA | + PCR_IRQ_POLAR); /* CTR bit 5 controls direction of port */ - cfg = ns87303_readb(config, PTR); - cfg |= PTR_LPT_REG_DIR; - ns87303_writeb(config, PTR, cfg); - - /* Configure IRQ to Push Pull, Level Low */ - cfg = ns87303_readb(config, PCR); - cfg &= ~(PCR_IRQ_ODRAIN); - cfg |= PCR_IRQ_POLAR; - ns87303_writeb(config, PCR, cfg); - -#ifndef HAVE_SLOW_DEVICES - /* Enable Zero Wait State for ECP */ - cfg = ns87303_readb(config, FCR); - cfg |= FCR_ZWS_ENA; - ns87303_writeb(config, FCR, cfg); -#endif + ns87303_modify(config, PTR, + 0, PTR_LPT_REG_DIR); if (parport_pc_probe_port(base, base + 0x400, edev->irqs[0], diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h index 98f706e01737..4131b698fcb5 100644 --- a/include/asm-sparc64/pci.h +++ b/include/asm-sparc64/pci.h @@ -9,6 +9,9 @@ */ #define pcibios_assign_all_busses() 0 +#define PCIBIOS_MIN_IO 0UL +#define PCIBIOS_MIN_MEM 0UL + struct pci_dev; /* Allocate and map kernel buffer using consistant mode DMA for PCI device. diff --git a/include/asm-sparc64/posix_types.h b/include/asm-sparc64/posix_types.h index e0836990a8ae..47415f2cc38a 100644 --- a/include/asm-sparc64/posix_types.h +++ b/include/asm-sparc64/posix_types.h @@ -29,6 +29,15 @@ typedef unsigned int __kernel_nlink_t; typedef int __kernel_daddr_t; typedef long __kernel_off_t; typedef char * __kernel_caddr_t; +typedef unsigned short __kernel_uid16_t; +typedef unsigned short __kernel_gid16_t; +typedef unsigned int __kernel_uid32_t; +typedef unsigned int __kernel_gid32_t; +#ifdef __KERNEL__ +#define UID16_COMPAT_NEEDED +typedef unsigned short __kernel_old_uid_t; +typedef unsigned short __kernel_old_gid_t; +#endif /* __KERNEL__ */ /* Note this piece of asymmetry from the v9 ABI. */ typedef int __kernel_suseconds_t; diff --git a/include/asm-sparc64/sembuf.h b/include/asm-sparc64/sembuf.h new file mode 100644 index 000000000000..99f04e4e288c --- /dev/null +++ b/include/asm-sparc64/sembuf.h @@ -0,0 +1,22 @@ +#ifndef _SPARC64_SEMBUF_H +#define _SPARC64_SEMBUF_H + +/* + * The semid64_ds structure for sparc64 architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 2 miscellaneous 64-bit values + */ + +struct semid64_ds { + struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ + __kernel_time_t sem_otime; /* last semop time */ + __kernel_time_t sem_ctime; /* last change time */ + unsigned long sem_nsems; /* no. of semaphores in array */ + unsigned long __unused1; + unsigned long __unused2; +}; + +#endif /* _SPARC64_SEMBUF_H */ diff --git a/include/asm-sparc64/shmbuf.h b/include/asm-sparc64/shmbuf.h new file mode 100644 index 000000000000..61c2ef42eba3 --- /dev/null +++ b/include/asm-sparc64/shmbuf.h @@ -0,0 +1,38 @@ +#ifndef _SPARC64_SHMBUF_H +#define _SPARC64_SHMBUF_H + +/* + * The shmid64_ds structure for sparc64 architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 2 miscellaneous 64-bit values + */ + +struct shmid64_ds { + struct ipc64_perm shm_perm; /* operation perms */ + __kernel_time_t shm_atime; /* last attach time */ + __kernel_time_t shm_dtime; /* last detach time */ + __kernel_time_t shm_ctime; /* last change time */ + size_t shm_segsz; /* size of segment (bytes) */ + __kernel_pid_t shm_cpid; /* pid of creator */ + __kernel_pid_t shm_lpid; /* pid of last operator */ + unsigned long shm_nattch; /* no. of current attaches */ + unsigned long __unused1; + unsigned long __unused2; +}; + +struct shminfo64 { + unsigned long shmmax; + unsigned long shmmin; + unsigned long shmmni; + unsigned long shmseg; + unsigned long shmall; + unsigned long __unused1; + unsigned long __unused2; + unsigned long __unused3; + unsigned long __unused4; +}; + +#endif /* _SPARC64_SHMBUF_H */ diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index 8c9b29bc6ffc..c022947dfbbf 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h @@ -1,4 +1,4 @@ -/* $Id: unistd.h,v 1.37 2000/01/05 07:37:55 jj Exp $ */ +/* $Id: unistd.h,v 1.39 2000/01/11 17:34:05 jj Exp $ */ #ifndef _SPARC64_UNISTD_H #define _SPARC64_UNISTD_H @@ -46,11 +46,11 @@ #define __NR_sigaltstack 28 /* Common */ #define __NR_pause 29 /* Is sigblock(0)->sigpause() in SunOS */ #define __NR_utime 30 /* Implemented via utimes() under SunOS */ -/* #define __NR_stty 31 Implemented via ioctl() under SunOS */ -/* #define __NR_gtty 32 Implemented via ioctl() under SunOS */ +/* #define __NR_lchown32 31 Linux sparc32 specific */ +/* #define __NR_fchown32 32 Linux sparc32 specific */ #define __NR_access 33 /* Common */ #define __NR_nice 34 /* Implemented via get/setpriority() in SunOS */ -/* #define __NR_ftime 35 Implemented via gettimeofday() in SunOS */ +/* #define __NR_chown32 35 Linux sparc32 specific */ #define __NR_sync 36 /* Common */ #define __NR_kill 37 /* Common */ #define __NR_stat 38 /* Common */ @@ -59,7 +59,7 @@ #define __NR_dup 41 /* Common */ #define __NR_pipe 42 /* Common */ #define __NR_times 43 /* Implemented via getrusage() in SunOS */ -/* #define __NR_profil 44 Common */ +/* #define __NR_getuid32 44 Linux sparc32 specific */ #define __NR_umount2 45 /* Linux Specific */ #define __NR_setgid 46 /* Implemented via setregid() in SunOS */ #define __NR_getgid 47 /* Common */ @@ -68,7 +68,7 @@ #define __NR_getegid 50 /* SunOS calls getgid() */ #define __NR_acct 51 /* Common */ #define __NR_memory_ordering 52 /* Linux Specific */ -/* #define __NR_mctl 53 SunOS specific */ +/* #define __NR_getgid32 53 Linux sparc32 specific */ #define __NR_ioctl 54 /* Common */ #define __NR_reboot 55 /* Common */ /* #define __NR_mmap2 56 Linux sparc32 Specific */ @@ -84,32 +84,32 @@ #define __NR_vfork 66 /* Common */ #define __NR_pread 67 /* Linux Specific */ #define __NR_pwrite 68 /* Linux Specific */ -/* #define __NR_sbrk 69 SunOS Specific */ -/* #define __NR_sstk 70 SunOS Specific */ +/* #define __NR_geteuid32 69 Linux sparc32, sbrk under SunOS */ +/* #define __NR_getegid32 70 Linux sparc32, sstk under SunOS */ #define __NR_mmap 71 /* Common */ -/* #define __NR_vadvise 72 SunOS Specific */ +/* #define __NR_setreuid32 72 Linux sparc32, vadvise under SunOS */ #define __NR_munmap 73 /* Common */ #define __NR_mprotect 74 /* Common */ -/* #define __NR_madvise 75 SunOS Specific */ +/* #define __NR_setregid32 75 Linux sparc32, madvise under SunOS */ #define __NR_vhangup 76 /* Common */ /* #define __NR_truncate64 77 Linux sparc32 Specific */ -/* #define __NR_mincore 78 SunOS Specific */ +/* #define __NR_getgroups32 78 Linux sparc32, mincore under SunOS */ #define __NR_getgroups 79 /* Common */ #define __NR_setgroups 80 /* Common */ #define __NR_getpgrp 81 /* Common */ -/* #define __NR_setpgrp 82 setpgid, same difference... */ +/* #define __NR_setgroups32 82 Linux sparc32, setpgrp under SunOS */ #define __NR_setitimer 83 /* Common */ /* #define __NR_ftruncate64 84 Linux sparc32 Specific */ #define __NR_swapon 85 /* Common */ #define __NR_getitimer 86 /* Common */ -/* #define __NR_gethostname 87 SunOS Specific */ +/* #define __NR_setuid32 87 Linux sparc32, gethostname under SunOS */ #define __NR_sethostname 88 /* Common */ -/* #define __NR_getdtablesize 89 SunOS Specific */ +/* #define __NR_setgid32 89 Linux sparc32, getdtablesize under SunOS */ #define __NR_dup2 90 /* Common */ -/* #define __NR_getdopt 91 SunOS Specific */ +/* #define __NR_setfsuid32 91 Linux sparc32, getdopt under SunOS */ #define __NR_fcntl 92 /* Common */ #define __NR_select 93 /* Common */ -/* #define __NR_setdopt 94 SunOS Specific */ +/* #define __NR_setfsgid32 94 Linux sparc32, setdopt under SunOS */ #define __NR_fsync 95 /* Common */ #define __NR_setpriority 96 /* Common */ #define __NR_socket 97 /* Common */ @@ -123,10 +123,10 @@ #define __NR_rt_sigtimedwait 105 /* Linux Specific */ #define __NR_rt_sigqueueinfo 106 /* Linux Specific */ #define __NR_rt_sigsuspend 107 /* Linux Specific */ -/* #define __NR_sigvec 108 SunOS Specific */ -/* #define __NR_sigblock 109 SunOS Specific */ -/* #define __NR_sigsetmask 110 SunOS Specific */ -/* #define __NR_sigpause 111 SunOS Specific */ +#define __NR_setresuid 108 /* Linux Specific, sigvec under SunOS */ +#define __NR_getresuid 109 /* Linux Specific, sigblock under SunOS */ +#define __NR_setresgid 110 /* Linux Specific, sigsetmask under SunOS */ +#define __NR_getresgid 111 /* Linux Specific, sigpause under SunOS */ /* #define __NR_sigstack 112 SunOS Specific */ #define __NR_recvmsg 113 /* Common */ #define __NR_sendmsg 114 /* Common */ diff --git a/include/linux/hfs_fs.h b/include/linux/hfs_fs.h index ef2bc41052cd..4c9543a5d763 100644 --- a/include/linux/hfs_fs.h +++ b/include/linux/hfs_fs.h @@ -140,6 +140,19 @@ struct hfs_hdr_layout { *order[HFS_HDR_MAX]; /* 'descr' ordered by offset */ }; +/* header layout for netatalk's v1 appledouble file format */ +struct hfs_nat_hdr { + hfs_lword_t magic; + hfs_lword_t version; + hfs_byte_t homefs[16]; + hfs_word_t entries; + hfs_byte_t descrs[12*5]; + hfs_byte_t real_name[255]; /* id=3 */ + hfs_byte_t comment[200]; /* id=4 XXX: not yet implemented */ + hfs_byte_t old_info[16]; /* id=7 */ + hfs_u8 finderinfo[32]; /* id=9 */ +}; + /* * Default header layout for Netatalk and AppleDouble */ diff --git a/include/linux/highuid.h b/include/linux/highuid.h index 98b07c7f7b4c..26e9d57c8757 100644 --- a/include/linux/highuid.h +++ b/include/linux/highuid.h @@ -1,24 +1,26 @@ #ifndef _LINUX_HIGHUID_H #define _LINUX_HIGHUID_H +#include #include /* * general notes: * - * UID16_COMPAT_NEEDED is defined in include/asm-{arch}/posix_types.h - * if the given architecture needs to support backwards compatibility - * for old system calls. + * CONFIG_UID16 is defined if the given architecture needs to + * support backwards compatibility for old system calls. * - * old_uid_t and old_gid_t are only used if UID16_COMPAT_NEEDED - * is defined. + * kernel code should use uid_t and gid_t at all times when dealing with + * kernel-private data. + * + * old_uid_t and old_gid_t are only used if CONFIG_UID16 is defined. * * uid16_t and gid16_t are used on all architectures. (when dealing * with structures hard coded to 16 bits, such as in filesystems) */ -#ifdef UID16_COMPAT_NEEDED +#ifdef CONFIG_UID16 /* * This is the "overflow" UID and GID. They are used to signify uid/gid @@ -54,11 +56,19 @@ extern int overflowgid; #define NEW_TO_OLD_UID(uid) high2lowuid(uid) #define NEW_TO_OLD_GID(gid) high2lowgid(gid) +/* specific to fs/stat.c */ #define SET_OLDSTAT_UID(stat, uid) (stat).st_uid = high2lowuid(uid) #define SET_OLDSTAT_GID(stat, gid) (stat).st_gid = high2lowgid(gid) #define SET_STAT_UID(stat, uid) (stat).st_uid = high2lowuid(uid) #define SET_STAT_GID(stat, gid) (stat).st_gid = high2lowgid(gid) +/* specific to kernel/signal.c */ +#ifdef UID16_SIGINFO_COMPAT_NEEDED +#define SET_SIGINFO_UID16(var, uid) var = high2lowuid(uid) +#else +#define SET_SIGINFO_UID16(var, uid) do { ; } while (0) +#endif + #else #define SET_UID16(var, uid) do { ; } while (0) @@ -71,9 +81,9 @@ extern int overflowgid; #define SET_STAT_UID(stat, uid) (stat).st_uid = uid #define SET_STAT_GID(stat, gid) (stat).st_gid = gid -#define high2lowuid(x) (x) +#define SET_SIGINFO_UID16(var, uid) do { ; } while (0) -#endif /* UID16_COMPAT_NEEDED */ +#endif /* CONFIG_UID16 */ /* diff --git a/include/linux/init.h b/include/linux/init.h index 28bcbbc86f18..4d4e6e156bd6 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -1,6 +1,8 @@ #ifndef _LINUX_INIT_H #define _LINUX_INIT_H +#include + /* These macros are used to mark some functions or * initialized data (doesn't apply to uninitialized data) * as `initialization' functions. The kernel can take this diff --git a/include/linux/pci.h b/include/linux/pci.h index a8cfb2cfb186..a78ca599f4fe 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -509,8 +509,6 @@ struct pci_device_id { unsigned long driver_data; /* Data private to the driver */ }; -#define PCI_ID(vendor,device) (((vendor)<<16) | (device)) - struct pci_driver { struct list_head node; char *name; @@ -526,29 +524,7 @@ void pci_unregister_driver(struct pci_driver *); void pci_insert_device(struct pci_dev *, struct pci_bus *); void pci_remove_device(struct pci_dev *); struct pci_driver *pci_dev_driver(struct pci_dev *); - -/* - * simple PCI probing for drivers (drivers/pci/helper.c) - */ - -struct pci_simple_probe_entry; -typedef int (*pci_simple_probe_callback) (struct pci_dev *dev, int match_num, - const struct pci_simple_probe_entry *ent, - void *drvr_data); - -struct pci_simple_probe_entry { - unsigned short vendor; /* vendor id, PCI_ANY_ID, or 0 for last entry */ - unsigned short device; /* device id, PCI_ANY_ID, or 0 for last entry */ - unsigned short subsys_vendor; /* subsystem vendor id, 0 for don't care */ - unsigned short subsys_device; /* subsystem device id, 0 for don't care */ - void *dev_data; /* driver-private, entry-specific data */ -}; - -int pci_simple_probe (const struct pci_simple_probe_entry *list, - size_t match_limit, pci_simple_probe_callback cb, - void *drvr_data); - - +struct pci_device_id *pci_match_device(struct pci_device_id *ids, struct pci_dev *dev); /* * If the system does not have PCI, clearly these return errors. Define @@ -585,10 +561,6 @@ unsigned int ss_vendor, unsigned int ss_device, struct pci_dev *from) extern inline void pci_set_master(struct pci_dev *dev) { } extern inline int pci_enable_device(struct pci_dev *dev) { return 0; } -extern inline int pci_simple_probe (const struct pci_simple_probe_entry *list, - size_t match_limit, pci_simple_probe_callback cb, void *drvr_data) -{ return 0; } - #endif /* !CONFIG_PCI */ /* diff --git a/kernel/Makefile b/kernel/Makefile index 2e88d3690240..270692eb2b84 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -13,10 +13,14 @@ O_TARGET := kernel.o O_OBJS = sched.o dma.o fork.o exec_domain.o panic.o printk.o sys.o \ module.o exit.o itimer.o info.o time.o softirq.o resource.o \ - sysctl.o acct.o capability.o ptrace.o timer.o uid16.o + sysctl.o acct.o capability.o ptrace.o timer.o OX_OBJS += signal.o +ifeq ($(CONFIG_UID16),y) +O_OBJS += uid16.o +endif + ifeq ($(CONFIG_KMOD),y) O_OBJS += kmod.o endif diff --git a/kernel/ksyms.c b/kernel/ksyms.c index cb42b9c3a68f..4decd70ea08a 100644 --- a/kernel/ksyms.c +++ b/kernel/ksyms.c @@ -42,6 +42,7 @@ #include #include #include +#include #if defined(CONFIG_PROC_FS) #include @@ -430,6 +431,11 @@ EXPORT_SYMBOL(__down_trylock); EXPORT_SYMBOL(__up); EXPORT_SYMBOL(brw_page); +#ifdef CONFIG_UID16 +EXPORT_SYMBOL(fs_overflowuid); +EXPORT_SYMBOL(fs_overflowgid); +#endif + /* all busmice */ EXPORT_SYMBOL(add_mouse_randomness); EXPORT_SYMBOL(fasync_helper); diff --git a/kernel/signal.c b/kernel/signal.c index 868ff5854fb8..6e0730512a91 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -144,7 +144,7 @@ printk("SIG dequeue (%s:%d): %d ", current->comm, current->pid, info->si_code = 0; info->si_pid = 0; info->si_uid = 0; - SET_UID16(info->si_uid16, 0); + SET_SIGINFO_UID16(info->si_uid16, 0); } else { struct signal_queue *q, **pp; pp = ¤t->sigqueue; @@ -180,7 +180,7 @@ printk("SIG dequeue (%s:%d): %d ", current->comm, current->pid, info->si_code = 0; info->si_pid = 0; info->si_uid = 0; - SET_UID16(info->si_uid16, 0); + SET_SIGINFO_UID16(info->si_uid16, 0); } } @@ -343,7 +343,7 @@ printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig); q->info.si_code = SI_USER; q->info.si_pid = current->pid; q->info.si_uid = current->uid; - SET_UID16(q->info.si_uid16, current->uid); + SET_SIGINFO_UID16(q->info.si_uid16, current->uid); break; case 1: q->info.si_signo = sig; @@ -351,7 +351,7 @@ printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig); q->info.si_code = SI_KERNEL; q->info.si_pid = 0; q->info.si_uid = 0; - SET_UID16(q->info.si_uid16, 0); + SET_SIGINFO_UID16(q->info.si_uid16, 0); break; default: q->info = *info; @@ -802,7 +802,7 @@ sys_kill(int pid, int sig) info.si_code = SI_USER; info.si_pid = current->pid; info.si_uid = current->uid; - SET_UID16(info.si_uid16, current->uid); + SET_SIGINFO_UID16(info.si_uid16, current->uid); return kill_something_info(sig, &info, pid); } diff --git a/kernel/sys.c b/kernel/sys.c index fde0159ff230..b32516614d5f 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -4,6 +4,7 @@ * Copyright (C) 1991, 1992 Linus Torvalds */ +#include #include #include #include @@ -17,6 +18,8 @@ #include #include +#ifdef CONFIG_UID16 + /* * this is where the system-wide overflow UID and GID are defined, for * architectures that now have 32-bit UID/GID but didn't in the past @@ -25,6 +28,8 @@ int overflowuid = DEFAULT_OVERFLOWUID; int overflowgid = DEFAULT_OVERFLOWGID; +#endif /* CONFIG_UID16 */ + /* * the same as above, but for filesystems which can only store a 16-bit * UID and GID. as such, this is needed on all architectures diff --git a/kernel/sysctl.c b/kernel/sysctl.c index fd4970e582eb..28f881570dcc 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -247,12 +247,14 @@ static ctl_table kern_table[] = { {KERN_MAX_THREADS, "threads-max", &max_threads, sizeof(int), 0644, NULL, &proc_dointvec}, {KERN_RANDOM, "random", NULL, 0, 0555, random_table}, +#ifdef CONFIG_UID16 {KERN_OVERFLOWUID, "overflowuid", &overflowuid, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &minolduid, &maxolduid}, {KERN_OVERFLOWGID, "overflowgid", &overflowgid, sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &minolduid, &maxolduid}, +#endif /* CONFIG_UID16 */ {0} }; diff --git a/mm/slab.c b/mm/slab.c index 41e19028a0e8..57caac781546 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -216,6 +216,8 @@ typedef struct kmem_bufctl_s { #endif /* SLAB_DEBUG_SUPPORT */ +#define SLAB_CACHE_NAME_LEN 20 /* max name length for a slab cache */ + /* Cache struct - manages a cache. * First four members are commonly referenced during an alloc/free operation. */ @@ -241,7 +243,7 @@ struct kmem_cache_s { size_t c_colour; /* cache colouring range */ size_t c_colour_next;/* cache colouring */ unsigned long c_failures; - const char *c_name; + char c_name[SLAB_CACHE_NAME_LEN]; struct kmem_cache_s *c_nextp; kmem_cache_t *c_index_cachep; #if SLAB_STATS @@ -667,7 +669,6 @@ kmem_cache_cal_waste(unsigned long gfporder, size_t size, size_t extra, /* Create a cache: * Returns a ptr to the cache on success, NULL on failure. * Cannot be called within a int, but can be interrupted. - * NOTE: The 'name' is assumed to be memory that is _not_ going to disappear. */ kmem_cache_t * kmem_cache_create(const char *name, size_t size, size_t offset, @@ -687,6 +688,10 @@ kmem_cache_create(const char *name, size_t size, size_t offset, printk("%sNULL ptr\n", func_nm); goto opps; } + if (strlen(name) >= SLAB_CACHE_NAME_LEN) { + printk("%sname too long\n", func_nm); + goto opps; + } if (in_interrupt()) { printk("%sCalled during int - %s\n", func_nm, name); goto opps; @@ -948,7 +953,8 @@ printk("%s: Left_over:%d Align:%d Size:%d\n", name, left_over, offset, size); cachep->c_ctor = ctor; cachep->c_dtor = dtor; cachep->c_magic = SLAB_C_MAGIC; - cachep->c_name = name; /* Simply point to the name. */ + /* Copy name over so we don't have problems with unloaded modules */ + strcpy(cachep->c_name, name); spin_lock_init(&cachep->c_spinlock); /* Need the semaphore to access the chain. */ @@ -1026,12 +1032,7 @@ static int __kmem_cache_shrink(kmem_cache_t *cachep) } /* Shrink a cache. Releases as many slabs as possible for a cache. - * It is expected this function will be called by a module when it is - * unloaded. The cache is _not_ removed, this creates too many problems and - * the cache-structure does not take up much room. A module should keep its - * cache pointer(s) in unloaded memory, so when reloaded it knows the cache - * is available. To help debugging, a zero exit status indicates all slabs - * were released. + * To help debugging, a zero exit status indicates all slabs were released. */ int kmem_cache_shrink(kmem_cache_t *cachep) @@ -1049,6 +1050,12 @@ kmem_cache_shrink(kmem_cache_t *cachep) /* * Remove a kmem_cache_t object from the slab cache. When returns 0 it * completed succesfully. -arca + * + * It is expected this function will be called by a module when it is + * unloaded. This will remove the cache completely, and avoid a duplicate + * cache being allocated each time a module is loaded and unloaded, if the + * module doesn't have persistent in-kernel storage across loads and unloads. + * */ int kmem_cache_destroy(kmem_cache_t * cachep) { diff --git a/mm/vmscan.c b/mm/vmscan.c index 7e064d0fadf7..3a5f4fbbeeaf 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -503,7 +503,7 @@ int kswapd(void *unused) do { /* kswapd is critical to provide GFP_ATOMIC allocations (not GFP_HIGHMEM ones). */ - if (nr_free_buffer_pages() >= freepages.high) + if (nr_free_pages() - nr_free_highpages() >= freepages.high) break; if (!do_try_to_free_pages(GFP_KSWAPD, 0)) break; diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 782e3d9ae580..70209a5fe19e 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -5,7 +5,7 @@ * * ROUTE - implementation of the IP router. * - * Version: $Id: route.c,v 1.77 2000/01/06 00:41:59 davem Exp $ + * Version: $Id: route.c,v 1.78 2000/01/13 00:06:58 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 4b034191fb72..e3d884dda316 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -5,7 +5,7 @@ * * Implementation of the Transmission Control Protocol(TCP). * - * Version: $Id: tcp_output.c,v 1.114 2000/01/09 02:19:43 davem Exp $ + * Version: $Id: tcp_output.c,v 1.116 2000/01/13 00:19:49 davem Exp $ * * Authors: Ross Biro, * Fred N. van Kempen, @@ -1031,7 +1031,7 @@ void tcp_send_delayed_ack(struct sock *sk, int max_timeout) unsigned long timeout; /* Stay within the limit we were given */ - timeout = tp->ato; + timeout = (tp->ato << 1) >> 1; if (timeout > max_timeout) timeout = max_timeout; timeout += jiffies; @@ -1070,10 +1070,14 @@ void tcp_send_ack(struct sock *sk) * * This is the one possible way that we can delay an * ACK and have tp->ato indicate that we are in - * quick ack mode, so clear it. + * quick ack mode, so clear it. It is also the only + * possible way for ato to be zero, when ACK'ing a + * SYNACK because we've taken no ATO measurement yet. */ - if(tcp_in_quickack_mode(tp)) + if (tcp_in_quickack_mode(tp)) tcp_exit_quickack_mode(tp); + if (!tp->ato) + tp->ato = tp->rto; tcp_send_delayed_ack(sk, HZ/2); return; } -- 2.39.5