diff options
Diffstat (limited to 'arch')
147 files changed, 3886 insertions, 2302 deletions
diff --git a/arch/alpha/boot/Makefile b/arch/alpha/boot/Makefile index ee2ac0ac0..6bd6cb03f 100644 --- a/arch/alpha/boot/Makefile +++ b/arch/alpha/boot/Makefile @@ -11,9 +11,9 @@ LINKFLAGS = -static -T bootloader.lds #-N -relax .S.s: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -E -o $*.o $< + $(CPP) $(AFLAGS) -traditional -o $*.o $< .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c -o $*.o $< + $(CC) $(AFLAGS) -traditional -c -o $*.o $< OBJECTS = head.o main.o BPOBJECTS = head.o bootp.o diff --git a/arch/alpha/config.in b/arch/alpha/config.in index d73afb558..6053ae25c 100644 --- a/arch/alpha/config.in +++ b/arch/alpha/config.in @@ -65,6 +65,7 @@ unset CONFIG_ALPHA_BROKEN_IRQ_MASK # Most of these machines have ISA slots; not exactly sure which don't, # and this doesn't activate hordes of code, so do it always. define_bool CONFIG_ISA y +define_bool CONFIG_SBUS n if [ "$CONFIG_ALPHA_JENSEN" = "y" ] then @@ -189,6 +190,8 @@ bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG if [ "$CONFIG_HOTPLUG" = "y" ] ; then source drivers/pcmcia/Config.in +else + define_bool CONFIG_PCMCIA n fi bool 'Networking support' CONFIG_NET @@ -274,7 +277,6 @@ endmenu source drivers/char/Config.in -source drivers/usb/Config.in #source drivers/misc/Config.in @@ -300,6 +302,8 @@ if [ "$CONFIG_SOUND" != "n" ]; then fi endmenu +source drivers/usb/Config.in + mainmenu_option next_comment comment 'Kernel hacking' diff --git a/arch/alpha/defconfig b/arch/alpha/defconfig index 03be84794..40676926c 100644 --- a/arch/alpha/defconfig +++ b/arch/alpha/defconfig @@ -46,11 +46,13 @@ CONFIG_ALPHA_GENERIC=y # CONFIG_ALPHA_SABLE is not set # CONFIG_ALPHA_TAKARA is not set CONFIG_ISA=y +# CONFIG_SBUS is not set CONFIG_PCI=y CONFIG_ALPHA_BROKEN_IRQ_MASK=y # CONFIG_SMP is not set CONFIG_PCI_NAMES=y # CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set CONFIG_NET=y CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set diff --git a/arch/alpha/kernel/Makefile b/arch/alpha/kernel/Makefile index 9d87b6e0c..3a0a4ec0b 100644 --- a/arch/alpha/kernel/Makefile +++ b/arch/alpha/kernel/Makefile @@ -8,9 +8,9 @@ # Note 2! The CFLAGS definitions are now in the main makefile... .S.s: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -E -o $*.s $< + $(CPP) $(AFLAGS) -o $*.s $< .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -c -o $*.o $< + $(CC) $(AFLAGS) -c -o $*.o $< O_TARGET := kernel.o O_OBJS := entry.o traps.o process.o osf_sys.o irq.o irq_alpha.o \ diff --git a/arch/alpha/kernel/irq_i8259.c b/arch/alpha/kernel/irq_i8259.c index a47178050..79a1c4fb5 100644 --- a/arch/alpha/kernel/irq_i8259.c +++ b/arch/alpha/kernel/irq_i8259.c @@ -146,12 +146,6 @@ isa_device_interrupt(unsigned long vector, struct pt_regs *regs) */ int j = *(vuip) IACK_SC; j &= 0xff; - if (j == 7) { - if (!(inb(0x20) & 0x80)) { - /* It's only a passive release... */ - return; - } - } handle_irq(j, regs); } #endif diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index a7110bf23..299a1b338 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c @@ -42,7 +42,7 @@ #include <asm/hwrpb.h> #include <asm/processor.h> -extern int do_mount(struct block_device *, const char *, const char *, char *, int, void *); +extern long do_sys_mount(char *, char *, char *, int, void *); extern int do_pipe(int *); extern asmlinkage int sys_swapon(const char *specialfile, int swap_flags); @@ -319,20 +319,16 @@ asmlinkage int osf_statfs(char *path, struct osf_statfs *buffer, unsigned long b asmlinkage int osf_fstatfs(unsigned long fd, struct osf_statfs *buffer, unsigned long bufsiz) { struct file *file; - struct dentry *dentry; int retval; - lock_kernel(); retval = -EBADF; file = fget(fd); - if (!file) - goto out; - dentry = file->f_dentry; - if (dentry) - retval = do_osf_statfs(dentry, buffer, bufsiz); - fput(file); -out: - unlock_kernel(); + if (file) { + lock_kernel(); + retval = do_osf_statfs(file->f_dentry, buffer, bufsiz); + unlock_kernel(); + fput(file); + } return retval; } @@ -363,32 +359,6 @@ struct procfs_args { uid_t exroot; }; -static struct dentry *getdev(const char *name, int rdonly) -{ - struct dentry *dentry; - struct inode *inode; - int retval; - - dentry = namei(name); - retval = PTR_ERR(dentry); - if (IS_ERR(dentry)) - return dentry; - - retval = -ENOTBLK; - inode = dentry->d_inode; - if (!S_ISBLK(inode->i_mode)) - goto out_dput; - - retval = -EACCES; - if (IS_NODEV(inode)) - goto out_dput; - return dentry; - -out_dput: - dput(dentry); - return ERR_PTR(retval); -} - /* * We can't actually handle ufs yet, so we translate UFS mounts to * ext2fs mounts. I wouldn't mind a UFS filesystem, but the UFS @@ -400,20 +370,18 @@ out_dput: static int osf_ufs_mount(char *dirname, struct ufs_args *args, int flags) { int retval; - struct dentry *dentry; struct cdfs_args tmp; + char *devname; retval = -EFAULT; if (copy_from_user(&tmp, args, sizeof(tmp))) goto out; - - dentry = getdev(tmp.devname, 0); - retval = PTR_ERR(dentry); - if (IS_ERR(dentry)) + devname = getname(tmp.devname); + retval = PTR_ERR(devname); + if (IS_ERR(devname)) goto out; - retval = do_mount(dentry->d_inode->i_bdev, tmp.devname, dirname, - "ext2", flags, NULL); - dput(dentry); + retval = do_sys_mount(devname, dirname, "ext2", flags, NULL); + putname(devname); out: return retval; } @@ -421,20 +389,18 @@ out: static int osf_cdfs_mount(char *dirname, struct cdfs_args *args, int flags) { int retval; - struct dentry * dentry; struct cdfs_args tmp; + char *devname; retval = -EFAULT; if (copy_from_user(&tmp, args, sizeof(tmp))) goto out; - - dentry = getdev(tmp.devname, 1); - retval = PTR_ERR(dentry); - if (IS_ERR(dentry)) + devname = getname(tmp.devname); + retval = PTR_ERR(devname); + if (IS_ERR(devname)) goto out; - retval = do_mount(dentry->d_inode->i_bdev, tmp.devname, dirname, - "iso9660", flags, NULL); - dput(dentry); + retval = do_sys_mount(devname, dirname, "iso9660", flags, NULL); + putname(devname); out: return retval; } @@ -445,27 +411,36 @@ static int osf_procfs_mount(char *dirname, struct procfs_args *args, int flags) if (copy_from_user(&tmp, args, sizeof(tmp))) return -EFAULT; - return do_mount(NULL, "", dirname, "proc", flags, NULL); + + return do_sys_mount("", dirname, "proc", flags, NULL); } asmlinkage int osf_mount(unsigned long typenr, char *path, int flag, void *data) { int retval = -EINVAL; + char *name; lock_kernel(); + + name = getname(path); + retval = PTR_ERR(name); + if (IS_ERR(name)) + goto out; switch (typenr) { case 1: - retval = osf_ufs_mount(path, (struct ufs_args *) data, flag); + retval = osf_ufs_mount(name, (struct ufs_args *) data, flag); break; case 6: - retval = osf_cdfs_mount(path, (struct cdfs_args *) data, flag); + retval = osf_cdfs_mount(name, (struct cdfs_args *) data, flag); break; case 9: - retval = osf_procfs_mount(path, (struct procfs_args *) data, flag); + retval = osf_procfs_mount(name, (struct procfs_args *) data, flag); break; default: printk("osf_mount(%ld, %x)\n", typenr, flag); } + putname(name); +out: unlock_kernel(); return retval; } diff --git a/arch/arm/Makefile b/arch/arm/Makefile index ff732b8fa..019f2115e 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -100,7 +100,7 @@ endif LIBGCC := $(shell $(CC) $(CFLAGS) --print-libgcc-file-name) -export LIBGCC +export LIBGCC MACHINE PROCESSOR TEXTADDR ifeq ($(CONFIG_ARCH_A5K),y) MACHINE = a5k @@ -216,7 +216,7 @@ archclean: @$(MAKEBOOT) clean $(RM) arch/arm/lib/constants.h arch/arm/vmlinux.lds -archdep: +archdep: symlinks @$(MAKEBOOT) dep # My testing targets (that short circuit a few dependencies) @@ -256,3 +256,8 @@ victor_config: empeg_config: $(RM) arch/arm/defconfig cp arch/arm/def-configs/empeg arch/arm/defconfig + +thinclient_config: + $(RM) arch/arm/defconfig + cp arch/arm/def-configs/thinclient arch/arm/defconfig + diff --git a/arch/arm/boot/compressed/head-sa1100.S b/arch/arm/boot/compressed/head-sa1100.S index 4464157c3..b6e9dbe64 100644 --- a/arch/arm/boot/compressed/head-sa1100.S +++ b/arch/arm/boot/compressed/head-sa1100.S @@ -17,8 +17,9 @@ __SA1100_start: #error What am I doing here... #endif -#ifdef CONFIG_SA1100_BRUTUS -@ need to enter SVC mode +#if defined( CONFIG_SA1100_BRUTUS ) || \ + defined( CONFIG_SA1100_THINCLIENT ) +@ Booting from Angel -- 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 diff --git a/arch/arm/config.in b/arch/arm/config.in index cf6312fc1..fa124b5fd 100644 --- a/arch/arm/config.in +++ b/arch/arm/config.in @@ -53,6 +53,7 @@ if [ "$CONFIG_ARCH_SA1100" = "y" ]; then Itsy CONFIG_SA1100_ITSY \ LART CONFIG_SA1100_LART \ PLEB CONFIG_SA1100_PLEB \ + ThinClient CONFIG_SA1100_THINCLIENT \ Victor CONFIG_SA1100_VICTOR \ Tifon CONFIG_SA1100_TIFON" Brutus fi @@ -136,6 +137,9 @@ else define_bool CONFIG_ISA_DMA n fi +define_bool CONFIG_SBUS n +define_bool CONFIG_PCMCIA n + if [ "$CONFIG_CPU_32" = "y" -a "$CONFIG_ARCH_EBSA110" != "y" ]; then bool 'Kernel-mode alignment trap handler' CONFIG_ALIGNMENT_TRAP fi @@ -218,7 +222,6 @@ if [ "$CONFIG_ARCH_ACORN" = "y" ]; then fi fi -source drivers/usb/Config.in #source drivers/misc/Config.in @@ -298,6 +301,8 @@ fi source fs/Config.in +source drivers/usb/Config.in + mainmenu_option next_comment comment 'Kernel hacking' diff --git a/arch/arm/def-configs/brutus b/arch/arm/def-configs/brutus index aade81639..284c92925 100644 --- a/arch/arm/def-configs/brutus +++ b/arch/arm/def-configs/brutus @@ -2,6 +2,12 @@ # Automatically generated make config: don't edit # CONFIG_ARM=y +CONFIG_UID16=y + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y # # System and processor type @@ -12,25 +18,21 @@ CONFIG_ARM=y # CONFIG_ARCH_EBSA110 is not set # CONFIG_FOOTBRIDGE is not set CONFIG_ARCH_SA1100=y -CONFIG_CPU_SA1100=y CONFIG_SA1100_BRUTUS=y # CONFIG_SA1100_EMPEG is not set # CONFIG_SA1100_ITSY is not set # CONFIG_SA1100_LART is not set # CONFIG_SA1100_PLEB is not set +# CONFIG_SA1100_THINCLIENT is not set # CONFIG_SA1100_VICTOR is not set # CONFIG_SA1100_TIFON is not set +CONFIG_DISCONTIGMEM=y # CONFIG_ARCH_ACORN is not set CONFIG_CPU_32=y # CONFIG_CPU_26 is not set CONFIG_CPU_32v4=y -CONFIG_CPU_SA110=y +CONFIG_CPU_SA1100=y # CONFIG_ISA_DMA is not set - -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y # CONFIG_ALIGNMENT_TRAP is not set # @@ -48,10 +50,16 @@ CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_SYSCTL is not set 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 # CONFIG_ARTHUR is not set + +# +# Parallel port support +# # CONFIG_PARPORT is not set CONFIG_CMDLINE="" @@ -61,7 +69,6 @@ CONFIG_CMDLINE="" # 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 @@ -81,7 +88,6 @@ CONFIG_CMDLINE="" # Please see Documentation/ide.txt for help/info on IDE drives # # CONFIG_BLK_DEV_HD_ONLY is not set -# CONFIG_BLK_CPQ_DA is not set # # Additional Block Devices @@ -91,7 +97,6 @@ CONFIG_CMDLINE="" CONFIG_BLK_DEV_RAM=y 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 @@ -100,9 +105,9 @@ CONFIG_PARIDE_PARPORT=y # Character devices # CONFIG_VT=y -CONFIG_VT_CONSOLE=y +# CONFIG_VT_CONSOLE is not set CONFIG_SERIAL_SA1100=y -# CONFIG_SERIAL_SA1100_CONSOLE is not set +CONFIG_SERIAL_SA1100_CONSOLE=y # CONFIG_SERIAL is not set # CONFIG_SERIAL_EXTENDED is not set # CONFIG_SERIAL_NONSTANDARD is not set @@ -110,11 +115,25 @@ CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=32 # +# I2C support +# +# CONFIG_I2C is not set + +# # Mice # # CONFIG_BUSMOUSE is not set # CONFIG_MOUSE 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 @@ -123,11 +142,6 @@ CONFIG_UNIX98_PTY_COUNT=32 # 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 @@ -137,9 +151,11 @@ CONFIG_UNIX98_PTY_COUNT=32 # # CONFIG_FTAPE is not set # CONFIG_DRM is not set +# CONFIG_DRM_TDFX is not set +# CONFIG_AGP is not set # -# USB drivers - not for the faint of heart +# USB support # # CONFIG_USB is not set @@ -148,16 +164,22 @@ CONFIG_UNIX98_PTY_COUNT=32 # # CONFIG_VGA_CONSOLE is not set CONFIG_FB=y + +# +# Frame-buffer support +# +CONFIG_FB=y CONFIG_DUMMY_CONSOLE=y CONFIG_FB_SA1100=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_CFB2=y CONFIG_FBCON_CFB4=y CONFIG_FBCON_CFB8=y -CONFIG_FBCON_CFB16=y CONFIG_FBCON_FONTWIDTH8_ONLY=y CONFIG_FBCON_FONTS=y CONFIG_FONT_8x8=y @@ -172,30 +194,35 @@ CONFIG_FONT_8x8=y # CONFIG_SCSI is not set # -# Filesystems +# File systems # # CONFIG_QUOTA is not set # CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set # CONFIG_FAT_FS is not set # CONFIG_MSDOS_FS is not set # CONFIG_UMSDOS_FS is not set # CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set +# CONFIG_CRAMFS is not set # CONFIG_ISO9660_FS is not set # CONFIG_JOLIET is not set -# CONFIG_UDF_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_NTFS_FS is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_DEBUG is not set 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 # @@ -203,8 +230,6 @@ CONFIG_EXT2_FS=y # # CONFIG_PARTITION_ADVANCED is not set CONFIG_MSDOS_PARTITION=y -# CONFIG_SGI_PARTITION is not set -# CONFIG_SUN_PARTITION is not set # CONFIG_NLS is not set # diff --git a/arch/arm/def-configs/footbridge b/arch/arm/def-configs/footbridge index e43a8d2a9..e0ee910b7 100644 --- a/arch/arm/def-configs/footbridge +++ b/arch/arm/def-configs/footbridge @@ -2,6 +2,7 @@ # Automatically generated make config: don't edit # CONFIG_ARM=y +CONFIG_UID16=y # # Code maturity level options @@ -19,16 +20,18 @@ CONFIG_FOOTBRIDGE=y CONFIG_HOST_FOOTBRIDGE=y # CONFIG_ADDIN_FOOTBRIDGE is not set CONFIG_ARCH_EBSA285=y -# CONFIG_CATS is not set +# CONFIG_ARCH_CATS is not set CONFIG_ARCH_NETWINDER=y +# CONFIG_ARCH_PERSONAL_SERVER is not set # CONFIG_ARCH_ACORN is not set CONFIG_CPU_32=y # CONFIG_CPU_26 is not set CONFIG_CPU_32v4=y CONFIG_CPU_SA110=y CONFIG_PCI=y +CONFIG_PCI_NAMES=y CONFIG_ISA_DMA=y -# CONFIG_ALIGNMENT_TRAP is not set +CONFIG_ALIGNMENT_TRAP=y # # Loadable module support @@ -42,7 +45,7 @@ CONFIG_KMOD=y # CONFIG_NET=y CONFIG_SYSVIPC=y -# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_BSD_PROCESS_ACCT=y CONFIG_SYSCTL=y CONFIG_NWFPE=y CONFIG_KCORE_ELF=y @@ -51,10 +54,14 @@ CONFIG_BINFMT_AOUT=y CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set # CONFIG_ARTHUR is not set + +# +# Parallel port support +# CONFIG_PARPORT=y CONFIG_PARPORT_PC=y CONFIG_PARPORT_PC_FIFO=y -# CONFIG_PARPORT_PC_PCMCIA is not set +# CONFIG_PARPORT_PC_SUPERIO is not set # CONFIG_PARPORT_ARC is not set # CONFIG_PARPORT_AMIGA is not set # CONFIG_PARPORT_MFC3 is not set @@ -68,6 +75,11 @@ CONFIG_LEDS_TIMER=y # CONFIG_LEDS_CPU is not set # +# IEEE 1394 (FireWire) support +# +# CONFIG_IEEE1394 is not set + +# # I2O device support # # CONFIG_I2O is not set @@ -87,64 +99,9 @@ CONFIG_ISAPNP=y # Block devices # # CONFIG_BLK_DEV_FD is not set -CONFIG_BLK_DEV_IDE=y - -# -# Please see Documentation/ide.txt for help/info on IDE drives -# -# 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_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_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 -# -CONFIG_BLK_DEV_LOOP=m -CONFIG_BLK_DEV_NBD=m -CONFIG_BLK_DEV_MD=y -CONFIG_MD_LINEAR=m -CONFIG_MD_STRIPED=m -CONFIG_MD_MIRRORING=m -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 +CONFIG_PARIDE_PARPORT=y # # Parallel IDE high-level drivers @@ -172,8 +129,17 @@ 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 +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set + +# +# Additional Block Devices +# +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_NBD=m +# CONFIG_BLK_DEV_MD is not set +CONFIG_BLK_DEV_RAM=y +# CONFIG_BLK_DEV_INITRD is not set # # Character devices @@ -183,7 +149,24 @@ CONFIG_VT_CONSOLE=y CONFIG_SERIAL=y CONFIG_SERIAL_CONSOLE=y # CONFIG_SERIAL_EXTENDED is not set -# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_SERIAL_NONSTANDARD=y +# CONFIG_COMPUTONE is not set +# CONFIG_ROCKETPORT is not set +# CONFIG_CYCLADES is not set +CONFIG_SERIAL_21285=y +CONFIG_SERIAL_21285_CONSOLE=y +# CONFIG_DIGIEPCA is not set +# CONFIG_DIGI is not set +# CONFIG_ESPSERIAL is not set +# CONFIG_MOXA_INTELLIO is not set +# CONFIG_MOXA_SMARTIO is not set +# CONFIG_ISI is not set +# CONFIG_SYNCLINK is not set +# CONFIG_N_HDLC is not set +# CONFIG_RISCOM8 is not set +# CONFIG_SPECIALIX is not set +# CONFIG_SX is not set +# CONFIG_STALDRV is not set CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=256 CONFIG_PRINTER=m @@ -191,6 +174,14 @@ CONFIG_PRINTER=m # CONFIG_PPDEV is not set # +# I2C support +# +CONFIG_I2C=m +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_CHARDEV is not set + +# # Mice # # CONFIG_BUSMOUSE is not set @@ -214,13 +205,14 @@ CONFIG_WATCHDOG=y CONFIG_SOFT_WATCHDOG=y # CONFIG_PCWATCHDOG is not set # CONFIG_ACQUIRE_WDT is not set -# CONFIG_21285_WATCHDOG is not set +# CONFIG_MIXCOMWD is not set +CONFIG_21285_WATCHDOG=m CONFIG_977_WATCHDOG=m CONFIG_DS1620=y CONFIG_NWBUTTON=y CONFIG_NWBUTTON_REBOOT=y CONFIG_NWFLASH=m -# CONFIG_NVRAM is not set +CONFIG_NVRAM=m CONFIG_RTC=y # @@ -230,25 +222,29 @@ CONFIG_VIDEO_DEV=y # CONFIG_I2C_PARPORT is not set # -# Radio/Video Adapters +# Radio 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 + +# +# Video Adapters +# +# CONFIG_VIDEO_PMS is not set +# CONFIG_VIDEO_BWQCAM is not set +# CONFIG_VIDEO_CQCAM is not set +# CONFIG_VIDEO_SAA5249 is not set +# CONFIG_TUNER_3036 is not set +# CONFIG_VIDEO_STRADIS is not set # CONFIG_VIDEO_ZORAN is not set # CONFIG_VIDEO_BUZ is not set # CONFIG_VIDEO_ZR36120 is not set @@ -263,15 +259,10 @@ CONFIG_VIDEO_CYBERPRO=m # 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 +# USB support # CONFIG_USB=m @@ -279,32 +270,46 @@ CONFIG_USB=m # USB Controllers # # CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT 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 +# CONFIG_USB_DEVICEFS 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_SCANNER=m +CONFIG_USB_AUDIO=m +# CONFIG_USB_ACM is not set # CONFIG_USB_SERIAL is not set # CONFIG_USB_CPIA is not set +# CONFIG_USB_IBMCAM is not set +# CONFIG_USB_OV511 is not set # CONFIG_USB_DC2XX is not set -# CONFIG_USB_SCSI is not set +# CONFIG_USB_STORAGE is not set # CONFIG_USB_USS720 is not set +# CONFIG_USB_DABUSB is not set +# CONFIG_USB_PLUSB is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_DSBR is not set + +# +# USB HID +# +# CONFIG_USB_HID is not set +CONFIG_USB_KBD=m +CONFIG_USB_MOUSE=m +# CONFIG_USB_WACOM is not set +# CONFIG_USB_WMFORCE is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set # # Console drivers @@ -342,10 +347,11 @@ CONFIG_FBCON_CFB24=y # CONFIG_FBCON_MAC is not set # CONFIG_FBCON_VGA_PLANES is not set CONFIG_FBCON_VGA=y +# CONFIG_FBCON_HGA is not set # CONFIG_FBCON_FONTWIDTH8_ONLY is not set CONFIG_FBCON_FONTS=y -CONFIG_FONT_8x8=y -CONFIG_FONT_8x16=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 @@ -356,7 +362,7 @@ CONFIG_FONT_ACORN_8x8=y # Networking options # CONFIG_PACKET=y -# CONFIG_PACKET_MMAP is not set +CONFIG_PACKET_MMAP=y # CONFIG_NETLINK is not set # CONFIG_NETFILTER is not set # CONFIG_FILTER is not set @@ -371,12 +377,12 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set CONFIG_IP_ALIAS=y -# CONFIG_SYN_COOKIES is not set +CONFIG_SYN_COOKIES=y # # (it is safe to leave these untouched) # -CONFIG_SKB_LARGE=y +# CONFIG_SKB_LARGE is not set # CONFIG_IPV6 is not set # CONFIG_KHTTPD is not set # CONFIG_ATM is not set @@ -409,7 +415,46 @@ CONFIG_SKB_LARGE=y # # IrDA (infrared) support # -# CONFIG_IRDA is not set +CONFIG_IRDA=m + +# +# IrDA protocols +# +CONFIG_IRLAN=m +CONFIG_IRCOMM=m +CONFIG_IRDA_ULTRA=y +CONFIG_IRDA_OPTIONS=y + +# +# IrDA options +# +CONFIG_IRDA_CACHE_LAST_LSAP=y +CONFIG_IRDA_FAST_RR=y +# CONFIG_IRDA_DEBUG is not set +# CONFIG_IRDA_COMPRESSION is not set + +# +# Infrared-port device drivers +# + +# +# SIR device drivers +# +# CONFIG_IRTTY_SIR is not set +# CONFIG_IRPORT_SIR is not set + +# +# FIR device drivers +# +# CONFIG_NSC_FIR is not set +CONFIG_WINBOND_FIR=m +# CONFIG_TOSHIBA_FIR is not set +# CONFIG_SMC_IRCC_FIR is not set + +# +# Dongle support +# +# CONFIG_DONGLE is not set # # Network device support @@ -421,6 +466,7 @@ CONFIG_NETDEVICES=y # # CONFIG_ARCNET is not set # CONFIG_DUMMY is not set +# CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set # CONFIG_NET_SB1000 is not set @@ -440,30 +486,30 @@ CONFIG_VORTEX=y # 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_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_NET_PCI=y # CONFIG_PCNET32 is not set # CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_AC3200 is not set # CONFIG_APRICOT is not set # CONFIG_CS89x0 is not set # CONFIG_DE4X5 is not set -CONFIG_DEC_ELCP=m +CONFIG_TULIP=m # CONFIG_DGRS is not set -# CONFIG_EEXPRESS_PRO100 is not set +# CONFIG_DM9102 is not set +# CONFIG_EEPRO100 is not set # CONFIG_LNE390 is not set # CONFIG_NE3210 is not set CONFIG_NE2K_PCI=y +# CONFIG_RTL8129 is not set +# CONFIG_8139TOO is not set # 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 # @@ -491,7 +537,7 @@ CONFIG_SLIP_MODE_SLIP6=y # CONFIG_NET_RADIO is not set # -# Token Ring driver support +# Token Ring devices # # CONFIG_TR is not set # CONFIG_NET_FC is not set @@ -504,9 +550,70 @@ CONFIG_SLIP_MODE_SLIP6=y # CONFIG_WAN is not set # -# PCMCIA network device support +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +CONFIG_IDEDISK_MULTI_MODE=y +# CONFIG_BLK_DEV_IDECS 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_NET_PCMCIA is not set +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_BLK_DEV_RZ1000 is not set +CONFIG_BLK_DEV_IDEPCI=y +CONFIG_IDEPCI_SHARE_IRQ=y +CONFIG_BLK_DEV_IDEDMA_PCI=y +CONFIG_BLK_DEV_OFFBOARD=y +CONFIG_IDEDMA_PCI_AUTO=y +CONFIG_BLK_DEV_IDEDMA=y +CONFIG_IDEDMA_PCI_EXPERIMENTAL=y +# CONFIG_IDEDMA_PCI_WIP is not set +# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set +# CONFIG_BLK_DEV_AEC6210 is not set +# CONFIG_AEC6210_TUNING is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_BLK_DEV_AMD7409 is not set +# CONFIG_AMD7409_OVERRIDE is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_CMD64X_RAID is not set +CONFIG_BLK_DEV_CY82C693=y +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_HPT34X_AUTODMA is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_HPT366_FIP is not set +# CONFIG_HPT366_MODE3 is not set +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_OPTI621 is not set +CONFIG_BLK_DEV_PDC202XX=y +# CONFIG_PDC202XX_BURST is not set +# CONFIG_PDC202XX_MASTER is not set +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +CONFIG_BLK_DEV_SL82C105=y +# CONFIG_IDE_CHIPSETS is not set +CONFIG_IDEDMA_AUTO=y +CONFIG_BLK_DEV_IDE_MODES=y # # SCSI support @@ -527,8 +634,12 @@ CONFIG_SOUND=m # CONFIG_SOUND_MSNDCLAS is not set # CONFIG_SOUND_MSNDPIN is not set CONFIG_SOUND_OSS=m +# CONFIG_SOUND_TRACEINIT is not set +# CONFIG_SOUND_DMAP is not set # CONFIG_SOUND_AD1816 is not set # CONFIG_SOUND_SGALAXY is not set +CONFIG_SOUND_ADLIB=m +# CONFIG_SOUND_ACI_MIXER is not set # CONFIG_SOUND_CS4232 is not set # CONFIG_SOUND_SSCAPE is not set # CONFIG_SOUND_GUS is not set @@ -539,9 +650,11 @@ CONFIG_SOUND_OSS=m # CONFIG_SOUND_NM256 is not set # CONFIG_SOUND_MAD16 is not set # CONFIG_SOUND_PAS is not set +# CONFIG_PAS_JOYSTICK is not set # CONFIG_SOUND_PSS is not set # CONFIG_SOUND_SOFTOSS is not set CONFIG_SOUND_SB=m +# CONFIG_SOUND_AWE32_SYNTH is not set # CONFIG_SOUND_WAVEFRONT is not set # CONFIG_SOUND_MAUI is not set # CONFIG_SOUND_VIA82CXXX is not set @@ -549,24 +662,18 @@ CONFIG_SOUND_SB=m # CONFIG_SOUND_OPL3SA1 is not set # CONFIG_SOUND_OPL3SA2 is not set # CONFIG_SOUND_UART6850 is not set +# CONFIG_SOUND_AEDSP16 is not set # CONFIG_SOUND_VIDC is not set CONFIG_SOUND_WAVEARTIST=m -CONFIG_WAVEARTIST_BASE=250 -CONFIG_WAVEARTIST_IRQ=12 -CONFIG_WAVEARTIST_DMA=3 -CONFIG_WAVEARTIST_DMA2=7 # -# Additional low level sound drivers -# -# CONFIG_LOWLEVEL_SOUND is not set - -# -# Filesystems +# File systems # # CONFIG_QUOTA is not set CONFIG_AUTOFS_FS=y -CONFIG_ADFS_FS=y +# CONFIG_AUTOFS4_FS is not set +CONFIG_ADFS_FS=m +# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set @@ -575,12 +682,15 @@ CONFIG_MSDOS_FS=m # CONFIG_UMSDOS_FS is not set CONFIG_VFAT_FS=m # CONFIG_EFS_FS is not set +# CONFIG_CRAMFS 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_DEVFS_FS is not set +# CONFIG_DEVFS_DEBUG is not set CONFIG_DEVPTS_FS=y # CONFIG_QNX4FS_FS is not set # CONFIG_ROMFS_FS is not set @@ -606,7 +716,14 @@ CONFIG_LOCKD=y # Partition Types # CONFIG_PARTITION_ADVANCED=y +CONFIG_ACORN_PARTITION=y +# CONFIG_ACORN_PARTITION_ICS is not set +CONFIG_ACORN_PARTITION_ADFS=y +# CONFIG_ACORN_PARTITION_POWERTEC is not set +# CONFIG_ACORN_PARTITION_RISCIX is not set # CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set # CONFIG_MAC_PARTITION is not set CONFIG_MSDOS_PARTITION=y # CONFIG_BSD_DISKLABEL is not set @@ -614,13 +731,6 @@ CONFIG_MSDOS_PARTITION=y # 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 -# CONFIG_ACORN_PARTITION_POWERTEC is not set -# CONFIG_ACORN_PARTITION_RISCIX is not set CONFIG_NLS=y # diff --git a/arch/arm/def-configs/thinclient b/arch/arm/def-configs/thinclient new file mode 100644 index 000000000..01829e71f --- /dev/null +++ b/arch/arm/def-configs/thinclient @@ -0,0 +1,379 @@ +# +# Automatically generated make config: don't edit +# +CONFIG_ARM=y +CONFIG_UID16=y + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# System and processor type +# +# CONFIG_ARCH_ARC is not set +# CONFIG_ARCH_A5K is not set +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_FOOTBRIDGE is not set +CONFIG_ARCH_SA1100=y +# CONFIG_SA1100_BRUTUS is not set +# CONFIG_SA1100_EMPEG is not set +# CONFIG_SA1100_ITSY is not set +# CONFIG_SA1100_LART is not set +# CONFIG_SA1100_PLEB is not set +CONFIG_SA1100_THINCLIENT=y +# CONFIG_SA1100_VICTOR is not set +# CONFIG_SA1100_TIFON is not set +CONFIG_DISCONTIGMEM=y +# CONFIG_ARCH_ACORN is not set +CONFIG_CPU_32=y +# CONFIG_CPU_26 is not set +CONFIG_CPU_32v4=y +CONFIG_CPU_SA1100=y +# CONFIG_ISA_DMA is not set +CONFIG_ALIGNMENT_TRAP=y + +# +# Loadable module support +# +CONFIG_MODULES=y +# CONFIG_MODVERSIONS is not set +# CONFIG_KMOD is not set + +# +# General setup +# +CONFIG_NET=y +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 +# CONFIG_ARTHUR is not set +# CONFIG_PARPORT is not set +CONFIG_CMDLINE="root=nfs" + +# +# 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 +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_IDE is not set + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_ONLY is not set + +# +# Additional Block Devices +# +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_MD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_INITRD=y +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_HD is not set + +# +# Character devices +# +CONFIG_VT=y +# CONFIG_VT_CONSOLE is not set +CONFIG_SERIAL_SA1100=y +CONFIG_SERIAL_SA1100_CONSOLE=y +# CONFIG_SERIAL is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=32 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE 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 +# CONFIG_EFI_RTC is not set + +# +# Video For Linux +# +# CONFIG_VIDEO_DEV 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 +# CONFIG_AGP is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# Misc devices +# + +# +# Console drivers +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_FB=y + +# +# Frame-buffer support +# +CONFIG_FB=y +CONFIG_DUMMY_CONSOLE=y +CONFIG_FB_SA1100=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_CFB2=y +CONFIG_FBCON_CFB4=y +CONFIG_FBCON_CFB8=y +CONFIG_FBCON_FONTWIDTH8_ONLY=y +CONFIG_FBCON_FONTS=y +# CONFIG_FONT_8x8 is not set +CONFIG_FONT_8x16=y +# CONFIG_FONT_SUN8x16 is not set +# CONFIG_FONT_PEARL_8x8 is not set +# CONFIG_FONT_ACORN_8x8 is not set + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +# CONFIG_NETLINK is not set +# CONFIG_NETFILTER is not set +# CONFIG_FILTER is not set +CONFIG_UNIX=y +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_PNP=y +CONFIG_IP_PNP_BOOTP=y +# CONFIG_IP_PNP_RARP is not set +# CONFIG_IP_ROUTER is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_ALIAS is not set +# CONFIG_SYN_COOKIES is not set + +# +# (it is safe to leave these untouched) +# +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 +# CONFIG_LLC is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# IrDA (infrared) support +# +# CONFIG_IRDA is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_NET_SB1000 is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +# CONFIG_ARM_AM79C961A is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_LANCE is not set +CONFIG_NET_VENDOR_SMC=y +# CONFIG_WD80x3 is not set +# CONFIG_ULTRA is not set +# CONFIG_ULTRA32 is not set +CONFIG_SMC9194=y +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_AT1700 is not set +# CONFIG_DEPCA is not set +# CONFIG_NET_ISA is not set +# CONFIG_NET_PCI 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_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_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# SCSI support +# +# CONFIG_SCSI is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_CRAMFS 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 +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_DEBUG is not set +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 + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +CONFIG_NFS_FS=y +CONFIG_ROOT_NFS=y +# CONFIG_NFSD is not set +CONFIG_SUNRPC=y +CONFIG_LOCKD=y +# CONFIG_SMB_FS is not set +# CONFIG_NCP_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_NLS is not set + +# +# Kernel hacking +# +CONFIG_FRAME_POINTER=y +CONFIG_DEBUG_ERRORS=y +CONFIG_DEBUG_USER=y +CONFIG_DEBUG_INFO=y +# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_DEBUG_LL is not set diff --git a/arch/arm/defconfig b/arch/arm/defconfig index 79cac7fa3..c5b389476 100644 --- a/arch/arm/defconfig +++ b/arch/arm/defconfig @@ -32,6 +32,8 @@ CONFIG_PCI=y CONFIG_PCI_NAMES=y CONFIG_ISA=y CONFIG_ISA_DMA=y +# CONFIG_SBUS is not set +# CONFIG_PCMCIA is not set # CONFIG_ALIGNMENT_TRAP is not set # @@ -537,6 +539,7 @@ CONFIG_IDEDMA_PCI_EXPERIMENTAL=y # CONFIG_BLK_DEV_AEC6210 is not set # CONFIG_AEC6210_TUNING is not set # CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_WDC_ALI15X3 is not set # CONFIG_BLK_DEV_AMD7409 is not set # CONFIG_AMD7409_OVERRIDE is not set # CONFIG_BLK_DEV_CMD64X is not set diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index c454c1350..6cc5652e0 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -59,12 +59,12 @@ MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) all: kernel.o $(HEAD_OBJ) init_task.o $(HEAD_OBJ): $(HEAD_OBJ:.o=.S) - $(CC) -D__ASSEMBLY__ $(AFLAGS) -DTEXTADDR=$(TEXTADDR) -traditional -c $(HEAD_OBJ:.o=.S) -o $@ + $(CC) $(AFLAGS) -DTEXTADDR=$(TEXTADDR) -traditional -c $(HEAD_OBJ:.o=.S) -o $@ include $(TOPDIR)/Rules.make .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) $(AFLAGS_$@) -c -o $*.o $< + $(CC) $(AFLAGS) $(AFLAGS_$@) -c -o $*.o $< # Spell out some dependencies that `make dep' doesn't spot entry-armv.o: calls.S ../lib/constants.h diff --git a/arch/arm/kernel/arch.c b/arch/arm/kernel/arch.c index 536e614ff..e9cca7748 100644 --- a/arch/arm/kernel/arch.c +++ b/arch/arm/kernel/arch.c @@ -23,6 +23,9 @@ unsigned int memc_ctrl_reg; unsigned int number_mfm_drives; #endif +extern void setup_initrd(unsigned int start, unsigned int size); +extern void setup_ramdisk(int doload, int prompt, int start, unsigned int rd_sz); + /* * Architecture specific fixups. This is where any * parameters in the params struct are fixed up, or @@ -157,11 +160,15 @@ fixup_sa1100(struct machine_desc *desc, struct param_struct *params, #if defined(CONFIG_SA1100_BRUTUS) ROOT_DEV = MKDEV(RAMDISK_MAJOR,0); setup_ramdisk( 1, 0, 0, 8192 ); - setup_initrd( __phys_to_virt(0xd8000000), 0x00400000 ); + setup_initrd( __phys_to_virt(0xd8000000), 3*1024*1024 ); #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_THINCLIENT) + ROOT_DEV = MKDEV(RAMDISK_MAJOR,0); + setup_ramdisk( 1, 0, 0, 8192 ); + setup_initrd( __phys_to_virt(0xc0800000), 4*1024*1024 ); #elif defined(CONFIG_SA1100_TIFON) ROOT_DEV = MKDEV(UNNAMED_MAJOR, 0); setup_ramdisk(1, 0, 0, 4096); @@ -198,7 +205,7 @@ static struct machine_desc machine_desc[] __attribute__ ((__section__ (".arch.in "EBSA110", /* RMK */ 0x00000400, NO_VIDEO, - 1, 0, 1, 1, 1, + 1, 0, 1, 0, 1, NULL }, #endif diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c index 5a1b4ed31..02a4f6cf0 100644 --- a/arch/arm/kernel/armksyms.c +++ b/arch/arm/kernel/armksyms.c @@ -190,6 +190,8 @@ EXPORT_SYMBOL(uaccess_kernel); EXPORT_SYMBOL(uaccess_user); #endif + /* consistent area handling */ +EXPORT_SYMBOL(pci_alloc_consistent); EXPORT_SYMBOL(consistent_alloc); EXPORT_SYMBOL(consistent_free); EXPORT_SYMBOL(consistent_sync); diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index 109e2f96d..c4ccd64e3 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -504,6 +504,10 @@ void pcibios_align_resource(void *data, struct resource *res, unsigned long size { } +void pcibios_set_master(struct pci_dev *dev) +{ +} + int pcibios_enable_device(struct pci_dev *dev) { u16 cmd, old_cmd; diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index fe3939888..182b1c3b4 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -201,6 +201,38 @@ irq_prio_ebsa110: .byte 6, 6, 6, 6, 2, 2, 2, 2, 3, 3, 6, 6, 2, 2, 2, 2 .endm +#elif defined(CONFIG_ARCH_SHARK) + + .macro disable_fiq + .endm + + .macro get_irqnr_and_base, irqnr, irqstat, base + mov r4, #0xe0000000 + orr r4, r4, #0x20 + + mov \irqstat, #0x0C + strb \irqstat, [r4] @outb(0x0C, 0x20) /* Poll command */ + ldrb \irqnr, [r4] @irq = inb(0x20) & 7 + and \irqstat, \irqnr, #0x80 + teq \irqstat, #0 + beq 43f + and \irqnr, \irqnr, #7 + teq \irqnr, #2 + bne 44f +43: mov \irqstat, #0x0C + strb \irqstat, [r4, #0x80] @outb(0x0C, 0xA0) /* Poll command */ + ldrb \irqnr, [r4, #0x80] @irq = (inb(0xA0) & 7) + 8 + and \irqstat, \irqnr, #0x80 + teq \irqstat, #0 + beq 44f + and \irqnr, \irqnr, #7 + add \irqnr, \irqnr, #8 +44: teq \irqstat, #0 + .endm + + .macro irq_prio_table + .endm + #elif defined(CONFIG_HOST_FOOTBRIDGE) || defined(CONFIG_ADDIN_FOOTBRIDGE) #include <asm/dec21285.h> @@ -295,9 +327,12 @@ irq_prio_ebsa110: .endm .macro get_irqnr_and_base, irqnr, irqstat, base - ldr r4, =0xffe00000 - ldr \irqstat, [r4, #0x180] @ get interrupts + ldr \irqstat, =INTCONT_BASE + ldr \base, =soft_irq_mask + ldr \irqstat, [\irqstat] @ get interrupts + ldr \base, [\base] mov \irqnr, #0 + and \irqstat, \irqstat, \base @ mask out disabled ones 1001: tst \irqstat, #1 addeq \irqnr, \irqnr, #1 moveq \irqstat, \irqstat, lsr #1 @@ -307,6 +342,39 @@ irq_prio_ebsa110: .endm .macro irq_prio_table + .ltorg + .bss +ENTRY(soft_irq_mask) + .word 0 + .text + .endm + +#elif defined(CONFIG_ARCH_TBOX) + + .macro disable_fiq + .endm + + .macro get_irqnr_and_base, irqnr, irqstat, base + ldr \irqstat, =0xffff7000 + ldr \irqstat, [\irqstat] @ get interrupts + ldr \base, =soft_irq_mask + ldr \base, [\base] + mov \irqnr, #0 + and \irqstat, \irqstat, \base @ mask out disabled ones +1001: tst \irqstat, #1 + addeq \irqnr, \irqnr, #1 + moveq \irqstat, \irqstat, lsr #1 + tsteq \irqnr, #32 + beq 1001b + teq \irqnr, #32 + .endm + + .macro irq_prio_table + .ltorg + .bss +ENTRY(soft_irq_mask) + .word 0 + .text .endm #elif defined(CONFIG_ARCH_SA1100) diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 6ea7916ef..c7ace10b5 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -28,15 +28,24 @@ #include <asm/uaccess.h> #include <asm/system.h> -#include <asm/arch/system.h> #include <asm/io.h> +/* + * Values for cpu_do_idle() + */ +#define IDLE_WAIT_SLOW 0 +#define IDLE_WAIT_FAST 1 +#define IDLE_CLOCK_SLOW 2 +#define IDLE_CLOCK_FAST 3 + extern char *processor_modes[]; extern void setup_mm_for_reboot(char mode); asmlinkage void ret_from_sys_call(void) __asm__("ret_from_sys_call"); -static int hlt_counter; +static volatile int hlt_counter; + +#include <asm/arch/system.h> void disable_hlt(void) { @@ -64,7 +73,9 @@ __setup("nohlt", nohlt_setup); __setup("hlt", hlt_setup); /* - * The idle loop on an ARM... + * The idle thread. We try to conserve power, while trying to keep + * overall latency low. The architecture specific idle is passed + * a value to indicate the level of "idleness" of the system. */ void cpu_idle(void) { @@ -72,15 +83,13 @@ void cpu_idle(void) init_idle(); current->priority = 0; current->counter = -100; + while (1) { - if (!hlt_counter) - arch_do_idle(); - if (current->need_resched) { - schedule(); + arch_idle(); + schedule(); #ifndef CONFIG_NO_PGT_CACHE - check_pgt_cache(); + check_pgt_cache(); #endif - } } } @@ -89,7 +98,7 @@ static char reboot_mode = 'h'; int __init reboot_setup(char *str) { reboot_mode = str[0]; - return 0; + return 1; } __setup("reboot=", reboot_setup); diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 6a3429bdd..f04b422b4 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -228,7 +228,7 @@ parse_cmdline(struct meminfo *mi, char **cmdline_p, char *from) *cmdline_p = command_line; } -static void __init +void __init setup_ramdisk(int doload, int prompt, int image_start, unsigned int rd_sz) { #ifdef CONFIG_BLK_DEV_RAM @@ -246,7 +246,7 @@ setup_ramdisk(int doload, int prompt, int image_start, unsigned int rd_sz) /* * initial ram disk */ -static void __init setup_initrd(unsigned int start, unsigned int size) +void __init setup_initrd(unsigned int start, unsigned int size) { #ifdef CONFIG_BLK_DEV_INITRD if (start == 0) diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 510a38451..5f48f951a 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -37,7 +37,7 @@ L_OBJS += $(L_OBJS_$(MACHINE)) include $(TOPDIR)/Rules.make .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c -o $*.o $< + $(CC) $(AFLAGS) -traditional -c -o $*.o $< constants.h: getconsdata.o extractconstants.pl $(PERL) extractconstants.pl $(OBJDUMP) > $@ diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile index 1c02473bb..26d7f1058 100644 --- a/arch/arm/mm/Makefile +++ b/arch/arm/mm/Makefile @@ -34,7 +34,7 @@ endif include $(TOPDIR)/Rules.make .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) $(AFLAGS_$@) -traditional -c -o $*.o $< + $(CC) $(AFLAGS) $(AFLAGS_$@) -traditional -c -o $*.o $< # Special dependencies fault-armv.o: fault-common.c diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c index cb29618a3..5d46369eb 100644 --- a/arch/arm/mm/mm-armv.c +++ b/arch/arm/mm/mm-armv.c @@ -293,10 +293,15 @@ static void __init create_mapping(struct map_desc *md) */ void setup_mm_for_reboot(char mode) { - pgd_t *pgd = current->mm->pgd; + pgd_t *pgd; pmd_t pmd; int i; + if (current->mm && current->mm->pgd) + pgd = current->mm->pgd; + else + pgd = init_mm.pgd; + for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++) { pmd_val(pmd) = (i << PGDIR_SHIFT) | PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | diff --git a/arch/arm/mm/mm-sa1100.c b/arch/arm/mm/mm-sa1100.c index c6f9f2e8b..1cb1a3b58 100644 --- a/arch/arm/mm/mm-sa1100.c +++ b/arch/arm/mm/mm-sa1100.c @@ -36,10 +36,8 @@ struct mem_desc { #if defined(CONFIG_SA1100_BRUTUS) { 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, 0x00400000 }, /* 4MB */ { 0xc8000000, 0x00400000 } /* 4MB */ @@ -50,6 +48,8 @@ struct mem_desc { { 0xc9000000, 0x00800000 } /* 8MB */ #elif defined(CONFIG_SA1100_VICTOR) { 0xc0000000, 0x00400000 } /* 4MB */ +#elif defined(CONFIG_SA1100_THINCLIENT) + { 0xc0000000, 0x01000000 } /* 16MB */ #elif defined(CONFIG_SA1100_TIFON) { 0xc0000000, 0x01000000 }, /* 16MB */ { 0xc8000000, 0x01000000 } /* 16MB */ @@ -67,12 +67,24 @@ struct map_desc io_desc[] __initdata = { { 0xd0000000, 0x00000000, 0x00200000, DOMAIN_IO, 1, 1, 0, 0 }, /* Flash */ #elif defined(CONFIG_SA1100_EMPEG) { EMPEG_FLASHBASE, 0x00000000, 0x00200000, DOMAIN_IO, 1, 1, 0, 0 }, /* Flash */ +#elif defined(CONFIG_SA1100_THINCLIENT) +#if 1 + /* ThinClient: only one of those... */ +// { 0xd0000000, 0x00000000, 0x01000000, DOMAIN_IO, 1, 1, 0, 0 }, /* Flash bank 0 when JP1 2-4 */ + { 0xd0000000, 0x08000000, 0x01000000, DOMAIN_IO, 1, 1, 0, 0 }, /* Flash bank 1 when JP1 3-4 */ +#else + /* GraphicsClient: */ + { 0xd0000000, 0x08000000, 0x00800000, DOMAIN_IO, 1, 1, 0, 0 }, /* Flash bank 1 */ + { 0xd0800000, 0x18000000, 0x00800000, DOMAIN_IO, 1, 1, 0, 0 }, /* Flash bank 3 */ +#endif #elif defined(CONFIG_SA1100_TIFON) { 0xd0000000, 0x00000000, 0x00800000, DOMAIN_IO, 1, 1, 0, 0 }, /* Flash bank 1 */ { 0xd0800000, 0x08000000, 0x00800000, DOMAIN_IO, 1, 1, 0, 0 }, /* Flash bank 2 */ #endif -#ifdef CONFIG_SA1101 +#if defined( CONFIG_SA1101 ) { 0xdc000000, SA1101_BASE, 0x00400000, DOMAIN_IO, 1, 1, 0, 0 }, /* SA1101 */ +#elif defined( CONFIG_SA1100_THINCLIENT ) + { 0xdc000000, 0x10000000, 0x00400000, DOMAIN_IO, 0, 1, 0, 0 }, /* CPLD */ #endif { 0xe0000000, 0x20000000, 0x04000000, DOMAIN_IO, 0, 1, 0, 0 }, /* PCMCIA0 IO */ { 0xe4000000, 0x30000000, 0x04000000, DOMAIN_IO, 0, 1, 0, 0 }, /* PCMCIA1 IO */ diff --git a/arch/arm/mm/mm-shark.c b/arch/arm/mm/mm-shark.c new file mode 100644 index 000000000..dc8e6e12b --- /dev/null +++ b/arch/arm/mm/mm-shark.c @@ -0,0 +1,25 @@ +/* + * arch/arm/mm/mm-shark.c + * + * by Alexander.Schulz@stud.uni-karlsruhe.de + */ +#include <linux/sched.h> +#include <linux/mm.h> +#include <linux/init.h> + +#include <asm/pgtable.h> +#include <asm/page.h> +#include <asm/io.h> + +#include "map.h" + +struct map_desc io_desc[] __initdata = { + { IO_BASE , IO_START , IO_SIZE , DOMAIN_IO, 0, 1, 0, 0 }, + { FB_BASE , FB_START , FB_SIZE , DOMAIN_IO, 0, 1, 0, 0 }, + { FBREG_BASE , FBREG_START , FBREG_SIZE , DOMAIN_IO, 0, 1, 0, 0 } +}; + + +#define SIZEOFMAP (sizeof(io_desc) / sizeof(io_desc[0])) + +unsigned int __initdata io_desc_size = SIZEOFMAP; diff --git a/arch/arm/mm/proc-sa110.S b/arch/arm/mm/proc-sa110.S index 9800643d9..13c1f2773 100644 --- a/arch/arm/mm/proc-sa110.S +++ b/arch/arm/mm/proc-sa110.S @@ -435,17 +435,35 @@ ENTRY(cpu_sa1100_proc_fin) ldmfd sp!, {r1, pc} .align 5 +idle: mcr p15, 0, r0, c15, c8, 2 @ Wait for interrupt + mov r0, r0 @ safety + mov pc, lr +/* + * Function: *_do_idle + * Params : r0 = call type: + * 0 = slow idle + * 1 = fast idle + * 2 = switch to slow processor clock + * 3 = switch to fast processor clock + */ ENTRY(cpu_sa110_do_idle) ENTRY(cpu_sa1100_do_idle) - mov r0, #0 - mcr p15, 0, r0, c15, c2, 2 @ Disable clock switching - ldr r1, =FLUSH_BASE+FLUSH_OFFSET*2 @ load from uncacheable loc - ldr r1, [r1, #0] - b 1f + mov ip, #0 + cmp r0, #4 + addcc pc, pc, r0, lsl #2 + mov pc, lr - .align 5 -1: mcr p15, 0, r0, c15, c8, 2 @ Wait for interrupt - mcr p15, 0, r0, c15, c1, 2 @ Enable clock switching + b idle + b idle + b slow_clock + b fast_clock + +fast_clock: mcr p15, 0, ip, c15, c1, 2 @ enable clock switching + mov pc, lr + +slow_clock: mcr p15, 0, ip, c15, c2, 2 @ disable clock switching + ldr r1, =UNCACHEABLE_ADDR @ load from uncacheable loc + ldr r1, [r1, #0] @ force switch to MCLK mov pc, lr /* diff --git a/arch/i386/boot/compressed/head.S b/arch/i386/boot/compressed/head.S index 102850b74..f016493ba 100644 --- a/arch/i386/boot/compressed/head.S +++ b/arch/i386/boot/compressed/head.S @@ -23,7 +23,6 @@ */ .text -#define __ASSEMBLY__ #include <linux/linkage.h> #include <asm/segment.h> diff --git a/arch/i386/config.in b/arch/i386/config.in index 36f1aafda..664b77800 100644 --- a/arch/i386/config.in +++ b/arch/i386/config.in @@ -6,6 +6,7 @@ mainmenu_name "Linux Kernel Configuration" define_bool CONFIG_X86 y define_bool CONFIG_ISA y +define_bool CONFIG_SBUS n define_bool CONFIG_UID16 y @@ -43,11 +44,17 @@ if [ "$CONFIG_M486" = "y" -o "$CONFIG_M586" = "y" ]; then define_bool CONFIG_X86_USE_STRING_486 y define_bool CONFIG_X86_ALIGNMENT_16 y fi -if [ "$CONFIG_M586TSC" = "y" -o "$CONFIG_MK6" = "y" ]; then +if [ "$CONFIG_M586TSC" = "y" ]; then define_bool CONFIG_X86_USE_STRING_486 y define_bool CONFIG_X86_ALIGNMENT_16 y define_bool CONFIG_X86_TSC y fi +if [ "$CONFIG_MK6" = "y" ]; then + define_bool CONFIG_X86_ALIGNMENT_16 y + define_bool CONFIG_X86_TSC y + define_bool CONFIG_X86_USE_3DNOW y + define_bool CONFIG_X86_USE_PPRO_CHECKSUM y +fi if [ "$CONFIG_M686" = "y" ]; then define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_GOOD_APIC y @@ -136,6 +143,8 @@ bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG if [ "$CONFIG_HOTPLUG" = "y" ] ; then source drivers/pcmcia/Config.in +else + define_bool CONFIG_PCMCIA n fi bool 'System V IPC' CONFIG_SYSVIPC @@ -252,7 +261,6 @@ endmenu source drivers/char/Config.in -source drivers/usb/Config.in #source drivers/misc/Config.in @@ -279,6 +287,8 @@ if [ "$CONFIG_SOUND" != "n" ]; then fi endmenu +source drivers/usb/Config.in + mainmenu_option next_comment comment 'Kernel hacking' diff --git a/arch/i386/defconfig b/arch/i386/defconfig index 15e23d91a..80f68ec31 100644 --- a/arch/i386/defconfig +++ b/arch/i386/defconfig @@ -3,6 +3,7 @@ # CONFIG_X86=y CONFIG_ISA=y +# CONFIG_SBUS is not set CONFIG_UID16=y # @@ -22,11 +23,14 @@ CONFIG_M686=y # CONFIG_MK7 is not set CONFIG_X86_WP_WORKS_OK=y CONFIG_X86_INVLPG=y +CONFIG_X86_CMPXCHG=y CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y +CONFIG_X86_L1_CACHE_BYTES=32 CONFIG_X86_TSC=y CONFIG_X86_GOOD_APIC=y CONFIG_X86_PGE=y +CONFIG_X86_USE_PPRO_CHECKSUM=y # CONFIG_MICROCODE is not set CONFIG_NOHIGHMEM=y # CONFIG_HIGHMEM4G is not set @@ -104,7 +108,10 @@ CONFIG_BLK_DEV_FD=y # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_STRIPED is not set # CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set # # Networking options @@ -185,6 +192,7 @@ CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_AEC6210 is not set # CONFIG_AEC6210_TUNING is not set # CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_WDC_ALI15X3 is not set # CONFIG_BLK_DEV_AMD7409 is not set # CONFIG_AMD7409_OVERRIDE is not set # CONFIG_BLK_DEV_CMD64X is not set @@ -248,6 +256,7 @@ CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_AM53C974 is not set # CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_DMA is not set @@ -375,6 +384,7 @@ CONFIG_PCMCIA_PCNET=y # CONFIG_PCMCIA_SMC91C92 is not set # CONFIG_PCMCIA_XIRC2PS is not set # CONFIG_ARCNET_COM20020_CS is not set +# CONFIG_PCMCIA_IBMTR is not set # CONFIG_PCMCIA_3C575 is not set # CONFIG_PCMCIA_XIRTULIP is not set CONFIG_NET_PCMCIA_RADIO=y @@ -467,17 +477,13 @@ CONFIG_PCMCIA_SERIAL=y # CONFIG_PCMCIA_SERIAL_CB is not set # -# USB support -# -# CONFIG_USB is not set - -# # File systems # # CONFIG_QUOTA is not set # CONFIG_AUTOFS_FS is not set CONFIG_AUTOFS4_FS=y # CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set @@ -487,27 +493,34 @@ CONFIG_AUTOFS4_FS=y # CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set +# CONFIG_RAMFS is not set CONFIG_ISO9660_FS=y # CONFIG_JOLIET is not set # CONFIG_MINIX_FS is not set # CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVFS_DEBUG is not set CONFIG_DEVPTS_FS=y # CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_SYSV_FS_WRITE is not set # CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set # # Network File Systems # # CONFIG_CODA_FS is not set CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set # CONFIG_ROOT_NFS is not set CONFIG_NFSD=y # CONFIG_NFSD_V3 is not set @@ -515,6 +528,16 @@ CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_MOUNT_SUBDIR is not set +# CONFIG_NCPFS_NDS_DOMAINS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set # # Partition Types @@ -535,6 +558,11 @@ CONFIG_VGA_CONSOLE=y # CONFIG_SOUND is not set # +# USB support +# +# CONFIG_USB is not set + +# # Kernel hacking # # CONFIG_MAGIC_SYSRQ is not set diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile index 525bb2c07..64b3d0951 100644 --- a/arch/i386/kernel/Makefile +++ b/arch/i386/kernel/Makefile @@ -8,7 +8,7 @@ # Note 2! The CFLAGS definitions are now in the main makefile... .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $< -o $*.o + $(CC) $(AFLAGS) -traditional -c $< -o $*.o all: kernel.o head.o init_task.o diff --git a/arch/i386/kernel/acpi.c b/arch/i386/kernel/acpi.c index f9410f3fd..aa09400fc 100644 --- a/arch/i386/kernel/acpi.c +++ b/arch/i386/kernel/acpi.c @@ -103,13 +103,57 @@ static int acpi_p_lvl3_tested = 0; enum { - ACPI_ENABLED, - ACPI_TABLES_ONLY, - ACPI_CHIPSET_ONLY, - ACPI_DISABLED, + ACPI_ENABLED = 0x00000000, // use ACPI if present + ACPI_DISABLED = 0x00000001, // never use ACPI + ACPI_TABLES_ONLY = 0x00000002, // never use chipset-specific driver + ACPI_CHIPSET_ONLY = 0x00000004, // always use chipset-specific driver + ACPI_IGNORE_ERRATA = 0x00000008, // ignore any listed platform errata + ACPI_COPY_TABLES = 0x00000010, // copy ACPI tables before use + ACPI_TRUST_TABLES = 0x00000020, // use tables even after ioremap fails + ACPI_SCI_DISABLED = 0x00000040, // never enable ACPI (info. only) + ACPI_C2_DISABLED = 0x00000080, // never enter C2 + ACPI_C3_DISABLED = 0x00000100, // never enter C3 + ACPI_S1_DISABLED = 0x00000200, // never enter S1 + ACPI_S5_DISABLED = 0x00000400, // never enter S5 }; -static int acpi_enabled = ACPI_ENABLED; +struct acpi_option_info +{ + const char *name; + unsigned long value; +}; + +static struct acpi_option_info acpi_options[] = +{ + {"on", ACPI_ENABLED}, + {"off", ACPI_DISABLED}, + {"tables", ACPI_TABLES_ONLY}, + {"chipset", ACPI_CHIPSET_ONLY}, + {"no-errata", ACPI_IGNORE_ERRATA}, + {"copy-tables", ACPI_COPY_TABLES}, + {"trust-tables", ACPI_TRUST_TABLES}, + {"no-sci", ACPI_SCI_DISABLED}, + {"no-c2", ACPI_C2_DISABLED}, + {"no-c3", ACPI_C3_DISABLED}, + {"no-s1", ACPI_S1_DISABLED}, + {"no-s5", ACPI_S5_DISABLED}, + {NULL, 0}, +}; + +static unsigned long acpi_opts = ACPI_ENABLED; + +struct acpi_errata_info +{ + const char *oem; + const char *oem_table; + u32 oem_rev; + unsigned long options; +}; + +struct acpi_errata_info acpi_errata[] = +{ + {NULL, NULL, 0, 0}, +}; // bits 8-15 are SLP_TYPa, bits 0-7 are SLP_TYPb static unsigned long acpi_slp_typ[] = @@ -171,7 +215,7 @@ static struct ctl_table acpi_table[] = &acpi_p_lvl3_lat, sizeof(acpi_p_lvl3_lat), 0644, NULL, &acpi_do_ulong}, - {ACPI_P_LVL2_LAT, "enter_lvl2_lat", + {ACPI_ENTER_LVL2_LAT, "enter_lvl2_lat", &acpi_enter_lvl2_lat, sizeof(acpi_enter_lvl2_lat), 0644, NULL, &acpi_do_ulong}, @@ -405,6 +449,16 @@ static struct acpi_table *__init acpi_map_table(u32 addr) printk(KERN_ERR "ACPI: unreserved table memory @ 0x%p!\n", (void*) addr); + + if (acpi_opts & ACPI_TRUST_TABLES) { + /* OK, trust that the table is there + * if it isn't you'll get an OOPS here + */ + static u32 sig; + table = (struct acpi_table *) + phys_to_virt(addr); + sig = table->signature; + } } } return table; @@ -423,14 +477,33 @@ static void acpi_unmap_table(struct acpi_table *table) /* * Initialize an ACPI table */ -static void acpi_init_table(struct acpi_table_info *info, - void *data, - int mapped) +static int acpi_init_table(struct acpi_table_info *info, + void *data, + int mapped) { struct acpi_table *table = (struct acpi_table*) data; + + info->table = NULL; + info->size = 0; + info->mapped = 0; + + if (!table || table->signature != info->expected_signature) + return -EINVAL; + + if (mapped && (acpi_opts & ACPI_COPY_TABLES)) { + struct acpi_table *copy + = kmalloc(table->length, GFP_KERNEL); + if (!copy) + return -ENOMEM; + memcpy(copy, table, table->length); + table = copy; + mapped = 0; + } + info->table = table; - info->size = (size_t)(table ? table->length:0); + info->size = (size_t) table->length; info->mapped = mapped; + return 0; } /* @@ -502,22 +575,13 @@ static int __init acpi_find_tables(void) rsdt_entry_count = (int) ((rsdt->length - sizeof(*rsdt)) >> 2); while (rsdt_entry_count) { struct acpi_table *dt = acpi_map_table(*rsdt_entry); - if (dt && dt->signature == ACPI_FACP_SIG) { - struct acpi_facp *facp = (struct acpi_facp*) dt; - acpi_init_table(&acpi_facp, dt, 1); + if (!acpi_init_table(&acpi_facp, dt, 1)) { + struct acpi_facp *facp + = (struct acpi_facp*) acpi_facp.table; // map DSDT if it exists dt = acpi_map_table(facp->dsdt); - if (dt && dt->signature == ACPI_DSDT_SIG) - acpi_init_table(&acpi_dsdt, dt, 1); - else - acpi_unmap_table(dt); - - // map FACS if it exists - dt = acpi_map_table(facp->facs); - if (dt && dt->signature == ACPI_FACS_SIG) - acpi_init_table(&acpi_facs, dt, 1); - else + if (acpi_init_table(&acpi_dsdt, dt, 1)) acpi_unmap_table(dt); } else { @@ -769,6 +833,15 @@ static void acpi_irq(int irq, void *dev_id, struct pt_regs *regs) } /* + * Is SCI to be enabled? + */ +static inline int +acpi_sci_enabled(void) +{ + return !(acpi_opts & ACPI_SCI_DISABLED); +} + +/* * Is ACPI enabled or not? */ static inline int acpi_is_enabled(struct acpi_facp *facp) @@ -781,7 +854,7 @@ static inline int acpi_is_enabled(struct acpi_facp *facp) */ static int acpi_enable(struct acpi_facp *facp) { - if (facp->smi_cmd) + if (facp->smi_cmd && acpi_sci_enabled()) outb(facp->acpi_enable, facp->smi_cmd); return (acpi_is_enabled(facp) ? 0:-1); } @@ -791,16 +864,20 @@ static int acpi_enable(struct acpi_facp *facp) */ static int acpi_disable(struct acpi_facp *facp) { - // disable and clear any pending events - acpi_write_gpe_enable(facp, 0); - while (acpi_read_gpe_status(facp)) - acpi_write_gpe_status(facp, acpi_read_gpe_status(facp)); - acpi_write_pm1_enable(facp, 0); - acpi_write_pm1_status(facp, acpi_read_pm1_status(facp)); - - /* writing acpi_disable to smi_cmd would be appropriate - * here but this causes a nasty crash on many systems - */ + if (facp->smi_cmd && acpi_sci_enabled()) { + // disable and clear any pending events + acpi_write_gpe_enable(facp, 0); + while (acpi_read_gpe_status(facp)) { + acpi_write_gpe_status(facp, + acpi_read_gpe_status(facp)); + } + acpi_write_pm1_enable(facp, 0); + acpi_write_pm1_status(facp, acpi_read_pm1_status(facp)); + + /* writing acpi_disable to smi_cmd would be appropriate + * here but this causes a nasty crash on many systems + */ + } return 0; } @@ -860,7 +937,7 @@ static void acpi_idle(void) sleep3: sleep_level = 3; if (!acpi_p_lvl3_tested) { - printk("ACPI C3 works\n"); + printk(KERN_INFO "ACPI C3 works\n"); acpi_p_lvl3_tested = 1; } wake_on_busmaster(facp); @@ -916,7 +993,7 @@ sleep3_with_arbiter: sleep2: sleep_level = 2; if (!acpi_p_lvl2_tested) { - printk("ACPI C2 works\n"); + printk(KERN_INFO "ACPI C2 works\n"); acpi_p_lvl2_tested = 1; } wake_on_busmaster(facp); /* Required to track BM activity.. */ @@ -1006,47 +1083,52 @@ static void acpi_update_clock(void) } } - /* * Enter system sleep state */ -static void acpi_enter_sx(acpi_sstate_t state) +static int acpi_enter_sx(acpi_sstate_t state) { - unsigned long slp_typ = acpi_slp_typ[(int) state]; - if (slp_typ != ACPI_SLP_TYP_DISABLED) { - struct acpi_facp *facp = (struct acpi_facp*) acpi_facp.table; - u16 typa, typb, value; - - // bits 8-15 are SLP_TYPa, bits 0-7 are SLP_TYPb - typa = (slp_typ >> 8) & 0xff; - typb = slp_typ & 0xff; - - typa = ((typa << ACPI_SLP_TYP_SHIFT) & ACPI_SLP_TYP_MASK); - typb = ((typb << ACPI_SLP_TYP_SHIFT) & ACPI_SLP_TYP_MASK); + unsigned long slp_typ; + u16 typa, typb, value; + struct acpi_facp *facp; - acpi_sleep_start = get_cmos_time(); - acpi_enter_dx(ACPI_D3); - acpi_sleep_state = state; + slp_typ = acpi_slp_typ[(int) state]; + if (slp_typ == ACPI_SLP_TYP_DISABLED) + return -EPERM; - // clear wake status - acpi_write_pm1_status(facp, ACPI_WAK); + // bits 8-15 are SLP_TYPa, bits 0-7 are SLP_TYPb + typa = (slp_typ >> 8) & 0xff; + typb = slp_typ & 0xff; + + typa = ((typa << ACPI_SLP_TYP_SHIFT) & ACPI_SLP_TYP_MASK); + typb = ((typb << ACPI_SLP_TYP_SHIFT) & ACPI_SLP_TYP_MASK); - // set SLP_TYPa/b and SLP_EN - if (facp->pm1a_cnt) { - value = inw(facp->pm1a_cnt) & ~ACPI_SLP_TYP_MASK; - outw(value | typa | ACPI_SLP_EN, facp->pm1a_cnt); - } - if (facp->pm1b_cnt) { - value = inw(facp->pm1b_cnt) & ~ACPI_SLP_TYP_MASK; - outw(value | typb | ACPI_SLP_EN, facp->pm1b_cnt); - } + acpi_sleep_start = get_cmos_time(); + acpi_enter_dx(ACPI_D3); + acpi_sleep_state = state; - // wait until S1 is entered - while (!(acpi_read_pm1_status(facp) & ACPI_WAK)) ; - // finished sleeping, update system time - acpi_update_clock(); - acpi_enter_dx(ACPI_D0); + facp = (struct acpi_facp*) acpi_facp.table; + + // clear wake status + acpi_write_pm1_status(facp, ACPI_WAK); + + // set SLP_TYPa/b and SLP_EN + if (facp->pm1a_cnt) { + value = inw(facp->pm1a_cnt) & ~ACPI_SLP_TYP_MASK; + outw(value | typa | ACPI_SLP_EN, facp->pm1a_cnt); } + if (facp->pm1b_cnt) { + value = inw(facp->pm1b_cnt) & ~ACPI_SLP_TYP_MASK; + outw(value | typb | ACPI_SLP_EN, facp->pm1b_cnt); + } + + // wait until S1 is entered + while (!(acpi_read_pm1_status(facp) & ACPI_WAK)) ; + // finished sleeping, update system time + acpi_update_clock(); + acpi_enter_dx(ACPI_D0); + + return 0; } /* @@ -1113,6 +1195,42 @@ static int acpi_release_ioports(struct acpi_facp *facp) } /* + * Determine if modification of value is permitted + */ +static int +acpi_verify_mod(int ctl_name) +{ + switch (ctl_name) { + case ACPI_PM1_ENABLE: + case ACPI_GPE_ENABLE: + case ACPI_GPE_LEVEL: + if (!acpi_sci_enabled()) + return -EPERM; + break; + case ACPI_P_LVL2_LAT: + case ACPI_ENTER_LVL2_LAT: + if (acpi_opts & ACPI_C2_DISABLED) + return -EPERM; + break; + case ACPI_P_LVL3_LAT: + case ACPI_ENTER_LVL3_LAT: + if (acpi_opts & ACPI_C3_DISABLED) + return -EPERM; + break; + case ACPI_S1_SLP_TYP: + case ACPI_SLEEP: + if (acpi_opts & ACPI_S1_DISABLED) + return -EPERM; + break; + case ACPI_S5_SLP_TYP: + if (acpi_opts & ACPI_S5_DISABLED) + return -EPERM; + break; + } + return 0; +} + +/* * Examine/modify value */ static int acpi_do_ulong(ctl_table *ctl, @@ -1141,6 +1259,9 @@ static int acpi_do_ulong(ctl_table *ctl, *len = 0; } else { + if (acpi_verify_mod(ctl->ctl_name)) + return -EPERM; + size = sizeof(str) - 1; if (size > *len) size = *len; @@ -1313,6 +1434,9 @@ static int acpi_do_event_reg(ctl_table *ctl, } else { + if (acpi_verify_mod(ctl->ctl_name)) + return -EPERM; + // fetch user value size = sizeof(str) - 1; if (size > *len) @@ -1443,24 +1567,71 @@ static int acpi_do_sleep(ctl_table *ctl, } else { -#ifdef CONFIG_ACPI_S1_SLEEP - acpi_enter_sx(ACPI_S1); -#endif + if (acpi_verify_mod(ctl->ctl_name) || acpi_enter_sx(ACPI_S1)) + return -EPERM; } file->f_pos += *len; return 0; } +/* + * Parse command line options + */ +static int __init acpi_setup(char *str) +{ + while (str && *str) { + struct acpi_option_info *opt = acpi_options; + while (opt->name) { + if (!strncmp(str, opt->name, strlen(opt->name))) { + acpi_opts |= opt->value; + break; + } + opt++; + } + str = strpbrk(str, ","); + if (str) + str += strspn(str, ","); + } + + if (acpi_opts) + printk(KERN_INFO "ACPI: options 0x%08lx\n", acpi_opts); + + return 1; +} + +/* + * kernel/module command line interfaces are both "acpi=OPTION,OPTION,..." + */ +__setup("acpi=", acpi_setup); + +static char * __initdata acpi = NULL; + +MODULE_DESCRIPTION("ACPI driver"); +MODULE_PARM(acpi, "s"); +MODULE_PARM_DESC(acpi, "ACPI driver command line"); /* * Initialize and enable ACPI */ -static int __init acpi_init(void) +int __init acpi_init(void) { struct acpi_facp *facp = NULL; - switch (acpi_enabled) { - case ACPI_ENABLED: + if (acpi) + acpi_setup(acpi); + + if (acpi_opts & ACPI_DISABLED) { + return -ENODEV; + } + else if (acpi_opts & ACPI_TABLES_ONLY) { + if (acpi_find_tables()) + return -ENODEV; + } + else if (acpi_opts & ACPI_CHIPSET_ONLY) { + if (acpi_find_chipset()) + return -ENODEV; + } + else { switch (acpi_find_tables()) { case 0: // found valid ACPI tables @@ -1474,17 +1645,6 @@ static int __init acpi_init(void) // found broken ACPI tables return -ENODEV; } - break; - case ACPI_TABLES_ONLY: - if (acpi_find_tables()) - return -ENODEV; - break; - case ACPI_CHIPSET_ONLY: - if (acpi_find_chipset()) - return -ENODEV; - break; - case ACPI_DISABLED: - return -ENODEV; } facp = (struct acpi_facp*) acpi_facp.table; @@ -1502,12 +1662,14 @@ static int __init acpi_init(void) * control in the /proc interfaces. */ if (facp->p_lvl2_lat - && facp->p_lvl2_lat <= ACPI_MAX_P_LVL2_LAT) { + && facp->p_lvl2_lat <= ACPI_MAX_P_LVL2_LAT + && !acpi_verify_mod(ACPI_P_LVL2_LAT)) { acpi_p_lvl2_lat = ACPI_uS_TO_TMR_TICKS(facp->p_lvl2_lat); acpi_enter_lvl2_lat = ACPI_uS_TO_TMR_TICKS(ACPI_TMR_HZ / 1000); } if (facp->p_lvl3_lat - && facp->p_lvl3_lat <= ACPI_MAX_P_LVL3_LAT) { + && facp->p_lvl3_lat <= ACPI_MAX_P_LVL3_LAT + && !acpi_verify_mod(ACPI_P_LVL3_LAT)) { acpi_p_lvl3_lat = ACPI_uS_TO_TMR_TICKS(facp->p_lvl3_lat); acpi_enter_lvl3_lat = ACPI_uS_TO_TMR_TICKS(facp->p_lvl3_lat * 5); @@ -1519,6 +1681,7 @@ static int __init acpi_init(void) } if (facp->sci_int + && acpi_sci_enabled() && request_irq(facp->sci_int, acpi_irq, SA_INTERRUPT | SA_SHIRQ, @@ -1529,6 +1692,10 @@ static int __init acpi_init(void) goto err_out; } +#ifndef CONFIG_ACPI_S1_SLEEP + acpi_opts |= ACPI_S1_DISABLED; +#endif + acpi_sysctl = register_sysctl_table(acpi_dir_table, 1); pm_power_off = acpi_power_off; @@ -1559,7 +1726,7 @@ err_out: /* * Disable and deinitialize ACPI */ -static void __exit acpi_exit(void) +void __exit acpi_exit(void) { struct acpi_facp *facp = (struct acpi_facp*) acpi_facp.table; @@ -1570,7 +1737,7 @@ static void __exit acpi_exit(void) acpi_disable(facp); acpi_release_ioports(facp); - if (facp->sci_int) + if (facp->sci_int && acpi_sci_enabled()) free_irq(facp->sci_int, &acpi_facp); acpi_destroy_tables(); @@ -1581,29 +1748,5 @@ static void __exit acpi_exit(void) pm_active = 0; } -/* - * Parse kernel command line options - */ -static int __init acpi_setup(char *str) -{ - while (str && *str) { - if (strncmp(str, "on", 2) == 0) - acpi_enabled = ACPI_ENABLED; - else if (strncmp(str, "tables", 6) == 0) - acpi_enabled = ACPI_TABLES_ONLY; - else if (strncmp(str, "chipset", 7) == 0) - acpi_enabled = ACPI_CHIPSET_ONLY; - else if (strncmp(str, "off", 3) == 0) - acpi_enabled = ACPI_DISABLED; - str = strpbrk(str, ","); - if (str) - str += strspn(str, ","); - } - return 1; -} - -__setup("acpi=", acpi_setup); - module_init(acpi_init); module_exit(acpi_exit); - diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S index 7a8a17b63..ee759f2bc 100644 --- a/arch/i386/kernel/head.S +++ b/arch/i386/kernel/head.S @@ -70,22 +70,28 @@ startup_32: */ #define cr4_bits mmu_cr4_features-__PAGE_OFFSET cmpl $0,cr4_bits - je 1f - movl %cr4,%eax # Turn on 4Mb pages + je 3f + movl %cr4,%eax # Turn on paging options (PSE,PAE,..) orl cr4_bits,%eax movl %eax,%cr4 + jmp 3f +1: #endif /* - * Setup paging (intialize tables, then switch them on) + * Initialize page tables */ -1: movl $pg0-__PAGE_OFFSET,%edi /* initialize page tables */ movl $007,%eax /* "007" doesn't mean with right to kill, but PRESENT+RW+USER */ -1: stosl +2: stosl add $0x1000,%eax cmp $empty_zero_page-__PAGE_OFFSET,%edi - jne 1b + jne 2b + +/* + * Enable paging + */ +3: movl $swapper_pg_dir-__PAGE_OFFSET,%eax movl %eax,%cr3 /* set the page table pointer.. */ movl %cr0,%eax diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c index d2ba2fd9c..a96540d6e 100644 --- a/arch/i386/kernel/irq.c +++ b/arch/i386/kernel/irq.c @@ -862,7 +862,7 @@ unsigned long probe_irq_on(void) */ /** - * probe_irq_mask + * probe_irq_mask - scan a bitmap of interrupt lines * @val: mask of interrupts to consider * * Scan the ISA bus interrupt lines and return a bitmap of diff --git a/arch/i386/kernel/mtrr.c b/arch/i386/kernel/mtrr.c index 1d6203f65..f5a035cc7 100644 --- a/arch/i386/kernel/mtrr.c +++ b/arch/i386/kernel/mtrr.c @@ -1281,7 +1281,7 @@ int mtrr_add(unsigned long base, unsigned long size, unsigned int type, char inc } /* End Function mtrr_add */ /** - * mtrr_del + * mtrr_del - delete a memory type region * @reg: Register returned by mtrr_add * @base: Physical base address * @size: Size of region diff --git a/arch/i386/kernel/pci-i386.c b/arch/i386/kernel/pci-i386.c index 942de9c79..cc3f8e1da 100644 --- a/arch/i386/kernel/pci-i386.c +++ b/arch/i386/kernel/pci-i386.c @@ -228,7 +228,7 @@ static void __init pcibios_allocate_resources(int pass) if (!pr || request_resource(pr, r) < 0) { printk(KERN_ERR "PCI: Cannot allocate resource region %d of device %s\n", idx, dev->slot_name); /* We'll assign a new address later */ - r->start -= r->end; + r->end -= r->start; r->start = 0; } } @@ -317,6 +317,8 @@ int pcibios_enable_resources(struct pci_dev *dev) if (r->flags & IORESOURCE_MEM) cmd |= PCI_COMMAND_MEMORY; } + if (dev->resource[PCI_ROM_RESOURCE].start) + cmd |= PCI_COMMAND_MEMORY; if (cmd != old_cmd) { printk("PCI: Enabling device %s (%04x -> %04x)\n", dev->slot_name, old_cmd, cmd); pci_write_config_word(dev, PCI_COMMAND, cmd); diff --git a/arch/i386/kernel/pci-pc.c b/arch/i386/kernel/pci-pc.c index b588642cc..fb5d6b75f 100644 --- a/arch/i386/kernel/pci-pc.c +++ b/arch/i386/kernel/pci-pc.c @@ -1188,7 +1188,7 @@ static char *pcibios_lookup_irq(struct pci_dev *dev, struct irq_routing_table *r } else if (newirq) { DBG(" -> [VIA] set to %02x\n", newirq); x = (pirq & 1) ? ((x & 0x0f) | (newirq << 4)) : ((x & 0xf0) | newirq); - pci_write_config_byte(router, reg, y); + pci_write_config_byte(router, reg, x); msg = "VIA-NEW"; } else DBG(" -> [VIA] sink\n"); break; diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 46292496d..71407c0ea 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c @@ -727,7 +727,7 @@ void __init setup_arch(char **cmdline_p) #ifdef CONFIG_BLK_DEV_INITRD if (LOADER_TYPE && INITRD_START) { - if (INITRD_START + INITRD_SIZE < (max_low_pfn << PAGE_SHIFT)) { + if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) { reserve_bootmem(INITRD_START, INITRD_SIZE); initrd_start = INITRD_START ? INITRD_START + PAGE_OFFSET : 0; @@ -863,7 +863,7 @@ static int __init amd_model(struct cpuinfo_x86 *c) rdmsr(0xC0000082, l, h); if((l&0x0000FFFF)==0) { - l=(1<<0)|(mbytes/4); + l=(1<<0)|((mbytes/4)<<1); save_flags(flags); __cli(); __asm__ __volatile__ ("wbinvd": : :"memory"); diff --git a/arch/i386/lib/Makefile b/arch/i386/lib/Makefile index 5c824c08c..2394245a6 100644 --- a/arch/i386/lib/Makefile +++ b/arch/i386/lib/Makefile @@ -3,7 +3,7 @@ # .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $< -o $*.o + $(CC) $(AFLAGS) -traditional -c $< -o $*.o L_TARGET = lib.a L_OBJS = checksum.o old-checksum.o delay.o \ diff --git a/arch/i386/math-emu/Makefile b/arch/i386/math-emu/Makefile index 68b327a2a..5564d8712 100644 --- a/arch/i386/math-emu/Makefile +++ b/arch/i386/math-emu/Makefile @@ -10,7 +10,7 @@ PARANOID = -DPARANOID CFLAGS := $(CFLAGS) $(PARANOID) $(DEBUG) -fno-builtin $(MATH_EMULATION) .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) $(PARANOID) -c $< + $(CC) $(AFLAGS) $(PARANOID) -c $< # From 'C' language sources: C_OBJS =fpu_entry.o errors.o \ diff --git a/arch/ia64/boot/Makefile b/arch/ia64/boot/Makefile index cba4fad66..5228d6c57 100644 --- a/arch/ia64/boot/Makefile +++ b/arch/ia64/boot/Makefile @@ -11,9 +11,9 @@ LINKFLAGS = -static -T bootloader.lds .S.s: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -E -o $*.o $< + $(CPP) $(AFLAGS) -traditional -o $*.o $< .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c -o $*.o $< + $(CC) $(AFLAGS) -traditional -c -o $*.o $< OBJECTS = bootloader.o TARGETS = diff --git a/arch/ia64/config.in b/arch/ia64/config.in index b0d924d14..b7cce3d73 100644 --- a/arch/ia64/config.in +++ b/arch/ia64/config.in @@ -4,6 +4,8 @@ mainmenu_option next_comment comment 'General setup' define_bool CONFIG_IA64 y +define_bool CONFIG_ISA n +define_bool CONFIG_SBUS n choice 'IA-64 system type' \ "Generic CONFIG_IA64_GENERIC \ @@ -50,7 +52,12 @@ tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC bool 'PCI support' CONFIG_PCI 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 +else + define_bool CONFIG_PCMCIA n +fi mainmenu_option next_comment comment 'Code maturity level options' @@ -134,7 +141,6 @@ fi endmenu source drivers/char/Config.in -source drivers/usb/Config.in #source drivers/misc/Config.in source fs/Config.in @@ -161,6 +167,8 @@ if [ "$CONFIG_SOUND" != "n" ]; then fi endmenu +source drivers/usb/Config.in + mainmenu_option next_comment comment 'Kernel hacking' diff --git a/arch/ia64/defconfig b/arch/ia64/defconfig index 1618d5401..12854f121 100644 --- a/arch/ia64/defconfig +++ b/arch/ia64/defconfig @@ -6,6 +6,8 @@ # General setup # CONFIG_IA64=y +# CONFIG_ISA is not set +# CONFIG_SBUS is not set # CONFIG_IA64_GENERIC is not set CONFIG_IA64_HP_SIM=y # CONFIG_IA64_SGI_SN1_SIM is not set @@ -25,10 +27,7 @@ CONFIG_KCORE_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_PCI=y CONFIG_PCI_NAMES=y - -# -# PCMCIA/CardBus support -# +# CONFIG_HOTPLUG is not set # CONFIG_PCMCIA is not set # @@ -119,6 +118,7 @@ CONFIG_IDEDMA_PCI_EXPERIMENTAL=y # CONFIG_BLK_DEV_AEC6210 is not set # CONFIG_AEC6210_TUNING is not set # CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_WDC_ALI15X3 is not set # CONFIG_BLK_DEV_AMD7409 is not set # CONFIG_AMD7409_OVERRIDE is not set # CONFIG_BLK_DEV_CMD64X is not set diff --git a/arch/ia64/dig/Makefile b/arch/ia64/dig/Makefile index cfc48eec1..8d0544ee5 100644 --- a/arch/ia64/dig/Makefile +++ b/arch/ia64/dig/Makefile @@ -6,9 +6,9 @@ # .S.s: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -E -o $*.s $< + $(CPP) $(AFLAGS) -o $*.s $< .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -c -o $*.o $< + $(CC) $(AFLAGS) -c -o $*.o $< all: dig.a diff --git a/arch/ia64/ia32/Makefile b/arch/ia64/ia32/Makefile index 674a6eb6e..82017941c 100644 --- a/arch/ia64/ia32/Makefile +++ b/arch/ia64/ia32/Makefile @@ -3,9 +3,9 @@ # .S.s: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -E -o $*.s $< + $(CPP) $(AFLAGS) -o $*.s $< .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -c -o $*.o $< + $(CC) $(AFLAGS) -c -o $*.o $< all: ia32.o diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c index 8d4e4a8fd..00eca716d 100644 --- a/arch/ia64/ia32/sys_ia32.c +++ b/arch/ia64/ia32/sys_ia32.c @@ -2298,7 +2298,9 @@ copy_mount_stuff_to_kernel(const void *user, unsigned long *kernel) return 0; } -extern asmlinkage int sys_mount(char * dev_name, char * dir_name, char * type, +extern asmlinkage long sys_mount(char * dev_name, char * dir_name, char * type, + unsigned long new_flags, void *data); +extern long do_sys_mount(char * dev_name, char * dir_name, char * type, unsigned long new_flags, void *data); #define SMBFS_NAME "smbfs" @@ -2328,7 +2330,6 @@ sys32_mount(char *dev_name, char *dir_name, char *type, (void *)AA(data)); } else { unsigned long dev_page, dir_page, data_page; - mm_segment_t old_fs; err = copy_mount_stuff_to_kernel((const void *)dev_name, &dev_page); @@ -2348,13 +2349,9 @@ sys32_mount(char *dev_name, char *dir_name, char *type, do_smb_super_data_conv((void *)data_page); else panic("The problem is here..."); - old_fs = get_fs(); - set_fs(KERNEL_DS); - err = sys_mount((char *)dev_page, (char *)dir_page, + err = do_sys_mount((char *)dev_page, (char *)dir_page, (char *)type_page, new_flags, (void *)data_page); - set_fs(old_fs); - if(data_page) free_page(data_page); dir_out: diff --git a/arch/ia64/kdb/Makefile b/arch/ia64/kdb/Makefile index 0b29d6b35..2e8db3fc4 100644 --- a/arch/ia64/kdb/Makefile +++ b/arch/ia64/kdb/Makefile @@ -13,7 +13,7 @@ MOD_SUB_DIRS := $(SUB_DIRS) ALL_SUB_DIRS := $(SUB_DIRS) .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $< -o $*.o + $(CC) $(AFLAGS) -traditional -c $< -o $*.o L_TARGET = kdb.a L_OBJS = kdbsupport.o kdb_io.o kdb_bt.o kdb_traps.o diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile index 7a2fcd214..6631d33c3 100644 --- a/arch/ia64/kernel/Makefile +++ b/arch/ia64/kernel/Makefile @@ -8,9 +8,9 @@ # Note 2! The CFLAGS definitions are now in the main makefile... .S.s: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -E -o $*.s $< + $(CPP) $(AFLAGS) -o $*.s $< .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -c -o $*.o $< + $(CC) $(AFLAGS) -c -o $*.o $< all: kernel.o head.o init_task.o diff --git a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile index 88a4aadd4..376d0d6d4 100644 --- a/arch/ia64/lib/Makefile +++ b/arch/ia64/lib/Makefile @@ -3,7 +3,7 @@ # .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -c $< -o $@ + $(CC) $(AFLAGS) -c $< -o $@ OBJS = __divdi3.o __divsi3.o __udivdi3.o __udivsi3.o \ __moddi3.o __modsi3.o __umoddi3.o __umodsi3.o \ diff --git a/arch/ia64/sn/Makefile b/arch/ia64/sn/Makefile index 3c8810967..b35ce21ff 100644 --- a/arch/ia64/sn/Makefile +++ b/arch/ia64/sn/Makefile @@ -10,9 +10,9 @@ CFLAGS := $(CFLAGS) -DCONFIG_SGI_SN1 -DSN1 -DSN -DSOFTSDV \ AFLAGS := $(AFLAGS) -DCONFIG_SGI_SN1 -DSN1 -DSOFTSDV .S.s: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -E -o $*.s $< + $(CPP) $(AFLAGS) -o $*.s $< .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -c -o $*.o $< + $(CC) $(AFLAGS) -c -o $*.o $< all: sn.a diff --git a/arch/ia64/sn/sn1/Makefile b/arch/ia64/sn/sn1/Makefile index 23758c473..fbb8e83ab 100644 --- a/arch/ia64/sn/sn1/Makefile +++ b/arch/ia64/sn/sn1/Makefile @@ -10,9 +10,9 @@ CFLAGS := $(CFLAGS) -DCONFIG_SGI_SN1 -DSN1 -DSN -DSOFTSDV \ AFLAGS := $(AFLAGS) -DCONFIG_SGI_SN1 -DSN1 -DSOFTSDV .S.s: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -E -o $*.s $< + $(CPP) $(AFLAGS) -o $*.s $< .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -c -o $*.o $< + $(CC) $(AFLAGS) -c -o $*.o $< all: sn1.a diff --git a/arch/m68k/config.in b/arch/m68k/config.in index edcbeb98a..bc6eec37a 100644 --- a/arch/m68k/config.in +++ b/arch/m68k/config.in @@ -16,16 +16,15 @@ mainmenu_option next_comment comment 'Platform dependent setup' define_bool CONFIG_ISA n +define_bool CONFIG_PCMCIA n + bool 'Amiga support' CONFIG_AMIGA bool 'Atari support' CONFIG_ATARI -if [ "$CONFIG_ATARI" = "y" ]; then - bool ' Hades support' CONFIG_HADES - if [ "$CONFIG_HADES" = "y" ]; then - define_bool CONFIG_PCI y - fi -fi -if [ "$CONFIG_HADES" != "y" ]; then - define_bool CONFIG_PCI n +dep_bool ' Hades support' CONFIG_HADES $CONFIG_ATARI +if [ "$CONFIG_HADES" = "y" ]; then + define_bool CONFIG_PCI y +else + define_bool CONFIG_PCI n fi bool 'Macintosh support' CONFIG_MAC if [ "$CONFIG_MAC" = "y" ]; then @@ -421,19 +420,21 @@ fi if [ "$CONFIG_HP300" = "y" -a "$CONFIG_DIO" = "y" ]; then tristate 'HP DCA serial support' CONFIG_HPDCA fi -if [ "$CONFIG_SUN3X" = "y" ]; then - bool 'Sun3x builtin serial support' CONFIG_SUN3X_ZS - if [ "$CONFIG_SUN3X_ZS" = "y" ]; then - bool ' Sun keyboard support' CONFIG_SUN_KEYBOARD - bool ' Sun mouse support' CONFIG_SUN_MOUSE - if [ "$CONFIG_SUN_MOUSE" != "n" ]; then - define_bool CONFIG_BUSMOUSE y - fi - define_bool CONFIG_SBUS y - define_bool CONFIG_SBUSCHAR y - define_bool CONFIG_SUN_SERIAL y - fi + +dep_bool 'Sun3x builtin serial support' CONFIG_SUN3X_ZS $CONFIG_SUN3X +dep_bool ' Sun keyboard support' CONFIG_SUN_KEYBOARD $CONFIG_SUN3X_ZS +dep_bool ' Sun mouse support' CONFIG_SUN_MOUSE $CONFIG_SUN3X_ZS +if [ "$CONFIG_SUN_MOUSE" = "y" ]; then + define_bool CONFIG_BUSMOUSE y +fi +if [ "$CONFIG_SUN3X_ZS" = "y" ]; then + define_bool CONFIG_SBUS y + define_bool CONFIG_SBUSCHAR y + define_bool CONFIG_SUN_SERIAL y +else + define_bool CONFIG_SBUS n fi + if [ "$CONFIG_AMIGA" = "y" -o "$CONFIG_ATARI" = "y" -o \ "$CONFIG_MAC" = "y" -o "$CONFIG_HP300" = "y" -o \ "$CONFIG_SUN3X" = "y" ]; then @@ -483,7 +484,7 @@ comment 'Sound support' tristate 'Sound support' CONFIG_SOUND if [ "$CONFIG_SOUND" != "n" ]; then - dep_tristate ' Amiga or Atari DMA sound support' CONFIG_DMASOUND $CONFIG_SOUND + source drivers/sound/dmasound/Config.in fi endmenu diff --git a/arch/m68k/defconfig b/arch/m68k/defconfig index d7261f600..400e38961 100644 --- a/arch/m68k/defconfig +++ b/arch/m68k/defconfig @@ -12,8 +12,10 @@ CONFIG_EXPERIMENTAL=y # Platform dependent setup # # CONFIG_ISA is not set +# CONFIG_PCMCIA is not set CONFIG_AMIGA=y # CONFIG_ATARI is not set +# CONFIG_HADES is not set # CONFIG_PCI is not set # CONFIG_MAC is not set # CONFIG_APOLLO is not set @@ -195,6 +197,10 @@ CONFIG_AMIGA_BUILTIN_SERIAL=y # CONFIG_GVPIOEXT_LP is not set # CONFIG_GVPIOEXT_PLIP is not set # CONFIG_MULTIFACE_III_TTY is not set +# CONFIG_SUN3X_ZS is not set +# CONFIG_SUN_KEYBOARD is not set +# CONFIG_SUN_MOUSE is not set +# CONFIG_SBUS is not set # CONFIG_SERIAL_CONSOLE is not set # CONFIG_USERIAL is not set # CONFIG_WATCHDOG is not set diff --git a/arch/m68k/fpsp040/Makefile b/arch/m68k/fpsp040/Makefile index bbfc0b174..acd06e79a 100644 --- a/arch/m68k/fpsp040/Makefile +++ b/arch/m68k/fpsp040/Makefile @@ -8,7 +8,7 @@ # Note 2! The CFLAGS definitions are now in the main makefile... .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c -o $*.o $< + $(CC) $(AFLAGS) -traditional -c -o $*.o $< OS_TARGET := fpsp.o diff --git a/arch/m68k/ifpsp060/Makefile b/arch/m68k/ifpsp060/Makefile index 7836197a6..9dce0a568 100644 --- a/arch/m68k/ifpsp060/Makefile +++ b/arch/m68k/ifpsp060/Makefile @@ -5,7 +5,7 @@ # for more details. .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c -o $*.o $< + $(CC) $(AFLAGS) -traditional -c -o $*.o $< OS_TARGET := ifpsp.o diff --git a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile index c51e43802..afd9e4040 100644 --- a/arch/m68k/kernel/Makefile +++ b/arch/m68k/kernel/Makefile @@ -8,7 +8,7 @@ # Note 2! The CFLAGS definitions are now in the main makefile... .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $< -o $*.o + $(CC) $(AFLAGS) -traditional -c $< -o $*.o ifndef CONFIG_SUN3 all: head.o kernel.o diff --git a/arch/m68k/lib/Makefile b/arch/m68k/lib/Makefile index 22fe6cb6d..b9480aeb6 100644 --- a/arch/m68k/lib/Makefile +++ b/arch/m68k/lib/Makefile @@ -3,7 +3,7 @@ # .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $< -o $@ + $(CC) $(AFLAGS) -traditional -c $< -o $@ L_TARGET = lib.a L_OBJS = ashrdi3.o lshrdi3.o checksum.o memcpy.o memcmp.o memset.o semaphore.o diff --git a/arch/m68k/math-emu/Makefile b/arch/m68k/math-emu/Makefile index 0e22edc96..78d295d6b 100644 --- a/arch/m68k/math-emu/Makefile +++ b/arch/m68k/math-emu/Makefile @@ -8,7 +8,7 @@ # Note 2! The CFLAGS definitions are now in the main makefile... .S.o: - $(CC) $(EXTRA_CFLAGS) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $< -o $*.o + $(CC) $(EXTRA_CFLAGS) $(AFLAGS) -traditional -c $< -o $*.o #EXTRA_CFLAGS=-DFPU_EMU_DEBUG diff --git a/arch/m68k/sun3/Makefile b/arch/m68k/sun3/Makefile index 9a34b3034..577667e5c 100644 --- a/arch/m68k/sun3/Makefile +++ b/arch/m68k/sun3/Makefile @@ -8,7 +8,7 @@ # Note 2! The CFLAGS definitions are now in the main makefile... .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -Wa,-m68020 -c $< -o $*.o + $(CC) $(AFLAGS) -traditional -Wa,-m68020 -c $< -o $*.o O_TARGET := sun3.o O_OBJS := config.o idprom.o mmu_emu.o sun3ints.o leds.o dvma.o sbus.o intersil.o diff --git a/arch/mips/config.in b/arch/mips/config.in index d0bc594ff..9e6e664d2 100644 --- a/arch/mips/config.in +++ b/arch/mips/config.in @@ -32,6 +32,8 @@ unset CONFIG_ISA unset CONFIG_MIPS_JAZZ unset CONFIG_VIDEO_G364 +define_bool CONFIG_SBUS n + if [ "$CONFIG_ALGOR_P4032" = "y" ]; then define_bool CONFIG_PCI y fi @@ -154,8 +156,10 @@ if [ "$CONFIG_ISA" = "y" ]; then source drivers/pnp/Config.in fi -if [ "$CONFIG_ISA" = "y" -o "$CONFIG_PCI" = "y" ]; then - source drivers/pcmcia/Config.in +if [ "$CONFIG_HOTPLUG" = "y" ] ; then + source drivers/pcmcia/Config.in +else + define_bool CONFIG_PCMCIA n fi source drivers/block/Config.in @@ -242,15 +246,7 @@ if [ "$CONFIG_NET" = "y" ]; then endmenu fi -if [ "$CONFIG_SGI_IP22" != "y" -a \ - "$CONFIG_DECSTATION" != "y" -a \ - "$CONFIG_BAGET_MIPS" != "y" ]; then - - mainmenu_option next_comment - comment 'AX.25 network device drivers' - source drivers/net/hamradio/Config.in - endmenu - +if [ "$CONFIG_ISA" = "y" -o "$CONFIG_PCI" = "y" ]; then mainmenu_option next_comment comment 'ISDN subsystem' @@ -324,9 +320,6 @@ if [ "$CONFIG_SGI_IP22" = "y" ]; then endmenu fi -#The ones having USB should include it -#source drivers/usb/Config.in - source fs/Config.in if [ "$CONFIG_VT" = "y" ]; then @@ -356,6 +349,8 @@ if [ "$CONFIG_SGI_IP22" = "y" ]; then source drivers/sgi/Config.in fi +source drivers/usb/Config.in + mainmenu_option next_comment comment 'Kernel hacking' diff --git a/arch/mips/defconfig b/arch/mips/defconfig index 85385be9e..d4570eb4e 100644 --- a/arch/mips/defconfig +++ b/arch/mips/defconfig @@ -19,6 +19,7 @@ CONFIG_EXPERIMENTAL=y # CONFIG_OLIVETTI_M700 is not set CONFIG_SGI_IP22=y # CONFIG_SNI_RM200_PCI is not set +# CONFIG_SBUS is not set CONFIG_ARC32=y # CONFIG_ISA is not set # CONFIG_PCI is not set @@ -61,6 +62,7 @@ CONFIG_SYSCTL=y CONFIG_MODULES=y # CONFIG_MODVERSIONS is not set CONFIG_KMOD=y +# CONFIG_PCMCIA is not set # # Block devices @@ -68,6 +70,8 @@ CONFIG_KMOD=y # CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_DEV_XD is not set # CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set # # Additional Block Devices @@ -75,7 +79,10 @@ CONFIG_KMOD=y # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_STRIPED is not set # CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set # # Networking options @@ -160,12 +167,12 @@ CONFIG_SCSI_SGIWD93=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 # CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_DMA is not set @@ -173,18 +180,19 @@ CONFIG_SCSI_SGIWD93=y # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_SYM53C416 is not set # CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_NCR53C7xx 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 # @@ -213,6 +221,7 @@ CONFIG_FONT_8x16=y CONFIG_AUTOFS_FS=y CONFIG_AUTOFS4_FS=y # CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set @@ -222,27 +231,34 @@ CONFIG_AUTOFS4_FS=y # CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set +# CONFIG_RAMFS is not set CONFIG_ISO9660_FS=y # CONFIG_JOLIET is not set # CONFIG_MINIX_FS is not set # CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS is not set # CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_SYSV_FS_WRITE is not set # CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set # # Network File Systems # # CONFIG_CODA_FS is not set CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set CONFIG_ROOT_NFS=y CONFIG_NFSD=y # CONFIG_NFSD_V3 is not set @@ -250,6 +266,16 @@ CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_MOUNT_SUBDIR is not set +# CONFIG_NCPFS_NDS_DOMAINS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set # # Partition Types @@ -294,6 +320,11 @@ CONFIG_SGI_DS1286=y # CONFIG_SGI_NEWPORT_GFX is not set # +# USB support +# +# CONFIG_USB is not set + +# # Kernel hacking # CONFIG_CROSSCOMPILE=y diff --git a/arch/mips/defconfig-decstation b/arch/mips/defconfig-decstation index 64b06c4d8..852319984 100644 --- a/arch/mips/defconfig-decstation +++ b/arch/mips/defconfig-decstation @@ -19,6 +19,7 @@ CONFIG_DECSTATION=y # CONFIG_OLIVETTI_M700 is not set # CONFIG_SGI_IP22 is not set # CONFIG_SNI_RM200_PCI is not set +# CONFIG_SBUS is not set # CONFIG_ISA is not set # CONFIG_PCI is not set @@ -47,32 +48,19 @@ CONFIG_ELF_KERNEL=y CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_NET=y - -# -# PCMCIA/CardBus support -# -# CONFIG_PCMCIA is not set CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # -# Loadable module support +# Parallel port support # +# CONFIG_PARPORT is not set CONFIG_MODULES=y # CONFIG_MODVERSIONS is not set CONFIG_KMOD=y - -# -# TURBOchannel support -# CONFIG_TC=y - -# -# Plug and Play configuration -# -# CONFIG_PNP is not set -# CONFIG_ISAPNP is not set +# CONFIG_PCMCIA is not set # # Block devices @@ -80,6 +68,8 @@ CONFIG_TC=y # CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_DEV_XD is not set # CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set # # Additional Block Devices @@ -87,7 +77,10 @@ CONFIG_TC=y # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_STRIPED is not set # CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set # # Networking options @@ -139,19 +132,6 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_NET_SCHED is not set # -# Telephony Support -# -# CONFIG_PHONE is not set -# CONFIG_PHONE_IXJ is not set - -# -# ATA/IDE/MFM/RLL support -# -# CONFIG_IDE is not set -# CONFIG_BLK_DEV_IDE_MODES is not set -# CONFIG_BLK_DEV_HD is not set - -# # SCSI support # CONFIG_SCSI=y @@ -178,20 +158,18 @@ CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_DECNCR=y # CONFIG_SCSI_DECSII is not set -CONFIG_SCSI_DECNCR=y -# CONFIG_SCSI_DECSII is not set # 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_IPS 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_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_DMA is not set @@ -199,33 +177,22 @@ CONFIG_SCSI_DECNCR=y # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_GENERIC_NCR5380 is not set -# CONFIG_SCSI_PPA is not set -# CONFIG_SCSI_IMM is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_SYM53C416 is not set # CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_NCR53C7xx 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 # -# 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 - -# # Network device support # CONFIG_NETDEVICES=y @@ -235,7 +202,7 @@ CONFIG_NETDEVICES=y CONFIG_DECLANCE=y # -# DECstation Character devices +# DECStation Character devices # # CONFIG_VT is not set CONFIG_SERIAL=y @@ -248,17 +215,13 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_RTC is not set # -# USB support -# -# CONFIG_USB is not set - -# # File systems # # CONFIG_QUOTA is not set # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set @@ -268,33 +231,51 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set +# CONFIG_RAMFS 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_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS is not set # CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_SYSV_FS_WRITE is not set # CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set # # Network File Systems # # CONFIG_CODA_FS is not set # CONFIG_NFS_FS is not set +# CONFIG_NFS_V3 is not set # CONFIG_ROOT_NFS is not set # CONFIG_NFSD is not set +# CONFIG_NFSD_V3 is not set # CONFIG_SUNRPC is not set # CONFIG_LOCKD is not set # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_MOUNT_SUBDIR is not set +# CONFIG_NCPFS_NDS_DOMAINS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set # # Partition Types @@ -315,6 +296,11 @@ CONFIG_ULTRIX_PARTITION=y # CONFIG_NLS is not set # +# USB support +# +# CONFIG_USB is not set + +# # Kernel hacking # CONFIG_CROSSCOMPILE=y diff --git a/arch/mips/defconfig-ip22 b/arch/mips/defconfig-ip22 index 85385be9e..d4570eb4e 100644 --- a/arch/mips/defconfig-ip22 +++ b/arch/mips/defconfig-ip22 @@ -19,6 +19,7 @@ CONFIG_EXPERIMENTAL=y # CONFIG_OLIVETTI_M700 is not set CONFIG_SGI_IP22=y # CONFIG_SNI_RM200_PCI is not set +# CONFIG_SBUS is not set CONFIG_ARC32=y # CONFIG_ISA is not set # CONFIG_PCI is not set @@ -61,6 +62,7 @@ CONFIG_SYSCTL=y CONFIG_MODULES=y # CONFIG_MODVERSIONS is not set CONFIG_KMOD=y +# CONFIG_PCMCIA is not set # # Block devices @@ -68,6 +70,8 @@ CONFIG_KMOD=y # CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_DEV_XD is not set # CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set # # Additional Block Devices @@ -75,7 +79,10 @@ CONFIG_KMOD=y # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_STRIPED is not set # CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set # # Networking options @@ -160,12 +167,12 @@ CONFIG_SCSI_SGIWD93=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 # CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_DMA is not set @@ -173,18 +180,19 @@ CONFIG_SCSI_SGIWD93=y # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_SYM53C416 is not set # CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_NCR53C7xx 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 # @@ -213,6 +221,7 @@ CONFIG_FONT_8x16=y CONFIG_AUTOFS_FS=y CONFIG_AUTOFS4_FS=y # CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set @@ -222,27 +231,34 @@ CONFIG_AUTOFS4_FS=y # CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set +# CONFIG_RAMFS is not set CONFIG_ISO9660_FS=y # CONFIG_JOLIET is not set # CONFIG_MINIX_FS is not set # CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS is not set # CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_SYSV_FS_WRITE is not set # CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set # # Network File Systems # # CONFIG_CODA_FS is not set CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set CONFIG_ROOT_NFS=y CONFIG_NFSD=y # CONFIG_NFSD_V3 is not set @@ -250,6 +266,16 @@ CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_MOUNT_SUBDIR is not set +# CONFIG_NCPFS_NDS_DOMAINS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set # # Partition Types @@ -294,6 +320,11 @@ CONFIG_SGI_DS1286=y # CONFIG_SGI_NEWPORT_GFX is not set # +# USB support +# +# CONFIG_USB is not set + +# # Kernel hacking # CONFIG_CROSSCOMPILE=y diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c index eca74b629..742cc9b9d 100644 --- a/arch/mips/kernel/sysirix.c +++ b/arch/mips/kernel/sysirix.c @@ -696,7 +696,7 @@ asmlinkage int irix_pause(void) return -EINTR; } -extern asmlinkage int sys_mount(char * dev_name, char * dir_name, char * type, +extern asmlinkage long sys_mount(char * dev_name, char * dir_name, char * type, unsigned long new_flags, void * data); /* XXX need more than this... */ diff --git a/arch/mips64/config.in b/arch/mips64/config.in index 7f22687c8..b2454b8cc 100644 --- a/arch/mips64/config.in +++ b/arch/mips64/config.in @@ -58,6 +58,8 @@ if [ "$CONFIG_PCI" != "y" ]; then define_bool CONFIG_PCI n fi +define_bool CONFIG_SBUS n + mainmenu_option next_comment comment 'CPU selection' @@ -81,7 +83,14 @@ bool 'Generate little endian code' CONFIG_CPU_LITTLE_ENDIAN bool 'Networking support' CONFIG_NET 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 +else + define_bool CONFIG_PCMCIA n +fi bool 'System V IPC' CONFIG_SYSVIPC bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT @@ -194,7 +203,6 @@ endmenu source drivers/char/Config.in -source drivers/usb/Config.in #source drivers/misc/Config.in @@ -231,6 +239,8 @@ if [ "$CONFIG_SGI_IP22" = "y" ]; then source drivers/sgi/Config.in fi +source drivers/usb/Config.in + mainmenu_option next_comment comment 'Kernel hacking' diff --git a/arch/mips64/defconfig b/arch/mips64/defconfig index 4f555127e..410152c15 100644 --- a/arch/mips64/defconfig +++ b/arch/mips64/defconfig @@ -21,6 +21,7 @@ CONFIG_COHERENT_IO=y CONFIG_PCI=y CONFIG_QL_ISP_A64=y # CONFIG_ISA is not set +# CONFIG_SBUS is not set # # CPU selection @@ -39,10 +40,7 @@ CONFIG_CPU_R10000=y # CONFIG_CPU_LITTLE_ENDIAN is not set CONFIG_NET=y CONFIG_PCI_NAMES=y - -# -# PCMCIA/CardBus support -# +# CONFIG_HOTPLUG is not set # CONFIG_PCMCIA is not set CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set @@ -75,7 +73,10 @@ CONFIG_PCI_NAMES=y # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_STRIPED is not set # CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set # # Networking options @@ -154,12 +155,12 @@ CONFIG_SD_EXTRA_DEVS=40 # 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 # CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_DMA is not set @@ -185,11 +186,9 @@ CONFIG_SD_EXTRA_DEVS=40 CONFIG_SCSI_QLOGIC_ISP=y # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set -# CONFIG_SCSI_SEAGATE is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_T128 is not set # CONFIG_SCSI_U14_34F is not set -# CONFIG_SCSI_ULTRASTOR is not set # # I2O device support @@ -327,17 +326,13 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_DRM_TDFX is not set # -# USB support -# -# CONFIG_USB is not set - -# # File systems # # CONFIG_QUOTA is not set # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set @@ -347,33 +342,51 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set +# CONFIG_RAMFS 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_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS is not set # CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_SYSV_FS_WRITE is not set # CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set # # Network File Systems # # CONFIG_CODA_FS is not set CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set CONFIG_ROOT_NFS=y # CONFIG_NFSD is not set +# CONFIG_NFSD_V3 is not set CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_MOUNT_SUBDIR is not set +# CONFIG_NCPFS_NDS_DOMAINS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set # # Partition Types @@ -397,6 +410,11 @@ CONFIG_KCORE_ELF=y # CONFIG_SOUND is not set # +# USB support +# +# CONFIG_USB is not set + +# # Kernel hacking # CONFIG_CROSSCOMPILE=y diff --git a/arch/mips64/defconfig-ip22 b/arch/mips64/defconfig-ip22 index c0973c4d0..b4ccf3abd 100644 --- a/arch/mips64/defconfig-ip22 +++ b/arch/mips64/defconfig-ip22 @@ -18,6 +18,7 @@ CONFIG_BOARD_SCACHE=y CONFIG_ARC_MEMORY=y # CONFIG_ISA is not set # CONFIG_PCI is not set +# CONFIG_SBUS is not set # # CPU selection @@ -34,10 +35,7 @@ CONFIG_CPU_R5000=y # # CONFIG_CPU_LITTLE_ENDIAN is not set CONFIG_NET=y - -# -# PCMCIA/CardBus support -# +# CONFIG_HOTPLUG is not set # CONFIG_PCMCIA is not set CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set @@ -57,6 +55,8 @@ CONFIG_BINFMT_ELF=y # CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_DEV_XD is not set # CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set # # Additional Block Devices @@ -64,7 +64,10 @@ CONFIG_BINFMT_ELF=y # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_STRIPED is not set # CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set # # Networking options @@ -244,17 +247,13 @@ CONFIG_VT_CONSOLE=y # CONFIG_DRM_TDFX is not set # -# USB support -# -# CONFIG_USB is not set - -# # File systems # # CONFIG_QUOTA is not set # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set @@ -264,33 +263,51 @@ CONFIG_VT_CONSOLE=y # CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set +# CONFIG_RAMFS 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_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS is not set # CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_SYSV_FS_WRITE is not set # CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set # # Network File Systems # # CONFIG_CODA_FS is not set CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set CONFIG_ROOT_NFS=y # CONFIG_NFSD is not set +# CONFIG_NFSD_V3 is not set CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_MOUNT_SUBDIR is not set +# CONFIG_NCPFS_NDS_DOMAINS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set # # Partition Types @@ -318,6 +335,11 @@ CONFIG_KCORE_ELF=y CONFIG_SGI_DS1286=y # +# USB support +# +# CONFIG_USB is not set + +# # Kernel hacking # CONFIG_CROSSCOMPILE=y diff --git a/arch/mips64/defconfig-ip27 b/arch/mips64/defconfig-ip27 index 4f555127e..410152c15 100644 --- a/arch/mips64/defconfig-ip27 +++ b/arch/mips64/defconfig-ip27 @@ -21,6 +21,7 @@ CONFIG_COHERENT_IO=y CONFIG_PCI=y CONFIG_QL_ISP_A64=y # CONFIG_ISA is not set +# CONFIG_SBUS is not set # # CPU selection @@ -39,10 +40,7 @@ CONFIG_CPU_R10000=y # CONFIG_CPU_LITTLE_ENDIAN is not set CONFIG_NET=y CONFIG_PCI_NAMES=y - -# -# PCMCIA/CardBus support -# +# CONFIG_HOTPLUG is not set # CONFIG_PCMCIA is not set CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set @@ -75,7 +73,10 @@ CONFIG_PCI_NAMES=y # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_STRIPED is not set # CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set # # Networking options @@ -154,12 +155,12 @@ CONFIG_SD_EXTRA_DEVS=40 # 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 # CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_DMA is not set @@ -185,11 +186,9 @@ CONFIG_SD_EXTRA_DEVS=40 CONFIG_SCSI_QLOGIC_ISP=y # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set -# CONFIG_SCSI_SEAGATE is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_T128 is not set # CONFIG_SCSI_U14_34F is not set -# CONFIG_SCSI_ULTRASTOR is not set # # I2O device support @@ -327,17 +326,13 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_DRM_TDFX is not set # -# USB support -# -# CONFIG_USB is not set - -# # File systems # # CONFIG_QUOTA is not set # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set @@ -347,33 +342,51 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set +# CONFIG_RAMFS 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_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS is not set # CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_SYSV_FS_WRITE is not set # CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set # # Network File Systems # # CONFIG_CODA_FS is not set CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set CONFIG_ROOT_NFS=y # CONFIG_NFSD is not set +# CONFIG_NFSD_V3 is not set CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_MOUNT_SUBDIR is not set +# CONFIG_NCPFS_NDS_DOMAINS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set # # Partition Types @@ -397,6 +410,11 @@ CONFIG_KCORE_ELF=y # CONFIG_SOUND is not set # +# USB support +# +# CONFIG_USB is not set + +# # Kernel hacking # CONFIG_CROSSCOMPILE=y diff --git a/arch/mips64/sgi-ip27/ip27-memory.c b/arch/mips64/sgi-ip27/ip27-memory.c index 60881d60a..063fb5a41 100644 --- a/arch/mips64/sgi-ip27/ip27-memory.c +++ b/arch/mips64/sgi-ip27/ip27-memory.c @@ -277,7 +277,7 @@ void __init paging_init(void) zones_size[ZONE_DMA] = end_pfn + 1 - start_pfn; free_area_init_node(node, NODE_DATA(node), zones_size, - start_pfn << PAGE_SHIFT); + start_pfn << PAGE_SHIFT, 0); if ((PLAT_NODE_DATA_STARTNR(node) + PLAT_NODE_DATA_SIZE(node)) > pagenr) pagenr = PLAT_NODE_DATA_STARTNR(node) + diff --git a/arch/ppc/8xx_io/enet.c b/arch/ppc/8xx_io/enet.c index 26beffc40..f6b37dcb4 100644 --- a/arch/ppc/8xx_io/enet.c +++ b/arch/ppc/8xx_io/enet.c @@ -63,13 +63,13 @@ * Like the LANCE driver: * The driver runs as two independent, single-threaded flows of control. One * is the send-packet routine, which enforces single-threaded use by the - * dev->tbusy flag. The other thread is the interrupt handler, which is single - * threaded by the hardware and other software. + * cep->tx_busy flag. The other thread is the interrupt handler, which is + * single threaded by the hardware and other software. * - * The send packet thread has partial control over the Tx ring and 'dev->tbusy' - * flag. It sets the tbusy flag whenever it's queuing a Tx packet. If the next - * queue slot is empty, it clears the tbusy flag when finished otherwise it sets - * the 'lp->tx_full' flag. + * The send packet thread has partial control over the Tx ring and the + * 'cep->tx_busy' flag. It sets the tx_busy flag whenever it's queuing a Tx + * packet. If the next queue slot is empty, it clears the tx_busy flag when + * finished otherwise it sets the 'lp->tx_full' flag. * * The MBX has a control register external to the MPC8xx that has some * control of the Ethernet interface. Control Register 1 has the @@ -149,8 +149,10 @@ struct cpm_enet_private { cbd_t *dirty_tx; /* The ring entries to be free()ed. */ scc_t *sccp; struct net_device_stats stats; - char tx_full; + uint tx_full; + uint tx_busy; unsigned long lock; + int interrupt; }; static int cpm_enet_open(struct net_device *dev); @@ -190,10 +192,7 @@ cpm_enet_open(struct net_device *dev) * a simple way to do that. */ - dev->tbusy = 0; - dev->interrupt = 0; - dev->start = 1; - + netif_start_queue(dev); return 0; /* Always succeed */ } @@ -205,7 +204,7 @@ cpm_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) unsigned long flags; /* Transmitter timeout, serious problems. */ - if (dev->tbusy) { + if (cep->tx_busy) { int tickssofar = jiffies - dev->trans_start; if (tickssofar < 200) return 1; @@ -233,22 +232,23 @@ cpm_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) } #endif - dev->tbusy=0; + cep->tx_busy=0; dev->trans_start = jiffies; return 0; } /* Block a timer-based transmit from overlapping. This could better be - done with atomic_swap(1, dev->tbusy), but set_bit() works as well. */ - if (test_and_set_bit(0, (void*)&dev->tbusy) != 0) { + * done with atomic_swap(1, cep->tx_busy), but set_bit() works as well. + */ + if (test_and_set_bit(0, (void*)&cep->tx_busy) != 0) { printk("%s: Transmitter access conflict.\n", dev->name); return 1; } if (test_and_set_bit(0, (void*)&cep->lock) != 0) { printk("%s: tx queue lock!.\n", dev->name); - /* don't clear dev->tbusy flag. */ + /* don't clear cep->tx_busy flag. */ return 1; } @@ -258,7 +258,7 @@ cpm_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) #ifndef final_version if (bdp->cbd_sc & BD_ENET_TX_READY) { /* Ooops. All transmit buffers are full. Bail out. - * This should not happen, since dev->tbusy should be set. + * This should not happen, since cep->tx_busy should be set. */ printk("%s: tx queue full!.\n", dev->name); cep->lock = 0; @@ -314,7 +314,7 @@ cpm_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) if (bdp->cbd_sc & BD_ENET_TX_READY) cep->tx_full = 1; else - dev->tbusy=0; + cep->tx_busy=0; restore_flags(flags); cep->cur_tx = (cbd_t *)bdp; @@ -335,10 +335,10 @@ cpm_enet_interrupt(void *dev_id) int must_restart; cep = (struct cpm_enet_private *)dev->priv; - if (dev->interrupt) + if (cep->interrupt) printk("%s: Re-entering the interrupt handler.\n", dev->name); - dev->interrupt = 1; + cep->interrupt = 1; /* Get the interrupt events that caused us to be here. */ @@ -399,7 +399,7 @@ cpm_enet_interrupt(void *dev_id) /* Free the sk buffer associated with this last transmit. */ - dev_kfree_skb(cep->tx_skbuff[cep->skb_dirty]/*, FREE_WRITE*/); + dev_kfree_skb_irq(cep->tx_skbuff[cep->skb_dirty]); cep->skb_dirty = (cep->skb_dirty + 1) & TX_RING_MOD_MASK; /* Update pointer to next buffer descriptor to be transmitted. @@ -421,10 +421,10 @@ cpm_enet_interrupt(void *dev_id) /* Since we have freed up a buffer, the ring is no longer * full. */ - if (cep->tx_full && dev->tbusy) { + if (cep->tx_full && cep->tx_busy) { cep->tx_full = 0; - dev->tbusy = 0; - mark_bh(NET_BH); + cep->tx_busy = 0; + netif_wake_queue(dev); } cep->dirty_tx = (cbd_t *)bdp; @@ -455,7 +455,7 @@ cpm_enet_interrupt(void *dev_id) printk("CPM ENET: BSY can't happen.\n"); } - dev->interrupt = 0; + cep->interrupt = 0; return; } @@ -564,6 +564,7 @@ cpm_enet_close(struct net_device *dev) { /* Don't know what to do yet. */ + netif_stop_queue(dev); return 0; } diff --git a/arch/ppc/8xx_io/uart.c b/arch/ppc/8xx_io/uart.c index 94e900ceb..575f68a28 100644 --- a/arch/ppc/8xx_io/uart.c +++ b/arch/ppc/8xx_io/uart.c @@ -28,6 +28,7 @@ #include <linux/tty.h> #include <linux/tty_flip.h> #include <linux/serial.h> +#include <linux/serialP.h> #include <linux/major.h> #include <linux/string.h> #include <linux/fcntl.h> @@ -1937,6 +1938,7 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp) printk("rs_open returning after block_til_ready with %d\n", retval); #endif + MOD_DEC_USE_COUNT; return retval; } diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile index 7c3f13822..4b578da45 100644 --- a/arch/ppc/Makefile +++ b/arch/ppc/Makefile @@ -72,7 +72,7 @@ MAKETREEBOOT = $(MAKE) -C arch/$(ARCH)/treeboot ifdef CONFIG_8xx SUBDIRS += arch/ppc/8xx_io -DRIVERS += arch/ppc/8xx_io/8xx_io.a drivers/net/net.a +DRIVERS += arch/ppc/8xx_io/8xx_io.a endif ifdef CONFIG_APUS diff --git a/arch/ppc/boot/Makefile b/arch/ppc/boot/Makefile index 604205565..33fa87999 100644 --- a/arch/ppc/boot/Makefile +++ b/arch/ppc/boot/Makefile @@ -16,9 +16,9 @@ .c.o: $(CC) $(CFLAGS) -DINITRD_OFFSET=$(IOFF) -DINITRD_SIZE=$(ISZ) -DZIMAGE_OFFSET=$(ZOFF) -DZIMAGE_SIZE=$(ZSZ) -D__BOOTER__ -c -o $*.o $< .S.s: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -E -o $*.o $< + $(CPP) $(AFLAGS) -traditional -o $*.o $< .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c -o $*.o $< + $(CC) $(AFLAGS) -traditional -c -o $*.o $< ZOFF = 0 ZSZ = 0 diff --git a/arch/ppc/chrpboot/Makefile b/arch/ppc/chrpboot/Makefile index 216b289ed..e988ce9de 100644 --- a/arch/ppc/chrpboot/Makefile +++ b/arch/ppc/chrpboot/Makefile @@ -12,9 +12,9 @@ .c.o: $(CC) $(CFLAGS) -DKERNELBASE=$(KERNELBASE) -c -o $*.o $< .S.s: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -E -o $*.o $< + $(CPP) $(AFLAGS) -traditional -o $*.o $< .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c -o $*.o $< + $(CC) $(AFLAGS) -traditional -c -o $*.o $< CFLAGS = $(CPPFLAGS) -O -fno-builtin -DSTDC_HEADERS LD_ARGS = -Ttext 0x00400000 diff --git a/arch/ppc/config.in b/arch/ppc/config.in index e21140d9d..e9499fbc9 100644 --- a/arch/ppc/config.in +++ b/arch/ppc/config.in @@ -83,12 +83,13 @@ mainmenu_option next_comment comment 'General setup' define_bool CONFIG_ISA n +define_bool CONFIG_SBUS n if [ "$CONFIG_APUS" = "y" -o "$CONFIG_4xx" = "y" -o \ "$CONFIG_82xx" = "y" ]; then define_bool CONFIG_PCI n else - if [ "$CONFIG_6xx" = "y" -o CONFIG_PPC64 ]; then + if [ "$CONFIG_6xx" = "y" -o "$CONFIG_PPC64" = "y" ]; then define_bool CONFIG_PCI y else # CONFIG_8xx @@ -115,6 +116,8 @@ bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG if [ "$CONFIG_HOTPLUG" = "y" ]; then source drivers/pcmcia/Config.in +else + define_bool CONFIG_PCMCIA n fi source drivers/parport/Config.in @@ -247,14 +250,13 @@ source drivers/video/Config.in endmenu source drivers/char/Config.in -source drivers/usb/Config.in source fs/Config.in mainmenu_option next_comment comment 'Sound' tristate 'Sound card support' CONFIG_SOUND if [ "$CONFIG_SOUND" != "n" ]; then - dep_tristate 'Amiga or PowerMac DMA sound support' CONFIG_DMASOUND $CONFIG_SOUND + source drivers/sound/dmasound/Config.in source drivers/sound/Config.in fi @@ -264,6 +266,8 @@ if [ "$CONFIG_8xx" = "y" ]; then source arch/ppc/8xx_io/Config.in fi +source drivers/usb/Config.in + mainmenu_option next_comment comment 'Kernel hacking' diff --git a/arch/ppc/defconfig b/arch/ppc/defconfig index 1f5784701..8717bc055 100644 --- a/arch/ppc/defconfig +++ b/arch/ppc/defconfig @@ -34,6 +34,7 @@ CONFIG_KMOD=y # General setup # # CONFIG_ISA is not set +# CONFIG_SBUS is not set CONFIG_PCI=y CONFIG_NET=y CONFIG_SYSCTL=y @@ -45,6 +46,7 @@ CONFIG_KERNEL_ELF=y # CONFIG_BINFMT_MISC is not set # CONFIG_PCI_NAMES is not set # CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set # # Parallel port support @@ -185,6 +187,7 @@ CONFIG_IDEDMA_PCI_EXPERIMENTAL=y # CONFIG_BLK_DEV_AEC6210 is not set # CONFIG_AEC6210_TUNING is not set # CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_WDC_ALI15X3 is not set # CONFIG_BLK_DEV_AMD7409 is not set # CONFIG_AMD7409_OVERRIDE is not set # CONFIG_BLK_DEV_CMD64X is not set diff --git a/arch/ppc/kernel/feature.c b/arch/ppc/kernel/feature.c index d14c7380a..d5baa3747 100644 --- a/arch/ppc/kernel/feature.c +++ b/arch/ppc/kernel/feature.c @@ -184,14 +184,14 @@ feature_init(void) if (controller_count) printk(KERN_INFO "Registered %d feature controller(s)\n", controller_count); -#ifdef CONFIG_PMAC_PBOOK -#ifdef CONFIG_DMASOUND_MODULE - /* On PowerBooks, we disable the sound chip when dmasound is a module */ +#if defined(CONFIG_PMAC_PBOOK) && !defined(CONFIG_DMASOUND_AWACS) + /* On PowerBooks, we disable the sound chip when dmasound is a module + * or not used at all + */ if (controller_count && find_devices("via-pmu") != NULL) { feature_clear(controllers[0].device, FEATURE_Sound_power); feature_clear(controllers[0].device, FEATURE_Sound_CLK_enable); } -#endif #endif } diff --git a/arch/ppc/kernel/m8xx_setup.c b/arch/ppc/kernel/m8xx_setup.c index 36e886d0c..a417bed2e 100644 --- a/arch/ppc/kernel/m8xx_setup.c +++ b/arch/ppc/kernel/m8xx_setup.c @@ -276,7 +276,6 @@ m8xx_init_IRQ(void) int i; void cpm_interrupt_init(void); - ppc8xx_pic.irq_offset = 0; for ( i = 0 ; i < NR_SIU_INTS ; i++ ) irq_desc[i].handler = &ppc8xx_pic; diff --git a/arch/ppc/lib/Makefile b/arch/ppc/lib/Makefile index e454e952d..b6a16900c 100644 --- a/arch/ppc/lib/Makefile +++ b/arch/ppc/lib/Makefile @@ -3,7 +3,7 @@ # .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -c $< -o $*.o + $(CC) $(AFLAGS) -c $< -o $*.o O_TARGET = lib.o O_OBJS = checksum.o string.o strcase.o diff --git a/arch/ppc/math-emu/math.c b/arch/ppc/math-emu/math.c index aed5c7062..146b17df4 100644 --- a/arch/ppc/math-emu/math.c +++ b/arch/ppc/math-emu/math.c @@ -233,14 +233,14 @@ do_mathemu(struct pt_regs *regs) case LFD: idx = (insn >> 16) & 0x1f; sdisp = (insn & 0xffff); - op0 = (void *)¤t->tss.fpr[(insn >> 21) & 0x1f]; + op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; op1 = (void *)((idx ? regs->gpr[idx] : 0) + sdisp); lfd(op0, op1, op2, op3); break; case LFDU: idx = (insn >> 16) & 0x1f; sdisp = (insn & 0xffff); - op0 = (void *)¤t->tss.fpr[(insn >> 21) & 0x1f]; + op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; op1 = (void *)((idx ? regs->gpr[idx] : 0) + sdisp); lfd(op0, op1, op2, op3); regs->gpr[idx] = (unsigned long)op1; @@ -248,21 +248,21 @@ do_mathemu(struct pt_regs *regs) case STFD: idx = (insn >> 16) & 0x1f; sdisp = (insn & 0xffff); - op0 = (void *)¤t->tss.fpr[(insn >> 21) & 0x1f]; + op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; op1 = (void *)((idx ? regs->gpr[idx] : 0) + sdisp); stfd(op0, op1, op2, op3); break; case STFDU: idx = (insn >> 16) & 0x1f; sdisp = (insn & 0xffff); - op0 = (void *)¤t->tss.fpr[(insn >> 21) & 0x1f]; + op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; op1 = (void *)((idx ? regs->gpr[idx] : 0) + sdisp); stfd(op0, op1, op2, op3); regs->gpr[idx] = (unsigned long)op1; break; case OP63: - op0 = (void *)¤t->tss.fpr[(insn >> 21) & 0x1f]; - op1 = (void *)¤t->tss.fpr[(insn >> 11) & 0x1f]; + op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; + op1 = (void *)¤t->thread.fpr[(insn >> 11) & 0x1f]; fmr(op0, op1, op2, op3); break; default: @@ -359,28 +359,28 @@ do_mathemu(struct pt_regs *regs) switch (type) { case AB: - op0 = (void *)¤t->tss.fpr[(insn >> 21) & 0x1f]; - op1 = (void *)¤t->tss.fpr[(insn >> 16) & 0x1f]; - op2 = (void *)¤t->tss.fpr[(insn >> 11) & 0x1f]; + op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; + op1 = (void *)¤t->thread.fpr[(insn >> 16) & 0x1f]; + op2 = (void *)¤t->thread.fpr[(insn >> 11) & 0x1f]; break; case AC: - op0 = (void *)¤t->tss.fpr[(insn >> 21) & 0x1f]; - op1 = (void *)¤t->tss.fpr[(insn >> 16) & 0x1f]; - op2 = (void *)¤t->tss.fpr[(insn >> 6) & 0x1f]; + op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; + op1 = (void *)¤t->thread.fpr[(insn >> 16) & 0x1f]; + op2 = (void *)¤t->thread.fpr[(insn >> 6) & 0x1f]; break; case ABC: - op0 = (void *)¤t->tss.fpr[(insn >> 21) & 0x1f]; - op1 = (void *)¤t->tss.fpr[(insn >> 16) & 0x1f]; - op2 = (void *)¤t->tss.fpr[(insn >> 11) & 0x1f]; - op3 = (void *)¤t->tss.fpr[(insn >> 6) & 0x1f]; + op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; + op1 = (void *)¤t->thread.fpr[(insn >> 16) & 0x1f]; + op2 = (void *)¤t->thread.fpr[(insn >> 11) & 0x1f]; + op3 = (void *)¤t->thread.fpr[(insn >> 6) & 0x1f]; break; case D: idx = (insn >> 16) & 0x1f; sdisp = (insn & 0xffff); - op0 = (void *)¤t->tss.fpr[(insn >> 21) & 0x1f]; + op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; op1 = (void *)((idx ? regs->gpr[idx] : 0) + sdisp); break; @@ -390,22 +390,22 @@ do_mathemu(struct pt_regs *regs) goto illegal; sdisp = (insn & 0xffff); - op0 = (void *)¤t->tss.fpr[(insn >> 21) & 0x1f]; + op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; op1 = (void *)(regs->gpr[idx] + sdisp); break; case X: - op0 = (void *)¤t->tss.fpr[(insn >> 21) & 0x1f]; + op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; break; case XA: - op0 = (void *)¤t->tss.fpr[(insn >> 21) & 0x1f]; - op1 = (void *)¤t->tss.fpr[(insn >> 16) & 0x1f]; + op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; + op1 = (void *)¤t->thread.fpr[(insn >> 16) & 0x1f]; break; case XB: - op0 = (void *)¤t->tss.fpr[(insn >> 21) & 0x1f]; - op1 = (void *)¤t->tss.fpr[(insn >> 11) & 0x1f]; + op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; + op1 = (void *)¤t->thread.fpr[(insn >> 11) & 0x1f]; break; case XE: @@ -413,13 +413,13 @@ do_mathemu(struct pt_regs *regs) if (!idx) goto illegal; - op0 = (void *)¤t->tss.fpr[(insn >> 21) & 0x1f]; + op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; op1 = (void *)(regs->gpr[idx] + regs->gpr[(insn >> 11) & 0x1f]); break; case XEU: idx = (insn >> 16) & 0x1f; - op0 = (void *)¤t->tss.fpr[(insn >> 21) & 0x1f]; + op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f]; op1 = (void *)((idx ? regs->gpr[idx] : 0) + regs->gpr[(insn >> 11) & 0x1f]); break; @@ -427,8 +427,8 @@ do_mathemu(struct pt_regs *regs) case XCR: op0 = (void *)®s->ccr; op1 = (void *)((insn >> 23) & 0x7); - op2 = (void *)¤t->tss.fpr[(insn >> 16) & 0x1f]; - op3 = (void *)¤t->tss.fpr[(insn >> 11) & 0x1f]; + op2 = (void *)¤t->thread.fpr[(insn >> 16) & 0x1f]; + op3 = (void *)¤t->thread.fpr[(insn >> 11) & 0x1f]; break; case XCRL: @@ -448,7 +448,7 @@ do_mathemu(struct pt_regs *regs) case XFLB: op0 = (void *)((insn >> 17) & 0xff); - op1 = (void *)¤t->tss.fpr[(insn >> 11) & 0x1f]; + op1 = (void *)¤t->thread.fpr[(insn >> 11) & 0x1f]; break; default: diff --git a/arch/ppc/math-emu/sfp-machine.h b/arch/ppc/math-emu/sfp-machine.h index 73b7e69c6..ac39cb054 100644 --- a/arch/ppc/math-emu/sfp-machine.h +++ b/arch/ppc/math-emu/sfp-machine.h @@ -166,7 +166,7 @@ extern int fp_pack_ds(void *, long, unsigned long, unsigned long, long, long); #include <linux/kernel.h> #include <linux/sched.h> -#define __FPU_FPSCR (current->tss.fpscr) +#define __FPU_FPSCR (current->thread.fpscr) /* We only actually write to the destination register * if exceptions signalled (if any) will not trap. diff --git a/arch/ppc/mbxboot/Makefile b/arch/ppc/mbxboot/Makefile index 59b95c5df..6f9fd0135 100644 --- a/arch/ppc/mbxboot/Makefile +++ b/arch/ppc/mbxboot/Makefile @@ -16,9 +16,9 @@ .c.o: $(CC) $(CFLAGS) -DINITRD_OFFSET=$(IOFF) -DINITRD_SIZE=$(ISZ) -DZIMAGE_OFFSET=$(ZOFF) -DZIMAGE_SIZE=$(ZSZ) -c -o $*.o $< .S.s: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -E -o $*.o $< + $(CPP) $(AFLAGS) -traditional -o $*.o $< .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c -o $*.o $< + $(CC) $(AFLAGS) -traditional -c -o $*.o $< ZOFF = 0 ZSZ = 0 @@ -26,7 +26,7 @@ IOFF = 0 ISZ = 0 TFTPIMAGE=/tftpboot/zImage.mbx -ZLINKFLAGS = -T ../vmlinux.lds -Ttext 0x00100000 +ZLINKFLAGS = -T ../vmlinux.lds -Ttext 0x00180000 OBJECTS := head.o misc.o ../coffboot/zlib.o m8xx_tty.o CFLAGS = $(CPPFLAGS) -O2 -DSTDC_HEADERS -fno-builtin -DCONFIG_8xx diff --git a/arch/ppc/mm/fault.c b/arch/ppc/mm/fault.c index 0427f2166..5fee4463b 100644 --- a/arch/ppc/mm/fault.c +++ b/arch/ppc/mm/fault.c @@ -182,34 +182,44 @@ bad_page_fault(struct pt_regs *regs, unsigned long address) #ifdef CONFIG_8xx -unsigned long va_to_phys(unsigned long address) +/* The pgtable.h claims some functions generically exist, but I + * can't find them...... + */ +pte_t *find_pte(struct mm_struct *mm, unsigned long address) { pgd_t *dir; pmd_t *pmd; pte_t *pte; - - dir = pgd_offset(current->mm, address & PAGE_MASK); - if (dir) - { + + dir = pgd_offset(mm, address & PAGE_MASK); + if (dir) { pmd = pmd_offset(dir, address & PAGE_MASK); - if (pmd && pmd_present(*pmd)) - { + if (pmd && pmd_present(*pmd)) { pte = pte_offset(pmd, address & PAGE_MASK); - if (pte && pte_present(*pte)) - { - return(pte_page(*pte) | (address & ~(PAGE_MASK-1))); + if (pte && pte_present(*pte)) { + return(pte); } - } else - { + } + else { return (0); } - } else - { + } + else { return (0); } return (0); } +unsigned long va_to_phys(unsigned long address) +{ + pte_t *pte; + + pte = find_pte(current->mm, address); + if (pte) + return((unsigned long)(pte_page(*pte)) | (address & ~(PAGE_MASK-1))); + return (0); +} + void print_8xx_pte(struct mm_struct *mm, unsigned long addr) { @@ -227,8 +237,8 @@ print_8xx_pte(struct mm_struct *mm, unsigned long addr) printk(" (0x%08lx)->(0x%08lx)->0x%08lx\n", (long)pgd, (long)pte, (long)pte_val(*pte)); #define pp ((long)pte_val(*pte)) - printk(" RPN: %05x PP: %x SPS: %x SH: %x " - "CI: %x v: %x\n", + printk(" RPN: %05x PP: %x SPS: %x SH: %lx " + "CI: %lx v: %lx\n", pp>>12, /* rpn */ (pp>>10)&3, /* pp */ (pp>>3)&1, /* small */ diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 83591c86c..1857ef33b 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 1999/12/23 12:13:53 gniibe Exp gniibe $ +# $Id: Makefile,v 1.4 2000/03/08 15:14:14 gniibe Exp $ # # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive diff --git a/arch/sh/config.in b/arch/sh/config.in index e3bfd113c..2ee913c3c 100644 --- a/arch/sh/config.in +++ b/arch/sh/config.in @@ -48,6 +48,7 @@ mainmenu_option next_comment comment 'General setup' define_bool CONFIG_ISA n +define_bool CONFIG_SBUS n bool 'Networking support' CONFIG_NET @@ -73,6 +74,8 @@ bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG if [ "$CONFIG_HOTPLUG" = "y" ] ; then source drivers/pcmcia/Config.in +else + define_bool CONFIG_PCMCIA n fi bool 'System V IPC' CONFIG_SYSVIPC @@ -170,8 +173,6 @@ if [ "$CONFIG_HOTPLUG" = "y" -a "$CONFIG_PCMCIA" != "n" ]; then source drivers/char/pcmcia/Config.in fi -#source drivers/misc/Config.in - source fs/Config.in if [ "$CONFIG_VT" = "y" ]; then diff --git a/arch/sh/defconfig b/arch/sh/defconfig index fad2ab8b1..337e46956 100644 --- a/arch/sh/defconfig +++ b/arch/sh/defconfig @@ -29,10 +29,12 @@ CONFIG_MEMORY_START=0c000000 # General setup # # CONFIG_ISA is not set +# CONFIG_SBUS is not set # CONFIG_NET is not set CONFIG_CF_ENABLER=y # CONFIG_PCI is not set # CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set # CONFIG_SYSVIPC is not set # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_SYSCTL is not set diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile index efa2fb109..8996a13dc 100644 --- a/arch/sh/kernel/Makefile +++ b/arch/sh/kernel/Makefile @@ -7,7 +7,7 @@ # .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $< -o $*.o + $(CC) $(AFLAGS) -traditional -c $< -o $*.o O_TARGET := kernel.o O_OBJS := process.o signal.o entry.o traps.o irq.o irq_onchip.o \ @@ -29,7 +29,7 @@ all: kernel.o head.o init_task.o entry.o: entry.S head.o: head.S - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $*.S -o $*.o + $(CC) $(AFLAGS) -traditional -c $*.S -o $*.o clean: diff --git a/arch/sh/kernel/entry.S b/arch/sh/kernel/entry.S index 77bb7938b..46ad20f53 100644 --- a/arch/sh/kernel/entry.S +++ b/arch/sh/kernel/entry.S @@ -1,4 +1,4 @@ -/* $Id: entry.S,v 1.55 2000/03/05 01:48:58 gniibe Exp $ +/* $Id: entry.S,v 1.71 2000/03/22 13:29:33 gniibe Exp $ * * linux/arch/sh/entry.S * @@ -33,10 +33,9 @@ * * syscall # * ssr - * r15 = stack pointer * r0 * ... - * r14 + * r15 = stack pointer * gbr * mach * macl @@ -46,7 +45,7 @@ */ /* - * these are offsets into the task-struct. + * These are offsets into the task-struct. */ state = 0 flags = 4 @@ -78,8 +77,8 @@ MMU_TEA = 0xff00000c ! TLB Exception Address Register /* Offsets to the stack */ SYSCALL_NR = 0 SR = 4 -SP = 8 -R0 = 12 +R0 = 8 +SP = (8+15*4) #define k0 r0 #define k1 r1 @@ -96,7 +95,7 @@ R0 = 12 k2 scratch (Exception code) k3 scratch (Return address) k4 Stack base = current+8192 - k5 reserved + k5 Global Interrupt Mask (0--15) k6 reserved k7 reserved */ @@ -115,109 +114,113 @@ R0 = 12 ! this first version depends *much* on C implementation. ! -#define DO_FAULT(write) \ - mov.l 4f,r0; \ - mov.l @r0,r6; \ - /* STI */ \ - mov.l 3f,r1; \ - stc sr,r0; \ - and r1,r0; \ - ldc r0,sr; \ - /* */ \ - mov r15,r4; \ - mov.l 2f,r0; \ - jmp @r0; \ - mov #write,r5; +#define RESTORE_FLAGS() \ + mov.l @(SR,$r15), $r0; \ + and #0xf0, $r0; \ + shlr8 $r0; \ + cmp/eq #0x0f, $r0; \ + bt 9f; \ + mov.l __INV_IMASK, $r1; \ + stc $sr, $r0; \ + and $r1, $r0; \ + stc $r5_bank, $r1; \ + or $r1, $r0; \ + ldc $r0, $sr .balign 4 tlb_protection_violation_load: tlb_miss_load: - mov #-1,r0 - mov.l r0,@r15 ! syscall nr = -1 - DO_FAULT(0) + mov #-1, $r0 + mov.l $r0, @$r15 ! syscall nr = -1 + mov.l 2f, $r0 + mov.l @$r0, $r6 + RESTORE_FLAGS() +9: mov $r15, $r4 + mov.l 1f, $r0 + jmp @$r0 + mov #0, $r5 .balign 4 tlb_protection_violation_store: tlb_miss_store: initial_page_write: - mov #-1,r0 - mov.l r0,@r15 ! syscall nr = -1 - DO_FAULT(1) + mov #-1, $r0 + mov.l $r0, @$r15 ! syscall nr = -1 + mov.l 2f, $r0 + mov.l @$r0, $r6 + RESTORE_FLAGS() +9: mov $r15, $r4 + mov.l 1f, $r0 + jmp @$r0 + mov #1, $r5 .balign 4 -2: .long SYMBOL_NAME(do_page_fault) -3: .long 0xefffffff ! BL=0 -4: .long MMU_TEA +1: .long SYMBOL_NAME(do_page_fault) +2: .long MMU_TEA #ifdef CONFIG_DEBUG_KERNEL_WITH_GDB_STUB .balign 4 /* Unwind the stack and jmp to the debug entry */ debug: - add #4,r15 ! skip syscall number - mov.l @r15+,r11 ! SSR - mov.l @r15+,r10 ! original stack - mov.l @r15+,r0 - mov.l @r15+,r1 - mov.l @r15+,r2 - mov.l @r15+,r3 - mov.l @r15+,r4 - mov.l @r15+,r5 - mov.l @r15+,r6 - mov.l @r15+,r7 - stc sr,r14 - mov.l 8f,r9 ! BL =1, RB=1 - or r9,r14 - ldc r14,sr ! here, change the register bank - mov r10,k0 - mov r11,k1 - mov.l @r15+,r8 - mov.l @r15+,r9 - mov.l @r15+,r10 - mov.l @r15+,r11 - mov.l @r15+,r12 - mov.l @r15+,r13 - mov.l @r15+,r14 - ldc.l @r15+,gbr - lds.l @r15+,mach - lds.l @r15+,macl - lds.l @r15+,pr - ldc.l @r15+,spc - mov k0,r15 + add #4, $r15 ! skip syscall number + mov.l @$r15+, $r11 ! SSR + mov.l @$r15+, $r0 + mov.l @$r15+, $r1 + mov.l @$r15+, $r2 + mov.l @$r15+, $r3 + mov.l @$r15+, $r4 + mov.l @$r15+, $r5 + mov.l @$r15+, $r6 + mov.l @$r15+, $r7 + stc $sr, $r14 + mov.l 1f, $r9 ! BL =1, RB=1 + or $r9, $r14 + ldc $r14, $sr ! here, change the register bank + mov $r11, $k1 + mov.l @$r15+, $r8 + mov.l @$r15+, $r9 + mov.l @$r15+, $r10 + mov.l @$r15+, $r11 + mov.l @$r15+, $r12 + mov.l @$r15+, $r13 + mov.l @$r15+, $r14 + mov.l @$r15+, $k0 + ldc.l @$r15+, $gbr + lds.l @$r15+, $mach + lds.l @$r15+, $macl + lds.l @$r15+, $pr + ldc.l @$r15+, $spc + mov $k0, $r15 ! - mov.l 9f,k0 - jmp @k0 - ldc k1,ssr + mov.l 2f, $k0 + jmp @$k0 + ldc $k1, $ssr .balign 4 -8: .long 0x300000f0 -9: .long 0xa0000100 +1: .long 0x300000f0 +2: .long 0xa0000100 #endif .balign 4 error: - ! STI - mov.l 2f,r1 - stc sr,r0 - and r1,r0 - ldc r0,sr ! - mov.l 1f,r1 - mov #-1,r0 - jmp @r1 - mov.l r0,@r15 ! syscall nr = -1 + RESTORE_FLAGS() +9: mov.l 1f, $r1 + mov #-1, $r0 + jmp @$r1 + mov.l $r0, @$r15 ! syscall nr = -1 .balign 4 1: .long SYMBOL_NAME(do_exception_error) -2: .long 0xefffffff ! BL=0 -badsys: mov #-ENOSYS,r0 +badsys: mov #-ENOSYS, $r0 rts ! go to ret_from_syscall.. - mov.l r0,@(R0,r15) + mov.l $r0, @(R0,$r15) ! ! ! ENTRY(ret_from_fork) bra SYMBOL_NAME(ret_from_syscall) - add #4,r15 ! pop down bogus r0 (see switch_to MACRO) + add #4, $r15 ! pop down bogus r0 (see switch_to MACRO) ! ! The immediate value of "trapa" indicates the number of arguments @@ -226,83 +229,77 @@ ENTRY(ret_from_fork) ! Note that TRA register contains the value = Imm x 4. ! system_call: - mov.l 1f,r2 - mov.l @r2,r8 + mov.l 1f, $r2 + mov.l @$r2, $r8 ! ! DEBUG DEBUG - ! mov.l led,r1 - ! mov r0,r2 - ! mov.b r2,@r1 + ! mov.l led, $r1 + ! mov $r0, $r2 + ! mov.b $r2, @$r1 ! #ifdef CONFIG_DEBUG_KERNEL_WITH_GDB_STUB - mov #0x20,r1 - extu.b r1,r1 - shll2 r1 - cmp/hs r1,r8 + mov #0x20, $r1 + extu.b $r1, $r1 + shll2 $r1 + cmp/hs $r1, $r8 bt debug #endif - ! STI - mov.l 2f,r1 - stc sr,r2 - and r1,r2 - ldc r2,sr ! - mov.l __n_sys,r1 - cmp/hs r1,r0 - bt/s badsys - mov r0,r2 + mov $r0, $r2 + RESTORE_FLAGS() +9: mov.l __n_sys, $r1 + cmp/hs $r1, $r2 + bt badsys ! - stc ksp,r1 ! - mov.l __tsk_flags,r0 ! - add r0,r1 ! - mov.l @r1,r0 ! Is it trace? - tst #PF_TRACESYS,r0 + stc $ksp, $r1 + mov.l __tsk_flags, $r0 + add $r0, $r1 ! + mov.l @$r1, $r0 ! Is it trace? + tst #PF_TRACESYS, $r0 bt 5f ! Trace system call - mov #-ENOSYS,r1 - mov.l r1,@(R0,r15) - mov.l 3f,r1 - jsr @r1 + mov #-ENOSYS, $r1 + mov.l $r1, @(R0,$r15) + mov.l 3f, $r1 + jsr @$r1 nop - mova 4f,r0 + mova 3f, $r0 bra 6f - lds r0,pr - ! -5: mova ret,r0 ! normal case - lds r0,pr - ! Build the stack frame if TRA > 0 + lds $r0, $pr ! -6: mov r2,r3 - mov r8,r2 - cmp/pl r8 - bf 9f - mov.l @(SP,r15),r0 ! get original stack -7: add #-4,r8 -8: mov.l @(r0,r8),r1 ! May cause address error exception.. - mov.l r1,@-r15 - cmp/pl r8 +5: mova syscall_ret, $r0 + lds $r0, $pr + ! Build the stack frame if TRA > 0 +6: mov $r2, $r3 + mov $r8, $r2 + cmp/pl $r8 + bf 0f + mov #SP, $r0 + mov.l @($r0,$r15), $r0 ! get original stack +7: add #-4, $r8 +4: mov.l @($r0,$r8), $r1 ! May cause address error exception.. + mov.l $r1, @-$r15 + cmp/pl $r8 bt 7b ! -9: mov r3,r0 - shll2 r0 ! x4 - mov.l __sct,r1 - add r1,r0 - mov.l @r0,r1 - jmp @r1 - mov r2,r8 - +0: mov $r3, $r0 + shll2 $r0 ! x4 + mov.l __sct, $r1 + add $r1, $r0 + mov.l @$r0, $r1 + jmp @$r1 + mov $r2, $r8 ! In case of trace .balign 4 -4: add r8,r15 ! pop off the arguments - mov.l r0,@(R0,r15) ! save the return value - mov.l 3f,r1 - mova SYMBOL_NAME(ret_from_syscall),r0 - jmp @r1 - lds r0,pr +3: add $r8, $r15 ! pop off the arguments + mov.l $r0, @(R0,$r15) ! save the return value + mov.l 2f, $r1 + mova SYMBOL_NAME(ret_from_syscall), $r0 + jmp @$r1 + lds $r0, $pr .balign 4 -3: .long SYMBOL_NAME(syscall_trace) -2: .long 0xefffffff ! BL=0 1: .long TRA +2: .long SYMBOL_NAME(syscall_trace) __n_sys: .long NR_syscalls __sct: .long SYMBOL_NAME(sys_call_table) __tsk_flags: .long flags-8192 ! offset from stackbase to tsk->flags @@ -311,85 +308,80 @@ led: .long 0xa8000000 ! For my board -- gN .section .fixup,"ax" fixup_syscall_argerr: rts - mov.l 1f,r0 + mov.l 1f, $r0 1: .long -22 ! -EINVAL .previous .section __ex_table, "a" .balign 4 - .long 8b,fixup_syscall_argerr + .long 4b,fixup_syscall_argerr .previous + .balign 4 reschedule: - mova SYMBOL_NAME(ret_from_syscall),r0 - mov.l 1f,r1 - jmp @r1 - lds r0,pr + mova SYMBOL_NAME(ret_from_syscall), $r0 + mov.l 1f, $r1 + jmp @$r1 + lds $r0, $pr .balign 4 1: .long SYMBOL_NAME(schedule) ENTRY(ret_from_irq) - mov.l @(SR,r15),r0 ! get status register - shll r0 - shll r0 ! kernel space? + mov.l @(SR,$r15), $r0 ! get status register + shll $r0 + shll $r0 ! kernel space? bt restore_all ! Yes, it's from kernel, go back soon - ! STI - mov.l 1f, $r1 - stc $sr, $r2 - and $r1, $r2 - ldc $r2, $sr ! - bra ret_with_reschedule + RESTORE_FLAGS() +9: bra ret_with_reschedule nop ENTRY(ret_from_exception) - mov.l @(SR,r15),r0 ! get status register - shll r0 - shll r0 ! kernel space? + mov.l @(SR,$r15), $r0 ! get status register + shll $r0 + shll $r0 ! kernel space? bt restore_all ! Yes, it's from kernel, go back soon - ! STI - mov.l 1f, $r1 - stc $sr, $r2 - and $r1, $r2 - ldc $r2, $sr ! - bra ret_from_syscall + RESTORE_FLAGS() +9: bra ret_from_syscall nop .balign 4 -1: .long 0xefffffff ! BL=0 +__INV_IMASK: + .long 0xffffff0f ! ~(IMASK) .balign 4 -ret: add r8,r15 ! pop off the arguments - mov.l r0,@(R0,r15) ! save the return value +syscall_ret: + add $r8, $r15 ! pop off the arguments + mov.l $r0, @(R0,$r15) ! save the return value /* fall through */ ENTRY(ret_from_syscall) - mov.l __softirq_state,r0 - mov.l @r0,r1 - mov.l @(4,r0),r2 - tst r2,r1 + mov.l __softirq_state, $r0 + mov.l @$r0, $r1 + mov.l @(4,$r0), $r2 + tst $r2, $r1 bt ret_with_reschedule handle_softirq: - mov.l __do_softirq,r0 - jsr @r0 + mov.l __do_softirq, $r0 + jsr @$r0 nop ret_with_reschedule: - stc ksp,r1 - mov.l __minus8192,r0 - add r0,r1 - mov.l @(need_resched,r1),r0 - tst #0xff,r0 + stc $ksp, $r1 + mov.l __minus8192, $r0 + add $r0, $r1 + mov.l @(need_resched,$r1), $r0 + tst #0xff, $r0 bf reschedule - mov.l @(sigpending,r1),r0 - tst #0xff,r0 + mov.l @(sigpending,$r1), $r0 + tst #0xff, $r0 bt restore_all signal_return: - mov r15,r4 - mov #0,r5 - mov.l __do_signal,r1 - mova restore_all,r0 - jmp @r1 - lds r0,pr + mov $r15, $r4 + mov #0, $r5 + mov.l __do_signal, $r1 + mova restore_all, $r0 + jmp @$r1 + lds $r0, $pr .balign 4 __do_signal: .long SYMBOL_NAME(do_signal) @@ -407,56 +399,57 @@ restore_all: jsr @$r1 stc $sr, $r4 #endif - add #4,r15 ! Skip syscall number - mov.l @r15+,r11 ! Got SSR into R11 + add #4, $r15 ! Skip syscall number + mov.l @$r15+, $r11 ! Got SSR into R11 #if defined(__SH4__) mov $r11, $r12 #endif ! - mov.l 1f,r1 - stc sr,r0 - and r1,r0 ! Get IMASK+FD - mov.l 2f,r1 - and r1,r11 - or r0,r11 ! Inherit the IMASK+FD value of SR + mov.l 1f, $r1 + stc $sr, $r0 + and $r1, $r0 ! Get FD + mov.l 2f, $r1 + and $r1, $r11 + or $r0, $r11 ! Inherit the FD value of SR + stc $r5_bank, $r0 + or $r0, $r11 ! Inherit the IMASK value ! - mov.l @r15+,r10 ! original stack - mov.l @r15+,r0 - mov.l @r15+,r1 - mov.l @r15+,r2 - mov.l @r15+,r3 - mov.l @r15+,r4 - mov.l @r15+,r5 - mov.l @r15+,r6 - mov.l @r15+,r7 - stc sr,r14 - mov.l __blrb_flags,r9 ! BL =1, RB=1 - or r9,r14 - ldc r14,sr ! here, change the register bank - mov r10,k0 - mov r11,k1 + mov.l @$r15+, $r0 + mov.l @$r15+, $r1 + mov.l @$r15+, $r2 + mov.l @$r15+, $r3 + mov.l @$r15+, $r4 + mov.l @$r15+, $r5 + mov.l @$r15+, $r6 + mov.l @$r15+, $r7 + stc $sr, $r14 + mov.l __blrb_flags, $r9 ! BL =1, RB=1 + or $r9, $r14 + ldc $r14, $sr ! here, change the register bank + mov $r11, $k1 #if defined(__SH4__) mov $r12, $k2 #endif - mov.l @r15+,r8 - mov.l @r15+,r9 - mov.l @r15+,r10 - mov.l @r15+,r11 - mov.l @r15+,r12 - mov.l @r15+,r13 - mov.l @r15+,r14 - ldc.l @r15+,gbr - lds.l @r15+,mach - lds.l @r15+,macl - lds.l @r15+,pr - ldc.l @r15+,spc - ldc k1,ssr + mov.l @$r15+, $r8 + mov.l @$r15+, $r9 + mov.l @$r15+, $r10 + mov.l @$r15+, $r11 + mov.l @$r15+, $r12 + mov.l @$r15+, $r13 + mov.l @$r15+, $r14 + mov.l @$r15+, $k0 ! original stack + ldc.l @$r15+, $gbr + lds.l @$r15+, $mach + lds.l @$r15+, $macl + lds.l @$r15+, $pr + ldc.l @$r15+, $spc + ldc $k1, $ssr #if defined(__SH4__) shll $k1 shll $k1 bf 9f ! user mode /* Kernel to kernel transition */ - mov.l 3f, $k1 + mov.l 1f, $k1 tst $k1, $k2 bf 9f ! it hadn't FPU ! Kernel to kernel and FPU was used @@ -496,7 +489,7 @@ restore_all: lds.l @$r15+, $fpul 9: #endif - mov k0,r15 + mov $k0, $r15 rte nop @@ -510,9 +503,8 @@ __init_task_flags: __PF_USEDFPU: .long PF_USEDFPU #endif -1: .long 0x000080f0 ! IMASK+FD +1: .long 0x00008000 ! FD 2: .long 0xffff7f0f ! ~(IMASK+FD) -3: .long 0x00008000 ! FD=1 ! Exception Vector Base ! @@ -524,10 +516,10 @@ ENTRY(vbr_base) ! .balign 256,0,256 general_exception: - mov.l 1f,k2 - mov.l 2f,k3 + mov.l 1f, $k2 + mov.l 2f, $k3 bra handle_exception - mov.l @k2,k2 + mov.l @$k2, $k2 .balign 4 2: .long SYMBOL_NAME(ret_from_exception) 1: .long EXPEVT @@ -535,17 +527,17 @@ general_exception: ! .balign 1024,0,1024 tlb_miss: - mov.l 1f,k2 - mov.l 4f,k3 + mov.l 1f, $k2 + mov.l 4f, $k3 bra handle_exception - mov.l @k2,k2 + mov.l @$k2, $k2 ! .balign 512,0,512 interrupt: - mov.l 2f,k2 - mov.l 3f,k3 + mov.l 2f, $k2 + mov.l 3f, $k3 bra handle_exception - mov.l @k2,k2 + mov.l @$k2, $k2 .balign 4 1: .long EXPEVT @@ -559,9 +551,9 @@ handle_exception: ! Using k0, k1 for scratch registers (r0_bank1, r1_bank), ! save all registers onto stack. ! - stc ssr,k0 ! from kernel space? - shll k0 ! Check MD bit (bit30) - shll k0 + stc $ssr, $k0 ! from kernel space? + shll $k0 ! Check MD bit (bit30) + shll $k0 #if defined(__SH4__) bf/s 8f ! it's from user to kernel transition mov $r15, $k0 ! save original stack to k0 @@ -569,6 +561,7 @@ handle_exception: mov.l 2f, $k1 stc $ssr, $k0 tst $k1, $k0 + mov.l 4f, $k1 bf/s 9f ! FPU is not used mov $r15, $k0 ! save original stack to k0 ! FPU is used, save FPU @@ -593,64 +586,63 @@ handle_exception: fmov.s $fr1, @-$r15 fmov.s $fr0, @-$r15 bra 9f - mov #0, $k1 + mov.l 3f, $k1 #else + mov.l 3f, $k1 bt/s 9f ! it's from kernel to kernel transition - mov r15,k0 ! save original stack to k0 anyway + mov $r15, $k0 ! save original stack to k0 anyway #endif 8: /* User space to kernel */ - mov kernel_sp, $r15 ! change to kernel stack -#if defined(__SH4__) - mov.l 2f, $k1 ! let kernel release FPU -#endif -9: stc.l spc,@-r15 - sts.l pr,@-r15 + mov $kernel_sp, $r15 ! change to kernel stack + mov.l 4f, $k1 ! let kernel release FPU +9: stc.l $spc, @-$r15 + sts.l $pr, @-$r15 ! - lds k3,pr ! Set the return address to pr + lds $k3, $pr ! Set the return address to pr ! - sts.l macl,@-r15 - sts.l mach,@-r15 - stc.l gbr,@-r15 - mov.l r14,@-r15 + sts.l $macl, @-$r15 + sts.l $mach, @-$r15 + stc.l $gbr, @-$r15 + mov.l $k0, @-$r15 ! save orignal stack + mov.l $r14, @-$r15 ! - stc sr,r14 ! Back to normal register bank, and -#if defined(__SH4__) - or $k1, $r14 ! may release FPU -#endif - mov.l 3f,k1 - and k1,r14 ! ... - ldc r14,sr ! ...changed here. + stc $sr, $r14 ! Back to normal register bank, and + or $k1, $r14 ! Block all interrupts, may release FPU + mov.l 5f, $k1 + and $k1, $r14 ! ... + ldc $r14, $sr ! ...changed here. ! - mov.l r13,@-r15 - mov.l r12,@-r15 - mov.l r11,@-r15 - mov.l r10,@-r15 - mov.l r9,@-r15 - mov.l r8,@-r15 - mov.l r7,@-r15 - mov.l r6,@-r15 - mov.l r5,@-r15 - mov.l r4,@-r15 - mov.l r3,@-r15 - mov.l r2,@-r15 - mov.l r1,@-r15 - mov.l r0,@-r15 - stc.l r0_bank,@-r15 ! save orignal stack - stc.l ssr,@-r15 - mov.l r0,@-r15 ! push r0 again (for syscall number) + mov.l $r13, @-$r15 + mov.l $r12, @-$r15 + mov.l $r11, @-$r15 + mov.l $r10, @-$r15 + mov.l $r9, @-$r15 + mov.l $r8, @-$r15 + mov.l $r7, @-$r15 + mov.l $r6, @-$r15 + mov.l $r5, @-$r15 + mov.l $r4, @-$r15 + mov.l $r3, @-$r15 + mov.l $r2, @-$r15 + mov.l $r1, @-$r15 + mov.l $r0, @-$r15 + stc.l $ssr, @-$r15 + mov.l $r0, @-$r15 ! push $r0 again (for syscall number) ! Then, dispatch to the handler, according to the excepiton code. - stc k_ex_code,r1 - shlr2 r1 - shlr r1 - mov.l 1f,r0 - add r1,r0 - mov.l @r0,r0 - jmp @r0 - mov.l @r15,r0 ! recovering r0.. + stc $k_ex_code, $r1 + shlr2 $r1 + shlr $r1 + mov.l 1f, $r0 + add $r1, $r0 + mov.l @$r0, $r0 + jmp @$r0 + mov.l @$r15, $r0 ! recovering $r0.. .balign 4 1: .long SYMBOL_NAME(exception_handling_table) 2: .long 0x00008000 ! FD=1 -3: .long 0xdfffffff ! RB=0, leave BL=1 +3: .long 0x000000f0 ! FD=0, IMASK=15 +4: .long 0x000080f0 ! FD=1, IMASK=15 +5: .long 0xcfffffff ! RB=0, BL=0 none: rts @@ -679,7 +671,7 @@ ENTRY(exception_handling_table) ENTRY(nmi_slot) .long none ! Not implemented yet ENTRY(user_break_point_trap) - .long error ! Not implemented yet + .long break_point_trap ENTRY(interrupt_table) ! external hardware .long SYMBOL_NAME(do_IRQ) ! 0000 @@ -985,6 +977,8 @@ ENTRY(sys_call_table) .long SYMBOL_NAME(sys_setfsuid) /* 215 */ .long SYMBOL_NAME(sys_setfsgid) .long SYMBOL_NAME(sys_pivot_root) + .long SYMBOL_NAME(sys_mincore) + .long SYMBOL_NAME(sys_madvise) /* * NOTE!! This doesn't have to be exact - we just have @@ -992,7 +986,7 @@ ENTRY(sys_call_table) * entries. Don't panic if you notice that this hasn't * been shrunk every time we add a new system call. */ - .rept NR_syscalls-217 + .rept NR_syscalls-219 .long SYMBOL_NAME(sys_ni_syscall) .endr diff --git a/arch/sh/kernel/fpu.c b/arch/sh/kernel/fpu.c index 335902c1d..5301a1333 100644 --- a/arch/sh/kernel/fpu.c +++ b/arch/sh/kernel/fpu.c @@ -1,4 +1,4 @@ -/* $Id: fpu.c,v 1.27 2000/03/05 01:48:34 gniibe Exp $ +/* $Id: fpu.c,v 1.29 2000/03/22 13:42:10 gniibe Exp $ * * linux/arch/sh/kernel/fpu.c * @@ -114,8 +114,6 @@ restore_fpu(struct task_struct *tsk) * has the property that no matter wether considered as single or as * double precission represents signaling NANS. */ -/* Double presision, NANS as NANS, rounding to nearest, no exceptions */ -#define FPU_DEFAULT 0x00080000 void fpu_init(void) { @@ -156,7 +154,7 @@ void fpu_init(void) "fsts $fpul, $fr15\n\t" "frchg" : /* no output */ - : "r" (0), "r" (FPU_DEFAULT)); + : "r" (0), "r" (FPSCR_INIT)); } asmlinkage void diff --git a/arch/sh/kernel/head.S b/arch/sh/kernel/head.S index 3f938557a..ae406d22d 100644 --- a/arch/sh/kernel/head.S +++ b/arch/sh/kernel/head.S @@ -1,4 +1,4 @@ -/* $Id: head.S,v 1.16 2000/03/02 00:01:15 gniibe Exp $ +/* $Id: head.S,v 1.17 2000/03/06 12:44:24 gniibe Exp $ * * arch/sh/kernel/head.S * @@ -37,8 +37,11 @@ ENTRY(empty_zero_page) */ ENTRY(_stext) ! Initialize Status Register - mov.l 1f, $r0 ! MD=1, RB=0, BL=1 + mov.l 1f, $r0 ! MD=1, RB=0, BL=0, IMASK=0xF ldc $r0, $sr + ! Initialize global interrupt mask + mov #0, $r0 + ldc $r0, $r5_bank ! mov.l 2f, $r0 mov $r0, $r15 ! Set initial r15 (stack pointer) @@ -62,7 +65,7 @@ ENTRY(_stext) nop .balign 4 -1: .long 0x50000000 ! MD=1, RB=0, BL=1, FD=0 +1: .long 0x400000F0 ! MD=1, RB=0, BL=0, FD=0, IMASK=0xF 2: .long SYMBOL_NAME(stack) 3: .long SYMBOL_NAME(__bss_start) 4: .long SYMBOL_NAME(_end) diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c index a15352389..af03ef46d 100644 --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c @@ -1,4 +1,4 @@ -/* $Id: irq.c,v 1.11 2000/02/29 11:03:40 gniibe Exp $ +/* $Id: irq.c,v 1.12 2000/03/06 14:07:50 gniibe Exp $ * * linux/arch/sh/kernel/irq.c * @@ -238,11 +238,11 @@ asmlinkage int do_IRQ(unsigned long r4, unsigned long r5, regs.syscall_nr = -1; /* It's not system call */ /* Get IRQ number */ - asm volatile("stc r2_bank,%0\n\t" + asm volatile("stc $r2_bank, %0\n\t" "shlr2 %0\n\t" "shlr2 %0\n\t" "shlr %0\n\t" - "add #-16,%0\n\t" + "add #-16, %0\n\t" :"=z" (irq)); kstat.irqs[cpu][irq]++; diff --git a/arch/sh/kernel/irq_imask.c b/arch/sh/kernel/irq_imask.c index a3cf78b5f..380acf405 100644 --- a/arch/sh/kernel/irq_imask.c +++ b/arch/sh/kernel/irq_imask.c @@ -1,8 +1,8 @@ -/* $Id: irq_imask.c,v 1.2 2000/02/11 04:57:40 gniibe Exp $ +/* $Id: irq_imask.c,v 1.6 2000/03/06 14:11:32 gniibe Exp $ * * linux/arch/sh/kernel/irq_imask.c * - * Copyright (C) 1999 Niibe Yutaka + * Copyright (C) 1999, 2000 Niibe Yutaka * * Simple interrupt handling using IMASK of SR register. * @@ -52,35 +52,40 @@ static struct hw_interrupt_type imask_irq_type = { end_imask_irq }; -void disable_imask_irq(unsigned int irq) +void static inline set_interrupt_registers(int ip) { unsigned long __dummy; + asm volatile("ldc %2, $r5_bank\n\t" + "stc $sr, %0\n\t" + "and #0xf0, %0\n\t" + "shlr8 %0\n\t" + "cmp/eq #0x0f, %0\n\t" + "bt 1f ! CLI-ed\n\t" + "stc $sr, %0\n\t" + "and %1, %0\n\t" + "or %2, %0\n\t" + "ldc %0, $sr\n" + "1:" + : "=&z" (__dummy) + : "r" (~0xf0), "r" (ip << 4)); +} + +void disable_imask_irq(unsigned int irq) +{ clear_bit(irq, &imask_mask); if (interrupt_priority < IMASK_PRIORITY - irq) interrupt_priority = IMASK_PRIORITY - irq; - asm volatile("stc sr,%0\n\t" - "and %1,%0\n\t" - "or %2,%0\n\t" - "ldc %0,sr" - : "=&r" (__dummy) - : "r" (0xffffff0f), "r" (interrupt_priority << 4)); + set_interrupt_registers(interrupt_priority); } static void enable_imask_irq(unsigned int irq) { - unsigned long __dummy; - set_bit(irq, &imask_mask); interrupt_priority = IMASK_PRIORITY - ffz(imask_mask); - asm volatile("stc sr,%0\n\t" - "and %1,%0\n\t" - "or %2,%0\n\t" - "ldc %0,sr" - : "=&r" (__dummy) - : "r" (0xffffff0f), "r" (interrupt_priority << 4)); + set_interrupt_registers(interrupt_priority); } static void mask_and_ack_imask(unsigned int irq) diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index 2ca91cb40..97cd1fe0c 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.28 2000/03/05 02:16:15 gniibe Exp $ +/* $Id: process.c,v 1.33 2000/03/25 00:06:15 gniibe Exp $ * * linux/arch/sh/kernel/process.c * @@ -94,7 +94,7 @@ void show_regs(struct pt_regs * regs) { printk("\n"); printk("PC : %08lx SP : %08lx SR : %08lx TEA : %08lx\n", - regs->pc, regs->sp, regs->sr, ctrl_inl(MMU_TEA)); + regs->pc, regs->regs[15], regs->sr, ctrl_inl(MMU_TEA)); printk("R0 : %08lx R1 : %08lx R2 : %08lx R3 : %08lx\n", regs->regs[0],regs->regs[1], regs->regs[2],regs->regs[3]); @@ -210,22 +210,22 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, struct task_struct *p, struct pt_regs *regs) { struct pt_regs *childregs; +#if defined(__SH4__) struct task_struct *tsk = current; - childregs = ((struct pt_regs *)(THREAD_SIZE + (unsigned long) p)) - 1; - struct_cpy(childregs, regs); - -#if defined(__SH4__) if (tsk != &init_task) { unlazy_fpu(tsk); - struct_cpy(&p->thread.fpu, ¤t->thread.fpu); + p->thread.fpu = current->thread.fpu; p->used_math = tsk->used_math; } #endif + childregs = ((struct pt_regs *)(THREAD_SIZE + (unsigned long) p)) - 1; + *childregs = *regs; + if (user_mode(regs)) { - childregs->sp = usp; + childregs->regs[15] = usp; } else { - childregs->sp = (unsigned long)p+2*PAGE_SIZE; + childregs->regs[15] = (unsigned long)p+2*PAGE_SIZE; } childregs->regs[0] = 0; /* Set return value for child */ childregs->sr |= SR_FD; /* Invalidate FPU flag */ @@ -244,7 +244,7 @@ void dump_thread(struct pt_regs * regs, struct user * dump) dump->magic = CMAGIC; dump->start_code = current->mm->start_code; dump->start_data = current->mm->start_data; - dump->start_stack = regs->sp & ~(PAGE_SIZE - 1); + dump->start_stack = regs->regs[15] & ~(PAGE_SIZE - 1); dump->u_tsize = (current->mm->end_code - dump->start_code) >> PAGE_SHIFT; dump->u_dsize = (current->mm->brk + (PAGE_SIZE-1) - dump->start_data) >> PAGE_SHIFT; dump->u_ssize = (current->mm->start_stack - dump->start_stack + @@ -279,7 +279,7 @@ asmlinkage int sys_fork(unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7, struct pt_regs regs) { - return do_fork(SIGCHLD, regs.sp, ®s); + return do_fork(SIGCHLD, regs.regs[15], ®s); } asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, @@ -287,7 +287,7 @@ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, struct pt_regs regs) { if (!newsp) - newsp = regs.sp; + newsp = regs.regs[15]; return do_fork(clone_flags, newsp, ®s); } @@ -305,7 +305,7 @@ asmlinkage int sys_vfork(unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7, struct pt_regs regs) { - return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs.sp, ®s); + return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs.regs[15], ®s); } /* @@ -370,3 +370,12 @@ asmlinkage void print_syscall(int x) (init_task.flags&PF_USEDFPU)?'K':' ', (sr&SR_FD)?' ':'F'); restore_flags(flags); } + +asmlinkage void break_point_trap(void) +{ + /* Clear traicng. */ + ctrl_outw(0, UBC_BBRA); + ctrl_outw(0, UBC_BBRB); + + force_sig(SIGTRAP, current); +} diff --git a/arch/sh/kernel/ptrace.c b/arch/sh/kernel/ptrace.c index 2d69b5b7c..d4a1556b9 100644 --- a/arch/sh/kernel/ptrace.c +++ b/arch/sh/kernel/ptrace.c @@ -1,6 +1,13 @@ -/* - * Surely this doesn't work... (we need to design ptrace for SupreH) +/* $Id: ptrace.c,v 1.4 2000/03/22 13:59:01 gniibe Exp $ + * * linux/arch/sh/kernel/ptrace.c + * + * Original x86 implementation: + * By Ross Biro 1/23/92 + * edited by Linus Torvalds + * + * SuperH version: Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka + * */ #include <linux/kernel.h> @@ -12,135 +19,126 @@ #include <linux/ptrace.h> #include <linux/user.h> +#include <asm/io.h> #include <asm/uaccess.h> #include <asm/pgtable.h> #include <asm/system.h> #include <asm/processor.h> +#include <asm/mmu_context.h> /* * does not yet catch signals sent when the child dies. * in exit.c or in signal.c. */ -/* determines which flags the user has access to. */ -/* 1 = access 0 = no access */ -#define FLAG_MASK 0x00044dd5 - -/* set's the trap flag. */ -#define TRAP_FLAG 0x100 - /* - * Offset of eflags on child stack.. + * This routine will get a word off of the process kernel stack. */ -#define EFL_OFFSET ((EFL-2)*4-sizeof(struct pt_regs)) - -/* - * this routine will get a word off of the processes privileged stack. - * the offset is how far from the base addr as stored in the TSS. - * this routine assumes that all the privileged stacks are in our - * data space. - */ static inline int get_stack_long(struct task_struct *task, int offset) { unsigned char *stack; - stack = (unsigned char *)task->thread.sp; + stack = (unsigned char *)task + THREAD_SIZE - sizeof(struct pt_regs); stack += offset; return (*((int *)stack)); } /* - * this routine will put a word on the processes privileged stack. - * the offset is how far from the base addr as stored in the TSS. - * this routine assumes that all the privileged stacks are in our - * data space. + * This routine will put a word on the process kernel stack. */ static inline int put_stack_long(struct task_struct *task, int offset, - unsigned long data) + unsigned long data) { - unsigned char * stack; + unsigned char *stack; - stack = (unsigned char *) task->thread.sp; + stack = (unsigned char *)task + THREAD_SIZE - sizeof(struct pt_regs); stack += offset; *(unsigned long *) stack = data; return 0; } -static int putreg(struct task_struct *child, - unsigned long regno, unsigned long value) +static void +compute_next_pc(struct pt_regs *regs, unsigned short inst, + unsigned long *pc1, unsigned long *pc2) { -#if 0 - switch (regno >> 2) { - case ORIG_EAX: - return -EIO; - case FS: - if (value && (value & 3) != 3) - return -EIO; - child->thread.fs = value; - return 0; - case GS: - if (value && (value & 3) != 3) - return -EIO; - child->thread.gs = value; - return 0; - case DS: - case ES: - if (value && (value & 3) != 3) - return -EIO; - value &= 0xffff; - break; - case SS: - case CS: - if ((value & 3) != 3) - return -EIO; - value &= 0xffff; - break; - case EFL: - value &= FLAG_MASK; - value |= get_stack_long(child, EFL_OFFSET) & ~FLAG_MASK; + int nib[4] + = { (inst >> 12) & 0xf, + (inst >> 8) & 0xf, + (inst >> 4) & 0xf, + inst & 0xf}; + + /* bra & bsr */ + if (nib[0] == 0xa || nib[0] == 0xb) { + *pc1 = regs->pc + 4 + ((short) ((inst & 0xfff) << 4) >> 3); + *pc2 = (unsigned long) -1; + return; } - if (regno > GS*4) - regno -= 2*4; - put_stack_long(child, regno - sizeof(struct pt_regs), value); -#endif - return 0; + + /* bt & bf */ + if (nib[0] == 0x8 && (nib[1] == 0x9 || nib[1] == 0xb)) { + *pc1 = regs->pc + 4 + ((char) (inst & 0xff) << 1); + *pc2 = regs->pc + 2; + return; + } + + /* bt/s & bf/s */ + if (nib[0] == 0x8 && (nib[1] == 0xd || nib[1] == 0xf)) { + *pc1 = regs->pc + 4 + ((char) (inst & 0xff) << 1); + *pc2 = regs->pc + 4; + return; + } + + /* jmp & jsr */ + if (nib[0] == 0x4 && nib[3] == 0xb + && (nib[2] == 0x0 || nib[2] == 0x2)) { + *pc1 = regs->regs[nib[1]]; + *pc2 = (unsigned long) -1; + return; + } + + /* braf & bsrf */ + if (nib[0] == 0x0 && nib[3] == 0x3 + && (nib[2] == 0x0 || nib[2] == 0x2)) { + *pc1 = regs->pc + 4 + regs->regs[nib[1]]; + *pc2 = (unsigned long) -1; + return; + } + + if (inst == 0x000b) { + *pc1 = regs->pr; + *pc2 = (unsigned long) -1; + return; + } + + *pc1 = regs->pc + 2; + *pc2 = (unsigned long) -1; + return; } -static unsigned long getreg(struct task_struct *child, - unsigned long regno) +/* Tracing by user break controller. */ +static void +ubc_set_tracing(int asid, unsigned long nextpc1, unsigned nextpc2) { - unsigned long retval = ~0UL; - -#if 0 - switch (regno >> 2) { - case FS: - retval = child->thread.fs; - break; - case GS: - retval = child->thread.gs; - break; - case DS: - case ES: - case SS: - case CS: - retval = 0xffff; - /* fall through */ - default: - if (regno > GS*4) - regno -= 2*4; - regno = regno - sizeof(struct pt_regs); - retval &= get_stack_long(child, regno); + ctrl_outl(nextpc1, UBC_BARA); + ctrl_outb(asid, UBC_BASRA); + ctrl_outb(BAMR_12, UBC_BAMRA); + ctrl_outw(BBR_INST | BBR_READ, UBC_BBRA); + + if (nextpc2 != (unsigned long) -1) { + ctrl_outl(nextpc2, UBC_BARB); + ctrl_outb(asid, UBC_BASRB); + ctrl_outb(BAMR_12, UBC_BAMRB); + ctrl_outw(BBR_INST | BBR_READ, UBC_BBRB); } -#endif - return retval; + ctrl_outw(BRCR_PCBA | BRCR_PCBB, UBC_BRCR); } asmlinkage int sys_ptrace(long request, long pid, long addr, long data) { - struct task_struct *child; + struct task_struct *child, *tsk = current; struct user * dummy = NULL; unsigned long flags; - int i, ret; + int ret; lock_kernel(); ret = -EPERM; @@ -163,16 +161,16 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) if (pid == 1) /* you may not mess with init */ goto out; if (request == PTRACE_ATTACH) { - if (child == current) + if (child == tsk) goto out; if ((!child->dumpable || - (current->uid != child->euid) || - (current->uid != child->suid) || - (current->uid != child->uid) || - (current->gid != child->egid) || - (current->gid != child->sgid) || - (!cap_issubset(child->cap_permitted, current->cap_permitted)) || - (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE)) + (tsk->uid != child->euid) || + (tsk->uid != child->suid) || + (tsk->uid != child->uid) || + (tsk->gid != child->egid) || + (tsk->gid != child->sgid) || + (!cap_issubset(child->cap_permitted, tsk->cap_permitted)) || + (tsk->gid != child->gid)) && !capable(CAP_SYS_PTRACE)) goto out; /* the same process cannot be attached many times */ if (child->flags & PF_PTRACED) @@ -180,9 +178,9 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) child->flags |= PF_PTRACED; write_lock_irqsave(&tasklist_lock, flags); - if (child->p_pptr != current) { + if (child->p_pptr != tsk) { REMOVE_LINKS(child); - child->p_pptr = current; + child->p_pptr = tsk; SET_LINKS(child); } write_unlock_irqrestore(&tasklist_lock, flags); @@ -198,257 +196,180 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) if (request != PTRACE_KILL) goto out; } - if (child->p_pptr != current) + if (child->p_pptr != tsk) goto out; switch (request) { /* when I and D space are separate, these will need to be fixed. */ - case PTRACE_PEEKTEXT: /* read word at location addr. */ - case PTRACE_PEEKDATA: { - unsigned long tmp; - int copied; - - copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0); - ret = -EIO; - if (copied != sizeof(tmp)) - goto out; - ret = put_user(tmp,(unsigned long *) data); - goto out; - } + case PTRACE_PEEKTEXT: /* read word at location addr. */ + case PTRACE_PEEKDATA: { + unsigned long tmp; + int copied; + + copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0); + ret = -EIO; + if (copied != sizeof(tmp)) + break; + ret = put_user(tmp,(unsigned long *) data); + break; + } /* read the word at location addr in the USER area. */ - case PTRACE_PEEKUSR: { - unsigned long tmp; - - ret = -EIO; - if ((addr & 3) || addr < 0 || - addr > sizeof(struct user) - 3) - goto out; - - tmp = 0; /* Default return condition */ - if(addr < 17*sizeof(long)) - tmp = getreg(child, addr); -#if 0 - if(addr >= (long) &dummy->u_debugreg[0] && - addr <= (long) &dummy->u_debugreg[7]){ - addr -= (long) &dummy->u_debugreg[0]; - addr = addr >> 2; - tmp = child->thread.debugreg[addr]; - }; -#endif - ret = put_user(tmp,(unsigned long *) data); - goto out; - } + case PTRACE_PEEKUSR: { + unsigned long tmp; - /* when I and D space are separate, this will have to be fixed. */ - case PTRACE_POKETEXT: /* write the word at location addr. */ - case PTRACE_POKEDATA: - ret = 0; - if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data)) - goto out; - ret = -EIO; - goto out; + ret = -EIO; + if ((addr & 3) || addr < 0 || + addr > sizeof(struct user) - 3) + break; - case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ - ret = -EIO; - if ((addr & 3) || addr < 0 || - addr > sizeof(struct user) - 3) - goto out; - - if (addr < 17*sizeof(long)) { - ret = putreg(child, addr, data); - goto out; - } - - /* We need to be very careful here. We implicitly - want to modify a portion of the task_struct, and we - have to be selective about what portions we allow someone - to modify. */ -#if 0 - if(addr >= (long) &dummy->u_debugreg[0] && - addr <= (long) &dummy->u_debugreg[7]){ - - if(addr == (long) &dummy->u_debugreg[4]) return -EIO; - if(addr == (long) &dummy->u_debugreg[5]) return -EIO; - if(addr < (long) &dummy->u_debugreg[4] && - ((unsigned long) data) >= TASK_SIZE-3) return -EIO; - - ret = -EIO; - if(addr == (long) &dummy->u_debugreg[7]) { - data &= ~DR_CONTROL_RESERVED; - for(i=0; i<4; i++) - if ((0x5f54 >> ((data >> (16 + 4*i)) & 0xf)) & 1) - goto out; - }; - - addr -= (long) &dummy->u_debugreg; - addr = addr >> 2; - child->thread.debugreg[addr] = data; - ret = 0; - goto out; - }; -#endif - ret = -EIO; - goto out; - - case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ - case PTRACE_CONT: { /* restart after signal. */ - long tmp; - - ret = -EIO; - if ((unsigned long) data > _NSIG) - goto out; - if (request == PTRACE_SYSCALL) - child->flags |= PF_TRACESYS; - else - child->flags &= ~PF_TRACESYS; - child->exit_code = data; - /* make sure the single step bit is not set. */ -#if 0 - tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG; - put_stack_long(child, EFL_OFFSET,tmp); -#endif - wake_up_process(child); + if (addr < sizeof(struct pt_regs)) + tmp = get_stack_long(child, addr); + else if (addr >= (long) &dummy->fpu && + addr < (long) &dummy->u_fpvalid) { + if (!child->used_math) { + if (addr == (long)&dummy->fpu.fpscr) + tmp = FPSCR_INIT; + else + tmp = 0; + } else + tmp = ((long *)&child->thread.fpu) + [(addr - (long)&dummy->fpu) >> 2]; + } else if (addr == (long) &dummy->u_fpvalid) + tmp = child->used_math; + else + tmp = 0; + ret = put_user(tmp, (unsigned long *)data); + break; + } + + /* when I and D space are separate, this will have to be fixed. */ + case PTRACE_POKETEXT: /* write the word at location addr. */ + case PTRACE_POKEDATA: + ret = 0; + if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data)) + break; + ret = -EIO; + break; + + case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ + ret = -EIO; + if ((addr & 3) || addr < 0 || + addr > sizeof(struct user) - 3) + break; + + if (addr < sizeof(struct pt_regs)) + ret = put_stack_long(child, addr, data); + else if (addr >= (long) &dummy->fpu && + addr < (long) &dummy->u_fpvalid) { + child->used_math = 1; + ((long *)&child->thread.fpu) + [(addr - (long)&dummy->fpu) >> 2] = data; + ret = 0; + } else if (addr == (long) &dummy->u_fpvalid) { + child->used_math = data?1:0; ret = 0; - goto out; } + break; + + case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ + case PTRACE_CONT: { /* restart after signal. */ + ret = -EIO; + if ((unsigned long) data > _NSIG) + break; + if (request == PTRACE_SYSCALL) + child->flags |= PF_TRACESYS; + else + child->flags &= ~PF_TRACESYS; + child->exit_code = data; + wake_up_process(child); + ret = 0; + break; + } /* * make the child exit. Best I can do is send it a sigkill. * perhaps it should be put in the status that it wants to * exit. */ - case PTRACE_KILL: { - long tmp; + case PTRACE_KILL: { + ret = 0; + if (child->state == TASK_ZOMBIE) /* already dead */ + break; + child->exit_code = SIGKILL; + wake_up_process(child); + break; + } - ret = 0; - if (child->state == TASK_ZOMBIE) /* already dead */ - goto out; - child->exit_code = SIGKILL; - /* make sure the single step bit is not set. */ -#if 0 - tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG; - put_stack_long(child, EFL_OFFSET, tmp); -#endif - wake_up_process(child); - goto out; - } + case PTRACE_SINGLESTEP: { /* set the trap flag. */ + long tmp, pc; + struct pt_regs *dummy = NULL; + struct pt_regs *regs; + unsigned long nextpc1, nextpc2; + unsigned short insn; - case PTRACE_SINGLESTEP: { /* set the trap flag. */ - long tmp; + ret = -EIO; + if ((unsigned long) data > _NSIG) + break; + child->flags &= ~PF_TRACESYS; + if ((child->flags & PF_DTRACE) == 0) { + /* Spurious delayed TF traps may occur */ + child->flags |= PF_DTRACE; + } - ret = -EIO; - if ((unsigned long) data > _NSIG) - goto out; - child->flags &= ~PF_TRACESYS; - if ((child->flags & PF_DTRACE) == 0) { - /* Spurious delayed TF traps may occur */ - child->flags |= PF_DTRACE; - } -#if 0 - tmp = get_stack_long(child, EFL_OFFSET) | TRAP_FLAG; - put_stack_long(child, EFL_OFFSET, tmp); + /* Compute next pc. */ + pc = get_stack_long(child, (long)&dummy->pc); + regs = (struct pt_regs *)((unsigned long)child + THREAD_SIZE - sizeof(struct pt_regs)); + if (access_process_vm(child, pc&~3, &tmp, sizeof(tmp), 1) != sizeof(data)) + break; + +#ifdef __LITTLE_ENDIAN__ + if (pc & 3) + insn = tmp >> 16; + else + insn = tmp & 0xffff; +#else + if (pc & 3) + insn = tmp & 0xffff; + else + insn = tmp >> 16; #endif - child->exit_code = data; - /* give it a chance to run. */ - wake_up_process(child); - ret = 0; - goto out; - } + compute_next_pc (regs, insn, &nextpc1, &nextpc2); - case PTRACE_DETACH: { /* detach a process that was attached. */ - long tmp; + if (nextpc1 & 0x80000000) + break; + if (nextpc2 != (unsigned long) -1 && (nextpc2 & 0x80000000)) + break; - ret = -EIO; - if ((unsigned long) data > _NSIG) - goto out; - child->flags &= ~(PF_PTRACED|PF_TRACESYS); - child->exit_code = data; - write_lock_irqsave(&tasklist_lock, flags); - REMOVE_LINKS(child); - child->p_pptr = child->p_opptr; - SET_LINKS(child); - write_unlock_irqrestore(&tasklist_lock, flags); - /* make sure the single step bit is not set. */ -#if 0 - tmp = get_stack_long(child, EFL_OFFSET) & ~TRAP_FLAG; - put_stack_long(child, EFL_OFFSET, tmp); -#endif - wake_up_process(child); - ret = 0; - goto out; - } -#if 0 - case PTRACE_GETREGS: { /* Get all gp regs from the child. */ - if (!access_ok(VERIFY_WRITE, (unsigned *)data, - 17*sizeof(long))) - { - ret = -EIO; - goto out; - } - for ( i = 0; i < 17*sizeof(long); i += sizeof(long) ) - { - __put_user(getreg(child, i),(unsigned long *) data); - data += sizeof(long); - } - ret = 0; - goto out; - }; - - case PTRACE_SETREGS: { /* Set all gp regs in the child. */ - unsigned long tmp; - if (!access_ok(VERIFY_READ, (unsigned *)data, - 17*sizeof(long))) - { - ret = -EIO; - goto out; - } - for ( i = 0; i < 17*sizeof(long); i += sizeof(long) ) - { - __get_user(tmp, (unsigned long *) data); - putreg(child, i, tmp); - data += sizeof(long); - } - ret = 0; - goto out; - }; - - case PTRACE_GETFPREGS: { /* Get the child FPU state. */ - if (!access_ok(VERIFY_WRITE, (unsigned *)data, - sizeof(struct user_i387_struct))) - { - ret = -EIO; - goto out; - } - ret = 0; - if ( !child->used_math ) { - /* Simulate an empty FPU. */ - child->thread.i387.hard.cwd = 0xffff037f; - child->thread.i387.hard.swd = 0xffff0000; - child->thread.i387.hard.twd = 0xffffffff; - } - __copy_to_user((void *)data, &child->thread.i387.hard, - sizeof(struct user_i387_struct)); - goto out; - }; - - case PTRACE_SETFPREGS: { /* Set the child FPU state. */ - if (!access_ok(VERIFY_READ, (unsigned *)data, - sizeof(struct user_i387_struct))) - { - ret = -EIO; - goto out; - } - child->used_math = 1; - __copy_from_user(&child->thread.i387.hard, (void *)data, - sizeof(struct user_i387_struct)); - ret = 0; - goto out; - }; -#endif - default: - ret = -EIO; - goto out; + ubc_set_tracing(child->mm->context & MMU_CONTEXT_ASID_MASK, + nextpc1, nextpc2); + + child->exit_code = data; + /* give it a chance to run. */ + wake_up_process(child); + ret = 0; + break; + } + + case PTRACE_DETACH: { /* detach a process that was attached. */ + ret = -EIO; + if ((unsigned long) data > _NSIG) + break; + child->flags &= ~(PF_PTRACED|PF_TRACESYS); + child->exit_code = data; + write_lock_irqsave(&tasklist_lock, flags); + REMOVE_LINKS(child); + child->p_pptr = child->p_opptr; + SET_LINKS(child); + write_unlock_irqrestore(&tasklist_lock, flags); + wake_up_process(child); + ret = 0; + break; + } + + default: + ret = -EIO; + break; } out: unlock_kernel(); @@ -457,20 +378,22 @@ out: asmlinkage void syscall_trace(void) { - if ((current->flags & (PF_PTRACED|PF_TRACESYS)) - != (PF_PTRACED|PF_TRACESYS)) + struct task_struct *tsk = current; + + if ((tsk->flags & (PF_PTRACED|PF_TRACESYS)) + != (PF_PTRACED|PF_TRACESYS)) return; - current->exit_code = SIGTRAP; - current->state = TASK_STOPPED; - notify_parent(current, SIGCHLD); + tsk->exit_code = SIGTRAP; + tsk->state = TASK_STOPPED; + notify_parent(tsk, SIGCHLD); schedule(); /* * this isn't the same as continuing with a signal, but it will do * for normal use. strace only continues with a signal if the * stopping signal is not SIGTRAP. -brl */ - if (current->exit_code) { - send_sig(current->exit_code, current, 1); - current->exit_code = 0; + if (tsk->exit_code) { + send_sig(tsk->exit_code, tsk, 1); + tsk->exit_code = 0; } } diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c index 0c24acf73..4b11100ae 100644 --- a/arch/sh/kernel/signal.c +++ b/arch/sh/kernel/signal.c @@ -1,4 +1,4 @@ -/* $Id: signal.c,v 1.16 2000/01/29 11:31:31 gniibe Exp gniibe $ +/* $Id: signal.c,v 1.21 2000/03/11 14:06:21 gniibe Exp $ * * linux/arch/sh/kernel/signal.c * @@ -6,7 +6,7 @@ * * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson * - * SuperH version: Copyright (C) 1999 Niibe Yutaka + * SuperH version: Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima * */ @@ -125,7 +125,7 @@ sys_sigaltstack(const stack_t *uss, stack_t *uoss, unsigned long r6, unsigned long r7, struct pt_regs regs) { - return do_sigaltstack(uss, uoss, regs.sp); + return do_sigaltstack(uss, uoss, regs.regs[15]); } @@ -136,7 +136,6 @@ sys_sigaltstack(const stack_t *uss, stack_t *uoss, struct sigframe { struct sigcontext sc; - /* FPU data should come here: SH-3 has no FPU */ unsigned long extramask[_NSIG_WORDS-1]; char retcode[4]; }; @@ -147,10 +146,38 @@ struct rt_sigframe void *puc; struct siginfo info; struct ucontext uc; - /* FPU should come here: SH-3 has no FPU */ char retcode[4]; }; +#if defined(__SH4__) +static inline int restore_sigcontext_fpu(struct sigcontext *sc) +{ + current->used_math = 1; + return __copy_from_user(&tsk->thread.fpu.hard, &sc->sc_fpregs[0], + sizeof(long)*(NUM_FPU_REGS*2+2)); +} + +static inline int save_sigcontext_fpu(struct sigcontext *sc) +{ + struct task_struct *tsk = current; + + if (!tsk->used_math) { + sc->owend_fp = 0; + return 0; + } + + sc->owend_fp = 1; + + /* This will cause a "finit" to be triggered by the next + attempted FPU operation by the 'current' process. + */ + tsk->used_math = 0; + + unlazy_fpu(tsk); + return __copy_to_user(&sc->sc_fpregs[0], &tsk->thread.fpu.hard, + sizeof(long)*(NUM_FPU_REGS*2+2)); +} +#endif static int restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc, int *r0_p) @@ -165,15 +192,28 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc, int *r0_p) COPY(regs[8]); COPY(regs[9]); COPY(regs[10]); COPY(regs[11]); COPY(regs[12]); COPY(regs[13]); - COPY(regs[14]); COPY(sp); + COPY(regs[14]); COPY(regs[15]); COPY(gbr); COPY(mach); COPY(macl); COPY(pr); COPY(sr); COPY(pc); #undef COPY +#if defined(__SH4__) + { + int owned_fp; + struct task_struct *tsk = current; + + regs->sr |= SR_FD; /* Release FPU */ + clear_fpu(tsk); + current->used_math = 0; + __get_user (owned_fp, &context->sc_ownedfp); + if (owned_fp) + err |= restore_sigcontext_fpu(sc); + } +#endif + regs->syscall_nr = -1; /* disable syscall checks */ err |= __get_user(*r0_p, &sc->sc_regs[0]); - return err; } @@ -181,7 +221,7 @@ asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7, struct pt_regs regs) { - struct sigframe *frame = (struct sigframe *)regs.sp; + struct sigframe *frame = (struct sigframe *)regs.regs[15]; sigset_t set; int r0; @@ -214,7 +254,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7, struct pt_regs regs) { - struct rt_sigframe *frame = (struct rt_sigframe *)regs.sp; + struct rt_sigframe *frame = (struct rt_sigframe *)regs.regs[15]; sigset_t set; stack_t st; int r0; @@ -238,7 +278,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, goto badframe; /* It is more difficult to avoid calling this function than to call it and ignore errors. */ - do_sigaltstack(&st, NULL, regs.sp); + do_sigaltstack(&st, NULL, regs.regs[15]); return r0; @@ -265,12 +305,16 @@ setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs, COPY(regs[8]); COPY(regs[9]); COPY(regs[10]); COPY(regs[11]); COPY(regs[12]); COPY(regs[13]); - COPY(regs[14]); COPY(sp); + COPY(regs[14]); COPY(regs[15]); COPY(gbr); COPY(mach); COPY(macl); COPY(pr); COPY(sr); COPY(pc); #undef COPY +#if defined(__SH4__) + err |= save_sigcontext_fpu(sc); +#endif + /* non-iBCS2 extensions.. */ err |= __put_user(mask, &sc->oldmask); @@ -296,7 +340,7 @@ static void setup_frame(int sig, struct k_sigaction *ka, int err = 0; int signal; - frame = get_sigframe(ka, regs->sp, sizeof(*frame)); + frame = get_sigframe(ka, regs->regs[15], sizeof(*frame)); if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) goto give_sigsegv; @@ -334,7 +378,7 @@ static void setup_frame(int sig, struct k_sigaction *ka, goto give_sigsegv; /* Set up registers for signal handler */ - regs->sp = (unsigned long) frame; + regs->regs[15] = (unsigned long) frame; regs->regs[4] = signal; /* Arg for signal handler */ regs->pc = (unsigned long) ka->sa.sa_handler; @@ -361,7 +405,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, int err = 0; int signal; - frame = get_sigframe(ka, regs->sp, sizeof(*frame)); + frame = get_sigframe(ka, regs->regs[15], sizeof(*frame)); if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) goto give_sigsegv; @@ -381,7 +425,8 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, err |= __put_user(0, &frame->uc.uc_link); err |= __put_user((void *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); - err |= __put_user(sas_ss_flags(regs->sp), &frame->uc.uc_stack.ss_flags); + err |= __put_user(sas_ss_flags(regs->regs[15]), + &frame->uc.uc_stack.ss_flags); err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]); @@ -407,7 +452,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, goto give_sigsegv; /* Set up registers for signal handler */ - regs->sp = (unsigned long) frame; + regs->regs[15] = (unsigned long) frame; regs->regs[4] = signal; /* Arg for signal handler */ regs->pc = (unsigned long) ka->sa.sa_handler; diff --git a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile index 5f7d68755..7af24f1c3 100644 --- a/arch/sh/lib/Makefile +++ b/arch/sh/lib/Makefile @@ -3,7 +3,7 @@ # .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $< -o $*.o + $(CC) $(AFLAGS) -traditional -c $< -o $*.o L_TARGET = lib.a L_OBJS = delay.o memcpy.o memset.o memmove.o memchr.o old-checksum.o \ diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c index f5c5200be..33bdf2114 100644 --- a/arch/sh/mm/cache.c +++ b/arch/sh/mm/cache.c @@ -1,4 +1,4 @@ -/* $Id: cache.c,v 1.9 2000/02/14 12:45:26 gniibe Exp $ +/* $Id: cache.c,v 1.10 2000/03/07 11:58:34 gniibe Exp $ * * linux/arch/sh/mm/cache.c * @@ -67,36 +67,15 @@ static struct _cache_system_info cache_system_info; #define CACHE_IC_NUM_WAYS 1 #endif -#define jump_to_p2(__dummy) \ - asm volatile("mova 1f,%0\n\t" \ - "add %1,%0\n\t" \ - "jmp @r0 ! Jump to P2 area\n\t" \ - " nop\n\t" \ - ".balign 4\n" \ - "1:" \ - : "=&z" (__dummy) \ - : "r" (0x20000000)) - -#define back_to_p1(__dummy) \ - asm volatile("nop;nop;nop;nop;nop;nop\n\t" \ - "mova 9f,%0\n\t" \ - "sub %1,%0\n\t" \ - "jmp @r0 ! Back to P1 area\n\t" \ - " nop\n\t" \ - ".balign 4\n" \ - "9:" \ - : "=&z" (__dummy) \ - : "r" (0x20000000), "0" (__dummy)) - /* Write back caches to memory (if needed) and invalidates the caches */ void cache_flush_area(unsigned long start, unsigned long end) { - unsigned long flags, __dummy; + unsigned long flags; unsigned long addr, data, v, p; start &= ~(L1_CACHE_BYTES-1); save_and_cli(flags); - jump_to_p2(__dummy); + jump_to_P2(); for (v = start; v < end; v+=L1_CACHE_BYTES) { p = __pa(v); @@ -110,7 +89,7 @@ void cache_flush_area(unsigned long start, unsigned long end) : "m" (__m(v))); #endif } - back_to_p1(__dummy); + back_to_P1(); restore_flags(flags); } @@ -124,12 +103,12 @@ void cache_flush_area(unsigned long start, unsigned long end) the cache line. */ void cache_purge_area(unsigned long start, unsigned long end) { - unsigned long flags, __dummy; + unsigned long flags; unsigned long addr, data, v, p, j; start &= ~(L1_CACHE_BYTES-1); save_and_cli(flags); - jump_to_p2(__dummy); + jump_to_P2(); for (v = start; v < end; v+=L1_CACHE_BYTES) { p = __pa(v); @@ -150,19 +129,19 @@ void cache_purge_area(unsigned long start, unsigned long end) : "m" (__m(v))); #endif } - back_to_p1(__dummy); + back_to_P1(); restore_flags(flags); } /* write back the dirty cache, but not invalidate the cache */ void cache_wback_area(unsigned long start, unsigned long end) { - unsigned long flags, __dummy; + unsigned long flags; unsigned long v; start &= ~(L1_CACHE_BYTES-1); save_and_cli(flags); - jump_to_p2(__dummy); + jump_to_P2(); for (v = start; v < end; v+=L1_CACHE_BYTES) { #if CACHE_IC_ADDRESS_ARRAY == CACHE_OC_ADDRESS_ARRAY @@ -187,7 +166,7 @@ void cache_wback_area(unsigned long start, unsigned long end) : "m" (__m(v))); #endif } - back_to_p1(__dummy); + back_to_P1(); restore_flags(flags); } @@ -199,11 +178,11 @@ void cache_wback_area(unsigned long start, unsigned long end) */ static void cache_wback_all(void) { - unsigned long flags, __dummy; + unsigned long flags; unsigned long addr, data, i, j; save_and_cli(flags); - jump_to_p2(__dummy); + jump_to_P2(); for (i=0; i<CACHE_OC_NUM_ENTRIES; i++) { for (j=0; j<CACHE_OC_NUM_WAYS; j++) { @@ -217,7 +196,7 @@ static void cache_wback_all(void) } } - back_to_p1(__dummy); + back_to_P1(); restore_flags(flags); } @@ -225,9 +204,9 @@ static void detect_cpu_and_cache_system(void) { #if defined(__sh3__) - unsigned long __dummy, addr0, addr1, data0, data1, data2, data3; + unsigned long addr0, addr1, data0, data1, data2, data3; - jump_to_p2(__dummy); + jump_to_P2(); /* Check if the entry shadows or not. * When shadowed, it's 128-entry system. * Otherwise, it's 256-entry system. @@ -245,7 +224,7 @@ detect_cpu_and_cache_system(void) /* Invaliate them, in case the cache has been enabled already. */ ctrl_outl(data0&~0x00000001,addr0); ctrl_outl(data2&~0x00000001,addr1); - back_to_p1(__dummy); + back_to_P1(); if (data0 == data1 && data2 == data3) { /* Shadow */ cache_system_info.way_shift = 11; @@ -265,7 +244,7 @@ detect_cpu_and_cache_system(void) void __init cache_init(void) { - unsigned long __dummy, ccr; + unsigned long ccr; detect_cpu_and_cache_system(); @@ -277,19 +256,19 @@ void __init cache_init(void) we only need to flush the half of the caches. */ cache_wback_all(); - jump_to_p2(__dummy); + jump_to_P2(); ctrl_outl(CCR_CACHE_INIT, CCR); - back_to_p1(__dummy); + back_to_P1(); } #if defined(__SH4__) void flush_icache_page(struct vm_area_struct *vma, struct page *pg) { - unsigned long flags, __dummy; + unsigned long flags; unsigned long addr, data, v; save_and_cli(flags); - jump_to_p2(__dummy); + jump_to_P2(); v = page_address(pg); @@ -303,18 +282,18 @@ void flush_icache_page(struct vm_area_struct *vma, struct page *pg) data = (v&0xfffffc00); /* Valid=0 */ ctrl_outl(data,addr); - back_to_p1(__dummy); + back_to_P1(); restore_flags(flags); } void flush_icache_range(unsigned long start, unsigned long end) { - unsigned long flags, __dummy; + unsigned long flags; unsigned long addr, data, v; start &= ~(L1_CACHE_BYTES-1); save_and_cli(flags); - jump_to_p2(__dummy); + jump_to_P2(); for (v = start; v < end; v+=L1_CACHE_BYTES) { /* Write back O Cache */ @@ -327,22 +306,22 @@ void flush_icache_range(unsigned long start, unsigned long end) data = (v&0xfffffc00); /* Valid=0 */ ctrl_outl(data,addr); } - back_to_p1(__dummy); + back_to_P1(); restore_flags(flags); } void flush_cache_all(void) { - unsigned long flags,__dummy; + unsigned long flags; /* Write back Operand Cache */ cache_wback_all (); /* Then, invalidate Instruction Cache and Operand Cache */ save_and_cli(flags); - jump_to_p2(__dummy); + jump_to_P2(); ctrl_outl(CCR_CACHE_INIT, CCR); - back_to_p1(__dummy); + back_to_P1(); restore_flags(flags); } @@ -356,12 +335,12 @@ void flush_cache_mm(struct mm_struct *mm) void flush_cache_range(struct mm_struct *mm, unsigned long start, unsigned long end) { - unsigned long flags, __dummy; + unsigned long flags; unsigned long addr, data, v; start &= ~(L1_CACHE_BYTES-1); save_and_cli(flags); - jump_to_p2(__dummy); + jump_to_P2(); for (v = start; v < end; v+=L1_CACHE_BYTES) { addr = CACHE_IC_ADDRESS_ARRAY | @@ -372,7 +351,7 @@ void flush_cache_range(struct mm_struct *mm, unsigned long start, (v&CACHE_OC_ENTRY_MASK) | 0x8 /* A-bit */; ctrl_outl(data,addr); } - back_to_p1(__dummy); + back_to_P1(); restore_flags(flags); } diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c index 3b8e86e36..bf448bf8b 100644 --- a/arch/sh/mm/fault.c +++ b/arch/sh/mm/fault.c @@ -1,4 +1,4 @@ -/* $Id: fault.c,v 1.12 2000/03/01 11:15:27 gniibe Exp $ +/* $Id: fault.c,v 1.13 2000/03/07 12:05:24 gniibe Exp $ * * linux/arch/sh/mm/fault.c * Copyright (C) 1999 Niibe Yutaka @@ -283,9 +283,6 @@ static void __flush_tlb_page(struct mm_struct *mm, unsigned long page) { unsigned long addr, data, asid; unsigned long saved_asid = MMU_NO_ASID; -#if defined(__SH4__) - int i; -#endif if (mm->context == NO_CONTEXT) return; @@ -305,20 +302,26 @@ static void __flush_tlb_page(struct mm_struct *mm, unsigned long page) data = (page & 0xfffe0000) | asid; /* VALID bit is off */ ctrl_outl(data, addr); #elif defined(__SH4__) + jump_to_P2(); addr = MMU_UTLB_ADDRESS_ARRAY | MMU_PAGE_ASSOC_BIT; data = page | asid; /* VALID bit is off */ ctrl_outl(data, addr); - - for (i=0; i<4; i++) { - addr = MMU_ITLB_ADDRESS_ARRAY | (i<<8); - data = ctrl_inl(addr); - data &= ~0x300; - if (data == (page | asid)) { - ctrl_outl(data, addr); - break; +#if 0 /* Not need when using ASSOC. ??? */ + { + int i; + for (i=0; i<4; i++) { + addr = MMU_ITLB_ADDRESS_ARRAY | (i<<8); + data = ctrl_inl(addr); + data &= ~0x300; + if (data == (page | asid)) { + ctrl_outl(data, addr); + break; + } } } #endif + back_to_P1(); +#endif if (saved_asid != MMU_NO_ASID) set_asid(saved_asid); } diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 776389cac..931564cac 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c @@ -224,7 +224,7 @@ void __init paging_init(void) zones_size[ZONE_DMA] = max_dma - start_pfn; zones_size[ZONE_NORMAL] = low - max_dma; } - free_area_init_node(0, 0, zones_size, __MEMORY_START); + free_area_init_node(0, 0, zones_size, __MEMORY_START, 0); } } diff --git a/arch/sparc/config.in b/arch/sparc/config.in index e77e72a76..279afb38f 100644 --- a/arch/sparc/config.in +++ b/arch/sparc/config.in @@ -1,4 +1,4 @@ -# $Id: config.in,v 1.90 2000/03/17 05:18:02 anton Exp $ +# $Id: config.in,v 1.92 2000/03/29 11:56:48 davem Exp $ # For a description of the syntax of this configuration file, # see the Configure script. # @@ -20,6 +20,8 @@ define_bool CONFIG_VT_CONSOLE y bool 'Symmetric multi-processing support (does not work on sun4/sun4c)' CONFIG_SMP # Global things across all Sun machines. +define_bool CONFIG_ISA n +define_bool CONFIG_PCMCIA n define_bool CONFIG_SBUS y define_bool CONFIG_SBUSCHAR y define_bool CONFIG_BUSMOUSE y diff --git a/arch/sparc/defconfig b/arch/sparc/defconfig index b39da1989..f2059871c 100644 --- a/arch/sparc/defconfig +++ b/arch/sparc/defconfig @@ -14,6 +14,8 @@ CONFIG_EXPERIMENTAL=y CONFIG_VT=y CONFIG_VT_CONSOLE=y # CONFIG_SMP is not set +# CONFIG_ISA is not set +# CONFIG_PCMCIA is not set CONFIG_SBUS=y CONFIG_SBUSCHAR=y CONFIG_BUSMOUSE=y diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile index 0d93f3a2b..bd9181933 100644 --- a/arch/sparc/kernel/Makefile +++ b/arch/sparc/kernel/Makefile @@ -8,10 +8,10 @@ # Note 2! The CFLAGS definitions are now in the main makefile... .S.s: - $(CPP) -D__ASSEMBLY__ $(AFLAGS) -ansi $< -o $*.s + $(CPP) $(AFLAGS) -ansi $< -o $*.s .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c $< -o $*.o + $(CC) $(AFLAGS) -ansi -c $< -o $*.o all: kernel.o head.o init_task.o @@ -47,7 +47,7 @@ O_OBJS += ebus.o endif head.o: head.S - $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c $*.S -o $*.o + $(CC) $(AFLAGS) -ansi -c $*.S -o $*.o check_asm: dummy @echo "/* Automatically generated. Do not edit. */" > asm_offsets.h @@ -62,7 +62,7 @@ check_asm: dummy @echo "#undef __SMP__" >> tmp.c @echo "#undef CONFIG_SMP" >> tmp.c @echo "#include <linux/sched.h>" >> tmp.c - $(CC) $(CPPFLAGS) -E tmp.c -o tmp.i + $(CPP) $(CPPFLAGS) tmp.c -o tmp.i @echo "/* Automatically generated. Do not edit. */" > check_asm.c @echo "#include <linux/config.h>" >> check_asm.c @echo "#undef __SMP__" >> check_asm.c @@ -87,7 +87,7 @@ check_asm: dummy @echo "#undef CONFIG_SMP" >> tmp.c @echo "#define CONFIG_SMP 1" >> tmp.c @echo "#include <linux/sched.h>" >> tmp.c - $(CC) $(CPPFLAGS) -D__SMP__ -E tmp.c -o tmp.i + $(CPP) $(CPPFLAGS) -D__SMP__ tmp.c -o tmp.i @echo "/* Automatically generated. Do not edit. */" > check_asm.c @echo "#include <linux/config.h>" >> check_asm.c @echo "#undef CONFIG_SMP" >> check_asm.c diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index b1ed3c2af..20c141a00 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c @@ -1,4 +1,4 @@ -/* $Id: ioport.c,v 1.36 2000/03/16 08:22:53 anton Exp $ +/* $Id: ioport.c,v 1.37 2000/03/28 06:38:19 davem Exp $ * ioport.c: Simple io mapping allocator. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -581,6 +581,7 @@ dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int dir { if (direction == PCI_DMA_NONE) BUG(); + /* IIep is write-through, not flushing. */ return virt_to_bus(ptr); } @@ -591,11 +592,15 @@ dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int dir * After this call, reads by the cpu to the buffer are guarenteed to see * whatever the device wrote there. */ -void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction) +void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t ba, size_t size, + int direction) { if (direction == PCI_DMA_NONE) BUG(); - /* Nothing to do... */ + if (direction != PCI_DMA_TODEVICE) { + mmu_inval_dma_area((unsigned long)bus_to_virt(ba), + (size + PAGE_SIZE-1) & PAGE_MASK); + } } /* Map a set of buffers described by scatterlist in streaming @@ -613,13 +618,14 @@ void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, i * Device ownership issues as mentioned above for pci_map_single are * the same here. */ -int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction) +int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, + int direction) { int n; if (direction == PCI_DMA_NONE) BUG(); - + /* IIep is write-through, not flushing. */ for (n = 0; n < nents; n++) { sg->dvma_address = virt_to_bus(sg->address); sg->dvma_length = sg->length; @@ -632,15 +638,24 @@ int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int dir * Again, cpu read rules concerning calls here are the same as for * pci_unmap_single() above. */ -void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nhwents, int direction) +void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, + int direction) { + int n; + if (direction == PCI_DMA_NONE) BUG(); - /* Nothing to do... */ + if (direction != PCI_DMA_TODEVICE) { + for (n = 0; n < nents; n++) { + mmu_inval_dma_area((unsigned long)sg->address, + (sg->length + PAGE_SIZE-1) & PAGE_MASK); + sg++; + } + } } /* Make physical memory consistent for a single - * streaming mode DMA translation after a transfer. + * streaming mode DMA translation before or after a transfer. * * If you perform a pci_map_single() but wish to interrogate the * buffer using the cpu, yet do not wish to teardown the PCI dma @@ -652,8 +667,10 @@ void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t ba, size_t size, int { if (direction == PCI_DMA_NONE) BUG(); - mmu_inval_dma_area((unsigned long)bus_to_virt(ba), - (size + PAGE_SIZE-1) & PAGE_MASK); + if (direction != PCI_DMA_TODEVICE) { + mmu_inval_dma_area((unsigned long)bus_to_virt(ba), + (size + PAGE_SIZE-1) & PAGE_MASK); + } } /* Make physical memory consistent for a set of streaming @@ -664,13 +681,16 @@ void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t ba, size_t size, int */ void pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction) { + int n; + if (direction == PCI_DMA_NONE) BUG(); - while (nents) { - --nents; - mmu_inval_dma_area((unsigned long)sg->address, - (sg->dvma_length + PAGE_SIZE-1) & PAGE_MASK); - sg++; + if (direction != PCI_DMA_TODEVICE) { + for (n = 0; n < nents; n++) { + mmu_inval_dma_area((unsigned long)sg->address, + (sg->length + PAGE_SIZE-1) & PAGE_MASK); + sg++; + } } } #endif CONFIG_PCI diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c index 5966e04d7..8c70c9f75 100644 --- a/arch/sparc/kernel/setup.c +++ b/arch/sparc/kernel/setup.c @@ -1,4 +1,4 @@ -/* $Id: setup.c,v 1.116 2000/03/15 23:26:22 anton Exp $ +/* $Id: setup.c,v 1.117 2000/03/27 12:14:54 davem Exp $ * linux/arch/sparc/kernel/setup.c * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -45,6 +45,8 @@ #include <asm/hardirq.h> #include <asm/machines.h> +#undef PROM_DEBUG_CONSOLE + struct screen_info screen_info = { 0, 0, /* orig-x, orig-y */ 0, /* unused */ @@ -282,6 +284,7 @@ struct tt_entry *sparc_ttable; struct pt_regs fake_swapper_regs = { 0, 0, 0, 0, { 0, } }; +#ifdef PROM_DEBUG_CONSOLE static void prom_cons_write(struct console *con, const char *str, unsigned count) { while (count--) @@ -291,6 +294,7 @@ static void prom_cons_write(struct console *con, const char *str, unsigned count static struct console prom_console = { "PROM", prom_cons_write, 0, 0, 0, 0, 0, CON_PRINTBUFFER, 0, 0, 0 }; +#endif extern void paging_init(void); @@ -345,6 +349,9 @@ void __init setup_arch(char **cmdline_p) printk("UNKNOWN!\n"); break; }; +#ifdef PROM_DEBUG_CONSOLE + register_console(&prom_console); +#endif #ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; diff --git a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c index 98b542402..484ffac82 100644 --- a/arch/sparc/kernel/signal.c +++ b/arch/sparc/kernel/signal.c @@ -1096,7 +1096,9 @@ static inline void read_maps (void) if (map->vm_file != NULL) { dev = map->vm_file->f_dentry->d_inode->i_dev; ino = map->vm_file->f_dentry->d_inode->i_ino; - line = d_path(map->vm_file->f_dentry, buffer, PAGE_SIZE); + line = d_path(map->vm_file->f_dentry, + map->vm_file->f_vfsmnt, + buffer, PAGE_SIZE); } printk(MAPS_LINE_FORMAT, map->vm_start, map->vm_end, str, map->vm_pgoff << PAGE_SHIFT, kdevname(dev), ino); diff --git a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c index 0a8a5827c..36670ab93 100644 --- a/arch/sparc/kernel/sys_sunos.c +++ b/arch/sparc/kernel/sys_sunos.c @@ -1,4 +1,4 @@ -/* $Id: sys_sunos.c,v 1.117 2000/03/15 02:43:32 davem Exp $ +/* $Id: sys_sunos.c,v 1.118 2000/03/26 11:28:56 davem Exp $ * sys_sunos.c: SunOS specific syscall compatibility support. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -91,7 +91,7 @@ asmlinkage unsigned long sunos_mmap(unsigned long addr, unsigned long len, * of /dev/zero, transform it into an anonymous mapping. * SunOS is so stupid some times... hmph! */ - if(file->f_dentry && file->f_dentry->d_inode) { + if (file) { if(MAJOR(file->f_dentry->d_inode->i_rdev) == MEM_MAJOR && MINOR(file->f_dentry->d_inode->i_rdev) == 5) { flags |= MAP_ANONYMOUS; @@ -633,10 +633,9 @@ struct sunos_nfs_mount_args { }; -extern int do_mount(struct block_device *, const char *, const char *, char *, int, void *); extern dev_t get_unnamed_dev(void); extern void put_unnamed_dev(dev_t); -extern asmlinkage int sys_mount(char *, char *, char *, unsigned long, void *); +extern asmlinkage long do_sys_mount(char *, char *, char *, int, void *); extern asmlinkage int sys_connect(int fd, struct sockaddr *uservaddr, int addrlen); extern asmlinkage int sys_socket(int family, int type, int protocol); extern asmlinkage int sys_bind(int fd, struct sockaddr *umyaddr, int addrlen); @@ -660,8 +659,6 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr) file = fget(fd); if (!file) goto out; - if (!file->f_dentry || !(inode = file->f_dentry->d_inode)) - goto out_putf; socket = &inode->u.socket_i; local.sin_family = AF_INET; @@ -702,12 +699,12 @@ static int get_default (int value, int def_value) return def_value; } -asmlinkage int sunos_nfs_mount(char *dir_name, int linux_flags, void *data) +static int sunos_nfs_mount(char *dir_name, int linux_flags, void *data) { int server_fd; char *the_name; struct nfs_mount_data linux_nfs_mount; - struct sunos_nfs_mount_args *sunos_mount = data; + struct sunos_nfs_mount_args sunos_mount; /* Ok, here comes the fun part: Linux's nfs mount needs a * socket connection to the server, but SunOS mount does not @@ -715,33 +712,42 @@ asmlinkage int sunos_nfs_mount(char *dir_name, int linux_flags, void *data) * address to create a socket and bind it to a reserved * port on this system */ + if (copy_from_user(&sunos_mount, data, sizeof(sunos_mount)) + return -EFAULT; + server_fd = sys_socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (server_fd < 0) return -ENXIO; - if (!sunos_nfs_get_server_fd (server_fd, sunos_mount->addr)){ + if (copy_from_user(&linux_nfs_mount.addr,sunos_mount.addr, + sizeof(*sunos_mount.addr)) || + copy_from_user(&linux_nfs_mount.root,sunos_mount.fh, + sizeof(*sunos_mount.fh))) { + sys_close (server_fd); + return -EFAULT; + } + + if (!sunos_nfs_get_server_fd (server_fd, &linux_nfs_mount.addr)){ sys_close (server_fd); return -ENXIO; } /* Now, bind it to a locally reserved port */ linux_nfs_mount.version = NFS_MOUNT_VERSION; - linux_nfs_mount.flags = sunos_mount->flags; - linux_nfs_mount.addr = *sunos_mount->addr; - linux_nfs_mount.root = *sunos_mount->fh; + linux_nfs_mount.flags = sunos_mount.flags; linux_nfs_mount.fd = server_fd; - linux_nfs_mount.rsize = get_default (sunos_mount->rsize, 8192); - linux_nfs_mount.wsize = get_default (sunos_mount->wsize, 8192); - linux_nfs_mount.timeo = get_default (sunos_mount->timeo, 10); - linux_nfs_mount.retrans = sunos_mount->retrans; + linux_nfs_mount.rsize = get_default (sunos_mount.rsize, 8192); + linux_nfs_mount.wsize = get_default (sunos_mount.wsize, 8192); + linux_nfs_mount.timeo = get_default (sunos_mount.timeo, 10); + linux_nfs_mount.retrans = sunos_mount.retrans; - linux_nfs_mount.acregmin = sunos_mount->acregmin; - linux_nfs_mount.acregmax = sunos_mount->acregmax; - linux_nfs_mount.acdirmin = sunos_mount->acdirmin; - linux_nfs_mount.acdirmax = sunos_mount->acdirmax; + linux_nfs_mount.acregmin = sunos_mount.acregmin; + linux_nfs_mount.acregmax = sunos_mount.acregmax; + linux_nfs_mount.acdirmin = sunos_mount.acdirmin; + linux_nfs_mount.acdirmax = sunos_mount.acdirmax; - the_name = getname(sunos_mount->hostname); + the_name = getname(sunos_mount.hostname); if(IS_ERR(the_name)) return PTR_ERR(the_name); @@ -749,7 +755,7 @@ asmlinkage int sunos_nfs_mount(char *dir_name, int linux_flags, void *data) linux_nfs_mount.hostname [255] = 0; putname (the_name); - return do_mount (NULL, "", dir_name, "nfs", linux_flags, &linux_nfs_mount); + return do_sys_mount ("", dir_name, "nfs", linux_flags, &linux_nfs_mount); } asmlinkage int @@ -758,6 +764,7 @@ sunos_mount(char *type, char *dir, int flags, void *data) int linux_flags = MS_MGC_MSK; /* new semantics */ int ret = -EINVAL; char *dev_fname = 0; + char *dir_page, *type_page; if (!capable (CAP_SYS_ADMIN)) return -EPERM; @@ -777,24 +784,44 @@ sunos_mount(char *type, char *dir, int flags, void *data) linux_flags |= MS_RDONLY; if(flags & SMNT_NOSUID) linux_flags |= MS_NOSUID; - if(strcmp(type, "ext2") == 0) { - dev_fname = (char *) data; - } else if(strcmp(type, "iso9660") == 0) { - dev_fname = (char *) data; - } else if(strcmp(type, "minix") == 0) { - dev_fname = (char *) data; - } else if(strcmp(type, "nfs") == 0) { - ret = sunos_nfs_mount (dir, flags, data); + + dir_page = getname(dir); + ret = PTR_ERR(dir_page); + if (IS_ERR(dir_page)) goto out; - } else if(strcmp(type, "ufs") == 0) { + + type_page = getname(type); + ret = PTR_ERR(type_page); + if (IS_ERR(type_page)) + goto out1; + + if(strcmp(type_page, "ext2") == 0) { + dev_fname = getname(data); + } else if(strcmp(type_page, "iso9660") == 0) { + dev_fname = getname(data); + } else if(strcmp(type_page, "minix") == 0) { + dev_fname = getname(data); + } else if(strcmp(type_page, "nfs") == 0) { + ret = sunos_nfs_mount (dir_page, flags, data); + goto out2 + } else if(strcmp(type_page, "ufs") == 0) { printk("Warning: UFS filesystem mounts unsupported.\n"); ret = -ENODEV; - goto out; - } else if(strcmp(type, "proc")) { + goto out2 + } else if(strcmp(type_page, "proc")) { ret = -ENODEV; - goto out; + goto out2 } - ret = sys_mount(dev_fname, dir, type, linux_flags, NULL); + ret = PTR_ERR(dev_fname); + if (IS_ERR(dev_fname)) + goto out2; + ret = do_sys_mount(dev_fname, dir_page, type_page, linux_flags, NULL); + if (dev_fname) + putname(dev_fname); +out2: + putname(type_page); +out1: + putname(dir_page); out: unlock_kernel(); return ret; diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile index 8c3e8e4a9..f5e316534 100644 --- a/arch/sparc/lib/Makefile +++ b/arch/sparc/lib/Makefile @@ -13,10 +13,10 @@ lib.a: $(OBJS) sync .S.s: - $(CPP) -D__ASSEMBLY__ $(AFLAGS) -ansi -DST_DIV0=0x2 $< -o $*.s + $(CPP) $(AFLAGS) -ansi -DST_DIV0=0x2 $< -o $*.s .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -DST_DIV0=0x2 -c $< -o $*.o + $(CC) $(AFLAGS) -ansi -DST_DIV0=0x2 -c $< -o $*.o dep: diff --git a/arch/sparc/math-emu/Makefile b/arch/sparc/math-emu/Makefile index e8880cd07..3c4195085 100644 --- a/arch/sparc/math-emu/Makefile +++ b/arch/sparc/math-emu/Makefile @@ -11,10 +11,10 @@ O_TARGET := math-emu.o O_OBJS := math.o ashldi3.o .S.s: - $(CPP) -D__ASSEMBLY__ $(AFLAGS) -ansi $< -o $*.s + $(CPP) $(AFLAGS) -ansi $< -o $*.s .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c $< -o $*.o + $(CC) $(AFLAGS) -ansi -c $< -o $*.o CFLAGS += -I. -I$(TOPDIR)/include/math-emu -w diff --git a/arch/sparc/mm/Makefile b/arch/sparc/mm/Makefile index 00a4f35d2..440e4fc61 100644 --- a/arch/sparc/mm/Makefile +++ b/arch/sparc/mm/Makefile @@ -7,6 +7,9 @@ # # Note 2! The CFLAGS definition is now in the main makefile... +.S.o: + $(CC) $(AFLAGS) -ansi -c -o $*.o $< + O_TARGET := mm.o O_OBJS := fault.o init.o loadmmu.o generic.o extable.o btfixup.o ifeq ($(CONFIG_SUN4),y) @@ -21,15 +24,3 @@ O_OBJS += sun4c.o endif include $(TOPDIR)/Rules.make - -hypersparc.o: hypersparc.S - $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o hypersparc.o hypersparc.S - -viking.o: viking.S - $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o viking.o viking.S - -tsunami.o: tsunami.S - $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o tsunami.o tsunami.S - -swift.o: swift.S - $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o swift.o swift.S diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c index 6e93111ae..3c8b079c3 100644 --- a/arch/sparc/mm/sun4c.c +++ b/arch/sparc/mm/sun4c.c @@ -2408,20 +2408,16 @@ static pgd_t *sun4c_pgd_alloc(void) */ static void sun4c_vac_alias_fixup(struct vm_area_struct *vma, unsigned long address, pte_t pte) { - struct dentry *dentry = NULL; - struct inode *inode = NULL; pgd_t *pgdp; pte_t *ptep; - if (vma->vm_file) - dentry = vma->vm_file->f_dentry; - if(dentry) - inode = dentry->d_inode; - if(inode) { - struct address_space *mapping = inode->i_mapping; + if (vma->vm_file) { + struct address_space *mapping; unsigned long offset = (address & PAGE_MASK) - vma->vm_start; struct vm_area_struct *vmaring; int alias_found = 0; + + mapping = vma->vm_file->f_dentry->d_inode->i_mapping; spin_lock(&mapping->i_shared_lock); vmaring = mapping->i_mmap; do { diff --git a/arch/sparc64/config.in b/arch/sparc64/config.in index 8f06e836b..27e5549c0 100644 --- a/arch/sparc64/config.in +++ b/arch/sparc64/config.in @@ -1,4 +1,4 @@ -# $Id: config.in,v 1.105 2000/03/24 00:34:11 davem Exp $ +# $Id: config.in,v 1.107 2000/03/29 11:56:51 davem Exp $ # For a description of the syntax of this configuration file, # see the Configure script. # @@ -18,6 +18,8 @@ define_bool CONFIG_VT_CONSOLE y bool 'Symmetric multi-processing support' CONFIG_SMP # Global things across all Sun machines. +define_bool CONFIG_ISA n +define_bool CONFIG_PCMCIA n define_bool CONFIG_SBUS y define_bool CONFIG_SBUSCHAR y define_bool CONFIG_BUSMOUSE y @@ -29,7 +31,6 @@ define_bool CONFIG_SUN_KEYBOARD y define_bool CONFIG_SUN_CONSOLE y define_bool CONFIG_SUN_AUXIO y define_bool CONFIG_SUN_IO y -define_bool CONFIG_ISA n bool 'PCI support' CONFIG_PCI source drivers/pci/Config.in diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig index 4cfd9b565..2f9febcbe 100644 --- a/arch/sparc64/defconfig +++ b/arch/sparc64/defconfig @@ -13,6 +13,8 @@ CONFIG_EXPERIMENTAL=y CONFIG_VT=y CONFIG_VT_CONSOLE=y # CONFIG_SMP is not set +# CONFIG_ISA is not set +# CONFIG_PCMCIA is not set CONFIG_SBUS=y CONFIG_SBUSCHAR=y CONFIG_BUSMOUSE=y @@ -24,7 +26,6 @@ CONFIG_SUN_KEYBOARD=y CONFIG_SUN_CONSOLE=y CONFIG_SUN_AUXIO=y CONFIG_SUN_IO=y -# CONFIG_ISA is not set CONFIG_PCI=y CONFIG_PCI_NAMES=y CONFIG_SUN_OPENPROMFS=m @@ -225,6 +226,7 @@ CONFIG_IDEDMA_PCI_EXPERIMENTAL=y # CONFIG_BLK_DEV_AEC6210 is not set # CONFIG_AEC6210_TUNING is not set # CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_WDC_ALI15X3 is not set # CONFIG_BLK_DEV_AMD7409 is not set # CONFIG_AMD7409_OVERRIDE is not set CONFIG_BLK_DEV_CMD64X=y diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile index 124776f51..5e37c94b4 100644 --- a/arch/sparc64/kernel/Makefile +++ b/arch/sparc64/kernel/Makefile @@ -8,10 +8,10 @@ # Note 2! The CFLAGS definitions are now in the main makefile... .S.s: - $(CPP) -D__ASSEMBLY__ $(AFLAGS) -ansi $< -o $*.s + $(CPP) $(AFLAGS) -ansi $< -o $*.s .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c $< -o $*.o + $(CC) $(AFLAGS) -ansi -c $< -o $*.o all: kernel.o head.o init_task.o @@ -54,7 +54,7 @@ endif head.o: head.S ttable.S itlb_base.S dtlb_base.S dtlb_backend.S dtlb_prot.S \ etrap.S rtrap.S winfixup.S entry.S - $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c $*.S -o $*.o + $(CC) $(AFLAGS) -ansi -c $*.S -o $*.o # # This is just to get the dependencies... @@ -84,7 +84,7 @@ check_asm: dummy @echo "#undef __SMP__" >> tmp.c @echo "#undef CONFIG_SMP" >> tmp.c @echo "#include <linux/sched.h>" >> tmp.c - $(CC) $(CPPFLAGS) -E tmp.c -o tmp.i + $(CPP) $(CPPFLAGS) tmp.c -o tmp.i @echo "/* Automatically generated. Do not edit. */" > check_asm.c @echo "#include <linux/config.h>" >> check_asm.c @echo "#undef __SMP__" >> check_asm.c @@ -113,7 +113,7 @@ check_asm: dummy @echo "#undef CONFIG_SMP" >> tmp.c @echo "#define CONFIG_SMP 1" >> tmp.c @echo "#include <linux/sched.h>" >> tmp.c - $(CC) $(CPPFLAGS) -D__SMP__ -E tmp.c -o tmp.i + $(CPP) $(CPPFLAGS) -D__SMP__ tmp.c -o tmp.i @echo "/* Automatically generated. Do not edit. */" > check_asm.c @echo "#include <linux/config.h>" >> check_asm.c @echo "#undef CONFIG_SMP" >> check_asm.c @@ -138,7 +138,7 @@ check_asm: dummy @rm -f check_asm check_asm.c @echo -e "\n#else /* SPIN_LOCK_DEBUG */\n" >> asm_offsets.h @echo "#include <linux/sched.h>" > tmp.c - $(CC) $(CPPFLAGS) -D__SMP__ -DSPIN_LOCK_DEBUG -E tmp.c -o tmp.i + $(CPP) $(CPPFLAGS) -D__SMP__ -DSPIN_LOCK_DEBUG tmp.c -o tmp.i @echo "/* Automatically generated. Do not edit. */" > check_asm.c @echo "#include <linux/config.h>" >> check_asm.c @echo "#undef CONFIG_SMP" >> check_asm.c diff --git a/arch/sparc64/kernel/dtlb_base.S b/arch/sparc64/kernel/dtlb_base.S index 0f86bc896..72120b563 100644 --- a/arch/sparc64/kernel/dtlb_base.S +++ b/arch/sparc64/kernel/dtlb_base.S @@ -1,4 +1,4 @@ -/* $Id: dtlb_base.S,v 1.5 2000/01/31 04:59:12 davem Exp $ +/* $Id: dtlb_base.S,v 1.7 2000/03/26 09:13:48 davem Exp $ * dtlb_base.S: Front end to DTLB miss replacement strategy. * This is included directly into the trap table. * @@ -56,19 +56,19 @@ be,pn %xcc, 3f ! Yep, special processing srax %g4, VPTE_SHIFT, %g6 ! Create VPTE offset ldxa [%g3 + %g6] ASI_S, %g5 ! Load VPTE -1: brlz,pt %g5, 2f ! Valid, load into TLB +1: brlz,pt %g5, 9f ! Valid, load into TLB and %g5, (_PAGE_PRESENT|_PAGE_READ), %g4 ! Mask readable bits ba,a,pt %xcc, 4f ! Invalid, branch out /* DTLB ** ICACHE line 2: Quick kernel TLB misses */ -3: brgez,a,pn %g4, 1b ! Kernel virtual map? - ldxa [%g3 + %g6] ASI_N, %g5 ! Yep, load k-vpte - srlx %g4, 40, %g5 ! Else compute phys-kpte - andcc %g5, 1, %g0 ! I/O area? - be,pt %xcc, 2f ! Nope, go and load TLB +3: brlz,pt %g4, 9f ! Kernel virtual map? xor %g2, %g4, %g5 ! Finish bit twiddles - ba,pt %xcc, 2f ! Yes, I/O space, back back - xor %g5, (KERN_IOBITS), %g5 ! After set E, clear CP/CV + ldxa [%g3 + %g6] ASI_N, %g5 ! Yep, load k-vpte + ba,pt %xcc, 1b ! Continue tlb reload + nop +9: stxa %g5, [%g0] ASI_DTLB_DATA_IN ! Reload TLB + retry ! Trap return + nop /* DTLB ** ICACHE line 3: winfixups+real_faults */ 4: cmp %g4, (_PAGE_PRESENT|_PAGE_READ) ! Readable page? @@ -81,14 +81,14 @@ mov TLB_TAG_ACCESS, %g4 ! Prepare for fault processing /* DTLB ** ICACHE line 4: padding */ + ldxa [%g4] ASI_DMMU, %g5 ! Load faulting VA page be,pt %xcc, sparc64_realfault_common ! Jump to normal fault handling - ldxa [%g4] ASI_DMMU, %g5 ! And load faulting VA page + mov FAULT_CODE_DTLB, %g4 ! It was read from DTLB ba,a,pt %xcc, winfix_trampoline ! Call window fixup code 5: or %g5, _PAGE_ACCESSED, %g5 ! Indicate reference or %g5, %g4, %g5 ! Set valid stxa %g5, [%g3 + %g6] ASI_S ! Update PTE table (cant trap) -2: stxa %g5, [%g0] ASI_DTLB_DATA_IN ! Reload TLB - retry ! Trap return + ba,a,pt %xcc, 9b ! Complete tlb miss #undef TAG_CONTEXT_BITS #undef VPTE_SHIFT diff --git a/arch/sparc64/kernel/dtlb_prot.S b/arch/sparc64/kernel/dtlb_prot.S index 73f3596e1..5e99d5d47 100644 --- a/arch/sparc64/kernel/dtlb_prot.S +++ b/arch/sparc64/kernel/dtlb_prot.S @@ -1,4 +1,4 @@ -/* $Id: dtlb_prot.S,v 1.19 2000/01/31 04:59:12 davem Exp $ +/* $Id: dtlb_prot.S,v 1.20 2000/03/26 09:13:48 davem Exp $ * dtlb_prot.S: DTLB protection trap strategy. * This is included directly into the trap table. * @@ -40,15 +40,15 @@ /* PROT ** ICACHE line 3: Real user faults */ 1: rdpr %pstate, %g5 ! Move into alternate globals wrpr %g5, PSTATE_AG|PSTATE_MG, %pstate - rdpr %tl, %g4 ! Need to do a winfixup? - cmp %g4, 1 ! Trap level >1? + rdpr %tl, %g1 ! Need to do a winfixup? + cmp %g1, 1 ! Trap level >1? mov TLB_TAG_ACCESS, %g4 ! Prepare reload of vaddr bgu,pn %xcc, winfix_trampoline ! Yes, perform winfixup ldxa [%g4] ASI_DMMU, %g5 ! Put tagaccess in %g5 ba,pt %xcc, sparc64_realfault_common ! Nope, normal fault /* PROT ** ICACHE line 4: More real fault processing */ - mov 1, %g4 ! Indicate this was a write + mov FAULT_CODE_DTLB | FAULT_CODE_WRITE, %g4 nop nop nop diff --git a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c index 903bcf445..f64422a0e 100644 --- a/arch/sparc64/kernel/ebus.c +++ b/arch/sparc64/kernel/ebus.c @@ -1,4 +1,4 @@ -/* $Id: ebus.c,v 1.46 1999/11/19 05:52:48 davem Exp $ +/* $Id: ebus.c,v 1.47 2000/03/25 05:18:10 davem Exp $ * ebus.c: PCI to EBus bridge device. * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -278,7 +278,6 @@ void __init ebus_init(void) struct linux_ebus *ebus; struct pci_dev *pdev; struct pcidev_cookie *cookie; - unsigned short pci_command; int nd, ebusnd; int num_ebus = 0; @@ -328,17 +327,6 @@ void __init ebus_init(void) ebus->self = pdev; ebus->parent = pbm = cookie->pbm; - /* Enable BUS Master. */ - pci_read_config_word(pdev, PCI_COMMAND, &pci_command); - pci_command |= PCI_COMMAND_MASTER; - pci_write_config_word(pdev, PCI_COMMAND, pci_command); - - /* Set reasonable cache line size and latency timer values. */ - pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 64); - - /* NOTE: Cache line size is in 32-bit word units. */ - pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, 64/sizeof(u32)); - ebus_ranges_init(ebus); ebus_intmap_init(ebus); diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S index 2ab8b70d4..529703dfc 100644 --- a/arch/sparc64/kernel/entry.S +++ b/arch/sparc64/kernel/entry.S @@ -1,4 +1,4 @@ -/* $Id: entry.S,v 1.113 2000/03/06 22:33:42 davem Exp $ +/* $Id: entry.S,v 1.115 2000/03/29 09:55:30 davem Exp $ * arch/sparc64/kernel/entry.S: Sparc64 trap low-level entry points. * * Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu) @@ -998,12 +998,12 @@ linux_sparc_syscall32: mov %i5, %o5 ! IEU1 srl %i2, 0, %o2 ! IEU0 Group - mov %i0, %l5 ! IEU1 - andcc %l0, 0x20, %g0 ! IEU1 Group + andcc %l0, 0x20, %g0 ! IEU0 Group bne,pn %icc, linux_syscall_trace32 ! CTI - srl %i3, 0, %o3 ! IEU0 + mov %i0, %l5 ! IEU1 call %l7 ! CTI Group brk forced - add %o7, 3f-.-4, %o7 ! IEU0 + srl %i3, 0, %o3 ! IEU0 + ba,a,pt %xcc, 3f /* Linux native and SunOS system calls enter here... */ .align 32 @@ -1032,30 +1032,31 @@ linux_sparc_syscall: mov %i0, %l5 ! IEU0 2: call %l7 ! CTI Group brk forced mov %i5, %o5 ! IEU0 + nop + 3: stx %o0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0] ret_sys_call: #ifdef SYSCALL_TRACING call syscall_trace_exit add %sp, STACK_BIAS + REGWIN_SZ, %o1 #endif - ldx [%curptr + AOFF_task_flags], %l6 + ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TSTATE], %g3 + ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TNPC], %l1 ! pc = npc sra %o0, 0, %o0 mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2 - ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TSTATE], %g3 cmp %o0, -ENOIOCTLCMD sllx %g2, 32, %g2 bgeu,pn %xcc, 1f - andcc %l6, 0x20, %l6 - /* System call success, clear Carry condition code. */ - andn %g3, %g2, %g3 + andcc %l0, 0x20, %l6 + andn %g3, %g2, %g3 /* System call success, clear Carry condition code. */ stx %g3, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TSTATE] bne,pn %icc, linux_syscall_trace2 - ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TNPC], %l1 ! pc = npc - add %l1, 0x4, %l2 !npc = npc+4 + add %l1, 0x4, %l2 ! npc = npc+4 stx %l1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TPC] - b,pt %xcc, rtrap_clr_l6 + ba,pt %xcc, rtrap_clr_l6 stx %l2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TNPC] + 1: /* System call failure, set Carry condition code. * Also, get abs(errno) to return to the process. @@ -1066,15 +1067,14 @@ ret_sys_call: mov 1, %l6 stx %g3, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TSTATE] bne,pn %icc, linux_syscall_trace2 - ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TNPC], %l1 ! pc = npc - add %l1, 0x4, %l2 !npc = npc+4 - + add %l1, 0x4, %l2 !npc = npc+4 stx %l1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TPC] + b,pt %xcc, rtrap stx %l2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TNPC] linux_syscall_trace2: call syscall_trace - add %l1, 0x4, %l2 /* npc = npc+4 */ + nop stx %l1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TPC] ba,pt %xcc, rtrap stx %l2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_TNPC] @@ -1082,6 +1082,9 @@ linux_syscall_trace2: .align 32 .globl __flushw_user __flushw_user: + rdpr %otherwin, %g1 + brz,pn %g1, 2f + clr %g2 1: save %sp, -128, %sp rdpr %otherwin, %g1 brnz,pt %g1, 1b @@ -1090,4 +1093,4 @@ __flushw_user: brnz,pt %g2, 1b restore %g0, %g0, %g0 2: retl - mov %g3, %o7 + nop diff --git a/arch/sparc64/kernel/etrap.S b/arch/sparc64/kernel/etrap.S index d243a43b3..b0a8f766d 100644 --- a/arch/sparc64/kernel/etrap.S +++ b/arch/sparc64/kernel/etrap.S @@ -1,4 +1,4 @@ -/* $Id: etrap.S,v 1.42 1999/07/30 09:35:18 davem Exp $ +/* $Id: etrap.S,v 1.43 2000/03/29 09:55:30 davem Exp $ * etrap.S: Preparing for entry into the kernel on Sparc V9. * * Copyright (C) 1996, 1997 David S. Miller (davem@caip.rutgers.edu) @@ -13,6 +13,8 @@ #include <asm/head.h> #define TASK_REGOFF ((PAGE_SIZE<<1)-TRACEREG_SZ-REGWIN_SZ) +#define ETRAP_PSTATE1 (PSTATE_RMO | PSTATE_PRIV) +#define ETRAP_PSTATE2 (PSTATE_RMO | PSTATE_PEF | PSTATE_PRIV | PSTATE_IE) /* * On entry, %g7 is return address - 0x4. @@ -20,148 +22,167 @@ */ .text - .align 32 - .globl etrap, etrap_irq, etraptl1 - .globl scetrap - -etrap: rdpr %pil, %g2 ! Single Group -etrap_irq: rdpr %tstate, %g1 ! Single Group - sllx %g2, 20, %g3 ! IEU0 Group - andcc %g1, TSTATE_PRIV, %g0 ! IEU1 - or %g1, %g3, %g1 ! IEU0 Group - bne,a,pn %xcc, 1f ! CTI - sub %sp, REGWIN_SZ + TRACEREG_SZ - STACK_BIAS, %g2 ! IEU1 - sethi %hi(TASK_REGOFF), %g2 ! IEU0 Group - sethi %hi(TSTATE_PEF), %g3 ! IEU1 - or %g2, %lo(TASK_REGOFF), %g2 ! IEU0 Group - and %g1, %g3, %g3 ! IEU1 - brnz,pn %g3, 1f ! CTI+IEU1 Group - add %g6, %g2, %g2 ! IEU0 - wr %g0, 0, %fprs ! Single Group+4bubbles -1: rdpr %tpc, %g3 ! Single Group - stx %g1, [%g2 + REGWIN_SZ + PT_V9_TSTATE] ! Store Group - rdpr %tnpc, %g1 ! Single Group - stx %g3, [%g2 + REGWIN_SZ + PT_V9_TPC] ! Store Group - rd %y, %g3 ! Single Group+4bubbles - stx %g1, [%g2 + REGWIN_SZ + PT_V9_TNPC] ! Store Group - st %g3, [%g2 + REGWIN_SZ + PT_V9_Y] ! Store Group - save %g2, -STACK_BIAS, %sp ! The ordering here is ! Single Group - rdpr %pstate, %g1 ! critical, see winfixup ! Single Group+9bubbles - andn %g6, 0x1f, %l6 ! IEU0 Group - bne,pn %xcc, 3f ! CTI - mov PRIMARY_CONTEXT, %l4 ! IEU1 - rdpr %canrestore, %g3 ! Single Group+4bubbles - rdpr %wstate, %g2 ! Single Group+4bubbles - wrpr %g0, 7, %cleanwin ! Single Group+4bubbles - wrpr %g0, 0, %canrestore ! Single Group+4bubbles - sll %g2, 3, %g2 ! IEU0 Group - mov 1, %l5 ! IEU1 - stb %l5, [%l6 + AOFF_task_thread + AOFF_thread_fpdepth] ! Store - wrpr %g3, 0, %otherwin ! Single Group+4bubbles - wrpr %g2, 0, %wstate ! Single Group+4bubbles - stxa %g0, [%l4] ASI_DMMU ! Store Group - flush %l6 ! Single Group+9bubbles - wr %g0, ASI_AIUS, %asi ! Single Group+4bubbles -2: wrpr %g0, 0x0, %tl ! Single Group+4bubbles - andn %g1, PSTATE_MM, %l1 ! IEU0 Group - mov %g4, %l4 ! IEU1 - mov %g5, %l5 ! IEU0 Group - mov %g7, %l2 ! IEU1 - wrpr %l1, (PSTATE_AG|PSTATE_RMO), %pstate ! Single Group+4bubbles - stx %g1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G1] ! Store Group - stx %g2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G2] ! Store Group - stx %g3, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G3] ! Store Group - stx %g4, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G4] ! Store Group - stx %g5, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G5] ! Store Group - stx %g6, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G6] ! Store Group - stx %g7, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G7] ! Store Group - stx %i0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0] ! Store Group - stx %i1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I1] ! Store Group - stx %i2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I2] ! Store Group - stx %i3, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I3] ! Store Group - stx %i4, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I4] ! Store Group - sethi %uhi(PAGE_OFFSET), %g4 ! IEU0 - stx %i5, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I5] ! Store Group - stx %i6, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I6] ! Store Group - sllx %g4, 32, %g4 ! IEU0 - stx %i7, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I7] ! Store Group - wrpr %l1, (PSTATE_IE|PSTATE_AG|PSTATE_RMO), %pstate ! Single Group+4bubbles - jmpl %l2 + 0x4, %g0 ! CTI Group - mov %l6, %g6 ! IEU0 - -3: ldub [%l6 + AOFF_task_thread + AOFF_thread_fpdepth], %l5 ! Load Group - add %l6, AOFF_task_thread + AOFF_thread_fpsaved + 1, %l4 ! IEU0 - srl %l5, 1, %l3 ! IEU0 Group - add %l5, 2, %l5 ! IEU1 - stb %l5, [%l6 + AOFF_task_thread + AOFF_thread_fpdepth] ! Store - ba,pt %xcc, 2b ! CTI - stb %g0, [%l4 + %l3] ! Store Group - -etraptl1: rdpr %tstate, %g1 ! Single Group+4bubbles - sub %sp, REGWIN_SZ + TRACEREG_SZ - STACK_BIAS, %g2 ! IEU1 - ba,pt %xcc, 1b ! CTI Group - andcc %g1, TSTATE_PRIV, %g0 ! IEU0 - -scetrap: rdpr %pil, %g2 ! Single Group - rdpr %tstate, %g1 ! Single Group - sllx %g2, 20, %g3 ! IEU0 Group - andcc %g1, TSTATE_PRIV, %g0 ! IEU1 - or %g1, %g3, %g1 ! IEU0 Group - bne,a,pn %xcc, 1f ! CTI - sub %sp, REGWIN_SZ + TRACEREG_SZ - STACK_BIAS, %g2 ! IEU1 - sethi %hi(TASK_REGOFF), %g2 ! IEU0 Group - sethi %hi(TSTATE_PEF), %g3 ! IEU1 - or %g2, %lo(TASK_REGOFF), %g2 ! IEU0 Group - and %g1, %g3, %g3 ! IEU1 - brnz,pn %g3, 1f ! CTI+IEU1 Group - add %g6, %g2, %g2 ! IEU0 - wr %g0, 0, %fprs ! Single Group+4bubbles -1: rdpr %tpc, %g3 ! Single Group - stx %g1, [%g2 + REGWIN_SZ + PT_V9_TSTATE] ! Store Group - rdpr %tnpc, %g1 ! Single Group - stx %g3, [%g2 + REGWIN_SZ + PT_V9_TPC] ! Store Group - stx %g1, [%g2 + REGWIN_SZ + PT_V9_TNPC] ! Store Group - st %g0, [%g2 + REGWIN_SZ + PT_V9_Y] ! Store Group - save %g2, -STACK_BIAS, %sp ! The ordering here is ! Single Group - rdpr %pstate, %g1 ! critical, see winfixup ! Single Group+9bubbles - andn %g6, 0x1f, %l6 ! IEU0 Group - bne,pn %xcc, 2f ! CTI - mov PRIMARY_CONTEXT, %l4 ! IEU1 - rdpr %canrestore, %g3 ! Single Group+4bubbles - rdpr %wstate, %g2 ! Single Group+4bubbles - wrpr %g0, 7, %cleanwin ! Single Group+4bubbles - wrpr %g0, 0, %canrestore ! Single Group+4bubbles - sll %g2, 3, %g2 ! IEU0 Group - wrpr %g3, 0, %otherwin ! Single Group+4bubbles - wrpr %g2, 0, %wstate ! Single Group+4bubbles - stxa %g0, [%l4] ASI_DMMU ! Store Group - flush %l6 ! Single Group+9bubbles - wr %g0, ASI_AIUS, %asi ! Single Group+4bubbles -2: wrpr %g0, 0x0, %tl ! Single Group+4bubbles - andn %g1, PSTATE_MM, %l1 ! IEU0 Group - mov %g4, %l4 ! IEU1 - mov %g5, %l5 ! IEU0 Group - mov %g7, %l2 ! IEU1 - wrpr %l1, (PSTATE_AG|PSTATE_RMO), %pstate ! Single Group+4bubbles - stx %g1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G1] ! Store Group - stx %g2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G2] ! Store Group - stx %g3, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G3] ! Store Group - stx %g4, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G4] ! Store Group - stx %g5, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G5] ! Store Group - stx %g6, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G6] ! Store Group - stx %g7, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G7] ! Store Group - stx %i0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0] ! Store Group - stx %i1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I1] ! Store Group - stx %i2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I2] ! Store Group - stx %i3, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I3] ! Store Group - stx %i4, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I4] ! Store Group - sethi %uhi(PAGE_OFFSET), %g4 ! IEU0 - stx %i5, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I5] ! Store Group - stx %i6, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I6] ! Store Group - sllx %g4, 32, %g4 ! IEU0 - stx %i7, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I7] ! Store Group - wrpr %l1, (PSTATE_IE|PSTATE_AG|PSTATE_RMO), %pstate ! Single Group+4bubbles - jmpl %l2 + 0x4, %g0 ! CTI Group - mov %l6, %g6 ! IEU0 + .align 64 + .globl etrap, etrap_irq, etraptl1 + +etrap: rdpr %pil, %g2 ! Single Group +etrap_irq: rdpr %tstate, %g1 ! Single Group + sllx %g2, 20, %g3 ! IEU0 Group + andcc %g1, TSTATE_PRIV, %g0 ! IEU1 + or %g1, %g3, %g1 ! IEU0 Group + bne,pn %xcc, 1f ! CTI + sub %sp, REGWIN_SZ+TRACEREG_SZ-STACK_BIAS, %g2 ! IEU1 + wrpr %g0, 7, %cleanwin ! Single Group+4bubbles + + sethi %hi(TASK_REGOFF), %g2 ! IEU0 Group + sethi %hi(TSTATE_PEF), %g3 ! IEU1 + or %g2, %lo(TASK_REGOFF), %g2 ! IEU0 Group + and %g1, %g3, %g3 ! IEU1 + brnz,pn %g3, 1f ! CTI+IEU1 Group + add %g6, %g2, %g2 ! IEU0 + wr %g0, 0, %fprs ! Single Group+4bubbles +1: rdpr %tpc, %g3 ! Single Group + + stx %g1, [%g2 + REGWIN_SZ + PT_V9_TSTATE] ! Store Group + rdpr %tnpc, %g1 ! Single Group + stx %g3, [%g2 + REGWIN_SZ + PT_V9_TPC] ! Store Group + rd %y, %g3 ! Single Group+4bubbles + stx %g1, [%g2 + REGWIN_SZ + PT_V9_TNPC] ! Store Group + st %g3, [%g2 + REGWIN_SZ + PT_V9_Y] ! Store Group + save %g2, -STACK_BIAS, %sp ! Ordering here is critical ! Single Group + mov %g6, %l6 ! IEU0 Group + + bne,pn %xcc, 3f ! CTI + mov PRIMARY_CONTEXT, %l4 ! IEU1 + rdpr %canrestore, %g3 ! Single Group+4bubbles + rdpr %wstate, %g2 ! Single Group+4bubbles + wrpr %g0, 0, %canrestore ! Single Group+4bubbles + sll %g2, 3, %g2 ! IEU0 Group + mov 1, %l5 ! IEU1 + stb %l5, [%l6 + AOFF_task_thread + AOFF_thread_fpdepth] ! Store + + wrpr %g3, 0, %otherwin ! Single Group+4bubbles + wrpr %g2, 0, %wstate ! Single Group+4bubbles + stxa %g0, [%l4] ASI_DMMU ! Store Group + flush %l6 ! Single Group+9bubbles + wr %g0, ASI_AIUS, %asi ! Single Group+4bubbles +2: wrpr %g0, 0x0, %tl ! Single Group+4bubbles + mov %g4, %l4 ! IEU1 + mov %g5, %l5 ! IEU0 Group + + mov %g7, %l2 ! IEU1 + wrpr %g0, ETRAP_PSTATE1, %pstate ! Single Group+4bubbles + stx %g1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G1] ! Store Group + stx %g2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G2] ! Store Group + stx %g3, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G3] ! Store Group + stx %g4, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G4] ! Store Group + stx %g5, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G5] ! Store Group + stx %g6, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G6] ! Store Group + + stx %g7, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G7] ! Store Group + stx %i0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0] ! Store Group + stx %i1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I1] ! Store Group + stx %i2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I2] ! Store Group + stx %i3, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I3] ! Store Group + stx %i4, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I4] ! Store Group + sethi %uhi(PAGE_OFFSET), %g4 ! IEU0 + stx %i5, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I5] ! Store Group + + stx %i6, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I6] ! Store Group + sllx %g4, 32, %g4 ! IEU0 + stx %i7, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I7] ! Store Group + wrpr %g0, ETRAP_PSTATE2, %pstate ! Single Group+4bubbles + jmpl %l2 + 0x4, %g0 ! CTI Group + mov %l6, %g6 ! IEU0 + nop + nop + +3: ldub [%l6 + AOFF_task_thread + AOFF_thread_fpdepth], %l5 ! Load Group + add %l6, AOFF_task_thread + AOFF_thread_fpsaved + 1, %l4 ! IEU0 + srl %l5, 1, %l3 ! IEU0 Group + add %l5, 2, %l5 ! IEU1 + stb %l5, [%l6 + AOFF_task_thread + AOFF_thread_fpdepth] ! Store + ba,pt %xcc, 2b ! CTI + stb %g0, [%l4 + %l3] ! Store Group + nop + +etraptl1: rdpr %tstate, %g1 ! Single Group+4bubbles + sub %sp, REGWIN_SZ + TRACEREG_SZ - STACK_BIAS, %g2 ! IEU1 + ba,pt %xcc, 1b ! CTI Group + andcc %g1, TSTATE_PRIV, %g0 ! IEU0 + + .align 64 + .globl scetrap +scetrap: rdpr %pil, %g2 ! Single Group + rdpr %tstate, %g1 ! Single Group + sllx %g2, 20, %g3 ! IEU0 Group + andcc %g1, TSTATE_PRIV, %g0 ! IEU1 + or %g1, %g3, %g1 ! IEU0 Group + bne,pn %xcc, 1f ! CTI + sub %sp, (REGWIN_SZ+TRACEREG_SZ-STACK_BIAS), %g2 ! IEU1 + wrpr %g0, 7, %cleanwin ! Single Group+4bubbles + + sllx %g1, 51, %g3 ! IEU0 Group + sethi %hi(TASK_REGOFF), %g2 ! IEU1 + or %g2, %lo(TASK_REGOFF), %g2 ! IEU0 Group + brlz,pn %g3, 1f ! CTI+IEU1 + add %g6, %g2, %g2 ! IEU0 Group + wr %g0, 0, %fprs ! Single Group+4bubbles +1: rdpr %tpc, %g3 ! Single Group + stx %g1, [%g2 + REGWIN_SZ + PT_V9_TSTATE] ! Store Group + + rdpr %tnpc, %g1 ! Single Group + stx %g3, [%g2 + REGWIN_SZ + PT_V9_TPC] ! Store Group + stx %g1, [%g2 + REGWIN_SZ + PT_V9_TNPC] ! Store Group + save %g2, -STACK_BIAS, %sp ! Ordering here is critical ! Single Group + mov %g6, %l6 ! IEU0 Group + bne,pn %xcc, 2f ! CTI + mov ASI_P, %l7 ! IEU1 + rdpr %canrestore, %g3 ! Single Group+4bubbles + + rdpr %wstate, %g2 ! Single Group+4bubbles + wrpr %g0, 0, %canrestore ! Single Group+4bubbles + sll %g2, 3, %g2 ! IEU0 Group + mov PRIMARY_CONTEXT, %l4 ! IEU1 + wrpr %g3, 0, %otherwin ! Single Group+4bubbles + wrpr %g2, 0, %wstate ! Single Group+4bubbles + stxa %g0, [%l4] ASI_DMMU ! Store + flush %l6 ! Single Group+9bubbles + + mov ASI_AIUS, %l7 ! IEU0 Group +2: mov %g4, %l4 ! IEU1 + mov %g5, %l5 ! IEU0 Group + add %g7, 0x4, %l2 ! IEU1 + wrpr %g0, ETRAP_PSTATE1, %pstate ! Single Group+4bubbles + stx %g1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G1] ! Store Group + stx %g2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G2] ! Store Group + sllx %l7, 24, %l7 ! IEU0 + + stx %g3, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G3] ! Store Group + rdpr %cwp, %l0 ! Single Group + stx %g4, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G4] ! Store Group + stx %g5, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G5] ! Store Group + stx %g6, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G6] ! Store Group + stx %g7, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G7] ! Store Group + or %l7, %l0, %l7 ! IEU0 + sethi %hi(TSTATE_RMO | TSTATE_PEF), %l0 ! IEU1 + + or %l7, %l0, %l7 ! IEU0 Group + wrpr %l2, %tnpc ! Single Group+4bubbles + wrpr %l7, (TSTATE_PRIV | TSTATE_IE), %tstate ! Single Group+4bubbles + stx %i0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0] ! Store Group + stx %i1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I1] ! Store Group + stx %i2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I2] ! Store Group + stx %i3, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I3] ! Store Group + stx %i4, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I4] ! Store Group + + sethi %uhi(PAGE_OFFSET), %g4 ! IEU0 + stx %i5, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I5] ! Store Group + stx %i6, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I6] ! Store Group + sllx %g4, 32, %g4 ! IEU0 + mov %l6, %g6 ! IEU1 + stx %i7, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I7] ! Store Group + done + nop #undef TASK_REGOFF diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c index 254e2eb8a..ef07fca85 100644 --- a/arch/sparc64/kernel/ioctl32.c +++ b/arch/sparc64/kernel/ioctl32.c @@ -1,4 +1,4 @@ -/* $Id: ioctl32.c,v 1.85 2000/03/23 05:25:41 davem Exp $ +/* $Id: ioctl32.c,v 1.87 2000/03/30 02:09:07 davem Exp $ * ioctl32.c: Conversion between 32bit and 64bit native ioctls. * * Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com) @@ -2716,6 +2716,25 @@ COMPATIBLE_IOCTL(SG_GET_TIMEOUT) COMPATIBLE_IOCTL(SG_EMULATED_HOST) COMPATIBLE_IOCTL(SG_SET_TRANSFORM) COMPATIBLE_IOCTL(SG_GET_TRANSFORM) +COMPATIBLE_IOCTL(SG_SET_RESERVED_SIZE) +COMPATIBLE_IOCTL(SG_GET_RESERVED_SIZE) +COMPATIBLE_IOCTL(SG_GET_SCSI_ID) +COMPATIBLE_IOCTL(SG_SET_FORCE_LOW_DMA) +COMPATIBLE_IOCTL(SG_GET_LOW_DMA) +COMPATIBLE_IOCTL(SG_SET_FORCE_PACK_ID) +COMPATIBLE_IOCTL(SG_GET_PACK_ID) +COMPATIBLE_IOCTL(SG_GET_NUM_WAITING) +COMPATIBLE_IOCTL(SG_SET_DEBUG) +COMPATIBLE_IOCTL(SG_GET_SG_TABLESIZE) +COMPATIBLE_IOCTL(SG_GET_COMMAND_Q) +COMPATIBLE_IOCTL(SG_SET_COMMAND_Q) +COMPATIBLE_IOCTL(SG_GET_VERSION_NUM) +COMPATIBLE_IOCTL(SG_NEXT_CMD_LEN) +COMPATIBLE_IOCTL(SG_SCSI_RESET) +COMPATIBLE_IOCTL(SG_IO) +COMPATIBLE_IOCTL(SG_GET_REQUEST_TABLE) +COMPATIBLE_IOCTL(SG_SET_KEEP_ORPHAN) +COMPATIBLE_IOCTL(SG_GET_KEEP_ORPHAN) /* PPP stuff */ COMPATIBLE_IOCTL(PPPIOCGFLAGS) COMPATIBLE_IOCTL(PPPIOCSFLAGS) diff --git a/arch/sparc64/kernel/itlb_base.S b/arch/sparc64/kernel/itlb_base.S index 4ef509731..7f0da3d14 100644 --- a/arch/sparc64/kernel/itlb_base.S +++ b/arch/sparc64/kernel/itlb_base.S @@ -1,4 +1,4 @@ -/* $Id: itlb_base.S,v 1.8 2000/01/31 04:59:12 davem Exp $ +/* $Id: itlb_base.S,v 1.9 2000/03/26 09:13:48 davem Exp $ * itlb_base.S: Front end to ITLB miss replacement strategy. * This is included directly into the trap table. * @@ -40,25 +40,25 @@ /* ITLB ** ICACHE line 3: Real faults */ rdpr %tpc, %g5 ! And load faulting VA - clr %g4 ! It was read + mov FAULT_CODE_ITLB, %g4 ! It was read from ITLB sparc64_realfault_common: ! Called by TL0 dtlb_miss too - sethi %hi(1f), %g7 ! Save state - ba,pt %xcc, etrap ! ... -1: or %g7, %lo(1b), %g7 ! ... - mov %l4, %o2 ! Read/Write/No idea - srlx %l5, PAGE_SHIFT, %o1 ! Page align faulting VA - add %sp, STACK_BIAS + REGWIN_SZ, %o0! Compute pt_regs arg - -/* ITLB ** ICACHE line 4: Call fault processing code */ + stb %g4, [%g6 + AOFF_task_thread + AOFF_thread_fault_code] + stx %g5, [%g6 + AOFF_task_thread + AOFF_thread_fault_address] + ba,pt %xcc, etrap ! Save state +1: rd %pc, %g7 ! ... call do_sparc64_fault ! Call fault handler - sllx %o1, PAGE_SHIFT, %o1 ! Finish page alignment - ba,a,pt %xcc, rtrap_clr_l6 ! Restore cpu state - nop + add %sp, STACK_BIAS + REGWIN_SZ, %o0! Compute pt_regs arg + +/* ITLB ** ICACHE line 4: Finish faults + window fixups */ + ba,pt %xcc, rtrap_clr_l6 ! Restore cpu state + nop winfix_trampoline: rdpr %tpc, %g3 ! Prepare winfixup TNPC or %g3, 0x7c, %g3 ! Compute offset to branch wrpr %g3, %tnpc ! Write it into TNPC done ! Do it to it + nop + nop #undef TAG_CONTEXT_BITS #undef VPTE_SHIFT diff --git a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c index 154ee0181..98b41d079 100644 --- a/arch/sparc64/kernel/pci_common.c +++ b/arch/sparc64/kernel/pci_common.c @@ -1,4 +1,4 @@ -/* $Id: pci_common.c,v 1.6 2000/01/06 23:51:49 davem Exp $ +/* $Id: pci_common.c,v 1.7 2000/03/25 05:18:11 davem Exp $ * pci_common.c: PCI controller common support. * * Copyright (C) 1999 David S. Miller (davem@redhat.com) @@ -565,6 +565,165 @@ void __init pci_fixup_irq(struct pci_pbm_info *pbm, pci_fixup_irq(pbm, pci_bus_b(walk)); } +#undef DEBUG_BUSMASTERING + +static void pdev_setup_busmastering(struct pci_dev *pdev, int is_66mhz) +{ + u16 cmd; + u8 hdr_type, min_gnt, ltimer; + +#ifdef DEBUG_BUSMASTERING + printk("PCI: Checking DEV(%s), ", pdev->name); +#endif + + pci_read_config_word(pdev, PCI_COMMAND, &cmd); + cmd |= PCI_COMMAND_MASTER; + pci_write_config_word(pdev, PCI_COMMAND, cmd); + + /* Read it back, if the mastering bit did not + * get set, the device does not support bus + * mastering so we have nothing to do here. + */ + pci_read_config_word(pdev, PCI_COMMAND, &cmd); + if ((cmd & PCI_COMMAND_MASTER) == 0) { +#ifdef DEBUG_BUSMASTERING + printk("no bus mastering...\n"); +#endif + return; + } + + /* Set correct cache line size, 64-byte on all + * Sparc64 PCI systems. Note that the value is + * measured in 32-bit words. + */ +#ifdef DEBUG_BUSMASTERING + printk("set cachelinesize, "); +#endif + pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, + 64 / sizeof(u32)); + + pci_read_config_byte(pdev, PCI_HEADER_TYPE, &hdr_type); + hdr_type &= ~0x80; + if (hdr_type != PCI_HEADER_TYPE_NORMAL) { +#ifdef DEBUG_BUSMASTERING + printk("hdr_type=%x, exit\n", hdr_type); +#endif + return; + } + + /* If the latency timer is already programmed with a non-zero + * value, assume whoever set it (OBP or whoever) knows what + * they are doing. + */ + pci_read_config_byte(pdev, PCI_LATENCY_TIMER, <imer); + if (ltimer != 0) { +#ifdef DEBUG_BUSMASTERING + printk("ltimer was %x, exit\n", ltimer); +#endif + return; + } + + /* XXX Since I'm tipping off the min grant value to + * XXX choose a suitable latency timer value, I also + * XXX considered making use of the max latency value + * XXX as well. Unfortunately I've seen too many bogusly + * XXX low settings for it to the point where it lacks + * XXX any usefulness. In one case, an ethernet card + * XXX claimed a min grant of 10 and a max latency of 5. + * XXX Now, if I had two such cards on the same bus I + * XXX could not set the desired burst period (calculated + * XXX from min grant) without violating the max latency + * XXX bound. Duh... + * XXX + * XXX I blame dumb PC bios implementors for stuff like + * XXX this, most of them don't even try to do something + * XXX sensible with latency timer values and just set some + * XXX default value (usually 32) into every device. + */ + + pci_read_config_byte(pdev, PCI_MIN_GNT, &min_gnt); + + if (min_gnt == 0) { + /* If no min_gnt setting then use a default + * value. + */ + if (is_66mhz) + ltimer = 16; + else + ltimer = 32; + } else { + int shift_factor; + + if (is_66mhz) + shift_factor = 2; + else + shift_factor = 3; + + /* Use a default value when the min_gnt value + * is erroneously high. + */ + if (((unsigned int) min_gnt << shift_factor) > 512 || + ((min_gnt << shift_factor) & 0xff) == 0) { + ltimer = 8 << shift_factor; + } else { + ltimer = min_gnt << shift_factor; + } + } + + pci_write_config_byte(pdev, PCI_LATENCY_TIMER, ltimer); +#ifdef DEBUG_BUSMASTERING + printk("set ltimer to %x\n", ltimer); +#endif +} + +void pci_determine_66mhz_disposition(struct pci_pbm_info *pbm, + struct pci_bus *pbus) +{ + struct list_head *walk; + int all_are_66mhz; + u16 status; + + if (pbm->is_66mhz_capable == 0) { + all_are_66mhz = 0; + goto out; + } + + walk = &pbus->devices; + all_are_66mhz = 1; + for (walk = walk->next; walk != &pbus->devices; walk = walk->next) { + struct pci_dev *pdev = pci_dev_b(walk); + + pci_read_config_word(pdev, PCI_STATUS, &status); + if (!(status & PCI_STATUS_66MHZ)) { + all_are_66mhz = 0; + break; + } + } +out: + pbm->all_devs_66mhz = all_are_66mhz; + + printk("PCI%d(PBM%c): Bus running at %dMHz\n", + pbm->parent->index, + (pbm == &pbm->parent->pbm_A) ? 'A' : 'B', + (all_are_66mhz ? 66 : 33)); +} + +void pci_setup_busmastering(struct pci_pbm_info *pbm, + struct pci_bus *pbus) +{ + struct list_head *walk = &pbus->devices; + int is_66mhz; + + is_66mhz = pbm->is_66mhz_capable && pbm->all_devs_66mhz; + + for (walk = walk->next; walk != &pbus->devices; walk = walk->next) + pdev_setup_busmastering(pci_dev_b(walk), is_66mhz); + + walk = &pbus->children; + for (walk = walk->next; walk != &pbus->children; walk = walk->next) + pci_setup_busmastering(pbm, pci_bus_b(walk)); +} + /* Generic helper routines for PCI error reporting. */ void pci_scan_for_target_abort(struct pci_controller_info *p, struct pci_pbm_info *pbm, diff --git a/arch/sparc64/kernel/pci_impl.h b/arch/sparc64/kernel/pci_impl.h index eeda574f7..54a8952b8 100644 --- a/arch/sparc64/kernel/pci_impl.h +++ b/arch/sparc64/kernel/pci_impl.h @@ -1,4 +1,4 @@ -/* $Id: pci_impl.h,v 1.5 2000/02/08 05:11:32 jj Exp $ +/* $Id: pci_impl.h,v 1.6 2000/03/25 05:18:11 davem Exp $ * pci_impl.h: Helper definitions for PCI controller support. * * Copyright (C) 1999 David S. Miller (davem@redhat.com) @@ -28,6 +28,10 @@ extern void pci_assign_unassigned(struct pci_pbm_info *pbm, struct pci_bus *pbus); extern void pci_fixup_irq(struct pci_pbm_info *pbm, struct pci_bus *pbus); +extern void pci_determine_66mhz_disposition(struct pci_pbm_info *pbm, + struct pci_bus *pbus); +extern void pci_setup_busmastering(struct pci_pbm_info *pbm, + struct pci_bus *pbus); /* Error reporting support. */ extern void pci_scan_for_target_abort(struct pci_controller_info *, struct pci_pbm_info *, struct pci_bus *); diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c index 1c8f59f3f..a45fe4740 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.14 2000/03/10 02:42:15 davem Exp $ +/* $Id: pci_psycho.c,v 1.15 2000/03/25 05:18:11 davem Exp $ * pci_psycho.c: PSYCHO/U2P specific PCI controller support. * * Copyright (C) 1997, 1998, 1999 David S. Miller (davem@caipfs.rutgers.edu) @@ -1193,6 +1193,23 @@ static void __init pbm_bridge_reconfigure(struct pci_controller_info *p) pbm_renumber(&p->pbm_A, 0xff); } +static void __init pbm_config_busmastering(struct pci_pbm_info *pbm) +{ + u8 *addr; + + /* Set cache-line size to 64 bytes, this is actually + * a nop but I do it for completeness. + */ + addr = psycho_pci_config_mkaddr(pbm, pbm->pci_first_busno, + 0, PCI_CACHE_LINE_SIZE); + pci_config_write8(addr, 64 / sizeof(u32)); + + /* Set PBM latency timer to 64 PCI clocks. */ + addr = psycho_pci_config_mkaddr(pbm, pbm->pci_first_busno, + 0, PCI_LATENCY_TIMER); + pci_config_write8(addr, 64); +} + static void __init pbm_scan_bus(struct pci_controller_info *p, struct pci_pbm_info *pbm) { @@ -1203,11 +1220,17 @@ static void __init pbm_scan_bus(struct pci_controller_info *p, pci_record_assignments(pbm, pbm->pci_bus); pci_assign_unassigned(pbm, pbm->pci_bus); pci_fixup_irq(pbm, pbm->pci_bus); + pci_determine_66mhz_disposition(pbm, pbm->pci_bus); + pci_setup_busmastering(pbm, pbm->pci_bus); } static void __init psycho_scan_bus(struct pci_controller_info *p) { pbm_bridge_reconfigure(p); + pbm_config_busmastering(&p->pbm_B); + p->pbm_B.is_66mhz_capable = 0; + pbm_config_busmastering(&p->pbm_A); + p->pbm_A.is_66mhz_capable = 1; pbm_scan_bus(p, &p->pbm_B); pbm_scan_bus(p, &p->pbm_A); diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c index a10f5f072..a55772179 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.15 2000/03/10 02:42:16 davem Exp $ +/* $Id: pci_sabre.c,v 1.16 2000/03/25 05:18:12 davem Exp $ * pci_sabre.c: Sabre specific PCI controller support. * * Copyright (C) 1997, 1998, 1999 David S. Miller (davem@caipfs.rutgers.edu) @@ -1060,6 +1060,13 @@ static void __init sabre_scan_bus(struct pci_controller_info *p) struct pci_bus *sabre_bus; struct list_head *walk; + /* The APB bridge speaks to the Sabre host PCI bridge + * at 66Mhz, but the front side of APB runs at 33Mhz + * for both segments. + */ + p->pbm_A.is_66mhz_capable = 0; + p->pbm_B.is_66mhz_capable = 0; + /* Unlike for PSYCHO, we can only have one SABRE * in a system. Having multiple SABREs is thus * and error, and as a consequence we do not need @@ -1079,6 +1086,17 @@ static void __init sabre_scan_bus(struct pci_controller_info *p) sabre_bus = pci_scan_bus(p->pci_first_busno, p->pci_ops, &p->pbm_A); + + { + unsigned int devfn; + u8 *addr; + + devfn = PCI_DEVFN(0, 0); + addr = sabre_pci_config_mkaddr(&p->pbm_A, 0, + devfn, PCI_LATENCY_TIMER); + pci_config_write8(addr, 32); + } + apb_init(p, sabre_bus); walk = &sabre_bus->children; @@ -1099,6 +1117,8 @@ static void __init sabre_scan_bus(struct pci_controller_info *p) pci_record_assignments(pbm, pbus); pci_assign_unassigned(pbm, pbus); pci_fixup_irq(pbm, pbus); + pci_determine_66mhz_disposition(pbm, pbus); + pci_setup_busmastering(pbm, pbus); } sabre_register_error_handlers(p); diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c index dd71b1e92..8ac030324 100644 --- a/arch/sparc64/kernel/process.c +++ b/arch/sparc64/kernel/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.104 2000/03/01 02:53:32 davem Exp $ +/* $Id: process.c,v 1.105 2000/03/26 09:13:48 davem Exp $ * arch/sparc64/kernel/process.c * * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu) @@ -451,7 +451,7 @@ static unsigned long clone_stackframe(unsigned long csp, unsigned long psp) { unsigned long fp, distance, rval; - if(!(current->thread.flags & SPARC_FLAG_32BIT)) { + if (!(current->thread.flags & SPARC_FLAG_32BIT)) { csp += STACK_BIAS; psp += STACK_BIAS; __get_user(fp, &(((struct reg_window *)psp)->ins[6])); @@ -466,14 +466,14 @@ static unsigned long clone_stackframe(unsigned long csp, unsigned long psp) distance = fp - psp; rval = (csp - distance); - if(copy_in_user(rval, psp, distance)) + if (copy_in_user(rval, psp, distance)) rval = 0; - else if(current->thread.flags & SPARC_FLAG_32BIT) { - if(put_user(((u32)csp), &(((struct reg_window32 *)rval)->ins[6]))) + else if (current->thread.flags & SPARC_FLAG_32BIT) { + if (put_user(((u32)csp), &(((struct reg_window32 *)rval)->ins[6]))) rval = 0; } else { - if(put_user(((u64)csp - STACK_BIAS), - &(((struct reg_window *)rval)->ins[6]))) + if (put_user(((u64)csp - STACK_BIAS), + &(((struct reg_window *)rval)->ins[6]))) rval = 0; else rval = rval - STACK_BIAS; @@ -488,7 +488,7 @@ static inline void shift_window_buffer(int first_win, int last_win, { int i; - for(i = first_win; i < last_win; i++) { + for (i = first_win; i < last_win; i++) { t->rwbuf_stkptrs[i] = t->rwbuf_stkptrs[i+1]; memcpy(&t->reg_window[i], &t->reg_window[i+1], sizeof(struct reg_window)); @@ -501,11 +501,11 @@ void synchronize_user_stack(void) unsigned long window; flush_user_windows(); - if((window = t->w_saved) != 0) { + if ((window = t->w_saved) != 0) { int winsize = REGWIN_SZ; int bias = 0; - if(t->flags & SPARC_FLAG_32BIT) + if (t->flags & SPARC_FLAG_32BIT) winsize = REGWIN32_SZ; else bias = STACK_BIAS; @@ -515,11 +515,11 @@ void synchronize_user_stack(void) unsigned long sp = (t->rwbuf_stkptrs[window] + bias); struct reg_window *rwin = &t->reg_window[window]; - if(!copy_to_user((char *)sp, rwin, winsize)) { + if (!copy_to_user((char *)sp, rwin, winsize)) { shift_window_buffer(window, t->w_saved - 1, t); t->w_saved--; } - } while(window--); + } while (window--); } } @@ -530,25 +530,29 @@ void fault_in_user_windows(struct pt_regs *regs) int winsize = REGWIN_SZ; int bias = 0; - if(t->flags & SPARC_FLAG_32BIT) + if (t->flags & SPARC_FLAG_32BIT) winsize = REGWIN32_SZ; else bias = STACK_BIAS; + flush_user_windows(); window = t->w_saved; - if(window != 0) { + + if (window != 0) { window -= 1; do { unsigned long sp = (t->rwbuf_stkptrs[window] + bias); struct reg_window *rwin = &t->reg_window[window]; - if(copy_to_user((char *)sp, rwin, winsize)) + if (copy_to_user((char *)sp, rwin, winsize)) goto barf; - } while(window--); + } while (window--); } t->w_saved = 0; return; + barf: + t->w_saved = window + 1; do_exit(SIGILL); } @@ -578,7 +582,8 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, t->kregs = (struct pt_regs *)(child_trap_frame+sizeof(struct reg_window)); t->cwp = (regs->tstate + 1) & TSTATE_CWP; t->fpsaved[0] = 0; - if(regs->tstate & TSTATE_PRIV) { + + if (regs->tstate & TSTATE_PRIV) { /* Special case, if we are spawning a kernel thread from * a userspace task (via KMOD, NFS, or similar) we must * disable performance counters in the child because the @@ -597,7 +602,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, sizeof(struct reg_window)); t->kregs->u_regs[UREG_G6] = (unsigned long) p; } else { - if(t->flags & SPARC_FLAG_32BIT) { + if (t->flags & SPARC_FLAG_32BIT) { sp &= 0x00000000ffffffffUL; regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL; } @@ -607,7 +612,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, unsigned long csp; csp = clone_stackframe(sp, regs->u_regs[UREG_FP]); - if(!csp) + if (!csp) return -EFAULT; t->kregs->u_regs[UREG_FP] = csp; } @@ -621,19 +626,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, /* Set the second return value for the parent. */ regs->u_regs[UREG_I1] = 0; -#if 0 - printk("\ncopy_thread: c(%p[mm(%p:%p)]) p(%p[mm(%p:%p)])\n", - current, current->mm, current->active_mm, - p, p->mm, p->active_mm); - printk("copy_thread: c MM_ctx(%016lx) MM_pgd(%016lx)\n", - (current->mm ? current->mm->context : 0), - (current->mm ? pgd_val(current->mm->pgd[0]) : 0)); - printk("copy_thread: p MM_ctx(%016lx) MM_pgd(%08x)\n", - (p->mm ? p->mm->context : 0), - (p->mm ? pgd_val(p->mm->pgd[0]) : 0)); - printk("copy_thread: c->flags(%x) p->flags(%x) ", - current->thread.flags, p->thread.flags); -#endif + return 0; } diff --git a/arch/sparc64/kernel/rtrap.S b/arch/sparc64/kernel/rtrap.S index d059a5a28..1c9b6ac3f 100644 --- a/arch/sparc64/kernel/rtrap.S +++ b/arch/sparc64/kernel/rtrap.S @@ -1,4 +1,4 @@ -/* $Id: rtrap.S,v 1.48 2000/02/09 11:15:07 davem Exp $ +/* $Id: rtrap.S,v 1.49 2000/03/29 09:55:31 davem Exp $ * rtrap.S: Preparing for return from trap on Sparc V9. * * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -14,194 +14,207 @@ #include <asm/processor.h> #define PTREGS_OFF (STACK_BIAS + REGWIN_SZ) +#define RTRAP_PSTATE (PSTATE_RMO|PSTATE_PEF|PSTATE_PRIV|PSTATE_IE) +#define RTRAP_PSTATE_IRQOFF (PSTATE_RMO|PSTATE_PEF|PSTATE_PRIV) +#define RTRAP_PSTATE_AG_IRQOFF (PSTATE_RMO|PSTATE_PEF|PSTATE_PRIV|PSTATE_AG) + +#if 0 +#define RTRAP_CHECK call rtrap_check; add %sp, (STACK_BIAS+REGWIN_SZ), %o0; +#else +#define RTRAP_CHECK +#endif .text + .align 32 +__handle_softirq: + call do_softirq + nop + ba,a,pt %xcc, __handle_softirq_continue + nop +__handle_preemption: + call schedule + nop + ba,pt %xcc, __handle_preemption_continue + nop +__handle_user_windows: + wrpr %g0, RTRAP_PSTATE, %pstate + call fault_in_user_windows + add %sp, STACK_BIAS + REGWIN_SZ, %g0 + ba,a,pt %xcc, __handle_user_windows_continue +__handle_perfctrs: + /* Don't forget to preserve user window invariants. */ + wrpr %g0, RTRAP_PSTATE, %pstate + call update_perfctrs + nop + wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate + ldub [%g6 + AOFF_task_thread + AOFF_thread_w_saved], %o2 + brz,pt %o2, __handle_perfctrs_continue + sethi %hi(TSTATE_PEF), %l6 + wrpr %g0, RTRAP_PSTATE, %pstate + + call fault_in_user_windows + add %sp, STACK_BIAS + REGWIN_SZ, %o0 + ba,pt %xcc, __handle_perfctrs_continue + nop +__handle_userfpu: + rd %fprs, %l5 + andcc %l5, FPRS_FEF, %g0 + be,a,pn %icc, __handle_userfpu_continue + andn %l1, %l6, %l1 + ba,a,pt %xcc, __handle_userfpu_continue +__handle_signal: + clr %o0 + mov %l5, %o2 + mov %l6, %o3 + call do_signal + add %sp, STACK_BIAS + REGWIN_SZ, %o1 + ba,pt %xcc, __handle_signal_continue + clr %l6 + nop + + .align 64 .globl rtrap_clr_l6, rtrap rtrap_clr_l6: clr %l6 - /* Fall through */ rtrap: lduw [%g6 + AOFF_task_processor], %l0 sethi %hi(softirq_state), %l2 or %l2, %lo(softirq_state), %l2 sllx %l0, 6, %l0 ldx [%l2 + %l0], %l1 srlx %l1, 32, %l2 - andcc %l1, %l2, %g0 - be,pt %icc, 2f - nop - call do_softirq - nop -2: ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1 + + bne,pn %icc, __handle_softirq + ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1 +__handle_softirq_continue: sethi %hi(0xf << 20), %l4 andcc %l1, TSTATE_PRIV, %l3 - and %l1, %l4, %l4 - rdpr %pstate, %l7 - andn %l1, %l4, %l1 - be,pt %icc, to_user - andn %l7, PSTATE_IE, %l7 + bne,pn %icc, to_kernel + andn %l1, %l4, %l1 +to_user: ldx [%g6 + AOFF_task_need_resched], %l0 + + brnz,pn %l0, __handle_preemption +__handle_preemption_continue: + lduw [%g6 + AOFF_task_sigpending], %l0 + brnz,pn %l0, __handle_signal + nop +__handle_signal_continue: +check_user_wins: + wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate + ldub [%g6 + AOFF_task_thread + AOFF_thread_w_saved], %o2 + brnz,pn %o2, __handle_user_windows + sethi %hi(TSTATE_PEF), %l6 + +__handle_user_windows_continue: + RTRAP_CHECK + ldub [%g6 + AOFF_task_thread + AOFF_thread_flags], %l5 + andcc %l5, SPARC_FLAG_PERFCTR, %g0 + bne,pn %xcc, __handle_perfctrs +__handle_perfctrs_continue: + andcc %l1, %l6, %g0 + bne,pn %xcc, __handle_userfpu + stb %g0, [%g6 + AOFF_task_thread + AOFF_thread_fpdepth] ! This is neccessary for non-syscall rtraps only +__handle_userfpu_continue: - ldub [%g6 + AOFF_task_thread + AOFF_thread_fpdepth], %l5 - brz,pt %l5, rt_continue - srl %l5, 1, %o0 - add %g6, AOFF_task_thread + AOFF_thread_fpsaved, %l6 - ldub [%l6 + %o0], %l2 - sub %l5, 2, %l5 - add %g6, AOFF_task_thread + AOFF_thread_gsr, %o1 - andcc %l2, (FPRS_FEF|FPRS_DU), %g0 - be,pt %icc, 2f - and %l2, FPRS_DL, %l6 - andcc %l2, FPRS_FEF, %g0 - be,pn %icc, 5f - sll %o0, 3, %o5 - rd %fprs, %g5 - wr %g5, FPRS_FEF, %fprs - ldub [%o1 + %o0], %g5 - add %g6, AOFF_task_thread + AOFF_thread_xfsr, %o1 - membar #StoreLoad | #LoadLoad - sll %o0, 8, %o2 - add %g6, AOFF_task_fpregs, %o3 - brz,pn %l6, 1f - add %g6, AOFF_task_fpregs+0x40, %o4 - ldda [%o3 + %o2] ASI_BLK_P, %f0 - ldda [%o4 + %o2] ASI_BLK_P, %f16 -1: andcc %l2, FPRS_DU, %g0 - be,pn %icc, 1f - wr %g5, 0, %gsr - add %o2, 0x80, %o2 - ldda [%o3 + %o2] ASI_BLK_P, %f32 - ldda [%o4 + %o2] ASI_BLK_P, %f48 -1: membar #Sync - ldx [%o1 + %o5], %fsr -2: stb %l5, [%g6 + AOFF_task_thread + AOFF_thread_fpdepth] rt_continue: ldx [%sp + PTREGS_OFF + PT_V9_G1], %g1 ldx [%sp + PTREGS_OFF + PT_V9_G2], %g2 + ldx [%sp + PTREGS_OFF + PT_V9_G3], %g3 - mov %g6, %o5 ldx [%sp + PTREGS_OFF + PT_V9_G4], %g4 ldx [%sp + PTREGS_OFF + PT_V9_G5], %g5 ldx [%sp + PTREGS_OFF + PT_V9_G6], %g6 ldx [%sp + PTREGS_OFF + PT_V9_G7], %g7 - - wrpr %l7, PSTATE_AG, %pstate + wrpr %g0, RTRAP_PSTATE_AG_IRQOFF, %pstate ldx [%sp + PTREGS_OFF + PT_V9_I0], %i0 ldx [%sp + PTREGS_OFF + PT_V9_I1], %i1 + ldx [%sp + PTREGS_OFF + PT_V9_I2], %i2 ldx [%sp + PTREGS_OFF + PT_V9_I3], %i3 ldx [%sp + PTREGS_OFF + PT_V9_I4], %i4 ldx [%sp + PTREGS_OFF + PT_V9_I5], %i5 ldx [%sp + PTREGS_OFF + PT_V9_I6], %i6 - ldx [%sp + PTREGS_OFF + PT_V9_I7], %i7 - ld [%sp + PTREGS_OFF + PT_V9_Y], %o3 ldx [%sp + PTREGS_OFF + PT_V9_TPC], %l2 ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %o2 + + ld [%sp + PTREGS_OFF + PT_V9_Y], %o3 wr %o3, %g0, %y srl %l4, 20, %l4 wrpr %l4, 0x0, %pil wrpr %g0, 0x1, %tl - wrpr %l1, %g0, %tstate wrpr %l2, %g0, %tpc wrpr %o2, %g0, %tnpc + brnz,pn %l3, kern_rtt mov PRIMARY_CONTEXT, %l7 ldxa [%l7 + %l7] ASI_DMMU, %l0 stxa %l0, [%l7] ASI_DMMU - flush %o5 - + flush %g6 rdpr %wstate, %l1 rdpr %otherwin, %l2 srl %l1, 3, %l1 + wrpr %l2, %g0, %canrestore wrpr %l1, %g0, %wstate wrpr %g0, %g0, %otherwin restore rdpr %canrestore, %g1 - wrpr %g1, 0x0, %cleanwin retry + nop + kern_rtt: restore retry -to_user: ldx [%g6 + AOFF_task_need_resched], %l0 - wrpr %l7, PSTATE_IE, %pstate - orcc %g0, %l0, %g0 - be,a,pt %xcc, check_signal - - lduw [%g6 + AOFF_task_sigpending], %l0 - call schedule - nop - lduw [%g6 + AOFF_task_sigpending], %l0 -check_signal: brz,a,pt %l0, check_user_wins - nop - clr %o0 - mov %l5, %o2 - mov %l6, %o3 - call do_signal - add %sp, STACK_BIAS + REGWIN_SZ, %o1 - clr %l6 - - /* We must not take any traps between here and the actual - * return to user-space. If we do we risk having windows - * saved to the thread struct between the test and the - * actual return from trap. --DaveM - */ -check_user_wins: - wrpr %l7, 0x0, %pstate - ldub [%g6 + AOFF_task_thread + AOFF_thread_w_saved], %o2 - brz,pt %o2, 1f - sethi %hi(TSTATE_PEF), %l6 +to_kernel: ldub [%g6 + AOFF_task_thread + AOFF_thread_fpdepth], %l5 + brz,pt %l5, rt_continue + srl %l5, 1, %o0 + add %g6, AOFF_task_thread + AOFF_thread_fpsaved, %l6 + ldub [%l6 + %o0], %l2 + sub %l5, 2, %l5 - wrpr %l7, PSTATE_IE, %pstate - call fault_in_user_windows - add %sp, STACK_BIAS + REGWIN_SZ, %o0 - /* It is OK to leave interrupts on now because if - * fault_in_user_windows has returned it has left us - * with a clean user stack state. - */ -1: -#if 0 - call rtrap_check - add %sp, STACK_BIAS + REGWIN_SZ, %o0 -#endif - ldub [%g6 + AOFF_task_thread + AOFF_thread_flags], %l5 - andcc %l5, SPARC_FLAG_PERFCTR, %g0 - be,pt %xcc, 1f - nop + add %g6, AOFF_task_thread + AOFF_thread_gsr, %o1 + andcc %l2, (FPRS_FEF|FPRS_DU), %g0 + be,pt %icc, 2f + and %l2, FPRS_DL, %l6 + andcc %l2, FPRS_FEF, %g0 + be,pn %icc, 5f + sll %o0, 3, %o5 + rd %fprs, %g5 - /* Don't forget to preserve user window invariants. */ - wrpr %l7, PSTATE_IE, %pstate - call update_perfctrs - nop - wrpr %l7, 0x0, %pstate - ldub [%g6 + AOFF_task_thread + AOFF_thread_w_saved], %o2 - brz,pt %o2, 1f - sethi %hi(TSTATE_PEF), %l6 - wrpr %l7, PSTATE_IE, %pstate - call fault_in_user_windows - add %sp, STACK_BIAS + REGWIN_SZ, %o0 + wr %g5, FPRS_FEF, %fprs + ldub [%o1 + %o0], %g5 + add %g6, AOFF_task_thread + AOFF_thread_xfsr, %o1 + membar #StoreLoad | #LoadLoad + sll %o0, 8, %o2 + add %g6, AOFF_task_fpregs, %o3 + brz,pn %l6, 1f + add %g6, AOFF_task_fpregs+0x40, %o4 -1: - andcc %l1, %l6, %g0 - be,pt %xcc, rt_continue - stb %g0, [%g6 + AOFF_task_thread + AOFF_thread_fpdepth] ! This is neccessary for non-syscall rtraps only + ldda [%o3 + %o2] ASI_BLK_P, %f0 + ldda [%o4 + %o2] ASI_BLK_P, %f16 +1: andcc %l2, FPRS_DU, %g0 + be,pn %icc, 1f + wr %g5, 0, %gsr + add %o2, 0x80, %o2 + ldda [%o3 + %o2] ASI_BLK_P, %f32 + ldda [%o4 + %o2] ASI_BLK_P, %f48 - rd %fprs, %l5 - andcc %l5, FPRS_FEF, %g0 - be,a,pn %icc, rt_continue - andn %l1, %l6, %l1 +1: membar #Sync + ldx [%o1 + %o5], %fsr +2: stb %l5, [%g6 + AOFF_task_thread + AOFF_thread_fpdepth] ba,pt %xcc, rt_continue nop - 5: wr %g0, FPRS_FEF, %fprs membar #StoreLoad | #LoadLoad sll %o0, 8, %o2 + add %g6, AOFF_task_fpregs+0x80, %o3 add %g6, AOFF_task_fpregs+0xc0, %o4 ldda [%o3 + %o2] ASI_BLK_P, %f32 ldda [%o4 + %o2] ASI_BLK_P, %f48 -1: membar #Sync + membar #Sync wr %g0, FPRS_DU, %fprs ba,pt %xcc, rt_continue stb %l5, [%g6 + AOFF_task_thread + AOFF_thread_fpdepth] diff --git a/arch/sparc64/kernel/semaphore.c b/arch/sparc64/kernel/semaphore.c index 88ab813f3..0919089ef 100644 --- a/arch/sparc64/kernel/semaphore.c +++ b/arch/sparc64/kernel/semaphore.c @@ -1,4 +1,4 @@ -/* $Id: semaphore.c,v 1.2 1999/12/23 17:12:03 jj Exp $ +/* $Id: semaphore.c,v 1.3 2000/03/27 10:38:46 davem Exp $ * Generic semaphore code. Buyer beware. Do your own * specific changes in <asm/semaphore-helper.h> */ @@ -203,7 +203,7 @@ void down_read_failed_biased(struct rw_semaphore *sem) add_wait_queue(&sem->wait, &wait); /* put ourselves at the head of the list */ for (;;) { - if (clear_le_bit(0, &sem->granted)) + if (test_and_clear_le_bit(0, &sem->granted)) break; set_task_state(tsk, TASK_UNINTERRUPTIBLE); if (!test_le_bit(0, &sem->granted)) @@ -221,7 +221,7 @@ void down_write_failed_biased(struct rw_semaphore *sem) add_wait_queue_exclusive(&sem->write_bias_wait, &wait); /* put ourselves at the end of the list */ for (;;) { - if (clear_le_bit(1, &sem->granted)) + if (test_and_clear_le_bit(1, &sem->granted)) break; set_task_state(tsk, TASK_UNINTERRUPTIBLE | TASK_EXCLUSIVE); if (!test_le_bit(1, &sem->granted)) @@ -286,11 +286,11 @@ void down_write_failed(struct rw_semaphore *sem) void __rwsem_wake(struct rw_semaphore *sem, unsigned long readers) { if (readers) { - if (set_le_bit(0, &sem->granted)) + if (test_and_set_le_bit(0, &sem->granted)) BUG(); wake_up(&sem->wait); } else { - if (set_le_bit(1, &sem->granted)) + if (test_and_set_le_bit(1, &sem->granted)) BUG(); wake_up(&sem->write_bias_wait); } diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c index 79db5bc4e..e7a50c150 100644 --- a/arch/sparc64/kernel/signal.c +++ b/arch/sparc64/kernel/signal.c @@ -616,7 +616,9 @@ static inline void read_maps (void) if (map->vm_file != NULL) { dev = map->vm_file->f_dentry->d_inode->i_dev; ino = map->vm_file->f_dentry->d_inode->i_ino; - line = d_path(map->vm_file->f_dentry, buffer, PAGE_SIZE); + line = d_path(map->vm_file->f_dentry, + map->vm_file->f_vfsmnt, + buffer, PAGE_SIZE); } printk(MAPS_LINE_FORMAT, map->vm_start, map->vm_end, str, map->vm_pgoff << PAGE_SHIFT, kdevname(dev), ino); diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c index 8df2116e7..423c5f648 100644 --- a/arch/sparc64/kernel/signal32.c +++ b/arch/sparc64/kernel/signal32.c @@ -1279,7 +1279,9 @@ static inline void read_maps (void) if (map->vm_file != NULL) { dev = map->vm_file->f_dentry->d_inode->i_dev; ino = map->vm_file->f_dentry->d_inode->i_ino; - line = d_path(map->vm_file->f_dentry, buffer, PAGE_SIZE); + line = d_path(map->vm_file->f_dentry, + map->vm_file->f_vfsmnt, + buffer, PAGE_SIZE); } printk(MAPS_LINE_FORMAT, map->vm_start, map->vm_end, str, map->vm_pgoff << PAGE_SHIFT, kdevname(dev), ino); diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index 0d5f615cf..e9a180d2a 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c @@ -469,52 +469,83 @@ void smp_flush_tlb_all(void) */ void smp_flush_tlb_mm(struct mm_struct *mm) { - u32 ctx = CTX_HWBITS(mm->context); - - if (mm == current->active_mm && - atomic_read(&mm->mm_users) == 1 && - (mm->cpu_vm_mask == (1UL << smp_processor_id()))) - goto local_flush_and_out; + if (CTX_VALID(mm->context)) { + u32 ctx = CTX_HWBITS(mm->context); + int cpu = smp_processor_id(); + + if (mm == current->active_mm && atomic_read(&mm->mm_users) == 1) { + /* See smp_flush_tlb_page for info about this. */ + mm->cpu_vm_mask = (1UL << cpu); + goto local_flush_and_out; + } - smp_cross_call(&xcall_flush_tlb_mm, ctx, 0, 0); + smp_cross_call(&xcall_flush_tlb_mm, ctx, 0, 0); -local_flush_and_out: - __flush_tlb_mm(ctx, SECONDARY_CONTEXT); + local_flush_and_out: + __flush_tlb_mm(ctx, SECONDARY_CONTEXT); + } } void smp_flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end) { - u32 ctx = CTX_HWBITS(mm->context); + if (CTX_VALID(mm->context)) { + u32 ctx = CTX_HWBITS(mm->context); + int cpu = smp_processor_id(); - start &= PAGE_MASK; - end &= PAGE_MASK; - if(mm == current->active_mm && - atomic_read(&mm->mm_users) == 1 && - (mm->cpu_vm_mask == (1UL << smp_processor_id()))) - goto local_flush_and_out; + start &= PAGE_MASK; + end &= PAGE_MASK; - smp_cross_call(&xcall_flush_tlb_range, ctx, start, end); + if (mm == current->active_mm && atomic_read(&mm->mm_users) == 1) { + mm->cpu_vm_mask = (1UL << cpu); + goto local_flush_and_out; + } + + smp_cross_call(&xcall_flush_tlb_range, ctx, start, end); -local_flush_and_out: - __flush_tlb_range(ctx, start, SECONDARY_CONTEXT, end, PAGE_SIZE, (end-start)); + local_flush_and_out: + __flush_tlb_range(ctx, start, SECONDARY_CONTEXT, end, PAGE_SIZE, (end-start)); + } } void smp_flush_tlb_page(struct mm_struct *mm, unsigned long page) { - u32 ctx = CTX_HWBITS(mm->context); - - page &= PAGE_MASK; - if(mm == current->active_mm && - atomic_read(&mm->mm_users) == 1 && - (mm->cpu_vm_mask == (1UL << smp_processor_id()))) { - goto local_flush_and_out; - } + if (CTX_VALID(mm->context)) { + u32 ctx = CTX_HWBITS(mm->context); + int cpu = smp_processor_id(); + + page &= PAGE_MASK; + if (mm == current->active_mm && atomic_read(&mm->mm_users) == 1) { + /* By virtue of being the current address space, and + * having the only reference to it, the following operation + * is safe. + * + * It would not be a win to perform the xcall tlb flush in + * this case, because even if we switch back to one of the + * other processors in cpu_vm_mask it is almost certain that + * all TLB entries for this context will be replaced by the + * time that happens. + */ + mm->cpu_vm_mask = (1UL << cpu); + goto local_flush_and_out; + } else { + /* By virtue of running under the mm->page_table_lock, + * and mmu_context.h:switch_mm doing the same, the following + * operation is safe. + */ + if (mm->cpu_vm_mask == (1UL << cpu)) + goto local_flush_and_out; + } - smp_cross_call(&xcall_flush_tlb_page, ctx, page, 0); + /* OK, we have to actually perform the cross call. Most likely + * this is a cloned mm or kswapd is kicking out pages for a task + * which has run recently on another cpu. + */ + smp_cross_call(&xcall_flush_tlb_page, ctx, page, 0); -local_flush_and_out: - __flush_tlb_page(ctx, page, SECONDARY_CONTEXT); + local_flush_and_out: + __flush_tlb_page(ctx, page, SECONDARY_CONTEXT); + } } /* CPU capture. */ @@ -603,13 +634,16 @@ static inline void sparc64_do_profile(unsigned long pc, unsigned long o7) extern int rwlock_impl_begin, rwlock_impl_end; extern int atomic_impl_begin, atomic_impl_end; extern int __memcpy_begin, __memcpy_end; + extern int __bitops_begin, __bitops_end; if ((pc >= (unsigned long) &atomic_impl_begin && pc < (unsigned long) &atomic_impl_end) || (pc >= (unsigned long) &rwlock_impl_begin && pc < (unsigned long) &rwlock_impl_end) || (pc >= (unsigned long) &__memcpy_begin && - pc < (unsigned long) &__memcpy_end)) + pc < (unsigned long) &__memcpy_end) || + (pc >= (unsigned long) &__bitops_begin && + pc < (unsigned long) &__bitops_end)) pc = o7; pc -= (unsigned long) &_stext; diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c index 26e11085d..fc7a8cfe5 100644 --- a/arch/sparc64/kernel/sparc64_ksyms.c +++ b/arch/sparc64/kernel/sparc64_ksyms.c @@ -1,4 +1,4 @@ -/* $Id: sparc64_ksyms.c,v 1.79 2000/03/17 14:41:18 davem Exp $ +/* $Id: sparc64_ksyms.c,v 1.80 2000/03/27 10:38:47 davem Exp $ * arch/sparc64/kernel/sparc64_ksyms.c: Sparc64 specific ksyms support. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -170,6 +170,13 @@ EXPORT_SYMBOL_NOVERS(__rwsem_wake); EXPORT_SYMBOL_PRIVATE(atomic_add); EXPORT_SYMBOL_PRIVATE(atomic_sub); +/* Atomic bit operations. */ +EXPORT_SYMBOL_PRIVATE(test_and_set_bit); +EXPORT_SYMBOL_PRIVATE(test_and_clear_bit); +EXPORT_SYMBOL_PRIVATE(test_and_change_bit); +EXPORT_SYMBOL_PRIVATE(test_and_set_le_bit); +EXPORT_SYMBOL_PRIVATE(test_and_clear_le_bit); + EXPORT_SYMBOL(ivector_table); EXPORT_SYMBOL(enable_irq); EXPORT_SYMBOL(disable_irq); diff --git a/arch/sparc64/kernel/sys32.S b/arch/sparc64/kernel/sys32.S index 34db8d056..c97b266be 100644 --- a/arch/sparc64/kernel/sys32.S +++ b/arch/sparc64/kernel/sys32.S @@ -1,4 +1,4 @@ -/* $Id: sys32.S,v 1.11 2000/01/11 17:33:29 jj Exp $ +/* $Id: sys32.S,v 1.12 2000/03/24 04:17:37 davem Exp $ * sys32.S: I-cache tricks for 32-bit compatability layer simple * conversions. * @@ -6,6 +6,8 @@ * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) */ +#include <asm/errno.h> + /* NOTE: call as jump breaks return stack, we have to avoid that */ .text @@ -69,3 +71,187 @@ sys32_mmap2: srl %o5, 0, %o5 jmpl %g1 + %lo(sys_mmap), %g0 sllx %o5, 12, %o5 + + .align 32 + .globl sys32_socketcall +sys32_socketcall: /* %o0=call, %o1=args */ + cmp %o0, 1 + bl,pn %xcc, do_einval + cmp %o0, 17 + bg,pn %xcc, do_einval + sub %o0, 1, %o0 + sllx %o0, 5, %o0 + sethi %hi(__socketcall_table_begin), %g2 + or %g2, %lo(__socketcall_table_begin), %g2 + jmpl %g2 + %o0, %g0 + nop + + /* Each entry is exactly 32 bytes. */ + .align 32 +__socketcall_table_begin: +do_sys_socket: /* sys_socket(int, int, int) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys_socket), %g1 + ldswa [%o1 + 0x8] %asi, %o2 + jmpl %g1 + %lo(sys_socket), %g0 + ldswa [%o1 + 0x4] %asi, %o1 + nop + nop + nop +do_sys_bind: /* sys_bind(int fd, struct sockaddr *, int) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys_bind), %g1 + ldswa [%o1 + 0x8] %asi, %o2 + jmpl %g1 + %lo(sys_bind), %g0 + lduwa [%o1 + 0x4] %asi, %o1 + nop + nop + nop +do_sys_connect: /* sys_connect(int, struct sockaddr *, int) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys_connect), %g1 + ldswa [%o1 + 0x8] %asi, %o2 + jmpl %g1 + %lo(sys_connect), %g0 + lduwa [%o1 + 0x4] %asi, %o1 + nop + nop + nop +do_sys_listen: /* sys_listen(int, int) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys_listen), %g1 + jmpl %g1 + %lo(sys_listen), %g0 + ldswa [%o1 + 0x4] %asi, %o1 + nop + nop + nop + nop +do_sys_accept: /* sys_accept(int, struct sockaddr *, int *) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys_accept), %g1 + lduwa [%o1 + 0x8] %asi, %o2 + jmpl %g1 + %lo(sys_accept), %g0 + lduwa [%o1 + 0x4] %asi, %o1 + nop + nop + nop +do_sys_getsockname: /* sys_getsockname(int, struct sockaddr *, int *) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys_getsockname), %g1 + lduwa [%o1 + 0x8] %asi, %o2 + jmpl %g1 + %lo(sys_getsockname), %g0 + lduwa [%o1 + 0x4] %asi, %o1 + nop + nop + nop +do_sys_getpeername: /* sys_getpeername(int, struct sockaddr *, int *) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys_getpeername), %g1 + lduwa [%o1 + 0x8] %asi, %o2 + jmpl %g1 + %lo(sys_getpeername), %g0 + lduwa [%o1 + 0x4] %asi, %o1 + nop + nop + nop +do_sys_socketpair: /* sys_socketpair(int, int, int, int *) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys_socketpair), %g1 + ldswa [%o1 + 0x8] %asi, %o2 + lduwa [%o1 + 0xc] %asi, %o3 + jmpl %g1 + %lo(sys_socketpair), %g0 + ldswa [%o1 + 0x4] %asi, %o1 + nop + nop +do_sys_send: /* sys_send(int, void *, size_t, unsigned int) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys_send), %g1 + lduwa [%o1 + 0x8] %asi, %o2 + lduwa [%o1 + 0xc] %asi, %o3 + jmpl %g1 + %lo(sys_send), %g0 + lduwa [%o1 + 0x4] %asi, %o1 + nop + nop +do_sys_recv: /* sys_recv(int, void *, size_t, unsigned int) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys_recv), %g1 + lduwa [%o1 + 0x8] %asi, %o2 + lduwa [%o1 + 0xc] %asi, %o3 + jmpl %g1 + %lo(sys_recv), %g0 + lduwa [%o1 + 0x4] %asi, %o1 + nop + nop +do_sys_sendto: /* sys32_sendto(int, u32, __kernel_size_t32, unsigned int, u32, int) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys32_sendto), %g1 + lduwa [%o1 + 0x8] %asi, %o2 + lduwa [%o1 + 0xc] %asi, %o3 + lduwa [%o1 + 0x10] %asi, %o4 + ldswa [%o1 + 0x14] %asi, %o5 + jmpl %g1 + %lo(sys32_sendto), %g0 + lduwa [%o1 + 0x4] %asi, %o1 +do_sys_recvfrom: /* sys32_recvfrom(int, u32, __kernel_size_t32, unsigned int, u32, u32) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys32_recvfrom), %g1 + lduwa [%o1 + 0x8] %asi, %o2 + lduwa [%o1 + 0xc] %asi, %o3 + lduwa [%o1 + 0x10] %asi, %o4 + lduwa [%o1 + 0x14] %asi, %o5 + jmpl %g1 + %lo(sys32_recvfrom), %g0 + lduwa [%o1 + 0x4] %asi, %o1 +do_sys_shutdown: /* sys_shutdown(int, int) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys_shutdown), %g1 + jmpl %g1 + %lo(sys_shutdown), %g0 + ldswa [%o1 + 0x4] %asi, %o1 + nop + nop + nop + nop +do_sys_setsockopt: /* sys32_setsockopt(int, int, int, char *, int) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys32_setsockopt), %g1 + ldswa [%o1 + 0x8] %asi, %o2 + lduwa [%o1 + 0xc] %asi, %o3 + ldswa [%o1 + 0x10] %asi, %o4 + jmpl %g1 + %lo(sys32_setsockopt), %g0 + ldswa [%o1 + 0x4] %asi, %o1 + nop +do_sys_getsockopt: /* sys32_getsockopt(int, int, int, u32, u32) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys32_getsockopt), %g1 + ldswa [%o1 + 0x8] %asi, %o2 + lduwa [%o1 + 0xc] %asi, %o3 + lduwa [%o1 + 0x10] %asi, %o4 + jmpl %g1 + %lo(sys32_getsockopt), %g0 + ldswa [%o1 + 0x4] %asi, %o1 + nop +do_sys_sendmsg: /* sys32_sendmsg(int, struct msghdr32 *, unsigned int) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys32_sendmsg), %g1 + lduwa [%o1 + 0x8] %asi, %o2 + jmpl %g1 + %lo(sys32_sendmsg), %g0 + lduwa [%o1 + 0x4] %asi, %o1 + nop + nop + nop +do_sys_recvmsg: /* sys32_recvmsg(int, struct msghdr32 *, unsigned int) */ + ldswa [%o1 + 0x0] %asi, %o0 + sethi %hi(sys32_recvmsg), %g1 + lduwa [%o1 + 0x8] %asi, %o2 + jmpl %g1 + %lo(sys32_recvmsg), %g0 + lduwa [%o1 + 0x4] %asi, %o1 + nop + nop + nop +__socketcall_table_end: + +do_einval: + retl + mov -EINVAL, %o0 +do_efault: + retl + mov -EFAULT, %o0 + + .section __ex_table + .align 4 + .word __socketcall_table_begin, 0, __socketcall_table_end, do_efault + .previous diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c index d752f1a0d..b1eb160ad 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.141 2000/03/24 01:31:30 davem Exp $ +/* $Id: sys_sparc32.c,v 1.142 2000/03/24 04:17:38 davem Exp $ * sys_sparc32.c: Conversion between 32bit and 64bit native syscalls. * * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -1746,8 +1746,8 @@ static int copy_mount_stuff_to_kernel(const void *user, unsigned long *kernel) return 0; } -extern long do_sys_mount(char * dev_name, char * dir_name, unsigned long type_page, - unsigned long new_flags, unsigned long data_page); +extern long do_sys_mount(char * dev_page, char * dir_page, char * type_page, + unsigned long new_flags, char * data_page); #define SMBFS_NAME "smbfs" #define NCPFS_NAME "ncpfs" @@ -1756,6 +1756,8 @@ asmlinkage int sys32_mount(char *dev_name, char *dir_name, char *type, unsigned { unsigned long type_page = 0; unsigned long data_page = 0; + unsigned long dev_page = 0; + unsigned long dir_page = 0; int err, is_smb, is_ncp; is_smb = is_ncp = 0; @@ -1777,19 +1779,32 @@ asmlinkage int sys32_mount(char *dev_name, char *dir_name, char *type, unsigned if (err) goto type_out; + err = copy_mount_stuff_to_kernel(dev_name, &dev_page); + if (err) + goto data_out; + + err = copy_mount_stuff_to_kernel(dir_name, &dir_page); + if (err) + goto dev_out; + if (!is_smb && !is_ncp) { - err = do_sys_mount(dev_name, dir_name, type_page, new_flags, - data_page); + err = do_sys_mount((char*)dev_page, (char*)dir_page, + (char*)type_page, new_flags, (char*)data_page); } else { if (is_ncp) do_ncp_super_data_conv((void *)data_page); else do_smb_super_data_conv((void *)data_page); - err = do_sys_mount(dev_name, dir_name, type_page, new_flags, - data_page); + err = do_sys_mount((char*)dev_page, (char*)dir_page, + (char*)type_page, new_flags, (char*)data_page); } + free_page(dir_page); + +dev_out: + free_page(dev_page); +data_out: free_page(data_page); type_out: @@ -2790,85 +2805,6 @@ asmlinkage int sys32_setsockopt(int fd, int level, int optname, return sys_setsockopt(fd, level, optname, optval, optlen); } -/* Argument list sizes for sys_socketcall */ -#define AL(x) ((x) * sizeof(u32)) -static unsigned char nargs[18]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3), - AL(3),AL(3),AL(4),AL(4),AL(4),AL(6), - AL(6),AL(2),AL(5),AL(5),AL(3),AL(3)}; -#undef AL - -extern asmlinkage int sys_bind(int fd, struct sockaddr *umyaddr, int addrlen); -extern asmlinkage int sys_connect(int fd, struct sockaddr *uservaddr, int addrlen); -extern asmlinkage int sys_accept(int fd, struct sockaddr *upeer_sockaddr, int *upeer_addrlen); -extern asmlinkage int sys_getsockname(int fd, struct sockaddr *usockaddr, int *usockaddr_len); -extern asmlinkage int sys_getpeername(int fd, struct sockaddr *usockaddr, int *usockaddr_len); -extern asmlinkage int sys_send(int fd, void *buff, size_t len, unsigned flags); -extern asmlinkage int sys32_sendto(int fd, u32 buff, __kernel_size_t32 len, - unsigned flags, u32 addr, int addr_len); -extern asmlinkage int sys_recv(int fd, void *ubuf, size_t size, unsigned flags); -extern asmlinkage int sys32_recvfrom(int fd, u32 ubuf, __kernel_size_t32 size, - unsigned flags, u32 addr, u32 addr_len); -extern asmlinkage int sys32_getsockopt(int fd, int level, int optname, - u32 optval, u32 optlen); - -extern asmlinkage int sys_socket(int family, int type, int protocol); -extern asmlinkage int sys_socketpair(int family, int type, int protocol, - int usockvec[2]); -extern asmlinkage int sys_shutdown(int fd, int how); -extern asmlinkage int sys_listen(int fd, int backlog); - -asmlinkage int sys32_socketcall(int call, u32 *args) -{ - u32 a[6]; - u32 a0,a1; - - if (call<SYS_SOCKET||call>SYS_RECVMSG) - return -EINVAL; - if (copy_from_user(a, args, nargs[call])) - return -EFAULT; - a0=a[0]; - a1=a[1]; - - switch(call) - { - case SYS_SOCKET: - return sys_socket(a0, a1, a[2]); - case SYS_BIND: - return sys_bind(a0, (struct sockaddr *)A(a1), a[2]); - case SYS_CONNECT: - return sys_connect(a0, (struct sockaddr *)A(a1), a[2]); - case SYS_LISTEN: - return sys_listen(a0, a1); - case SYS_ACCEPT: - return sys_accept(a0, (struct sockaddr *)A(a1), (int *)A(a[2])); - case SYS_GETSOCKNAME: - return sys_getsockname(a0, (struct sockaddr *)A(a1), (int *)A(a[2])); - case SYS_GETPEERNAME: - return sys_getpeername(a0, (struct sockaddr *)A(a1), (int *)A(a[2])); - case SYS_SOCKETPAIR: - return sys_socketpair(a0, a1, a[2], (int *)A(a[3])); - case SYS_SEND: - return sys_send(a0, (void *)A(a1), a[2], a[3]); - case SYS_SENDTO: - return sys32_sendto(a0, a1, a[2], a[3], a[4], a[5]); - case SYS_RECV: - return sys_recv(a0, (void *)A(a1), a[2], a[3]); - case SYS_RECVFROM: - return sys32_recvfrom(a0, a1, a[2], a[3], a[4], a[5]); - case SYS_SHUTDOWN: - return sys_shutdown(a0,a1); - case SYS_SETSOCKOPT: - return sys32_setsockopt(a0, a1, a[2], (char *)A(a[3]), a[4]); - case SYS_GETSOCKOPT: - return sys32_getsockopt(a0, a1, a[2], a[3], a[4]); - case SYS_SENDMSG: - return sys32_sendmsg(a0, (struct msghdr32 *)A(a1), a[2]); - case SYS_RECVMSG: - return sys32_recvmsg(a0, (struct msghdr32 *)A(a1), a[2]); - } - return -EINVAL; -} - extern void check_pending(int signum); asmlinkage int sys32_sigaction (int sig, struct old_sigaction32 *act, struct old_sigaction32 *oact) @@ -4144,7 +4080,7 @@ asmlinkage long sparc32_open(const char * filename, int flags, int mode) if (fd >= 0) { struct file * f; lock_kernel(); - f = filp_open(tmp, flags, mode, NULL); + f = filp_open(tmp, flags, mode); unlock_kernel(); error = PTR_ERR(f); if (IS_ERR(f)) diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c index a572e4976..291b174ac 100644 --- a/arch/sparc64/kernel/sys_sunos32.c +++ b/arch/sparc64/kernel/sys_sunos32.c @@ -1,4 +1,4 @@ -/* $Id: sys_sunos32.c,v 1.42 2000/03/15 02:43:35 davem Exp $ +/* $Id: sys_sunos32.c,v 1.43 2000/03/26 11:28:53 davem Exp $ * sys_sunos32.c: SunOS binary compatability layer on sparc64. * * Copyright (C) 1995, 1996, 1997 David S. Miller (davem@caip.rutgers.edu) @@ -79,19 +79,17 @@ asmlinkage u32 sunos_mmap(u32 addr, u32 len, u32 prot, u32 flags, u32 fd, u32 of } retval = -EBADF; if(!(flags & MAP_ANONYMOUS)) { + struct inode * inode; if(fd >= SUNOS_NR_OPEN) goto out; file = fget(fd); if (!file) goto out; - if (file->f_dentry && file->f_dentry->d_inode) { - struct inode * inode = file->f_dentry->d_inode; - if(MAJOR(inode->i_rdev) == MEM_MAJOR && - MINOR(inode->i_rdev) == 5) { - flags |= MAP_ANONYMOUS; - fput(file); - file = NULL; - } + inode = file->f_dentry->d_inode; + if(MAJOR(inode->i_rdev)==MEM_MAJOR && MINOR(inode->i_rdev)==5) { + flags |= MAP_ANONYMOUS; + fput(file); + file = NULL; } } @@ -601,7 +599,7 @@ struct sunos_nfs_mount_args { char *netname; /* server's netname */ }; -extern int do_mount(struct block_device *, const char *, const char *, char *, int, void *); +extern long do_sys_mount(const char *, const char *, char *, int, void *); extern dev_t get_unnamed_dev(void); extern void put_unnamed_dev(dev_t); extern asmlinkage int sys_mount(char *, char *, char *, unsigned long, void *); @@ -627,17 +625,12 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr) struct inode *inode; struct file *file; - file = fcheck(fd); + file = fget(fd); if(!file) return 0; dentry = file->f_dentry; - if(!dentry) - return 0; - inode = dentry->d_inode; - if(!inode) - return 0; socket = &inode->u.socket_i; local.sin_family = AF_INET; @@ -651,8 +644,10 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr) sizeof(local)); } while (ret && try_port > (1024 / 2)); - if (ret) + if (ret) { + fput(file); return 0; + } server.sin_family = AF_INET; server.sin_addr = addr->sin_addr; @@ -661,6 +656,7 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr) /* Call sys_connect */ ret = socket->ops->connect (socket, (struct sockaddr *) &server, sizeof (server), file->f_flags); + fput(file); if (ret < 0) return 0; return 1; @@ -676,12 +672,12 @@ static int get_default (int value, int def_value) } /* XXXXXXXXXXXXXXXXXXXX */ -asmlinkage int sunos_nfs_mount(char *dir_name, int linux_flags, void *data) +static int sunos_nfs_mount(char *dir_name, int linux_flags, void *data) { int server_fd; char *the_name; struct nfs_mount_data linux_nfs_mount; - struct sunos_nfs_mount_args *sunos_mount = data; + struct sunos_nfs_mount_args sunos_mount; /* Ok, here comes the fun part: Linux's nfs mount needs a * socket connection to the server, but SunOS mount does not @@ -689,41 +685,50 @@ asmlinkage int sunos_nfs_mount(char *dir_name, int linux_flags, void *data) * address to create a socket and bind it to a reserved * port on this system */ + if (copy_from_user(&sunos_mount, data, sizeof(sunos_mount)) + return -EFAULT; + server_fd = sys_socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (server_fd < 0) return -ENXIO; - if (!sunos_nfs_get_server_fd (server_fd, sunos_mount->addr)){ + if (copy_from_user(&linux_nfs_mount.addr,sunos_mount.addr, + sizeof(*sunos_mount.addr)) || + copy_from_user(&linux_nfs_mount.root,sunos_mount.fh, + sizeof(*sunos_mount.fh))) { + sys_close (server_fd); + return -EFAULT; + } + + if (!sunos_nfs_get_server_fd (server_fd, &linux_nfs_mount.addr)){ sys_close (server_fd); return -ENXIO; } /* Now, bind it to a locally reserved port */ linux_nfs_mount.version = NFS_MOUNT_VERSION; - linux_nfs_mount.flags = sunos_mount->flags; - linux_nfs_mount.addr = *sunos_mount->addr; - linux_nfs_mount.root = *sunos_mount->fh; + linux_nfs_mount.flags = sunos_mount.flags; linux_nfs_mount.fd = server_fd; - linux_nfs_mount.rsize = get_default (sunos_mount->rsize, 8192); - linux_nfs_mount.wsize = get_default (sunos_mount->wsize, 8192); - linux_nfs_mount.timeo = get_default (sunos_mount->timeo, 10); - linux_nfs_mount.retrans = sunos_mount->retrans; + linux_nfs_mount.rsize = get_default (sunos_mount.rsize, 8192); + linux_nfs_mount.wsize = get_default (sunos_mount.wsize, 8192); + linux_nfs_mount.timeo = get_default (sunos_mount.timeo, 10); + linux_nfs_mount.retrans = sunos_mount.retrans; - linux_nfs_mount.acregmin = sunos_mount->acregmin; - linux_nfs_mount.acregmax = sunos_mount->acregmax; - linux_nfs_mount.acdirmin = sunos_mount->acdirmin; - linux_nfs_mount.acdirmax = sunos_mount->acdirmax; + linux_nfs_mount.acregmin = sunos_mount.acregmin; + linux_nfs_mount.acregmax = sunos_mount.acregmax; + linux_nfs_mount.acdirmin = sunos_mount.acdirmin; + linux_nfs_mount.acdirmax = sunos_mount.acdirmax; - the_name = getname(sunos_mount->hostname); + the_name = getname(sunos_mount.hostname); if(IS_ERR(the_name)) - return -EFAULT; + return PTR_ERR(the_name); strncpy (linux_nfs_mount.hostname, the_name, 254); linux_nfs_mount.hostname [255] = 0; putname (the_name); - - return do_mount (NULL, "", dir_name, "nfs", linux_flags, &linux_nfs_mount); + + return do_sys_mount ("", dir_name, "nfs", linux_flags, &linux_nfs_mount); } /* XXXXXXXXXXXXXXXXXXXX */ @@ -733,6 +738,7 @@ sunos_mount(char *type, char *dir, int flags, void *data) int linux_flags = MS_MGC_MSK; /* new semantics */ int ret = -EINVAL; char *dev_fname = 0; + char *dir_page, *type_page; if (!capable (CAP_SYS_ADMIN)) return -EPERM; @@ -751,24 +757,44 @@ sunos_mount(char *type, char *dir, int flags, void *data) linux_flags |= MS_RDONLY; if(flags & SMNT_NOSUID) linux_flags |= MS_NOSUID; - if(strcmp(type, "ext2") == 0) { - dev_fname = (char *) data; - } else if(strcmp(type, "iso9660") == 0) { - dev_fname = (char *) data; - } else if(strcmp(type, "minix") == 0) { - dev_fname = (char *) data; - } else if(strcmp(type, "nfs") == 0) { - ret = sunos_nfs_mount (dir, flags, data); + + dir_page = getname(dir); + ret = PTR_ERR(dir_page); + if (IS_ERR(dir_page)) goto out; - } else if(strcmp(type, "ufs") == 0) { + + type_page = getname(type); + ret = PTR_ERR(type_page); + if (IS_ERR(type_page)) + goto out1; + + if(strcmp(type_page, "ext2") == 0) { + dev_fname = getname(data); + } else if(strcmp(type_page, "iso9660") == 0) { + dev_fname = getname(data); + } else if(strcmp(type_page, "minix") == 0) { + dev_fname = getname(data); + } else if(strcmp(type_page, "nfs") == 0) { + ret = sunos_nfs_mount (dir_page, flags, data); + goto out2 + } else if(strcmp(type_page, "ufs") == 0) { printk("Warning: UFS filesystem mounts unsupported.\n"); ret = -ENODEV; - goto out; - } else if(strcmp(type, "proc")) { + goto out2 + } else if(strcmp(type_page, "proc")) { ret = -ENODEV; - goto out; + goto out2 } - ret = sys_mount(dev_fname, dir, type, linux_flags, NULL); + ret = PTR_ERR(dev_fname); + if (IS_ERR(dev_fname)) + goto out2; + ret = do_sys_mount(dev_fname, dir_page, type_page, linux_flags, NULL); + if (dev_fname) + putname(dev_fname); +out2: + putname(type_page); +out1: + putname(dir_page); out: unlock_kernel(); return ret; diff --git a/arch/sparc64/kernel/winfixup.S b/arch/sparc64/kernel/winfixup.S index 67653fef1..d733de2c1 100644 --- a/arch/sparc64/kernel/winfixup.S +++ b/arch/sparc64/kernel/winfixup.S @@ -1,4 +1,4 @@ -/* $Id: winfixup.S,v 1.28 1999/07/30 09:35:34 davem Exp $ +/* $Id: winfixup.S,v 1.29 2000/03/26 09:13:48 davem Exp $ * * winfixup.S: Handle cases where user stack pointer is found to be bogus. * @@ -31,7 +31,7 @@ fill_fixup: rdpr %tstate, %g1 andcc %g1, TSTATE_PRIV, %g0 - clr %g4 + or %g4, FAULT_CODE_WINFIXUP, %g4 be,pt %xcc, window_scheisse_from_user_common and %g1, TSTATE_CWP, %g1 @@ -69,21 +69,20 @@ fill_fixup: mov %g6, %o7 ! Get current. andn %l1, PSTATE_MM, %l1 ! We want to be in RMO - srlx %g5, PAGE_SHIFT, %o1 ! Fault address + stb %g4, [%g6 + AOFF_task_thread + AOFF_thread_fault_code] + stx %g5, [%g6 + AOFF_task_thread + AOFF_thread_fault_address] wrpr %g0, 0x0, %tl ! Out of trap levels. wrpr %l1, (PSTATE_IE | PSTATE_AG | PSTATE_RMO), %pstate sethi %uhi(PAGE_OFFSET), %g4 ! Prepare page_offset global reg mov %o7, %g6 sllx %g4, 32, %g4 ! and finish it... - clr %o2 /* This is the same as below, except we handle this a bit special * since we must preserve %l5 and %l6, see comment above. */ - sllx %o1, PAGE_SHIFT, %o1 call do_sparc64_fault add %sp, STACK_BIAS + REGWIN_SZ, %o0 - b,pt %xcc, rtrap + ba,pt %xcc, rtrap nop ! yes, nop is correct /* Be very careful about usage of the alternate globals here. @@ -149,22 +148,19 @@ spill_fixup: andcc %g1, TSTATE_PRIV, %g0 saved and %g1, TSTATE_CWP, %g1 - be,a,pn %xcc, window_scheisse_from_user_common - or %g4, 0x4, %g4 ! we know it was a write + be,pn %xcc, window_scheisse_from_user_common + mov FAULT_CODE_WRITE | FAULT_CODE_DTLB | FAULT_CODE_WINFIXUP, %g4 retry + window_scheisse_from_user_common: + stb %g4, [%g6 + AOFF_task_thread + AOFF_thread_fault_code] + stx %g5, [%g6 + AOFF_task_thread + AOFF_thread_fault_address] wrpr %g1, %cwp - sethi %hi(109f), %g7 ba,pt %xcc, etrap -109: or %g7, %lo(109b), %g7 - srlx %l5, PAGE_SHIFT, %o1 - - and %l4, 0x4, %o2 - sllx %o1, PAGE_SHIFT, %o1 + rd %pc, %g7 call do_sparc64_fault add %sp, STACK_BIAS + REGWIN_SZ, %o0 - ba,pt %xcc, rtrap - clr %l6 + ba,a,pt %xcc, rtrap_clr_l6 .globl winfix_mna, fill_fixup_mna, spill_fixup_mna winfix_mna: diff --git a/arch/sparc64/lib/Makefile b/arch/sparc64/lib/Makefile index f3067cad6..e70e28e52 100644 --- a/arch/sparc64/lib/Makefile +++ b/arch/sparc64/lib/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.20 2000/01/19 04:06:03 davem Exp $ +# $Id: Makefile,v 1.21 2000/03/27 10:38:41 davem Exp $ # Makefile for Sparc library files.. # @@ -7,7 +7,7 @@ CFLAGS := $(CFLAGS) OBJS = PeeCeeI.o blockops.o debuglocks.o strlen.o strncmp.o \ memscan.o strncpy_from_user.o strlen_user.o memcmp.o checksum.o \ VIScopy.o VISbzero.o VISmemset.o VIScsum.o VIScsumcopy.o \ - VIScsumcopyusr.o VISsave.o atomic.o rwlock.o + VIScsumcopyusr.o VISsave.o atomic.o rwlock.o bitops.o lib.a: $(OBJS) $(AR) rcs lib.a $(OBJS) @@ -17,10 +17,10 @@ VIScopy.o: VIScopy.S VIS.h VISbzero.o: VISbzero.S VIS.h .S.s: - $(CPP) -D__ASSEMBLY__ $(AFLAGS) -ansi $< -o $*.s + $(CPP) $(AFLAGS) -ansi $< -o $*.s .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c $< -o $*.o + $(CC) $(AFLAGS) -ansi -c $< -o $*.o dep: diff --git a/arch/sparc64/lib/VIScopy.S b/arch/sparc64/lib/VIScopy.S index e20118648..56634f83f 100644 --- a/arch/sparc64/lib/VIScopy.S +++ b/arch/sparc64/lib/VIScopy.S @@ -1,4 +1,4 @@ -/* $Id: VIScopy.S,v 1.22 2000/03/16 16:44:38 davem Exp $ +/* $Id: VIScopy.S,v 1.23 2000/03/26 09:13:49 davem Exp $ * VIScopy.S: High speed copy operations utilizing the UltraSparc * Visual Instruction Set. * @@ -135,11 +135,11 @@ #define MAIN_LOOP_CHUNK(src, dest, fdest, fsrc, len, jmptgt) \ EXVIS(LDBLK [%src] ASIBLK, %fdest); \ ASI_SETDST_BLK \ + EXVIS2(STBLK %fsrc, [%dest] ASIBLK); \ add %src, 0x40, %src; \ - add %dest, 0x40, %dest; \ subcc %len, 0x40, %len; \ be,pn %xcc, jmptgt; \ - EXVIS2(STBLK %fsrc, [%dest - 0x40] ASIBLK); \ + add %dest, 0x40, %dest; \ ASI_SETSRC_BLK #define LOOP_CHUNK1(src, dest, len, branch_dest) \ diff --git a/arch/sparc64/lib/bitops.S b/arch/sparc64/lib/bitops.S new file mode 100644 index 000000000..f964e4550 --- /dev/null +++ b/arch/sparc64/lib/bitops.S @@ -0,0 +1,110 @@ +/* $Id: bitops.S,v 1.1 2000/03/27 10:38:41 davem Exp $ + * bitops.S: Sparc64 atomic bit operations. + * + * Copyright (C) 2000 David S. Miller (davem@redhat.com) + */ + +#include <asm/asi.h> + + .text + .align 64 + .globl __bitops_begin +__bitops_begin: + + .globl __test_and_set_bit +__test_and_set_bit: /* %o0=nr, %o1=addr */ + srlx %o0, 6, %g1 + mov 1, %g5 + sllx %g1, 3, %g3 + and %o0, 63, %g2 + sllx %g5, %g2, %g5 + add %o1, %g3, %o1 + ldx [%o1], %g7 +1: andcc %g7, %g5, %o0 + bne,pn %xcc, 2f + xor %g7, %g5, %g1 + casx [%o1], %g7, %g1 + cmp %g7, %g1 + bne,a,pn %xcc, 1b + ldx [%o1], %g7 +2: retl + nop + + .globl __test_and_clear_bit +__test_and_clear_bit: /* %o0=nr, %o1=addr */ + srlx %o0, 6, %g1 + mov 1, %g5 + sllx %g1, 3, %g3 + and %o0, 63, %g2 + sllx %g5, %g2, %g5 + add %o1, %g3, %o1 + ldx [%o1], %g7 +1: andcc %g7, %g5, %o0 + be,pn %xcc, 2f + xor %g7, %g5, %g1 + casx [%o1], %g7, %g1 + cmp %g7, %g1 + bne,a,pn %xcc, 1b + ldx [%o1], %g7 +2: retl + nop + + .globl __test_and_change_bit +__test_and_change_bit: /* %o0=nr, %o1=addr */ + srlx %o0, 6, %g1 + mov 1, %g5 + sllx %g1, 3, %g3 + and %o0, 63, %g2 + sllx %g5, %g2, %g5 + add %o1, %g3, %o1 + ldx [%o1], %g7 +1: and %g7, %g5, %o0 + xor %g7, %g5, %g1 + casx [%o1], %g7, %g1 + cmp %g7, %g1 + bne,a,pn %xcc, 1b + ldx [%o1], %g7 +2: retl + nop + nop + + .globl __test_and_set_le_bit +__test_and_set_le_bit: /* %o0=nr, %o1=addr */ + srlx %o0, 5, %g1 + mov 1, %g5 + sllx %g1, 2, %g3 + and %o0, 31, %g2 + sllx %g5, %g2, %g5 + add %o1, %g3, %o1 + lduwa [%o1] ASI_PL, %g7 +1: andcc %g7, %g5, %o0 + bne,pn %icc, 2f + xor %g7, %g5, %g1 + casa [%o1] ASI_PL, %g7, %g1 + cmp %g7, %g1 + bne,a,pn %icc, 1b + lduwa [%o1] ASI_PL, %g7 +2: retl + nop + + .globl __test_and_clear_le_bit +__test_and_clear_le_bit: /* %o0=nr, %o1=addr */ + srlx %o0, 5, %g1 + mov 1, %g5 + sllx %g1, 2, %g3 + and %o0, 31, %g2 + sllx %g5, %g2, %g5 + add %o1, %g3, %o1 + lduwa [%o1] ASI_PL, %g7 +1: andcc %g7, %g5, %o0 + be,pn %icc, 2f + xor %g7, %g5, %g1 + casa [%o1] ASI_PL, %g7, %g1 + cmp %g7, %g1 + bne,a,pn %icc, 1b + lduwa [%o1] ASI_PL, %g7 +2: retl + nop + + .globl __bitops_end +__bitops_end: diff --git a/arch/sparc64/lib/blockops.S b/arch/sparc64/lib/blockops.S index b4a91b97c..9c6a8beba 100644 --- a/arch/sparc64/lib/blockops.S +++ b/arch/sparc64/lib/blockops.S @@ -1,4 +1,4 @@ -/* $Id: blockops.S,v 1.22 2000/03/15 07:18:55 davem Exp $ +/* $Id: blockops.S,v 1.24 2000/03/27 10:38:41 davem Exp $ * blockops.S: UltraSparc block zero optimized routines. * * Copyright (C) 1996, 1998, 1999, 2000 David S. Miller (davem@redhat.com) @@ -38,21 +38,21 @@ copy_page: /* %o0=dest, %o1=src */ sethi %hi(8192), %o2 1: TOUCH(f0, f2, f4, f6, f8, f10, f12, f14) ldda [%o1] ASI_BLK_P, %f32 + stda %f48, [%o0] ASI_BLK_P add %o1, 0x40, %o1 sub %o2, 0x40, %o2 - stda %f48, [%o0] ASI_BLK_P add %o0, 0x40, %o0 TOUCH(f16, f18, f20, f22, f24, f26, f28, f30) ldda [%o1] ASI_BLK_P, %f0 + stda %f48, [%o0] ASI_BLK_P add %o1, 0x40, %o1 sub %o2, 0x40, %o2 - stda %f48, [%o0] ASI_BLK_P add %o0, 0x40, %o0 TOUCH(f32, f34, f36, f38, f40, f42, f44, f46) ldda [%o1] ASI_BLK_P, %f16 - add %o1, 0x40, %o1 - sub %o2, 0x40, %o2 stda %f48, [%o0] ASI_BLK_P + sub %o2, 0x40, %o2 + add %o1, 0x40, %o1 cmp %o2, 0x80 bne,pt %xcc, 1b add %o0, 0x40, %o0 @@ -122,7 +122,11 @@ copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */ stxa %g2, [%o3] ASI_DTLB_DATA_ACCESS membar #Sync - membar #LoadStore | #StoreStore | #StoreLoad + ldub [%g6 + AOFF_task_thread + AOFF_thread_use_blkcommit], %g2 + cmp %g2, 0 + bne,pn %xcc, copy_page_using_blkcommit + nop + ldda [%o1] ASI_BLK_P, %f0 add %o1, 0x40, %o1 ldda [%o1] ASI_BLK_P, %f16 @@ -130,21 +134,21 @@ copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */ sethi %hi(8192), %o2 1: TOUCH(f0, f2, f4, f6, f8, f10, f12, f14) ldda [%o1] ASI_BLK_P, %f32 + stda %f48, [%o0] ASI_BLK_P add %o1, 0x40, %o1 sub %o2, 0x40, %o2 - stda %f48, [%o0] ASI_BLK_P add %o0, 0x40, %o0 TOUCH(f16, f18, f20, f22, f24, f26, f28, f30) ldda [%o1] ASI_BLK_P, %f0 + stda %f48, [%o0] ASI_BLK_P add %o1, 0x40, %o1 sub %o2, 0x40, %o2 - stda %f48, [%o0] ASI_BLK_P add %o0, 0x40, %o0 TOUCH(f32, f34, f36, f38, f40, f42, f44, f46) ldda [%o1] ASI_BLK_P, %f16 - add %o1, 0x40, %o1 - sub %o2, 0x40, %o2 stda %f48, [%o0] ASI_BLK_P + sub %o2, 0x40, %o2 + add %o1, 0x40, %o1 cmp %o2, 0x80 bne,pt %xcc, 1b add %o0, 0x40, %o0 @@ -152,6 +156,7 @@ copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */ stda %f0, [%o0] ASI_BLK_P add %o0, 0x40, %o0 stda %f16, [%o0] ASI_BLK_P +copy_user_page_continue: membar #Sync VISExit @@ -166,6 +171,39 @@ copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */ jmpl %o7 + 0x8, %g0 wrpr %g3, 0x0, %pstate +copy_page_using_blkcommit: + membar #LoadStore | #StoreStore | #StoreLoad + ldda [%o1] ASI_BLK_P, %f0 + add %o1, 0x40, %o1 + ldda [%o1] ASI_BLK_P, %f16 + add %o1, 0x40, %o1 + sethi %hi(8192), %o2 +1: TOUCH(f0, f2, f4, f6, f8, f10, f12, f14) + ldda [%o1] ASI_BLK_P, %f32 + stda %f48, [%o0] ASI_BLK_COMMIT_P + add %o1, 0x40, %o1 + sub %o2, 0x40, %o2 + add %o0, 0x40, %o0 + TOUCH(f16, f18, f20, f22, f24, f26, f28, f30) + ldda [%o1] ASI_BLK_P, %f0 + stda %f48, [%o0] ASI_BLK_COMMIT_P + add %o1, 0x40, %o1 + sub %o2, 0x40, %o2 + add %o0, 0x40, %o0 + TOUCH(f32, f34, f36, f38, f40, f42, f44, f46) + ldda [%o1] ASI_BLK_P, %f16 + stda %f48, [%o0] ASI_BLK_COMMIT_P + sub %o2, 0x40, %o2 + add %o1, 0x40, %o1 + cmp %o2, 0x80 + bne,pt %xcc, 1b + add %o0, 0x40, %o0 + membar #Sync + stda %f0, [%o0] ASI_BLK_COMMIT_P + add %o0, 0x40, %o0 + ba,pt %xcc, copy_user_page_continue + stda %f16, [%o0] ASI_BLK_COMMIT_P + .align 32 .globl clear_page .type clear_page,@function @@ -213,6 +251,7 @@ clear_user_page: /* %o0=dest, %o1=vaddr */ mov 1, %o4 clear_page_common: + membar #StoreLoad | #StoreStore | #LoadStore ! LSU Group fzero %f0 ! FPA Group mov 32, %o1 ! IEU0 fzero %f2 ! FPA Group @@ -223,7 +262,6 @@ clear_page_common: faddd %f0, %f2, %f12 ! FPA Group fmuld %f0, %f2, %f14 ! FPM - membar #StoreLoad | #StoreStore | #LoadStore ! LSU Group 1: stda %f0, [%o0 + %g0] ASI_BLK_P ! Store Group add %o0, 0x40, %o0 ! IEU0 stda %f0, [%o0 + %g0] ASI_BLK_P ! Store Group diff --git a/arch/sparc64/mm/Makefile b/arch/sparc64/mm/Makefile index d97c47778..039195944 100644 --- a/arch/sparc64/mm/Makefile +++ b/arch/sparc64/mm/Makefile @@ -8,10 +8,10 @@ # Note 2! The CFLAGS definition is now in the main makefile... .S.s: - $(CPP) -D__ASSEMBLY__ $(AFLAGS) -ansi $< -o $*.s + $(CPP) $(AFLAGS) -ansi $< -o $*.s .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c $< -o $*.o + $(CC) $(AFLAGS) -ansi -c $< -o $*.o O_TARGET := mm.o O_OBJS := ultra.o fault.o init.o generic.o extable.o modutil.o diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c index 6063d002e..0d8152887 100644 --- a/arch/sparc64/mm/fault.c +++ b/arch/sparc64/mm/fault.c @@ -1,4 +1,4 @@ -/* $Id: fault.c,v 1.43 2000/03/14 03:59:46 davem Exp $ +/* $Id: fault.c,v 1.45 2000/03/27 10:38:51 davem Exp $ * arch/sparc64/mm/fault.c: Page fault handlers for the 64-bit Sparc. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -92,162 +92,211 @@ void unhandled_fault(unsigned long address, struct task_struct *tsk, die_if_kernel("Oops", regs); } -/* #define DEBUG_EXCEPTIONS */ -/* #define DEBUG_LOCKUPS */ - -/* #define INSN_VPTE_LOOKUP */ - -static inline u32 get_user_insn(unsigned long tpc) +static unsigned int get_user_insn(unsigned long tpc) { - u32 insn; -#ifndef INSN_VPTE_LOOKUP pgd_t *pgdp = pgd_offset(current->mm, tpc); pmd_t *pmdp; - pte_t *ptep; + pte_t *ptep, pte; + unsigned long pa; + u32 insn = 0; if(pgd_none(*pgdp)) - return 0; + goto out; pmdp = pmd_offset(pgdp, tpc); if(pmd_none(*pmdp)) - return 0; + goto out; ptep = pte_offset(pmdp, tpc); - if(!pte_present(*ptep)) - return 0; - insn = *(unsigned int *) - ((unsigned long)__va(pte_pagenr(*ptep) << PAGE_SHIFT) + - (tpc & ~PAGE_MASK)); -#else - register unsigned long pte asm("l1"); - - /* So that we don't pollute TLB, we read the instruction - * using PHYS bypass. For that, we of course need - * to know its page table entry. Do this by simulating - * dtlb_miss handler. -jj */ - pte = ((((long)tpc) >> (PAGE_SHIFT-3)) & ~7); - asm volatile (" - rdpr %%pstate, %%l0 - wrpr %%l0, %2, %%pstate - wrpr %%g0, 1, %%tl - mov %%l1, %%g6 - ldxa [%%g3 + %%l1] %3, %%g5 - mov %%g5, %%l1 - wrpr %%g0, 0, %%tl - wrpr %%l0, 0, %%pstate - " : "=r" (pte) : "0" (pte), "i" (PSTATE_MG|PSTATE_IE), "i" (ASI_S) : "l0"); - - if ((long)pte >= 0) return 0; - - pte = (pte & _PAGE_PADDR) + (tpc & ~PAGE_MASK); - asm ("lduwa [%1] %2, %0" : "=r" (insn) : "r" (pte), "i" (ASI_PHYS_USE_EC)); -#endif + pte = *ptep; + if(!pte_present(pte)) + goto out; + + pa = (pte_pagenr(pte) << PAGE_SHIFT) + (tpc & ~PAGE_MASK); + /* Use phys bypass so we don't pollute dtlb/dcache. */ + __asm__ __volatile__("lduwa [%1] %2, %0" + : "=r" (insn) + : "r" (pa), "i" (ASI_PHYS_USE_EC)); + +out: return insn; } -asmlinkage void do_sparc64_fault(struct pt_regs *regs, unsigned long address, int write) +static void do_fault_siginfo(int code, int sig, unsigned long address) +{ + siginfo_t info; + + info.si_code = code; + info.si_signo = sig; + info.si_errno = 0; + info.si_addr = (void *) address; + info.si_trapno = 0; + force_sig_info(sig, &info, current); +} + +extern int handle_ldf_stq(u32, struct pt_regs *); +extern int handle_ld_nf(u32, struct pt_regs *); + +static void do_kernel_fault(struct pt_regs *regs, int si_code, int fault_code, + unsigned int insn, unsigned long address) +{ + unsigned long g2; + unsigned char asi = ASI_P; + + if (!insn) { + if (regs->tstate & TSTATE_PRIV) { + if (regs->tpc & 0x3) + goto cannot_handle; + insn = *(unsigned int *)regs->tpc; + } else { + insn = get_user_insn(regs->tpc); + } + } + + /* If user insn could be read (thus insn is zero), that + * is fine. We will just gun down the process with a signal + * in that case. + */ + + if (!(fault_code & FAULT_CODE_WRITE) && + (insn & 0xc0800000) == 0xc0800000) { + if (insn & 0x2000) + asi = (regs->tstate >> 24); + else + asi = (insn >> 5); + if ((asi & 0xf2) == 0x82) { + if (insn & 0x1000000) { + handle_ldf_stq(insn, regs); + } else { + /* This was a non-faulting load. Just clear the + * destination register(s) and continue with the next + * instruction. -jj + */ + handle_ld_nf(insn, regs); + } + return; + } + } + + g2 = regs->u_regs[UREG_G2]; + + /* Is this in ex_table? */ + if (regs->tstate & TSTATE_PRIV) { + unsigned long fixup; + + if (asi == ASI_P && (insn & 0xc0800000) == 0xc0800000) { + if (insn & 0x2000) + asi = (regs->tstate >> 24); + else + asi = (insn >> 5); + } + + /* Look in asi.h: All _S asis have LS bit set */ + if ((asi & 0x1) && + (fixup = search_exception_table (regs->tpc, &g2))) { + regs->tpc = fixup; + regs->tnpc = regs->tpc + 4; + regs->u_regs[UREG_G2] = g2; + return; + } + } else { + /* The si_code was set to make clear whether + * this was a SEGV_MAPERR or SEGV_ACCERR fault. + */ + do_fault_siginfo(si_code, SIGSEGV, address); + return; + } + +cannot_handle: + unhandled_fault (address, current, regs); +} + +asmlinkage void do_sparc64_fault(struct pt_regs *regs) { struct mm_struct *mm = current->mm; struct vm_area_struct *vma; unsigned int insn = 0; - siginfo_t info; -#ifdef DEBUG_LOCKUPS - static unsigned long lastaddr, lastpc; - static int lastwrite, lockcnt; -#endif + int si_code, fault_code; + unsigned long address; + + si_code = SEGV_MAPERR; + fault_code = current->thread.fault_code; + address = current->thread.fault_address; + + if ((fault_code & FAULT_CODE_ITLB) && + (fault_code & FAULT_CODE_DTLB)) + BUG(); - info.si_code = SEGV_MAPERR; /* * If we're in an interrupt or have no user * context, we must not take the fault.. */ if (in_interrupt() || !mm) - goto do_kernel_fault; + goto handle_kernel_fault; down(&mm->mmap_sem); -#ifdef DEBUG_LOCKUPS - if (regs->tpc == lastpc && - address == lastaddr && - write == lastwrite) { - lockcnt++; - if (lockcnt == 100000) { - unsigned char tmp; - register unsigned long tmp1 asm("o5"); - register unsigned long tmp2 asm("o4"); - - printk("do_sparc64_fault[%s:%d]: possible fault loop for %016lx %s\n", - current->comm, current->pid, - address, write ? "write" : "read"); - printk("do_sparc64_fault: CHECK[papgd[%016lx],pcac[%016lx]]\n", - __pa(mm->pgd), pgd_val(mm->pgd[0])<<11UL); - __asm__ __volatile__( - "wrpr %%g0, 0x494, %%pstate\n\t" - "mov %3, %%g4\n\t" - "mov %%g7, %0\n\t" - "ldxa [%%g4] %2, %1\n\t" - "wrpr %%g0, 0x096, %%pstate" - : "=r" (tmp1), "=r" (tmp2) - : "i" (ASI_DMMU), "i" (TSB_REG)); - printk("do_sparc64_fault: IS[papgd[%016lx],pcac[%016lx]]\n", - tmp1, tmp2); - printk("do_sparc64_fault: CHECK[ctx(%016lx)] IS[ctx(%016lx)]\n", - mm->context, spitfire_get_secondary_context()); - __asm__ __volatile__("rd %%asi, %0" - : "=r" (tmp)); - printk("do_sparc64_fault: CHECK[seg(%02x)] IS[seg(%02x)]\n", - current->thread.current_ds.seg, tmp); - show_regs(regs); - __sti(); - while(1) - barrier(); - } - } else { - lastpc = regs->tpc; - lastaddr = address; - lastwrite = write; - lockcnt = 0; - } -#endif vma = find_vma(mm, address); - if(!vma) + if (!vma) goto bad_area; -#ifndef INSN_VPTE_LOOKUP - write &= 0xf; -#else - if (write & 0x10) { - write = 0; - if((vma->vm_flags & VM_WRITE)) { - if (regs->tstate & TSTATE_PRIV) - insn = *(unsigned int *)regs->tpc; - else - insn = get_user_insn(regs->tpc); - if ((insn & 0xc0200000) == 0xc0200000 && (insn & 0x1780000) != 0x1680000) - write = 1; + + /* Pure DTLB misses do not tell us whether the fault causing + * load/store/atomic was a write or not, it only says that there + * was no match. So in such a case we (carefully) read the + * instruction to try and figure this out. It's an optimization + * so it's ok if we can't do this. + * + * Special hack, window spill/fill knows the exact fault type. + */ + if (((fault_code & + (FAULT_CODE_DTLB | FAULT_CODE_WRITE | FAULT_CODE_WINFIXUP)) == FAULT_CODE_DTLB) && + (vma->vm_flags & VM_WRITE) != 0) { + unsigned long tpc = regs->tpc; + + if (tpc & 0x3) + goto continue_fault; + + if (regs->tstate & TSTATE_PRIV) + insn = *(unsigned int *)tpc; + else + insn = get_user_insn(tpc); + + if ((insn & 0xc0200000) == 0xc0200000 && + (insn & 0x1780000) != 0x1680000) { + /* Don't bother updating thread struct value, + * because update_mmu_cache only cares which tlb + * the access came from. + */ + fault_code |= FAULT_CODE_WRITE; } } -#endif - if(vma->vm_start <= address) +continue_fault: + + if (vma->vm_start <= address) goto good_area; - if(!(vma->vm_flags & VM_GROWSDOWN)) + if (!(vma->vm_flags & VM_GROWSDOWN)) goto bad_area; - if(expand_stack(vma, address)) + if (expand_stack(vma, address)) goto bad_area; /* * Ok, we have a good vm_area for this memory access, so * we can handle it.. */ good_area: - info.si_code = SEGV_ACCERR; - if(write) { - if(!(vma->vm_flags & VM_WRITE)) + si_code = SEGV_ACCERR; + if (fault_code & FAULT_CODE_WRITE) { + if (!(vma->vm_flags & VM_WRITE)) goto bad_area; + if ((vma->vm_flags & VM_EXEC) != 0 && + vma->vm_file != NULL) + current->thread.use_blkcommit = 1; } else { /* Allow reads even for write-only mappings */ - if(!(vma->vm_flags & (VM_READ | VM_EXEC))) + if (!(vma->vm_flags & (VM_READ | VM_EXEC))) goto bad_area; } { - int fault = handle_mm_fault(current, vma, address, write); + int fault = handle_mm_fault(current, vma, + address, (fault_code & FAULT_CODE_WRITE)); if (fault < 0) goto out_of_memory; @@ -255,7 +304,8 @@ good_area: goto do_sigbus; } up(&mm->mmap_sem); - return; + goto fault_done; + /* * Something tried to access memory that isn't in our memory map.. * Fix it, but check if it's kernel or user first.. @@ -263,89 +313,10 @@ good_area: bad_area: up(&mm->mmap_sem); -do_kernel_fault: - { - unsigned long g2; - unsigned char asi = ASI_P; - - if (!insn) { - if (regs->tstate & TSTATE_PRIV) - insn = *(unsigned int *)regs->tpc; - else - insn = get_user_insn(regs->tpc); - } - if (write != 1 && (insn & 0xc0800000) == 0xc0800000) { - if (insn & 0x2000) - asi = (regs->tstate >> 24); - else - asi = (insn >> 5); - if ((asi & 0xf2) == 0x82) { - /* This was a non-faulting load. Just clear the - destination register(s) and continue with the next - instruction. -jj */ - if (insn & 0x1000000) { - extern int handle_ldf_stq(u32, struct pt_regs *); - - handle_ldf_stq(insn, regs); - } else { - extern int handle_ld_nf(u32, struct pt_regs *); - - handle_ld_nf(insn, regs); - } - return; - } - } - - g2 = regs->u_regs[UREG_G2]; - - /* Is this in ex_table? */ - if (regs->tstate & TSTATE_PRIV) { - unsigned long fixup; +handle_kernel_fault: + do_kernel_fault(regs, si_code, fault_code, insn, address); - if (asi == ASI_P && (insn & 0xc0800000) == 0xc0800000) { - if (insn & 0x2000) - asi = (regs->tstate >> 24); - else - asi = (insn >> 5); - } - - /* Look in asi.h: All _S asis have LS bit set */ - if ((asi & 0x1) && - (fixup = search_exception_table (regs->tpc, &g2))) { -#ifdef DEBUG_EXCEPTIONS - printk("Exception: PC<%016lx> faddr<%016lx>\n", - regs->tpc, address); - printk("EX_TABLE: insn<%016lx> fixup<%016lx> " - "g2<%016lx>\n", regs->tpc, fixup, g2); -#endif - regs->tpc = fixup; - regs->tnpc = regs->tpc + 4; - regs->u_regs[UREG_G2] = g2; - return; - } - } else { -#if 0 - extern void __show_regs(struct pt_regs *); - printk("SHIT(%s:%d:cpu(%d)): PC[%016lx] ADDR[%016lx]\n", - current->comm, current->pid, smp_processor_id(), - regs->tpc, address); - __show_regs(regs); - __sti(); - while(1) - barrier(); -#endif - info.si_signo = SIGSEGV; - info.si_errno = 0; - /* info.si_code set above to make clear whether - this was a SEGV_MAPERR or SEGV_ACCERR fault. */ - info.si_addr = (void *)address; - info.si_trapno = 0; - force_sig_info (SIGSEGV, &info, current); - return; - } - unhandled_fault (address, current, regs); - } - return; + goto fault_done; /* * We ran out of memory, or some other thing happened to us that made @@ -356,7 +327,7 @@ out_of_memory: printk("VM: killing process %s\n", current->comm); if (!(regs->tstate & TSTATE_PRIV)) do_exit(SIGKILL); - goto do_kernel_fault; + goto handle_kernel_fault; do_sigbus: up(&mm->mmap_sem); @@ -365,14 +336,15 @@ do_sigbus: * Send a sigbus, regardless of whether we were in kernel * or user mode. */ - info.si_signo = SIGBUS; - info.si_errno = 0; - info.si_code = BUS_ADRERR; - info.si_addr = (void *)address; - info.si_trapno = 0; - force_sig_info (SIGBUS, &info, current); + do_fault_siginfo(BUS_ADRERR, SIGBUS, address); /* Kernel mode? Handle exceptions or die */ if (regs->tstate & TSTATE_PRIV) - goto do_kernel_fault; + goto handle_kernel_fault; + +fault_done: + /* These values are no longer needed, clear them. */ + current->thread.fault_code = 0; + current->thread.use_blkcommit = 0; + current->thread.fault_address = 0; } diff --git a/arch/sparc64/mm/ultra.S b/arch/sparc64/mm/ultra.S index 210db79e6..1c3714e5b 100644 --- a/arch/sparc64/mm/ultra.S +++ b/arch/sparc64/mm/ultra.S @@ -1,11 +1,12 @@ -/* $Id: ultra.S,v 1.38 2000/03/03 23:48:44 davem Exp $ +/* $Id: ultra.S,v 1.41 2000/03/27 10:38:51 davem Exp $ * ultra.S: Don't expand these all over the place... * - * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) + * Copyright (C) 1997, 2000 David S. Miller (davem@redhat.com) */ #include <asm/asi.h> #include <asm/pgtable.h> +#include <asm/page.h> #include <asm/spitfire.h> /* This file is meant to be read efficiently by the CPU, not humans. @@ -160,35 +161,87 @@ __flush_icache_page: /* %o0 = phys_page */ srlx %o0, 5, %o0 clr %o1 ! IC_addr sllx %g1, 36, %g1 + ldda [%o1] ASI_IC_TAG, %o4 sub %g1, 1, %g2 or %o0, %g1, %o0 ! VALID+phys-addr comparitor - sllx %g2, 1, %g2 + sllx %g2, 1, %g2 andn %g2, 0xfe, %g2 ! IC_tag mask -1: ldda [%o1] ASI_IC_TAG, %o4 - and %o5, %g2, %o5 - cmp %o5, %o0 + nop + nop + nop + nop + nop + nop + +1: addx %g0, %g0, %g0 + ldda [%o1 + %o2] ASI_IC_TAG, %g4 + addx %g0, %g0, %g0 + and %o5, %g2, %g3 + cmp %g3, %o0 + add %o1, 0x20, %o1 + ldda [%o1] ASI_IC_TAG, %o4 be,pn %xcc, iflush1 - add %o1, 0x20, %g3 -2: ldda [%o1 + %o2] ASI_IC_TAG, %o4 - and %o5, %g2, %o5 - cmp %o5, %o0 +2: nop + and %g5, %g2, %g5 + cmp %g5, %o0 be,pn %xcc, iflush2 - nop -3: cmp %g3, %o2 +3: cmp %o1, %o2 bne,pt %xcc, 1b - mov %g3, %o1 + addx %g0, %g0, %g0 + nop + + sethi %uhi(PAGE_OFFSET), %g4 retl - nop + sllx %g4, 32, %g4 -iflush1:stxa %g0, [%o1] ASI_IC_TAG +iflush1:sub %o1, 0x20, %g3 + stxa %g0, [%g3] ASI_IC_TAG flush %g6 ba,a,pt %xcc, 2b -iflush2:stxa %g0, [%o1 + %o2] ASI_IC_TAG +iflush2:sub %o1, 0x20, %g3 + stxa %g0, [%o1 + %o2] ASI_IC_TAG flush %g6 ba,a,pt %xcc, 3b + .align 32 +__prefill_dtlb: + rdpr %pstate, %g7 + wrpr %g7, PSTATE_IE, %pstate + mov TLB_TAG_ACCESS, %g1 + stxa %o0, [%g1] ASI_DMMU + stxa %o1, [%g0] ASI_DTLB_DATA_IN + flush %g6 + retl + wrpr %g7, %pstate +__prefill_itlb: + rdpr %pstate, %g7 + wrpr %g7, PSTATE_IE, %pstate + mov TLB_TAG_ACCESS, %g1 + stxa %o0, [%g1] ASI_IMMU + stxa %o1, [%g0] ASI_ITLB_DATA_IN + flush %g6 + retl + wrpr %g7, %pstate + + .globl update_mmu_cache +update_mmu_cache: /* %o0=vma, %o1=address, %o2=pte */ + ldub [%g6 + AOFF_task_thread + AOFF_thread_fault_code], %o3 + srlx %o1, 13, %o1 + ldx [%o0 + 0x0], %o4 /* XXX vma->vm_mm */ + brz,pn %o3, 1f + sllx %o1, 13, %o0 + ldx [%o4 + AOFF_mm_context], %o5 + andcc %o3, FAULT_CODE_DTLB, %g0 + mov %o2, %o1 + and %o5, 0x3ff, %o5 + bne,pt %xcc, __prefill_dtlb + or %o0, %o5, %o0 + ba,a,pt %xcc, __prefill_itlb +1: retl + nop + #ifdef __SMP__ /* These are all called by the slaves of a cross call, at * trap level 1, with interrupts fully disabled. diff --git a/arch/sparc64/prom/Makefile b/arch/sparc64/prom/Makefile index 42906da28..88ca5251b 100644 --- a/arch/sparc64/prom/Makefile +++ b/arch/sparc64/prom/Makefile @@ -18,10 +18,10 @@ promlib.a: $(OBJS) sync .S.s: - $(CPP) -D__ASSEMBLY__ $(AFLAGS) -ansi $< -o $*.s + $(CPP) $(AFLAGS) -ansi $< -o $*.s .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c $< -o $*.o + $(CC) $(AFLAGS) -ansi -c $< -o $*.o dep: $(CPP) $(CPPFLAGS) -M *.c > .depend diff --git a/arch/sparc64/solaris/Makefile b/arch/sparc64/solaris/Makefile index 5e5a6aff8..51598f727 100644 --- a/arch/sparc64/solaris/Makefile +++ b/arch/sparc64/solaris/Makefile @@ -15,10 +15,10 @@ CPPFLAGS = $(MODFLAGS) endif .S.s: - $(CPP) -D__ASSEMBLY__ $(AFLAGS) $(CPPFLAGS) -ansi $< -o $*.s + $(CPP) $(AFLAGS) $(CPPFLAGS) -ansi $< -o $*.s .S.o: - $(CC) -D__ASSEMBLY__ $(AFLAGS) $(CPPFLAGS) -ansi -c $< -o $*.o + $(CC) $(AFLAGS) $(CPPFLAGS) -ansi -c $< -o $*.o ifneq ($(CONFIG_SOLARIS_EMUL),y) do_it_all: diff --git a/arch/sparc64/solaris/fs.c b/arch/sparc64/solaris/fs.c index 4adaf4077..2c17d664d 100644 --- a/arch/sparc64/solaris/fs.c +++ b/arch/sparc64/solaris/fs.c @@ -495,26 +495,18 @@ asmlinkage int solaris_statvfs(u32 path, u32 buf) asmlinkage int solaris_fstatvfs(unsigned int fd, u32 buf) { - struct inode * inode; - struct dentry * dentry; struct file * file; int error; - lock_kernel(); error = -EBADF; file = fget(fd); - if (!file) - goto out; - - if (!(dentry = file->f_dentry)) - error = -ENOENT; - else if (!(inode = dentry->d_inode)) - error = -ENOENT; - else - error = report_statvfs(inode, buf); - fput(file); + if (file) { + lock_kernel(); + error = report_statvfs(file->f_dentry->d_inode, buf); + unlock_kernel(); + fput(file); + } out: - unlock_kernel(); return error; } @@ -538,26 +530,17 @@ asmlinkage int solaris_statvfs64(u32 path, u32 buf) asmlinkage int solaris_fstatvfs64(unsigned int fd, u32 buf) { - struct inode * inode; - struct dentry * dentry; struct file * file; int error; - lock_kernel(); error = -EBADF; file = fget(fd); - if (!file) - goto out; - - if (!(dentry = file->f_dentry)) - error = -ENOENT; - else if (!(inode = dentry->d_inode)) - error = -ENOENT; - else - error = report_statvfs64(inode, buf); - fput(file); -out: - unlock_kernel(); + if (file) { + lock_kernel(); + error = report_statvfs64(file->f_dentry->d_inode, buf); + unlock_kernel(); + fput(file); + } return error; } diff --git a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c index b77a27236..c9341b0fd 100644 --- a/arch/sparc64/solaris/misc.c +++ b/arch/sparc64/solaris/misc.c @@ -72,7 +72,7 @@ static u32 do_solaris_mmap(u32 addr, u32 len, u32 prot, u32 flags, u32 fd, u64 o file = fget(fd); if (!file) goto out; - if (file->f_dentry && file->f_dentry->d_inode) { + else { struct inode * inode = file->f_dentry->d_inode; if(MAJOR(inode->i_rdev) == MEM_MAJOR && MINOR(inode->i_rdev) == 5) { diff --git a/arch/sparc64/solaris/socksys.c b/arch/sparc64/solaris/socksys.c index 89f771609..220e549ac 100644 --- a/arch/sparc64/solaris/socksys.c +++ b/arch/sparc64/solaris/socksys.c @@ -1,4 +1,4 @@ -/* $Id: socksys.c,v 1.12 2000/02/17 05:50:11 davem Exp $ +/* $Id: socksys.c,v 1.13 2000/03/29 11:56:54 davem Exp $ * socksys.c: /dev/inet/ stuff for Solaris emulation. * * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -17,6 +17,7 @@ #include <linux/init.h> #include <linux/poll.h> #include <linux/malloc.h> +#include <linux/in.h> #include <linux/devfs_fs_kernel.h> #include <asm/uaccess.h> diff --git a/arch/sparc64/solaris/timod.c b/arch/sparc64/solaris/timod.c index 062e00218..dbdcc2e1d 100644 --- a/arch/sparc64/solaris/timod.c +++ b/arch/sparc64/solaris/timod.c @@ -1,4 +1,4 @@ -/* $Id: timod.c,v 1.5 1999/11/23 08:55:24 davem Exp $ +/* $Id: timod.c,v 1.6 2000/03/25 03:23:21 davem Exp $ * timod.c: timod emulation. * * Copyright (C) 1998 Patrik Rak (prak3264@ss1000.ms.mff.cuni.cz) @@ -151,7 +151,7 @@ static void timod_wake_socket(unsigned int fd) SOLD("wakeing socket"); sock = ¤t->files->fd[fd]->f_dentry->d_inode->u.socket_i; wake_up_interruptible(&sock->wait); - if (sock->fasync_list && !(sock->flags & SO_WAITDATA)) + if (sock->fasync_list && !test_bit(SOCK_ASYNC_WAITDATA, &sock->flags)) kill_fasync(sock->fasync_list, SIGIO, POLL_IN); SOLD("done"); } |