From 4f2a8b91849835f235f279f96d95d5262d6fd05f Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 2 Jun 2011 09:07:35 +0200 Subject: [PATCH 1/1] Fixes (asm, entry, irq, linker, defconfig) --- arch/m68k/coldfire/config.c | 6 +- arch/m68k/coldfire/ints.c | 22 +- arch/m68k/configs/m5484lite_defconfig | 1032 ++++++++++++++++++++++--- arch/m68k/include/asm/checksum.h | 56 +- arch/m68k/include/asm/entry_mm.h | 58 ++ arch/m68k/include/asm/string.h | 3 +- arch/m68k/kernel/Makefile | 4 +- arch/m68k/kernel/cf-head.S | 7 +- arch/m68k/kernel/entry.S | 130 +++- arch/m68k/kernel/ints.c | 1 + arch/m68k/kernel/setup.c | 3 + arch/m68k/kernel/vmlinux-cf.lds | 6 +- arch/m68k/kernel/vmlinux.lds.S | 4 +- arch/m68k/lib/checksum.c | 113 +++ arch/m68k/lib/muldi3.c | 10 + arch/m68k/lib/uaccess.c | 241 ++++++ arch/m68k/mm/cf-mmu.c | 24 + 17 files changed, 1573 insertions(+), 147 deletions(-) diff --git a/arch/m68k/coldfire/config.c b/arch/m68k/coldfire/config.c index 4f5f9edf9aca..8ddd42eadef2 100644 --- a/arch/m68k/coldfire/config.c +++ b/arch/m68k/coldfire/config.c @@ -244,7 +244,7 @@ void settimericr(unsigned int timer, unsigned int level) asmlinkage void buserr(void); asmlinkage void trap(void); asmlinkage void system_call(void); -asmlinkage void inthandler(void); +asmlinkage void auto_inthandler(void); void __init coldfire_trap_init(void) { @@ -267,9 +267,9 @@ void __init coldfire_trap_init(void) for (i = 33; (i <= 63); i++) vectors[i] = trap; for (i = 24; (i <= 31); i++) - vectors[i] = inthandler; + vectors[i] = auto_inthandler; for (i = 64; (i < 255); i++) - vectors[i] = inthandler; + vectors[i] = auto_inthandler; vectors[255] = 0; vectors[2] = buserr; diff --git a/arch/m68k/coldfire/ints.c b/arch/m68k/coldfire/ints.c index abadadc33f08..332a3247c7b2 100644 --- a/arch/m68k/coldfire/ints.c +++ b/arch/m68k/coldfire/ints.c @@ -96,24 +96,32 @@ void __init init_IRQ(void) #endif } +unsigned int irq_canonicalize(unsigned int irq) +{ + return irq; +} + +EXPORT_SYMBOL(irq_canonicalize); + + /* - * process_int(unsigned long vec, struct pt_regs *fp) + * __m68k_handle_int(unsigned long vec, struct pt_regs *fp) * * Process an interrupt. Called from entry.S. */ -asmlinkage void process_int(unsigned long vec, struct pt_regs *fp) +asmlinkage void __m68k_handle_int(unsigned int irq, struct pt_regs *regs) { struct pt_regs *old_regs; struct irq_node *node; - old_regs = set_irq_regs(fp); - kstat_cpu(0).irqs[vec]++; + old_regs = set_irq_regs(regs); + kstat_cpu(0).irqs[irq]++; - node = irq_list[vec]; + node = irq_list[irq]; if (!node) - handle_badint(fp); + handle_badint(regs); else { do { - node->handler(vec, node->dev_id); + node->handler(irq, node->dev_id); node = node->next; } while (node); } diff --git a/arch/m68k/configs/m5484lite_defconfig b/arch/m68k/configs/m5484lite_defconfig index e9b5edcc6a82..b35d43bf7f91 100644 --- a/arch/m68k/configs/m5484lite_defconfig +++ b/arch/m68k/configs/m5484lite_defconfig @@ -1,117 +1,969 @@ -CONFIG_MTD_PHYSMAP=y -# CONFIG_MTD_PHYSMAP_START=0xff800000 -# CONFIG_MTD_PHYSMAP_COMPAT=y -# CONFIG_MTD_PHYSMAP_LEN=0x400000 -# CONFIG_MTD_PHYSMAP_BANKWIDTH=2 -CONFIG_DMADEVICES=y -CONFIG_CFDMA=y -CONFIG_FPU=y -# CONFIG_M5474LITE is not set -CONFIG_M5484LITE=y -# CONFIG_M5441X is not set -# CONFIG_VDSO is not set -CONFIG_BROADCOM5222_PHY=y -# CONFIG_8139TOO is not set -CONFIG_ADVANCED=y -# CONFIG_AMIGA is not set -# CONFIG_APOLLO is not set -# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set +# +# Automatically generated make config: don't edit +# Linux/m68k 2.6.37 Kernel Configuration +# Fri May 27 11:18:53 2011 +# +CONFIG_M68K=y +CONFIG_MMU=y +# CONFIG_GENERIC_TIME is not set +# CONFIG_GENERIC_CLOCKEVENTS is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_ARCH_HAS_ILOG2_U32 is not set # CONFIG_ARCH_HAS_ILOG2_U64 is not set -CONFIG_ARCH_SUPPORTS_AOUT=y -# CONFIG_ARCH_SUPPORTS_MSI is not set -# CONFIG_ATARI is not set -# CONFIG_BINFMT_AOUT is not set -CONFIG_BITREVERSE=y -CONFIG_BOOTPARAM=y -CONFIG_BOOTPARAM_STRING="console=ttyS0,115200 mtdparts=phys_mapped_flash:4m(Boot)" -CONFIG_BOUNCE=y -CONFIG_CFV4E=y -CONFIG_CLASSIC_RCU=y -# CONFIG_COLDFIRE_EDMA is not set -# CONFIG_COLDFIRE_WATCHDOG is not set -CONFIG_COLDFIRE=y -CONFIG_FEC_DMA_AUTO_NEGOTIATION=y -CONFIG_FEC_DMA_ENABLE_FEC2=y -CONFIG_FEC_DMA=y -CONFIG_FEC_DMA_SHARED_PHY=y -# CONFIG_GENERIC_CLOCKEVENTS is not set +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_TIME_LOW_RES=y CONFIG_GENERIC_IOMAP=y -# CONFIG_GENERIC_TIME is not set -# CONFIG_GEN_RTC is not set -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAVE_IDE=y -# CONFIG_HAVE_KPROBES is not set -# CONFIG_HAVE_KRETPROBES is not set -# CONFIG_HAVE_OPROFILE is not set +# CONFIG_NO_IOPORT is not set +# CONFIG_NO_DMA is not set +CONFIG_HZ=100 +CONFIG_ARCH_USES_GETTIMEOFFSET=y +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_CONSTRUCTORS=y + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_CROSS_COMPILE="" +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_TASKSTATS is not set +# CONFIG_AUDIT is not set +# CONFIG_HAVE_GENERIC_HARDIRQS is not set + +# +# RCU Subsystem +# +CONFIG_TINY_RCU=y +# CONFIG_PREEMPT_RCU is not set +# CONFIG_TREE_RCU_TRACE is not set +CONFIG_IKCONFIG=y +# CONFIG_IKCONFIG_PROC is not set +CONFIG_LOG_BUF_SHIFT=17 +# CONFIG_CGROUPS is not set +CONFIG_NAMESPACES=y +CONFIG_UTS_NS=y +CONFIG_IPC_NS=y +CONFIG_USER_NS=y +CONFIG_PID_NS=y +CONFIG_NET_NS=y +# CONFIG_SYSFS_DEPRECATED is not set +# CONFIG_RELAY is not set +# CONFIG_BLK_DEV_INITRD is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y +CONFIG_ANON_INODES=y +# CONFIG_EMBEDDED is not set +CONFIG_UID16=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y + +# +# Kernel Performance Events And Counters +# +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_SLUB_DEBUG=y +CONFIG_COMPAT_BRK=y +# CONFIG_SLAB is not set +CONFIG_SLUB=y +# CONFIG_PROFILING is not set + +# +# GCOV-based kernel profiling +# +# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_LOAD is not set +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +CONFIG_MODVERSIONS=y +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_BLOCK=y +CONFIG_LBDAF=y +CONFIG_BLK_DEV_BSG=y +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_DEFAULT_DEADLINE is not set +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +# CONFIG_INLINE_SPIN_TRYLOCK is not set +# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK is not set +# CONFIG_INLINE_SPIN_LOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK_IRQ is not set +# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set +CONFIG_INLINE_SPIN_UNLOCK=y +# CONFIG_INLINE_SPIN_UNLOCK_BH is not set +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y +# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_READ_TRYLOCK is not set +# CONFIG_INLINE_READ_LOCK is not set +# CONFIG_INLINE_READ_LOCK_BH is not set +# CONFIG_INLINE_READ_LOCK_IRQ is not set +# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set +CONFIG_INLINE_READ_UNLOCK=y +# CONFIG_INLINE_READ_UNLOCK_BH is not set +CONFIG_INLINE_READ_UNLOCK_IRQ=y +# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_WRITE_TRYLOCK is not set +# CONFIG_INLINE_WRITE_LOCK is not set +# CONFIG_INLINE_WRITE_LOCK_BH is not set +# CONFIG_INLINE_WRITE_LOCK_IRQ is not set +# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set +CONFIG_INLINE_WRITE_UNLOCK=y +# CONFIG_INLINE_WRITE_UNLOCK_BH is not set +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y +# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set +# CONFIG_MUTEX_SPIN_ON_OWNER is not set +# CONFIG_FREEZER is not set + +# +# Platform dependent setup +# +CONFIG_COLDFIRE=y +CONFIG_CFV4E=y +CONFIG_FPU=y +CONFIG_MCD_DMA=y +# CONFIG_AMIGA is not set +# CONFIG_ATARI is not set +# CONFIG_MAC is not set +# CONFIG_APOLLO is not set +# CONFIG_VME is not set # CONFIG_HP300 is not set -CONFIG_HW_RANDOM=y -# CONFIG_IDE is not set -CONFIG_INITRAMFS_SOURCE="" -# CONFIG_LEDS_ALIX is not set +# CONFIG_SUN3X is not set +# CONFIG_Q40 is not set +# CONFIG_SUN3 is not set + +# +# Processor type +# +# CONFIG_M68020 is not set +# CONFIG_M68030 is not set +# CONFIG_M68040 is not set +# CONFIG_M68060 is not set # CONFIG_M5445X is not set +# CONFIG_HAVE_FSL_USB_DR is not set +CONFIG_M547X_8X=y +# CONFIG_M547X is not set +CONFIG_M548X=y +# CONFIG_M5474LITE is not set # CONFIG_M5475AFE is not set # CONFIG_M5475BFE is not set # CONFIG_M5475CFE is not set # CONFIG_M5475DFE is not set # CONFIG_M5475EFE is not set # CONFIG_M5475FFE is not set -CONFIG_M547X_8X=y -# CONFIG_M547X is not set +CONFIG_M5484LITE=y # CONFIG_M5485AFE is not set # CONFIG_M5485BFE is not set # CONFIG_M5485CFE is not set # CONFIG_M5485DFE is not set # CONFIG_M5485EFE is not set # CONFIG_M5485FFE is not set -CONFIG_M548X=y -# CONFIG_M68020 is not set -# CONFIG_M68030 is not set -# CONFIG_M68040 is not set -# CONFIG_M68060 is not set -# CONFIG_M68KFPU_EMU is not set -CONFIG_M68K=y -# CONFIG_MAC is not set -CONFIG_MCD_DMA=y CONFIG_MCFCLK=200000000 -CONFIG_MCF_USER_HALT=y -# CONFIG_MEMSTICK is not set +# CONFIG_MCF_USER_HALT is not set CONFIG_MMU_CFV4E=y -CONFIG_MTD_CFI_ADV_OPTIONS=y -# CONFIG_MTD_CFI_GEOMETRY is not set -# CONFIG_NE2K_PCI is not set -CONFIG_NEED_MULTIPLE_NODES=y -# CONFIG_NETDEV_1000 is not set -# CONFIG_NET_VENDOR_3COM is not set -# CONFIG_NO_DMA is not set -# CONFIG_NO_IOPORT is not set +CONFIG_SDRAM_BASE=0x00000000 +CONFIG_SDRAM_SIZE=0x04000000 CONFIG_NOR_FLASH_BASE=0xFF800000 -# CONFIG_PCI_LEGACY is not set -# CONFIG_PCIPCWATCHDOG is not set -# CONFIG_PROC_HARDWARE is not set -# CONFIG_Q40 is not set -# CONFIG_R6040 is not set +CONFIG_DMA_BASE=0xef000000 +CONFIG_DMA_SIZE=0x800000 +# CONFIG_VDSO is not set +# CONFIG_M68KFPU_EMU is not set +CONFIG_ADVANCED=y # CONFIG_RMW_INSNS is not set +CONFIG_SINGLE_MEMORY_CHUNK=y +# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_NEED_MULTIPLE_NODES=y +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_PHYS_ADDR_T_64BIT is not set +CONFIG_ZONE_DMA_FLAG=1 +CONFIG_BOUNCE=y +CONFIG_VIRT_TO_BUS=y +# CONFIG_KSM is not set +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 +CONFIG_NEED_PER_CPU_KM=y + +# +# General setup +# +CONFIG_BINFMT_ELF=y +CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y +CONFIG_HAVE_AOUT=y +# CONFIG_BINFMT_AOUT is not set +# CONFIG_BINFMT_MISC is not set +CONFIG_PROC_HARDWARE=y +CONFIG_ZONE_DMA=y +# CONFIG_ARCH_SUPPORTS_MSI is not set +CONFIG_NET=y + +# +# Networking options +# +# CONFIG_PACKET is not set +CONFIG_UNIX=y +CONFIG_XFRM=y +# CONFIG_XFRM_USER is not set +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_STATISTICS is not set +CONFIG_NET_KEY=y +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_ASK_IP_FIB_HASH=y +# CONFIG_IP_FIB_TRIE is not set +CONFIG_IP_FIB_HASH=y +# CONFIG_IP_MULTIPLE_TABLES is not set +# CONFIG_IP_ROUTE_MULTIPATH is not set +# CONFIG_IP_ROUTE_VERBOSE is not set +CONFIG_IP_PNP=y +# CONFIG_IP_PNP_DHCP is not set +# CONFIG_IP_PNP_BOOTP is not set +# CONFIG_IP_PNP_RARP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE_DEMUX is not set +# CONFIG_ARPD is not set +# CONFIG_SYN_COOKIES is not set +CONFIG_INET_AH=y +CONFIG_INET_ESP=y +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_XFRM_TUNNEL is not set +# CONFIG_INET_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +# CONFIG_INET_LRO is not set +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set +# CONFIG_IPV6 is not set +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETWORK_PHY_TIMESTAMPING is not set +# CONFIG_NETFILTER is not set +# CONFIG_IP_DCCP is not set +# CONFIG_IP_SCTP is not set +# CONFIG_RDS is not set +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_L2TP is not set +# CONFIG_BRIDGE is not set +# CONFIG_NET_DSA is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_PHONET is not set +# CONFIG_IEEE802154 is not set +# CONFIG_NET_SCHED is not set +# CONFIG_DCB is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_CAN is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +# CONFIG_AF_RXRPC is not set +# CONFIG_WIRELESS is not set +# CONFIG_WIMAX is not set +# CONFIG_RFKILL is not set +# CONFIG_NET_9P is not set +# CONFIG_CAIF is not set +# CONFIG_CEPH_LIB is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="" +# CONFIG_DEVTMPFS is not set +# CONFIG_STANDALONE is not set +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +CONFIG_FIRMWARE_IN_KERNEL=y +CONFIG_EXTRA_FIRMWARE="" +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_SYS_HYPERVISOR is not set +# CONFIG_CONNECTOR is not set +# CONFIG_MTD is not set +# CONFIG_PARPORT is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set + +# +# DRBD disabled because PROC_FS, INET or CONNECTOR not selected +# +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_ATA_OVER_ETH is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_RBD is not set +CONFIG_MISC_DEVICES=y +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_C2PORT is not set + +# +# EEPROM support +# +# CONFIG_EEPROM_93CX6 is not set + +# +# Texas Instruments shared transport line discipline +# +CONFIG_HAVE_IDE=y +# CONFIG_IDE is not set + +# +# SCSI device support +# +CONFIG_SCSI_MOD=y +# CONFIG_RAID_ATTRS is not set +# CONFIG_SCSI is not set # CONFIG_SCSI_DMA is not set -CONFIG_SDRAM_BASE=0x00000000 -CONFIG_SDRAM_SIZE=0x04000000 +# CONFIG_SCSI_NETLINK is not set +# CONFIG_MD is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_MACVLAN is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_VETH is not set +# CONFIG_MII is not set +CONFIG_PHYLIB=y + +# +# MII PHY device drivers +# +# CONFIG_MARVELL_PHY is not set +# CONFIG_DAVICOM_PHY is not set +# CONFIG_QSEMI_PHY is not set +# CONFIG_LXT_PHY is not set +# CONFIG_CICADA_PHY is not set +# CONFIG_VITESSE_PHY is not set +# CONFIG_SMSC_PHY is not set +# CONFIG_BROADCOM_PHY is not set +# CONFIG_BROADCOM5222_PHY is not set +# CONFIG_BCM63XX_PHY is not set +# CONFIG_ICPLUS_PHY is not set +# CONFIG_REALTEK_PHY is not set +# CONFIG_NATIONAL_PHY is not set +# CONFIG_STE10XP is not set +# CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_MICREL_PHY is not set +# CONFIG_FIXED_PHY is not set +# CONFIG_MDIO_BITBANG is not set +CONFIG_NET_ETHERNET=y +# CONFIG_SMC91X is not set +# CONFIG_ETHOC is not set +# CONFIG_DNET is not set +# CONFIG_IBM_NEW_EMAC_ZMII is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set +# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set +# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set +# CONFIG_B44 is not set +# CONFIG_KS8851_MLL is not set +CONFIG_FEC_DMA=y +CONFIG_FEC_DMA_ENABLE_FEC2=y +# CONFIG_FEC_DMA_SHARED_PHY is not set +# CONFIG_NETDEV_1000 is not set +# CONFIG_NETDEV_10000 is not set +# CONFIG_WLAN is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# +# CONFIG_WAN is not set + +# +# CAIF transport drivers +# +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_ISDN is not set +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y +# CONFIG_INPUT_FF_MEMLESS is not set +# CONFIG_INPUT_POLLDEV is not set +# CONFIG_INPUT_SPARSEKMAP is not set + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +CONFIG_KEYBOARD_ATKBD=y +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_OPENCORES is not set +# CONFIG_KEYBOARD_STOWAWAY is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=y +CONFIG_MOUSE_PS2_ALPS=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_TRACKPOINT=y +# CONFIG_MOUSE_PS2_ELANTECH is not set +# CONFIG_MOUSE_PS2_SENTELIC is not set +# CONFIG_MOUSE_PS2_TOUCHKIT is not set +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +CONFIG_SERIO=y +CONFIG_SERIO_SERPORT=y +CONFIG_SERIO_LIBPS2=y +# CONFIG_SERIO_RAW is not set +# CONFIG_SERIO_ALTERA_PS2 is not set +# CONFIG_SERIO_PS2MULT is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +# CONFIG_VT_HW_CONSOLE_BINDING is not set +CONFIG_DEVKMEM=y +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_N_GSM is not set + +# +# Serial drivers +# # CONFIG_SERIAL_8250 is not set -# CONFIG_SERIAL_COLDFIRE_IRDA is not set -# CONFIG_SERIAL_COLDFIRE is not set -# CONFIG_SERIAL_CONSOLE is not set + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_SERIAL_MCF=y -# CONFIG_SERIAL_COLDFIRE_EDMA is not set CONFIG_SERIAL_MCF_BAUDRATE=115200 CONFIG_SERIAL_MCF_CONSOLE=y -CONFIG_SINGLE_MEMORY_CHUNK=y -CONFIG_SLABINFO=y -# CONFIG_SUN3 is not set -# CONFIG_SUN3X is not set -CONFIG_TIME_LOW_RES=y -CONFIG_UID16=y +# CONFIG_SERIAL_TIMBERDALE is not set +# CONFIG_SERIAL_ALTERA_JTAGUART is not set +# CONFIG_SERIAL_ALTERA_UART is not set +CONFIG_UNIX98_PTYS=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +# CONFIG_IPMI_HANDLER is not set +# CONFIG_HW_RANDOM is not set +# CONFIG_GEN_RTC is not set +# CONFIG_R3964 is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_TCG_TPM is not set +# CONFIG_RAMOOPS is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set + +# +# PPS support +# +# CONFIG_PPS is not set +# CONFIG_W1 is not set +# CONFIG_POWER_SUPPLY is not set +CONFIG_HWMON=y +# CONFIG_HWMON_VID is not set +# CONFIG_HWMON_DEBUG_CHIP is not set + +# +# Native drivers +# +# CONFIG_SENSORS_F71805F is not set +# CONFIG_SENSORS_F71882FG is not set +# CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_PC87427 is not set +# CONFIG_SENSORS_SMSC47M1 is not set +# CONFIG_SENSORS_SMSC47B397 is not set +# CONFIG_SENSORS_VT1211 is not set +# CONFIG_SENSORS_W83627HF is not set +# CONFIG_SENSORS_W83627EHF is not set +# CONFIG_THERMAL is not set +# CONFIG_WATCHDOG is not set +CONFIG_SSB_POSSIBLE=y + +# +# Sonics Silicon Backplane +# +# CONFIG_SSB is not set +# CONFIG_MFD_SUPPORT is not set +# CONFIG_REGULATOR is not set +# CONFIG_MEDIA_SUPPORT is not set + +# +# Graphics support +# +# CONFIG_DRM is not set # CONFIG_VGASTATE is not set -# CONFIG_VIA_RHINE is not set -# CONFIG_VME is not set -CONFIG_UBOOT=y +# CONFIG_VIDEO_OUTPUT_CONTROL is not set +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Display device support +# +# CONFIG_DISPLAY_SUPPORT is not set + +# +# Console display driver support +# +CONFIG_DUMMY_CONSOLE=y +# CONFIG_SOUND is not set +CONFIG_HID_SUPPORT=y +CONFIG_HID=y +# CONFIG_HIDRAW is not set +# CONFIG_HID_PID is not set + +# +# Special HID drivers +# +CONFIG_USB_SUPPORT=y +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set +# CONFIG_USB_ARCH_HAS_EHCI is not set + +# +# Enable Host or Gadget support to see Inventra options +# + +# +# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may +# +# CONFIG_USB_GADGET is not set + +# +# OTG and related infrastructure +# +# CONFIG_MMC is not set +# CONFIG_MEMSTICK is not set +# CONFIG_NEW_LEDS is not set +# CONFIG_ACCESSIBILITY is not set +# CONFIG_RTC_CLASS is not set +CONFIG_DMADEVICES=y +# CONFIG_DMADEVICES_DEBUG is not set + +# +# DMA Devices +# +# CONFIG_TIMB_DMA is not set +# CONFIG_AUXDISPLAY is not set +# CONFIG_UIO is not set +# CONFIG_STAGING is not set + +# +# Character devices +# + +# +# File systems +# +# CONFIG_EXT2_FS is not set +# CONFIG_EXT3_FS is not set +# CONFIG_EXT4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_FS_POSIX_ACL is not set +# CONFIG_XFS_FS is not set +# CONFIG_GFS2_FS is not set +# CONFIG_OCFS2_FS is not set +# CONFIG_BTRFS_FS is not set +# CONFIG_NILFS2_FS is not set +CONFIG_FILE_LOCKING=y +CONFIG_FSNOTIFY=y +CONFIG_DNOTIFY=y +# CONFIG_INOTIFY_USER is not set +# CONFIG_FANOTIFY is not set +# CONFIG_QUOTA is not set +# CONFIG_QUOTACTL is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_FS is not set + +# +# Caches +# +# CONFIG_FSCACHE is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +# CONFIG_PROC_KCORE is not set +CONFIG_PROC_SYSCTL=y +CONFIG_PROC_PAGE_MONITOR=y +CONFIG_SYSFS=y +# CONFIG_TMPFS is not set +# CONFIG_HUGETLB_PAGE is not set +# CONFIG_CONFIGFS_FS is not set +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_LOGFS is not set +# CONFIG_CRAMFS is not set +CONFIG_SQUASHFS=y +# CONFIG_SQUASHFS_XATTR is not set +# CONFIG_SQUASHFS_LZO is not set +# CONFIG_SQUASHFS_EMBEDDED is not set +CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 +# CONFIG_VXFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_OMFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set +# CONFIG_NFS_V4 is not set +CONFIG_ROOT_NFS=y +# CONFIG_NFSD is not set +CONFIG_LOCKD=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_CEPH_FS is not set +# CONFIG_CIFS is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_CODEPAGE_437=y +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ASCII is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set +# CONFIG_DLM is not set + +# +# Kernel hacking +# +CONFIG_PRINTK_TIME=y +CONFIG_ENABLE_WARN_DEPRECATED=y +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_FRAME_WARN=1024 +# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_STRIP_ASM_SYMS is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +CONFIG_DEBUG_KERNEL=y +CONFIG_LOCKUP_DETECTOR=y +# CONFIG_HARDLOCKUP_DETECTOR is not set +# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set +CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 +# CONFIG_DETECT_HUNG_TASK is not set +CONFIG_SCHED_DEBUG=y +CONFIG_SCHEDSTATS=y +CONFIG_TIMER_STATS=y +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_SLUB_DEBUG_ON is not set +# CONFIG_SLUB_STATS is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +CONFIG_BKL=y +# CONFIG_SPARSE_RCU_POINTER is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_KOBJECT is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_INFO_REDUCED is not set +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_WRITECOUNT is not set +CONFIG_DEBUG_MEMORY_INIT=y +# CONFIG_DEBUG_LIST is not set +# CONFIG_TEST_LIST_SORT is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_DEBUG_CREDENTIALS is not set +# CONFIG_FRAME_POINTER is not set +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_BACKTRACE_SELF_TEST is not set +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_SYSCTL_SYSCALL_CHECK is not set +# CONFIG_PAGE_POISONING is not set +# CONFIG_ATOMIC64_SELFTEST is not set +# CONFIG_SAMPLES is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY_DMESG_RESTRICT is not set +# CONFIG_SECURITY is not set +# CONFIG_SECURITYFS is not set +CONFIG_DEFAULT_SECURITY_DAC=y +CONFIG_DEFAULT_SECURITY="" +CONFIG_CRYPTO=y + +# +# Crypto core or helper +# +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_BLKCIPHER=y +CONFIG_CRYPTO_BLKCIPHER2=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_RNG=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_PCOMP2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y +# CONFIG_CRYPTO_GF128MUL is not set +# CONFIG_CRYPTO_NULL is not set +CONFIG_CRYPTO_WORKQUEUE=y +# CONFIG_CRYPTO_CRYPTD is not set +CONFIG_CRYPTO_AUTHENC=y +# CONFIG_CRYPTO_TEST is not set + +# +# Authenticated Encryption with Associated Data +# +# CONFIG_CRYPTO_CCM is not set +# CONFIG_CRYPTO_GCM is not set +# CONFIG_CRYPTO_SEQIV is not set + +# +# Block modes +# +CONFIG_CRYPTO_CBC=y +# CONFIG_CRYPTO_CTR is not set +# CONFIG_CRYPTO_CTS is not set +# CONFIG_CRYPTO_ECB is not set +# CONFIG_CRYPTO_LRW is not set +# CONFIG_CRYPTO_PCBC is not set +# CONFIG_CRYPTO_XTS is not set + +# +# Hash modes +# +CONFIG_CRYPTO_HMAC=y +# CONFIG_CRYPTO_XCBC is not set +# CONFIG_CRYPTO_VMAC is not set + +# +# Digest +# +CONFIG_CRYPTO_CRC32C=y +# CONFIG_CRYPTO_GHASH is not set +# CONFIG_CRYPTO_MD4 is not set +CONFIG_CRYPTO_MD5=y +# CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_RMD128 is not set +# CONFIG_CRYPTO_RMD160 is not set +# CONFIG_CRYPTO_RMD256 is not set +# CONFIG_CRYPTO_RMD320 is not set +CONFIG_CRYPTO_SHA1=y +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_TGR192 is not set +# CONFIG_CRYPTO_WP512 is not set + +# +# Ciphers +# +CONFIG_CRYPTO_AES=y +# CONFIG_CRYPTO_ANUBIS is not set +# CONFIG_CRYPTO_ARC4 is not set +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_CAMELLIA is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +CONFIG_CRYPTO_DES=y +# CONFIG_CRYPTO_FCRYPT is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_SALSA20 is not set +# CONFIG_CRYPTO_SEED is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_TEA is not set +# CONFIG_CRYPTO_TWOFISH is not set + +# +# Compression +# +# CONFIG_CRYPTO_DEFLATE is not set +# CONFIG_CRYPTO_ZLIB is not set +# CONFIG_CRYPTO_LZO is not set + +# +# Random Number Generation +# +CONFIG_CRYPTO_ANSI_CPRNG=y +CONFIG_CRYPTO_HW=y +# CONFIG_BINARY_PRINTF is not set + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_GENERIC_FIND_LAST_BIT=y +CONFIG_CRC_CCITT=y +CONFIG_CRC16=y +# CONFIG_CRC_T10DIF is not set +# CONFIG_CRC_ITU_T is not set +CONFIG_CRC32=y +# CONFIG_CRC7 is not set +CONFIG_LIBCRC32C=y +CONFIG_ZLIB_INFLATE=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_NLATTR=y +CONFIG_GENERIC_ATOMIC64=y diff --git a/arch/m68k/include/asm/checksum.h b/arch/m68k/include/asm/checksum.h index bfd09bcaa102..ec0d4767426c 100644 --- a/arch/m68k/include/asm/checksum.h +++ b/arch/m68k/include/asm/checksum.h @@ -34,30 +34,6 @@ extern __wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum); - -#ifdef CONFIG_COLDFIRE - -/* - * The ColdFire cores don't support all the 68k instructions used - * in the optimized checksum code below. So it reverts back to using - * more standard C coded checksums. The fast checksum code is - * significantly larger than the optimized version, so it is not - * inlined here. - */ -__sum16 ip_fast_csum(const void *iph, unsigned int ihl); - -static inline __sum16 csum_fold(__wsum sum) -{ - unsigned int tmp = (__force u32)sum; - - tmp = (tmp & 0xffff) + (tmp >> 16); - tmp = (tmp & 0xffff) + (tmp >> 16); - - return (__force __sum16)~tmp; -} - -#else - /* * This is a version of ip_fast_csum() optimized for IP headers, * which always checksum on 4 octet boundaries. @@ -67,7 +43,21 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) unsigned int sum = 0; unsigned long tmp; #ifdef CONFIG_COLDFIRE - #error need to do this in CF asm + __asm__ ("subql #1,%2\n" + "1:\t" + "movel %1@+,%3\n\t" + "addxl %3,%0\n\t" + "subql #1,%2\n\t" + "bra 1b\n\t" + "movel %0,%3\n\t" + "swap %3\n\t" + "andl #0x0000FFFF,%3\n\t" + "addxl %3,%0\n\t" + "clrl %3\n\t" + "addxl %3,%0\n\t" + : "=d" (sum), "=&a" (iph), "=&d" (ihl), "=&d" (tmp) + : "0" (sum), "1" (iph), "2" (ihl) + : "memory"); #else __asm__ ("subqw #1,%2\n" "1:\t" @@ -90,10 +80,13 @@ static inline __sum16 csum_fold(__wsum sum) { unsigned int tmp = (__force u32)sum; #ifdef CONFIG_COLDFIRE - #error need to do this in CF asm - /*tmp = (tmp & 0xffff) + (tmp >> 16); - tmp = (tmp & 0xffff) + (tmp >> 16); - return (__force __sum16) ~tmp;*/ + __asm__("swap %1\n\t" + "andl #0x0000FFFF,%1\n\t" + "addl %1, %0\n\t" + "clrl %1\n\t" + "addxl %1, %0" + : "=&d" (sum), "=&d" (tmp) + : "0" (sum), "1" (tmp)); #else __asm__("swap %1\n\t" @@ -102,12 +95,10 @@ static inline __sum16 csum_fold(__wsum sum) "addxw %1, %0" : "=&d" (sum), "=&d" (tmp) : "0" (sum), "1" (tmp)); -#endif +#endif /* CONFIG_COLDFIRE */ return (__force __sum16)~sum; } -#endif /* CONFIG_COLDFIRE */ - static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len, unsigned short proto, __wsum sum) @@ -151,6 +142,7 @@ csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __u32 len, unsigned short proto, __wsum sum) { register unsigned long tmp; + __asm__("addl %2@,%0\n\t" "movel %2@(4),%1\n\t" "addxl %1,%0\n\t" diff --git a/arch/m68k/include/asm/entry_mm.h b/arch/m68k/include/asm/entry_mm.h index 2ffb1bea9283..703301ee81dc 100644 --- a/arch/m68k/include/asm/entry_mm.h +++ b/arch/m68k/include/asm/entry_mm.h @@ -9,6 +9,7 @@ #ifdef CONFIG_COLDFIRE #include +#include #endif /* @@ -78,7 +79,12 @@ LFLUSH_I_AND_D = 0x00000808 clrl %sp@- | stk_adj pea -1:w | orig d0 movel %d0,%sp@- | d0 +#ifdef CONFIG_COLDFIRE + subal #(8*4), %sp + moveml %d1-%d5/%a0-%a1/%curptr,%sp@ +#else moveml %d1-%d5/%a0-%a1/%curptr,%sp@- +#endif .endm .macro save_all_sys @@ -89,11 +95,21 @@ LFLUSH_I_AND_D = 0x00000808 clrl %sp@- | stk_adj movel %d0,%sp@- | orig d0 movel %d0,%sp@- | d0 +#ifdef CONFIG_COLDFIRE + subal #(8*4), %sp + moveml %d1-%d5/%a0-%a1/%curptr,%sp@ +#else moveml %d1-%d5/%a0-%a1/%curptr,%sp@- +#endif .endm .macro restore_all +#ifdef CONFIG_COLDFIRE + moveml %sp@,%a0-%a1/%curptr/%d1-%d5 + addal #(8*4), %sp +#else moveml %sp@+,%a0-%a1/%curptr/%d1-%d5 +#endif movel %sp@+,%d0 addql #4,%sp | orig d0 addl %sp@+,%sp | stk adj @@ -109,6 +125,27 @@ LFLUSH_I_AND_D = 0x00000808 #define RESTORE_SWITCH_STACK restore_switch_stack #define GET_CURRENT(tmp) get_current tmp +#ifdef CONFIG_COLDFIRE + +.macro save_switch_stack + subal #(6*4), %sp + moveml %a3-%a6/%d6-%d7,%sp@ +.endm + +.macro restore_switch_stack + moveml %sp@,%a3-%a6/%d6-%d7 + addal #(6*4), %sp +.endm + +.macro get_current reg=%d0 + movel %sp,\reg + andl #-THREAD_SIZE,\reg + movel \reg,%curptr + movel %curptr@,%curptr +.endm + +#else + .macro save_switch_stack moveml %a3-%a6/%d6-%d7,%sp@- .endm @@ -124,11 +161,30 @@ LFLUSH_I_AND_D = 0x00000808 movel %curptr@,%curptr .endm +#endif + + + #else /* C source */ #define STR(X) STR1(X) #define STR1(X) #X +#ifdef CONFIG_COLDFIRE + +#define SAVE_ALL_INT \ + "clrl %%sp@-;" /* stk_adj */ \ + "pea -1:w;" /* orig d0 = -1 */ \ + "movel %%d0,%%sp@-;" /* d0 */ \ + "subal #(8*4),%sp" \ + "moveml %%d1-%%d5/%%a0-%%a2,%%sp@" +#define GET_CURRENT(tmp) \ + "movel %%sp,"#tmp"\n\t" \ + "andl #-"STR(THREAD_SIZE)","#tmp"\n\t" \ + "movel "#tmp",%%a2\n\t" + +#else + #define SAVE_ALL_INT \ "clrl %%sp@-;" /* stk_adj */ \ "pea -1:w;" /* orig d0 = -1 */ \ @@ -142,4 +198,6 @@ LFLUSH_I_AND_D = 0x00000808 #endif +#endif + #endif /* __M68K_ENTRY_H */ diff --git a/arch/m68k/include/asm/string.h b/arch/m68k/include/asm/string.h index 2936dda938d7..a3c28782f3e7 100644 --- a/arch/m68k/include/asm/string.h +++ b/arch/m68k/include/asm/string.h @@ -112,13 +112,14 @@ static inline int strcmp(const char *cs, const char *ct) return res; } +#endif /* CONFIG_COLDFIRE */ + #define __HAVE_ARCH_MEMMOVE extern void *memmove(void *, const void *, __kernel_size_t); #define __HAVE_ARCH_MEMCMP extern int memcmp(const void *, const void *, __kernel_size_t); #define memcmp(d, s, n) __builtin_memcmp(d, s, n) -#endif /* CONFIG_COLDFIRE */ #define __HAVE_ARCH_MEMSET extern void *memset(void *, int, __kernel_size_t); diff --git a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile index df95b62c1e77..c85f37406f8e 100644 --- a/arch/m68k/kernel/Makefile +++ b/arch/m68k/kernel/Makefile @@ -12,11 +12,11 @@ endif extra-y += vmlinux.lds -obj-y := process.o ptrace.o module.o \ +obj-y := entry.o process.o ptrace.o module.o \ sys_m68k.o time.o setup.o m68k_ksyms.o devres.o ifndef CONFIG_COLDFIRE - obj-y += entry.o signal.o traps.o ints.o + obj-y += signal.o traps.o ints.o endif devres-y = ../../../kernel/irq/devres.o diff --git a/arch/m68k/kernel/cf-head.S b/arch/m68k/kernel/cf-head.S index e1b53214f679..edb1a02f1d01 100644 --- a/arch/m68k/kernel/cf-head.S +++ b/arch/m68k/kernel/cf-head.S @@ -33,7 +33,7 @@ .globl set_context .globl set_fpga #if defined(CONFIG_UBOOT) -.global uboot_init_sp +.globl uboot_init_sp #endif @@ -570,13 +570,14 @@ ENTRY(__running_high) movel %a1,%a0@ /* zero bss */ - lea _sbss,%a0 +/* FIXME: FFS WHY? */ +/* lea _sbss,%a0 lea _ebss,%a1 clrl %d0 _loop_bss: movel %d0,(%a0)+ cmpl %a0,%a1 - bne _loop_bss + bne _loop_bss */ /* Unmap unity mappings */ #if CONFIG_SDRAM_BASE != PAGE_OFFSET diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index 6360c437dcf5..e97d01feedac 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S @@ -50,6 +50,10 @@ .globl auto_irqhandler_fixup .globl user_irqvec_fixup, user_irqhandler_fixup +#ifdef CONFIG_COLDFIRE +.global sw_usp, sw_ksp +#endif + .text ENTRY(buserr) SAVE_ALL_INT @@ -77,7 +81,12 @@ ENTRY(ret_from_fork) jra .Lret_from_exception do_trace_entry: +#ifdef CONFIG_COLDFIRE + movel #-ENOSYS,%d1 /* needed for strace */ + movel %d1,%sp@(PT_OFF_D0) +#else movel #-ENOSYS,%sp@(PT_OFF_D0)| needed for strace +#endif subql #4,%sp SAVE_SWITCH_STACK jbsr syscall_trace @@ -87,7 +96,12 @@ do_trace_entry: cmpl #NR_syscalls,%d0 jcs syscall badsys: +#ifdef CONFIG_COLDFIRE + movel #-ENOSYS,%d1 + movel %d1,%sp@(PT_OFF_D0) +#else movel #-ENOSYS,%sp@(PT_OFF_D0) +#endif jra ret_from_syscall do_trace_exit: @@ -126,8 +140,17 @@ ENTRY(system_call) cmpl #NR_syscalls,%d0 jcc badsys syscall: +#ifdef CONFIG_COLDFIRE + movel #sys_call_table,%a0 + asll #2,%d0 + addl %d0,%a0 + movel %a0@,%a0 + jsr %a0@ + movel %d0,%sp@(PT_OFF_D0) | save the return value +#else jbsr @(sys_call_table,%d0:l:4)@(0) movel %d0,%sp@(PT_OFF_D0) | save the return value +#endif ret_from_syscall: |oriw #0x0700,%sr movew %curptr@(TASK_INFO+TINFO_FLAGS+2),%d0 @@ -137,11 +160,20 @@ ret_from_syscall: syscall_exit_work: btst #5,%sp@(PT_OFF_SR) | check if returning to kernel bnes 1b | if so, skip resched, signals +#ifdef CONFIG_COLDFIRE + btstl #15,%d0 + jne do_trace_exit + btstl #14,%d0 + jne do_delayed_trace + btstl #6,%d0 + jne do_signal_return +#else lslw #1,%d0 jcs do_trace_exit jmi do_delayed_trace lslw #8,%d0 jmi do_signal_return +#endif pea resume_userspace jra schedule @@ -153,7 +185,16 @@ ENTRY(ret_from_exception) | only allow interrupts when we are really the last one on the | kernel stack, otherwise stack overflow can occur during | heavy interrupt load + +#ifdef CONFIG_COLDFIRE + movel %d0,%sp@- + move %sr,%d0 + andl #ALLOWINT,%d0 + move %d0,%sr + movel %sp@+,%d0 +#else andw #ALLOWINT,%sr +#endif resume_userspace: moveb %curptr@(TASK_INFO+TINFO_FLAGS+3),%d0 @@ -163,8 +204,13 @@ resume_userspace: exit_work: | save top of frame movel %sp,%curptr@(TASK_THREAD+THREAD_ESP0) +#ifdef CONFIG_COLDFIRE + btstl #6,%d0 + jne do_signal_return +#else lslb #1,%d0 jmi do_signal_return +#endif pea resume_userspace jra schedule @@ -201,10 +247,19 @@ do_delayed_trace: ENTRY(auto_inthandler) SAVE_ALL_INT GET_CURRENT(%d0) +#ifdef CONFIG_COLDFIRE + addql #1,%curptr@(TASK_INFO+TINFO_PREEMPT) + | put exception # in d0 + movel %sp@(PT_OFF_FORMATVEC),%d0 + swap %d0 | extract bits 25:18 + lsrl #2,%d0 + andl #0x0ff,%d0 +#else addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) | put exception # in d0 bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0 subw #VEC_SPUR,%d0 +#endif movel %sp,%sp@- movel %d0,%sp@- | put vector # on stack @@ -213,14 +268,23 @@ auto_irqhandler_fixup = . + 2 addql #8,%sp | pop parameters off stack ret_from_interrupt: +#ifdef CONFIG_COLDFIRE + subql #1,%curptr@(TASK_INFO+TINFO_PREEMPT) +#else subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) +#endif jeq ret_from_last_interrupt 2: RESTORE_ALL ALIGN ret_from_last_interrupt: +#ifdef CONFIG_COLDFIRE + moveb %sp@(PT_OFF_SR),%d0 + andl #(~ALLOWINT>>8)&0xff,%d0 +#else moveq #(~ALLOWINT>>8)&0xff,%d0 andb %sp@(PT_OFF_SR),%d0 +#endif jne 2b /* check if we need to do software interrupts */ @@ -234,11 +298,21 @@ ret_from_last_interrupt: ENTRY(user_inthandler) SAVE_ALL_INT GET_CURRENT(%d0) +#ifdef CONFIG_COLDFIRE + addql #1,%curptr@(TASK_INFO+TINFO_PREEMPT) + | put exception # in d0 + movel %sp@(PT_OFF_FORMATVEC),%d0 +user_irqvec_fixup = . + 2 + swap %d0 | extract bits 25:18 + lsrl #2,%d0 + andl #0x0ff,%d0 +#else addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) | put exception # in d0 bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0 user_irqvec_fixup = . + 2 - subw #VEC_USER,%d0 + subw #VEC_SPUR,%d0 +#endif movel %sp,%sp@- movel %d0,%sp@- | put vector # on stack @@ -246,7 +320,11 @@ user_irqhandler_fixup = . + 2 jsr __m68k_handle_int | process the IRQ addql #8,%sp | pop parameters off stack +#ifdef CONFIG_COLDFIRE + subql #1,%curptr@(TASK_INFO+TINFO_PREEMPT) +#else subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) +#endif jeq ret_from_last_interrupt RESTORE_ALL @@ -255,13 +333,29 @@ user_irqhandler_fixup = . + 2 ENTRY(bad_inthandler) SAVE_ALL_INT GET_CURRENT(%d0) +#ifdef CONFIG_COLDFIRE + addql #1,%curptr@(TASK_INFO+TINFO_PREEMPT) + | put exception # in d0 + movel %sp@(PT_OFF_FORMATVEC),%d0 + swap %d0 | extract bits 25:18 + lsrl #2,%d0 + andl #0x0ff,%d0 +#else addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) + | put exception # in d0 + bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0 + subw #VEC_SPUR,%d0 +#endif movel %sp,%sp@- jsr handle_badint addql #4,%sp +#ifdef CONFIG_COLDFIRE + subql #1,%curptr@(TASK_INFO+TINFO_PREEMPT) +#else subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1) +#endif jeq ret_from_last_interrupt RESTORE_ALL @@ -325,6 +419,20 @@ resume: * registers until their contents are no longer needed. */ +#ifdef CONFIG_COLDFIRE + /* save sr */ + movew %sr,%d0 + movew %d0,%a0@(TASK_THREAD+THREAD_SR) + + /* On CF use %a1 to save usp */ + movel %a1,%d0 + + /* save usp */ + movel %usp,%a1 + movel %a1,%a0@(TASK_THREAD+THREAD_USP) + + movel %d0,%a1 +#else /* save sr */ movew %sr,%a0@(TASK_THREAD+THREAD_SR) @@ -336,6 +444,7 @@ resume: /* it is better to use a movel here instead of a movew 8*) */ movec %usp,%d0 movel %d0,%a0@(TASK_THREAD+THREAD_USP) +#endif /* save non-scratch registers on stack */ SAVE_SWITCH_STACK @@ -344,7 +453,7 @@ resume: movel %sp,%a0@(TASK_THREAD+THREAD_KSP) /* save floating point context */ -#ifndef CONFIG_M68KFPU_EMU_ONLY +#if !defined(CONFIG_M68KFPU_EMU_ONLY) && !defined(CONFIG_COLDFIRE) #ifdef CONFIG_M68KFPU_EMU tstl m68k_fputype jeq 3f @@ -378,7 +487,7 @@ resume: movel %a1,%curptr /* restore floating point context */ -#ifndef CONFIG_M68KFPU_EMU_ONLY +#if !defined(CONFIG_M68KFPU_EMU_ONLY) && !defined(CONFIG_COLDFIRE) #ifdef CONFIG_M68KFPU_EMU tstl m68k_fputype jeq 4f @@ -415,6 +524,11 @@ resume: movel %a1@(TASK_THREAD+THREAD_USP),%a0 movel %a0,%usp +#ifdef CONFIG_COLDFIRE + /* restore status register */ + movew %a1@(TASK_THREAD+THREAD_SR),%d0 + movew %d0,%sr +#else /* restore fs (sfc,%dfc) */ movew %a1@(TASK_THREAD+THREAD_FS),%a0 movec %a0,%sfc @@ -423,10 +537,20 @@ resume: /* restore status register */ movew %a1@(TASK_THREAD+THREAD_SR),%sr +#endif rts .data ALIGN + +#ifdef CONFIG_COLDFIRE +sw_ksp: + .long 0 + +sw_usp: + .long 0 +#endif + sys_call_table: .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */ .long sys_exit diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c index 761ee0440c99..7ac9b8d35dbc 100644 --- a/arch/m68k/kernel/ints.c +++ b/arch/m68k/kernel/ints.c @@ -405,6 +405,7 @@ asmlinkage void __m68k_handle_int(unsigned int irq, struct pt_regs *regs) set_irq_regs(old_regs); } + asmlinkage void handle_badint(struct pt_regs *regs) { kstat_cpu(0).irqs[0]++; diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c index 1abe3412c7f6..3fffe2ff38e7 100644 --- a/arch/m68k/kernel/setup.c +++ b/arch/m68k/kernel/setup.c @@ -87,6 +87,9 @@ void (*mach_sched_init) (irq_handler_t handler) __initdata = NULL; void (*mach_init_IRQ) (void) __initdata = NULL; void (*mach_get_model) (char *model); void (*mach_get_hardware_list) (struct seq_file *m); +#ifdef CONFIG_COLDFIRE +void (*mach_tick)(void); +#endif /* machine dependent timer functions */ unsigned long (*mach_gettimeoffset) (void); int (*mach_hwclk) (int, struct rtc_time*); diff --git a/arch/m68k/kernel/vmlinux-cf.lds b/arch/m68k/kernel/vmlinux-cf.lds index 595a3a438f98..88ceea422557 100755 --- a/arch/m68k/kernel/vmlinux-cf.lds +++ b/arch/m68k/kernel/vmlinux-cf.lds @@ -112,11 +112,7 @@ SECTIONS *(.data.init_task) /* The initial task and kernel stack */ } - _sbss = .; - .bss : AT(ADDR(.bss) - LOAD_OFFSET) { /* BSS */ - *(.bss) - } - _ebss = .; + BSS_SECTION(0, 0, 0) _end = . ; diff --git a/arch/m68k/kernel/vmlinux.lds.S b/arch/m68k/kernel/vmlinux.lds.S index 99ba315bd0a8..707b40b16952 100644 --- a/arch/m68k/kernel/vmlinux.lds.S +++ b/arch/m68k/kernel/vmlinux.lds.S @@ -3,7 +3,9 @@ PHDRS text PT_LOAD FILEHDR PHDRS FLAGS (7); data PT_LOAD FLAGS (7); } -#ifdef CONFIG_SUN3 +#ifdef CONFIG_COLDFIRE +#include "vmlinux-cf.lds" +#elif defined CONFIG_SUN3 #include "vmlinux-sun3.lds" #else #include "vmlinux-std.lds" diff --git a/arch/m68k/lib/checksum.c b/arch/m68k/lib/checksum.c index 6216f12a756b..05d90fe870b7 100644 --- a/arch/m68k/lib/checksum.c +++ b/arch/m68k/lib/checksum.c @@ -35,6 +35,118 @@ #include #include +#ifdef CONFIG_COLDFIRE + +static inline unsigned short from32to16(unsigned long x) +{ + /* add up 16-bit and 16-bit for 16+c bit */ + x = (x & 0xffff) + (x >> 16); + /* add up carry.. */ + x = (x & 0xffff) + (x >> 16); + return x; +} + +static unsigned long do_csum(const unsigned char *buff, int len) +{ + int odd, count; + unsigned long result = 0; + + if (len <= 0) + goto out; + odd = 1 & (unsigned long) buff; + if (odd) { + result = *buff; + len--; + buff++; + } + count = len >> 1; /* nr of 16-bit words.. */ + if (count) { + if (2 & (unsigned long) buff) { + result += *(unsigned short *) buff; + count--; + len -= 2; + buff += 2; + } + count >>= 1; /* nr of 32-bit words.. */ + if (count) { + unsigned long carry = 0; + do { + unsigned long w = *(unsigned long *) buff; + count--; + buff += 4; + result += carry; + result += w; + carry = (w > result); + } while (count); + result += carry; + result = (result & 0xffff) + (result >> 16); + } + if (len & 2) { + result += *(unsigned short *) buff; + buff += 2; + } + } + if (len & 1) + result += (*buff << 8); + result = from32to16(result); + if (odd) + result = ((result >> 8) & 0xff) | ((result & 0xff) << 8); +out: + return result; +} + +/* + * computes the checksum of a memory block at buff, length len, + * and adds in "sum" (32-bit) + * + * returns a 32-bit number suitable for feeding into itself + * or csum_tcpudp_magic + * + * this function must be called with even lengths, except + * for the last fragment, which may be odd + * + * it's best to have buff aligned on a 32-bit boundary + */ +__wsum csum_partial(const void *buff, int len, __wsum sum) +{ + unsigned int result = do_csum(buff, len); + + /* add in old sum, and carry.. */ + result += sum; + if (sum > result) + result += 1; + return result; +} +EXPORT_SYMBOL(csum_partial); + +/* + * copy from fs while checksumming, otherwise like csum_partial + */ + +__wsum +csum_partial_copy_from_user(const void __user *src, void *dst, int len, + __wsum sum, int *csum_err) +{ + if (csum_err) *csum_err = 0; + memcpy(dst, src, len); + return csum_partial(dst, len, sum); +} +EXPORT_SYMBOL(csum_partial_copy_from_user); + +/* + * copy from ds while checksumming, otherwise like csum_partial + */ + +__wsum +csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum) +{ + memcpy(dst, src, len); + return csum_partial(dst, len, sum); +} +EXPORT_SYMBOL(csum_partial_copy_nocheck); + +#else /* !CONFIG_COLDFIRE */ + /* * computes a partial checksum, e.g. for TCP/UDP fragments */ @@ -423,3 +535,4 @@ csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum) return(sum); } EXPORT_SYMBOL(csum_partial_copy_nocheck); +#endif /* CONFIG_COLDFIRE */ diff --git a/arch/m68k/lib/muldi3.c b/arch/m68k/lib/muldi3.c index be4f275649e3..c5da89fa2519 100644 --- a/arch/m68k/lib/muldi3.c +++ b/arch/m68k/lib/muldi3.c @@ -21,12 +21,22 @@ Boston, MA 02111-1307, USA. */ #define BITS_PER_UNIT 8 +#ifdef CONFIG_COLDFIRE +#define umul_ppmm(w1, w0, u, v) \ + do { \ + unsigned long long x; \ + x = (unsigned long long)u * v; \ + w0 = (unsigned long)(x & 0x00000000ffffffff); \ + w1 = (unsigned long)(x & 0xffffffff00000000) >> 32; \ + } while (0) +#else /* CONFIG_COLDFIRE */ #define umul_ppmm(w1, w0, u, v) \ __asm__ ("mulu%.l %3,%1:%0" \ : "=d" ((USItype)(w0)), \ "=d" ((USItype)(w1)) \ : "%0" ((USItype)(u)), \ "dmi" ((USItype)(v))) +#endif /* CONFIG_COLDFIRE */ #define __umulsidi3(u, v) \ ({DIunion __w; \ diff --git a/arch/m68k/lib/uaccess.c b/arch/m68k/lib/uaccess.c index 13854ed8cd9a..acdc97a082a9 100644 --- a/arch/m68k/lib/uaccess.c +++ b/arch/m68k/lib/uaccess.c @@ -5,6 +5,7 @@ */ #include +#ifndef CONFIG_COLDFIRE #include unsigned long __generic_copy_from_user(void *to, const void __user *from, @@ -220,3 +221,243 @@ unsigned long __clear_user(void __user *to, unsigned long n) return res; } EXPORT_SYMBOL(__clear_user); + +#else /* CONFIG_COLDFIRE */ + +#include + +unsigned long __generic_copy_from_user(void *to, const void *from, + unsigned long n) +{ + unsigned long tmp; + __asm__ __volatile__ + (" tstl %2\n" + " jeq 2f\n" + "1: movel (%1)+,%3\n" + " movel %3,(%0)+\n" + " subql #1,%2\n" + " jne 1b\n" + "2: movel %4,%2\n" + " bclr #1,%2\n" + " jeq 4f\n" + "3: movew (%1)+,%3\n" + " movew %3,(%0)+\n" + "4: bclr #0,%2\n" + " jeq 6f\n" + "5: moveb (%1)+,%3\n" + " moveb %3,(%0)+\n" + "6:\n" + ".section .fixup,\"ax\"\n" + " .even\n" + "7: movel %2,%%d0\n" + "71:clrl (%0)+\n" + " subql #1,%%d0\n" + " jne 71b\n" + " lsll #2,%2\n" + " addl %4,%2\n" + " btst #1,%4\n" + " jne 81f\n" + " btst #0,%4\n" + " jne 91f\n" + " jra 6b\n" + "8: addql #2,%2\n" + "81:clrw (%0)+\n" + " btst #0,%4\n" + " jne 91f\n" + " jra 6b\n" + "9: addql #1,%2\n" + "91:clrb (%0)+\n" + " jra 6b\n" + ".previous\n" + ".section __ex_table,\"a\"\n" + " .align 4\n" + " .long 1b,7b\n" + " .long 3b,8b\n" + " .long 5b,9b\n" + ".previous" + : "=a"(to), "=a"(from), "=d"(n), "=&d"(tmp) + : "d"(n & 3), "0"(to), "1"(from), "2"(n/4) + : "d0", "memory"); + return n; +} +EXPORT_SYMBOL(__generic_copy_from_user); + + +unsigned long __generic_copy_to_user(void *to, const void *from, + unsigned long n) +{ + unsigned long tmp; + __asm__ __volatile__ + (" tstl %2\n" + " jeq 3f\n" + "1: movel (%1)+,%3\n" + "22:movel %3,(%0)+\n" + "2: subql #1,%2\n" + " jne 1b\n" + "3: movel %4,%2\n" + " bclr #1,%2\n" + " jeq 4f\n" + " movew (%1)+,%3\n" + "24:movew %3,(%0)+\n" + "4: bclr #0,%2\n" + " jeq 5f\n" + " moveb (%1)+,%3\n" + "25:moveb %3,(%0)+\n" + "5:\n" + ".section .fixup,\"ax\"\n" + " .even\n" + "60:addql #1,%2\n" + "6: lsll #2,%2\n" + " addl %4,%2\n" + " jra 5b\n" + "7: addql #2,%2\n" + " jra 5b\n" + "8: addql #1,%2\n" + " jra 5b\n" + ".previous\n" + ".section __ex_table,\"a\"\n" + " .align 4\n" + " .long 1b,60b\n" + " .long 22b,6b\n" + " .long 2b,6b\n" + " .long 24b,7b\n" + " .long 3b,60b\n" + " .long 4b,7b\n" + " .long 25b,8b\n" + " .long 5b,8b\n" + ".previous" + : "=a"(to), "=a"(from), "=d"(n), "=&d"(tmp) + : "r"(n & 3), "0"(to), "1"(from), "2"(n / 4) + : "memory"); + return n; +} +EXPORT_SYMBOL(__generic_copy_to_user); + +/* + * Copy a null terminated string from userspace. + */ + +long strncpy_from_user(char *dst, const char *src, long count) +{ + long res = -EFAULT; + if (!(access_ok(VERIFY_READ, src, 1))) /* --tym-- */ + return res; + if (count == 0) return count; + __asm__ __volatile__ + ("1: moveb (%2)+,%%d0\n" + "12:moveb %%d0,(%1)+\n" + " jeq 2f\n" + " subql #1,%3\n" + " jne 1b\n" + "2: subl %3,%0\n" + "3:\n" + ".section .fixup,\"ax\"\n" + " .even\n" + "4: movel %4,%0\n" + " jra 3b\n" + ".previous\n" + ".section __ex_table,\"a\"\n" + " .align 4\n" + " .long 1b,4b\n" + " .long 12b,4b\n" + ".previous" + : "=d"(res), "=a"(dst), "=a"(src), "=d"(count) + : "i"(-EFAULT), "0"(count), "1"(dst), "2"(src), "3"(count) + : "d0", "memory"); + return res; +} +EXPORT_SYMBOL(strncpy_from_user); + +/* + * Return the size of a string (including the ending 0) + * + * Return 0 on exception, a value greater than N if too long + */ +long strnlen_user(const char *src, long n) +{ + long res = -EFAULT; + if (!(access_ok(VERIFY_READ, src, 1))) /* --tym-- */ + return res; + + res = -(long)src; + __asm__ __volatile__ + ("1:\n" + " tstl %2\n" + " jeq 3f\n" + "2: moveb (%1)+,%%d0\n" + "22:\n" + " subql #1,%2\n" + " tstb %%d0\n" + " jne 1b\n" + " jra 4f\n" + "3:\n" + " addql #1,%0\n" + "4:\n" + " addl %1,%0\n" + "5:\n" + ".section .fixup,\"ax\"\n" + " .even\n" + "6: moveq %3,%0\n" + " jra 5b\n" + ".previous\n" + ".section __ex_table,\"a\"\n" + " .align 4\n" + " .long 2b,6b\n" + " .long 22b,6b\n" + ".previous" + : "=d"(res), "=a"(src), "=d"(n) + : "i"(0), "0"(res), "1"(src), "2"(n) + : "d0"); + return res; +} +EXPORT_SYMBOL(strnlen_user); + + +/* + * Zero Userspace + */ + +unsigned long __clear_user(void *to, unsigned long n) +{ + __asm__ __volatile__ + (" tstl %1\n" + " jeq 3f\n" + "1: movel %3,(%0)+\n" + "2: subql #1,%1\n" + " jne 1b\n" + "3: movel %2,%1\n" + " bclr #1,%1\n" + " jeq 4f\n" + "24:movew %3,(%0)+\n" + "4: bclr #0,%1\n" + " jeq 5f\n" + "25:moveb %3,(%0)+\n" + "5:\n" + ".section .fixup,\"ax\"\n" + " .even\n" + "61:addql #1,%1\n" + "6: lsll #2,%1\n" + " addl %2,%1\n" + " jra 5b\n" + "7: addql #2,%1\n" + " jra 5b\n" + "8: addql #1,%1\n" + " jra 5b\n" + ".previous\n" + ".section __ex_table,\"a\"\n" + " .align 4\n" + " .long 1b,61b\n" + " .long 2b,6b\n" + " .long 3b,61b\n" + " .long 24b,7b\n" + " .long 4b,7b\n" + " .long 25b,8b\n" + " .long 5b,8b\n" + ".previous" + : "=a"(to), "=d"(n) + : "r"(n & 3), "d"(0), "0"(to), "1"(n/4)); + return n; +} +EXPORT_SYMBOL(__clear_user); + +#endif /* CONFIG_COLDFIRE */ diff --git a/arch/m68k/mm/cf-mmu.c b/arch/m68k/mm/cf-mmu.c index 629e7a2cab57..ce58496afd46 100644 --- a/arch/m68k/mm/cf-mmu.c +++ b/arch/m68k/mm/cf-mmu.c @@ -233,4 +233,28 @@ void __init mmu_context_init(void) atomic_set(&nr_free_contexts, LAST_CONTEXT - FIRST_CONTEXT + 1); } +/* + * Steal a context from a task that has one at the moment. + * This is only used on 8xx and 4xx and we presently assume that + * they don't do SMP. If they do then thicfpgalloc.hs will have to check + * whether the MM we steal is in use. + * We also assume that this is only used on systems that don't + * use an MMU hash table - this is true for 8xx and 4xx. + * This isn't an LRU system, it just frees up each context in + * turn (sort-of pseudo-random replacement :). This would be the + * place to implement an LRU scheme if anyone was motivated to do it. + * -- paulus + */ +void steal_context(void) +{ + struct mm_struct *mm; + /* free up context `next_mmu_context' */ + /* if we shouldn't free context 0, don't... */ + if (next_mmu_context < FIRST_CONTEXT) + next_mmu_context = FIRST_CONTEXT; + mm = context_mm[next_mmu_context]; + flush_tlb_mm(mm); + destroy_context(mm); +} + -- 2.39.2