--- linux-2.6.11-rc1/arch/alpha/kernel/irq_i8259.c 2003-06-14 12:18:29.000000000 -0700 +++ 25/arch/alpha/kernel/irq_i8259.c 2005-01-19 20:33:21.356136784 -0800 @@ -22,7 +22,7 @@ /* Note mask bit is true for DISABLED irqs. */ static unsigned int cached_irq_mask = 0xffff; -static spinlock_t i8259_irq_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(i8259_irq_lock); static inline void i8259_update_irq_hw(unsigned int irq, unsigned long mask) --- linux-2.6.11-rc1/arch/alpha/kernel/irq_srm.c 2003-06-14 12:18:30.000000000 -0700 +++ 25/arch/alpha/kernel/irq_srm.c 2005-01-19 20:33:21.356136784 -0800 @@ -15,7 +15,7 @@ * at the same time in multiple CPUs? To be safe I added a spinlock * but it can be removed trivially if the palcode is robust against smp. */ -spinlock_t srm_irq_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(srm_irq_lock); static inline void srm_enable_irq(unsigned int irq) --- linux-2.6.11-rc1/arch/alpha/kernel/setup.c 2004-08-15 00:35:02.000000000 -0700 +++ 25/arch/alpha/kernel/setup.c 2005-01-19 20:34:09.093879544 -0800 @@ -111,8 +111,6 @@ struct alpha_machine_vector alpha_mv; int alpha_using_srm; #endif -unsigned char aux_device_present = 0xaa; - #define N(a) (sizeof(a)/sizeof(a[0])) static struct alpha_machine_vector *get_sysvec(unsigned long, unsigned long, --- linux-2.6.11-rc1/arch/alpha/kernel/smc37c669.c 2004-08-15 00:35:02.000000000 -0700 +++ 25/arch/alpha/kernel/smc37c669.c 2005-01-19 20:33:21.358136480 -0800 @@ -1104,7 +1104,7 @@ static int SMC37c669_xlate_drq( int drq ); -static spinlock_t smc_lock __cacheline_aligned = SPIN_LOCK_UNLOCKED; +static __cacheline_aligned DEFINE_SPINLOCK(smc_lock); /* **++ --- linux-2.6.11-rc1/arch/alpha/kernel/srmcons.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/alpha/kernel/srmcons.c 2005-01-19 20:33:21.358136480 -0800 @@ -22,7 +22,7 @@ #include -static spinlock_t srmcons_callback_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(srmcons_callback_lock); static int srm_is_registered_console = 0; /* @@ -160,7 +160,7 @@ static int srmcons_get_private_struct(struct srmcons_private **ps) { static struct srmcons_private *srmconsp = NULL; - static spinlock_t srmconsp_lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(srmconsp_lock); unsigned long flags; int retval = 0; --- linux-2.6.11-rc1/arch/alpha/kernel/sys_dp264.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/alpha/kernel/sys_dp264.c 2005-01-19 20:33:21.359136328 -0800 @@ -43,7 +43,7 @@ static unsigned long cached_irq_mask; /* dp264 boards handle at max four CPUs */ static unsigned long cpu_irq_affinity[4] = { 0UL, 0UL, 0UL, 0UL }; -spinlock_t dp264_irq_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(dp264_irq_lock); static void tsunami_update_irq_hw(unsigned long mask) --- linux-2.6.11-rc1/arch/alpha/kernel/sys_rawhide.c 2004-10-18 16:55:19.000000000 -0700 +++ 25/arch/alpha/kernel/sys_rawhide.c 2005-01-19 20:33:21.360136176 -0800 @@ -42,7 +42,7 @@ static unsigned int hose_irq_masks[4] = 0xff0000, 0xfe0000, 0xff0000, 0xff0000 }; static unsigned int cached_irq_masks[4]; -spinlock_t rawhide_irq_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(rawhide_irq_lock); static inline void rawhide_update_irq_hw(int hose, int mask) --- linux-2.6.11-rc1/arch/alpha/kernel/sys_sable.c 2004-10-18 16:55:19.000000000 -0700 +++ 25/arch/alpha/kernel/sys_sable.c 2005-01-19 20:33:21.360136176 -0800 @@ -31,7 +31,7 @@ #include "pci_impl.h" #include "machvec_impl.h" -spinlock_t sable_lynx_irq_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(sable_lynx_irq_lock); typedef struct irq_swizzle_struct { --- linux-2.6.11-rc1/arch/alpha/kernel/sys_titan.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/alpha/kernel/sys_titan.c 2005-01-19 20:33:21.361136024 -0800 @@ -56,7 +56,7 @@ static unsigned long titan_cached_irq_ma /* * Need SMP-safe access to interrupt CSRs */ -spinlock_t titan_irq_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(titan_irq_lock); static void titan_update_irq_hw(unsigned long mask) --- linux-2.6.11-rc1/arch/alpha/kernel/sys_wildfire.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/alpha/kernel/sys_wildfire.c 2005-01-19 20:33:21.362135872 -0800 @@ -32,7 +32,7 @@ static unsigned long cached_irq_mask[WILDFIRE_NR_IRQS/(sizeof(long)*8)]; -spinlock_t wildfire_irq_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(wildfire_irq_lock); static int doing_init_irq_hw = 0; --- linux-2.6.11-rc1/arch/alpha/kernel/time.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/alpha/kernel/time.c 2005-01-19 20:33:21.363135720 -0800 @@ -63,7 +63,7 @@ extern unsigned long wall_jiffies; /* ke static int set_rtc_mmss(unsigned long); -spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(rtc_lock); #define TICK_SIZE (tick_nsec / 1000) --- linux-2.6.11-rc1/arch/arm26/Kconfig 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm26/Kconfig 2005-01-19 20:32:13.000000000 -0800 @@ -225,4 +225,3 @@ source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - --- linux-2.6.11-rc1/arch/arm26/kernel/dma.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm26/kernel/dma.c 2005-01-19 20:33:13.864275720 -0800 @@ -22,7 +22,7 @@ #include -spinlock_t dma_spin_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(dma_spin_lock); static dma_t dma_chan[MAX_DMA_CHANNELS]; --- linux-2.6.11-rc1/arch/arm26/kernel/irq.c 2004-10-18 16:55:20.000000000 -0700 +++ 25/arch/arm26/kernel/irq.c 2005-01-19 20:33:13.865275568 -0800 @@ -50,7 +50,7 @@ void __init arc_init_irq(void); #define MAX_IRQ_CNT 100000 static volatile unsigned long irq_err_count; -static spinlock_t irq_controller_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(irq_controller_lock); struct irqdesc irq_desc[NR_IRQS]; --- linux-2.6.11-rc1/arch/arm26/kernel/semaphore.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm26/kernel/semaphore.c 2005-01-19 20:33:13.865275568 -0800 @@ -56,7 +56,7 @@ void __up(struct semaphore *sem) wake_up(&sem->wait); } -static spinlock_t semaphore_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(semaphore_lock); void __sched __down(struct semaphore * sem) { --- linux-2.6.11-rc1/arch/arm26/kernel/setup.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm26/kernel/setup.c 2005-01-19 20:34:09.093879544 -0800 @@ -37,7 +37,7 @@ #endif #ifdef CONFIG_PREEMPT -spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(kernel_flag); #endif #if defined(CONFIG_FPE_NWFPE) @@ -74,7 +74,6 @@ unsigned int number_mfm_drives; struct processor processor; -unsigned char aux_device_present; char elf_platform[ELF_PLATFORM_SIZE]; unsigned long phys_initrd_start __initdata = 0; --- linux-2.6.11-rc1/arch/arm26/kernel/time.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm26/kernel/time.c 2005-01-19 20:33:13.866275416 -0800 @@ -41,7 +41,7 @@ EXPORT_SYMBOL(jiffies_64); extern unsigned long wall_jiffies; /* this needs a better home */ -spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(rtc_lock); /* change this if you have some constant time drift */ #define USECS_PER_JIFFY (1000000/HZ) --- linux-2.6.11-rc1/arch/arm26/kernel/traps.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm26/kernel/traps.c 2005-01-19 20:33:13.867275264 -0800 @@ -171,7 +171,7 @@ void show_stack(struct task_struct *task dump_mem("Stack: ", (unsigned long)sp, 8192+(unsigned long)task->thread_info); } -spinlock_t die_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(die_lock); /* * This function is protected against re-entrancy. --- linux-2.6.11-rc1/arch/arm26/mm/small_page.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm26/mm/small_page.c 2005-01-19 20:33:13.867275264 -0800 @@ -75,7 +75,7 @@ static struct order orders[] = { #define TEST_AND_CLEAR_USED(pg,off) (test_and_clear_bit(off, &USED_MAP(pg))) #define SET_USED(pg,off) (set_bit(off, &USED_MAP(pg))) -static spinlock_t small_page_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(small_page_lock); static unsigned long __get_small_page(int priority, struct order *order) { --- linux-2.6.11-rc1/arch/arm/common/rtctime.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/common/rtctime.c 2005-01-19 20:33:18.677543992 -0800 @@ -28,7 +28,7 @@ static struct fasync_struct *rtc_async_q /* * rtc_lock protects rtc_irq_data */ -static spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(rtc_lock); static unsigned long rtc_irq_data; /* --- linux-2.6.11-rc1/arch/arm/common/scoop.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/common/scoop.c 2005-01-19 20:33:18.678543840 -0800 @@ -31,7 +31,7 @@ void reset_scoop(void) SCOOP_REG(SCOOP_IRM) = 0x0000; } -static spinlock_t scoop_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(scoop_lock); static u32 scoop_gpwr; unsigned short set_scoop_gpio(unsigned short bit) @@ -100,11 +100,13 @@ int __init scoop_probe(struct device *de struct platform_device *pdev = to_platform_device(dev); struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!mem) return -EINVAL; + if (!mem) + return -EINVAL; inf = dev->platform_data; scoop_io_base = ioremap(mem->start, 0x1000); - if (!scoop_io_base) return -ENOMEM; + if (!scoop_io_base) + return -ENOMEM; SCOOP_REG(SCOOP_MCR) = 0x0140; --- linux-2.6.11-rc1/arch/arm/configs/s3c2410_defconfig 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/configs/s3c2410_defconfig 2005-01-19 20:32:13.000000000 -0800 @@ -1,12 +1,13 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc2 -# Mon Nov 15 15:29:42 2004 +# Linux kernel version: 2.6.11-rc1-bk5 +# Tue Jan 18 11:36:49 2005 # CONFIG_ARM=y CONFIG_MMU=y CONFIG_UID16=y CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_GENERIC_IOMAP=y # @@ -123,12 +124,20 @@ CONFIG_CPU_TLB_V4WBI=y # # General setup # -# CONFIG_ZBOOT_ROM is not set CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 # CONFIG_XIP_KERNEL is not set # +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# # At least one math emulation must be selected # CONFIG_FPE_NWFPE=y @@ -143,6 +152,7 @@ CONFIG_BINFMT_AOUT=y # CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # CONFIG_DEBUG_DRIVER is not set CONFIG_PM=y # CONFIG_PREEMPT is not set @@ -168,6 +178,7 @@ CONFIG_MTD=y CONFIG_MTD_PARTITIONS=y # CONFIG_MTD_CONCAT is not set CONFIG_MTD_REDBOOT_PARTS=y +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y # CONFIG_MTD_REDBOOT_PARTS_READONLY is not set CONFIG_MTD_CMDLINE_PARTS=y @@ -200,13 +211,15 @@ CONFIG_MTD_CFI_I2=y # CONFIG_MTD_CFI_I4 is not set # CONFIG_MTD_CFI_I8 is not set CONFIG_MTD_CFI_INTELEXT=y -# CONFIG_MTD_CFI_AMDSTD is not set +CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_CFI_AMDSTD_RETRY=0 # CONFIG_MTD_CFI_STAA is not set CONFIG_MTD_CFI_UTIL=y # CONFIG_MTD_RAM is not set -# CONFIG_MTD_ROM is not set +CONFIG_MTD_ROM=y # CONFIG_MTD_ABSENT is not set # CONFIG_MTD_OBSOLETE_CHIPS is not set +# CONFIG_MTD_XIP is not set # # Mapping drivers for chip access @@ -226,6 +239,7 @@ CONFIG_MTD_BAST_MAXSIZE=4 # CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set # CONFIG_MTD_BLKMTD is not set +# CONFIG_MTD_BLOCK2MTD is not set # # Disk-On-Chip Device Drivers @@ -244,6 +258,7 @@ CONFIG_MTD_NAND_S3C2410=y # CONFIG_MTD_NAND_S3C2410_DEBUG is not set # CONFIG_MTD_NAND_S3C2410_HWECC is not set # CONFIG_MTD_NAND_DISKONCHIP is not set +# CONFIG_MTD_NAND_NANDSIM is not set # # Plug and Play support @@ -254,10 +269,12 @@ CONFIG_MTD_NAND_S3C2410=y # # CONFIG_BLK_DEV_FD is not set # CONFIG_PARIDE is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" @@ -270,6 +287,7 @@ CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # Multi-device support (RAID and LVM) @@ -456,6 +474,7 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PARKBD is not set +CONFIG_SERIO_LIBPS2=y # CONFIG_SERIO_RAW is not set # @@ -489,6 +508,7 @@ CONFIG_SERIAL_NONSTANDARD=y # CONFIG_DIGI is not set # CONFIG_MOXA_INTELLIO is not set # CONFIG_MOXA_SMARTIO is not set +# CONFIG_ISI is not set # CONFIG_SYNCLINKMP is not set # CONFIG_N_HDLC is not set # CONFIG_RISCOM8 is not set @@ -583,6 +603,7 @@ CONFIG_I2C_S3C2410=y CONFIG_I2C_SENSOR=m # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set # CONFIG_SENSORS_ADM1031 is not set # CONFIG_SENSORS_ASB100 is not set # CONFIG_SENSORS_DS1621 is not set @@ -600,6 +621,7 @@ CONFIG_SENSORS_LM85=m # CONFIG_SENSORS_LM90 is not set # CONFIG_SENSORS_MAX1619 is not set # CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_SMSC47B397 is not set # CONFIG_SENSORS_SMSC47M1 is not set # CONFIG_SENSORS_W83781D is not set # CONFIG_SENSORS_W83L785TS is not set @@ -693,6 +715,7 @@ CONFIG_JFFS_FS_VERBOSE=0 CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 # CONFIG_JFFS2_FS_NAND is not set +# CONFIG_JFFS2_FS_NOR_ECC is not set # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_RTIME=y @@ -812,6 +835,7 @@ CONFIG_DUMMY_CONSOLE=y # Logo configuration # # CONFIG_LOGO is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -830,6 +854,10 @@ CONFIG_USB_ARCH_HAS_HCD=y # CONFIG_USB_ARCH_HAS_OHCI is not set # +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# + +# # USB Gadget Support # # CONFIG_USB_GADGET is not set @@ -848,8 +876,9 @@ CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_KOBJECT is not set -# CONFIG_DEBUG_BUGVERBOSE is not set +CONFIG_DEBUG_BUGVERBOSE=y CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_FS is not set CONFIG_FRAME_POINTER=y CONFIG_DEBUG_USER=y # CONFIG_DEBUG_WAITQ is not set @@ -871,6 +900,10 @@ CONFIG_DEBUG_S3C2410_UART=0 # CONFIG_CRYPTO is not set # +# Hardware crypto devices +# + +# # Library routines # # CONFIG_CRC_CCITT is not set --- linux-2.6.11-rc1/arch/arm/Kconfig 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/Kconfig 2005-01-19 20:32:26.000000000 -0800 @@ -131,7 +131,7 @@ config ARCH_L7200 If you have any questions or comments about the Linux kernel port - to this board, send e-mail to sjhill@cotw.com. + to this board, send e-mail to . config ARCH_PXA bool "PXA2xx-based" @@ -149,7 +149,7 @@ config ARCH_S3C2410 bool "Samsung S3C2410" help Samsung S3C2410X CPU based systems, such as the Simtec Electronics - BAST (http://www.simtec.co.uk/products/EB110ITX/), the IPAQ 1940 or + BAST (), the IPAQ 1940 or the Samsung SMDK2410 development board (and derviatives). config ARCH_SHARK @@ -236,7 +236,7 @@ config SHARP_LOCOMO config SHARP_SCOOP bool - depends on PXA_SHARPSL + depends on PXA_SHARPSL || SA1100_COLLIE default y config FORCE_MAX_ZONEORDER @@ -418,20 +418,6 @@ config XIP_PHYS_ADDR be linked for and stored to. This address is dependent on your own flash usage. - Please note that, if you're using MTD, you must use a flash chip - that is NOT handled by MTD or the flash will be turned into non - data mode for status and query purposes which will instantaneously - crash the kernel. - - MTD can however be used with a XIP kernel on the same flash chip - but only if the flash memory supports multiple partitions in - hardware, like with the Intel K3 flash parts, and only if the - kernel is not stored within the firrst hardware partition of the - chip. - - In any case, make sure that MTD support is configured out for - the first attempt. - if (ARCH_SA1100 || ARCH_INTEGRATOR) source "drivers/cpufreq/Kconfig" --- linux-2.6.11-rc1/arch/arm/kernel/apm.c 2004-10-18 16:55:19.000000000 -0700 +++ 25/arch/arm/kernel/apm.c 2005-01-19 20:33:18.678543840 -0800 @@ -97,7 +97,7 @@ static LIST_HEAD(apm_user_list); */ static DECLARE_WAIT_QUEUE_HEAD(kapmd_wait); static DECLARE_COMPLETION(kapmd_exit); -static spinlock_t kapmd_queue_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(kapmd_queue_lock); static struct apm_queue kapmd_queue; --- linux-2.6.11-rc1/arch/arm/kernel/dma.c 2003-06-14 12:18:29.000000000 -0700 +++ 25/arch/arm/kernel/dma.c 2005-01-19 20:33:18.679543688 -0800 @@ -22,7 +22,7 @@ #include -spinlock_t dma_spin_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(dma_spin_lock); #if MAX_DMA_CHANNELS > 0 --- linux-2.6.11-rc1/arch/arm/kernel/entry-armv.S 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/kernel/entry-armv.S 2005-01-19 20:33:35.225028392 -0800 @@ -136,11 +136,9 @@ svc_preempt: teq r9, #0 @ was preempt ldr r1, [r6, #8] @ local_bh_count adds r0, r0, r1 movne pc, lr - mov r7, #PREEMPT_ACTIVE - str r7, [r8, #TI_PREEMPT] @ set PREEMPT_ACTIVE -1: enable_irq r2 @ enable IRQs - bl schedule - disable_irq r0 @ disable IRQs + mov r7, #0 @ preempt_schedule_irq + str r7, [r8, #TI_PREEMPT] @ expects preempt_count == 0 +1: bl preempt_schedule_irq @ irq en/disable is done inside ldr r0, [r8, #TI_FLAGS] @ get new tasks TI_FLAGS tst r0, #_TIF_NEED_RESCHED beq preempt_return @ go again --- linux-2.6.11-rc1/arch/arm/kernel/entry-common.S 2004-08-15 00:35:02.000000000 -0700 +++ 25/arch/arm/kernel/entry-common.S 2005-01-19 20:33:08.475095000 -0800 @@ -29,6 +29,11 @@ * stack. */ ret_fast_syscall: +#if (CONFIG_LTT) + mov r7, r0 @ save returned r0 + bl trace_real_syscall_exit + mov r0, r7 +#endif disable_irq r1 @ disable interrupts ldr r1, [tsk, #TI_FLAGS] tst r1, #_TIF_WORK_MASK @@ -126,6 +131,16 @@ ENTRY(vector_swi) mcr p15, 0, ip, c1, c0 @ update control register #endif enable_irq ip +#if (CONFIG_LTT) + /* zzz note that validity of scno is not yet checked. + * zzz The visualizer checks it. + */ + add r1, sp, #S_R0 @ pointer to regs + mov r0, scno @ syscall number + bl trace_real_syscall_entry + add r1, sp, #S_R0 @ pointer to regs + ldmia r1, {r0 - r3} @ have to reload r0 - r3 +#endif str r4, [sp, #-S_OFF]! @ push fifth arg @@ -166,6 +181,9 @@ __sys_trace: __sys_trace_return: str r0, [sp, #S_R0 + S_OFF]! @ save returned r0 +#if (CONFIG_LTT) + bl trace_real_syscall_exit +#endif mov r1, sp mov r0, #1 @ trace exit [IP = 1] bl syscall_trace --- linux-2.6.11-rc1/arch/arm/kernel/head.S 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/kernel/head.S 2005-01-19 20:32:26.000000000 -0800 @@ -406,7 +406,7 @@ err_str: * calculate the offset. * * Returns: - * r3, r6 corrupted + * r3, r4, r6 corrupted * r5 = proc_info pointer in physical address space * r9 = cpuid */ @@ -418,9 +418,9 @@ __lookup_processor_type: add r5, r5, r3 @ convert virt addresses to add r6, r6, r3 @ physical address space mrc p15, 0, r9, c0, c0 @ get processor id -1: ldmia r5, {r3, r10} @ value, mask - and r10, r10, r9 @ mask wanted bits - teq r3, r10 +1: ldmia r5, {r3, r4} @ value, mask + and r4, r4, r9 @ mask wanted bits + teq r3, r4 beq 2f add r5, r5, #PROC_INFO_SZ @ sizeof(proc_info_list) cmp r5, r6 @@ -429,6 +429,15 @@ __lookup_processor_type: 2: mov pc, lr /* + * This provides a C-API version of the above function. + */ +ENTRY(lookup_processor_type) + stmfd sp!, {r4 - r6, r9, lr} + bl __lookup_processor_type + mov r0, r5 + ldmfd sp!, {r4 - r6, r9, pc} + +/* * Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for * more information about the __proc_info and __arch_info structures. */ @@ -464,3 +473,13 @@ __lookup_machine_type: blt 1b mov r5, #0 @ unknown machine 2: mov pc, lr + +/* + * This provides a C-API version of the above function. + */ +ENTRY(lookup_machine_type) + stmfd sp!, {r4 - r6, lr} + mov r1, r0 + bl __lookup_machine_type + mov r0, r5 + ldmfd sp!, {r4 - r6, pc} --- linux-2.6.11-rc1/arch/arm/kernel/irq.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/kernel/irq.c 2005-01-19 20:33:18.680543536 -0800 @@ -31,7 +31,9 @@ #include #include #include +#include #include +#include #include #include @@ -48,7 +50,7 @@ static int noirqdebug; static volatile unsigned long irq_err_count; -static spinlock_t irq_controller_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(irq_controller_lock); static LIST_HEAD(irq_pending); struct irqdesc irq_desc[NR_IRQS]; @@ -85,6 +87,23 @@ static struct irqdesc bad_irq_desc = { .disable_depth = 1, }; +#ifdef CONFIG_SMP +void synchronize_irq(unsigned int irq) +{ + struct irqdesc *desc = irq_desc + irq; + + while (desc->running) + barrier(); +} +EXPORT_SYMBOL(synchronize_irq); + +#define smp_set_running(desc) do { desc->running = 1; } while (0) +#define smp_clear_running(desc) do { desc->running = 0; } while (0) +#else +#define smp_set_running(desc) do { } while (0) +#define smp_clear_running(desc) do { } while (0) +#endif + /** * disable_irq_nosync - disable an irq without waiting * @irq: Interrupt to disable @@ -232,6 +251,9 @@ unlock: #ifdef CONFIG_ARCH_ACORN show_fiq_list(p, v); #endif +#ifdef CONFIG_SMP + show_ipi_list(p); +#endif seq_printf(p, "Err: %10lu\n", irq_err_count); } return 0; @@ -329,18 +351,22 @@ void do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) { struct irqaction *action; - const int cpu = smp_processor_id(); + const unsigned int cpu = smp_processor_id(); desc->triggered = 1; kstat_cpu(cpu).irqs[irq]++; + smp_set_running(desc); + action = desc->action; if (action) { int ret = __do_irq(irq, action, regs); if (ret != IRQ_HANDLED) report_bad_irq(irq, regs, desc, ret); } + + smp_clear_running(desc); } /* @@ -350,7 +376,7 @@ do_simple_IRQ(unsigned int irq, struct i void do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) { - const int cpu = smp_processor_id(); + const unsigned int cpu = smp_processor_id(); desc->triggered = 1; @@ -414,7 +440,7 @@ void do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) { struct irqaction *action; - const int cpu = smp_processor_id(); + const unsigned int cpu = smp_processor_id(); desc->triggered = 1; @@ -426,6 +452,8 @@ do_level_IRQ(unsigned int irq, struct ir if (likely(!desc->disable_depth)) { kstat_cpu(cpu).irqs[irq]++; + smp_set_running(desc); + /* * Return with this interrupt masked if no action */ @@ -440,6 +468,8 @@ do_level_IRQ(unsigned int irq, struct ir !check_irq_lock(desc, irq, regs))) desc->chip->unmask(irq); } + + smp_clear_running(desc); } } @@ -486,6 +516,8 @@ asmlinkage void asm_do_IRQ(unsigned int { struct irqdesc *desc = irq_desc + irq; + ltt_ev_irq_entry(irq, !(user_mode(regs))); + /* * Some hardware gives randomly wrong interrupts. Rather * than crashing, do something sensible. @@ -505,6 +537,8 @@ asmlinkage void asm_do_IRQ(unsigned int spin_unlock(&irq_controller_lock); irq_exit(); + + ltt_ev_irq_exit(); } void __set_irq_handler(unsigned int irq, irq_handler_t handle, int is_chained) @@ -878,8 +912,97 @@ out: EXPORT_SYMBOL(probe_irq_off); +#ifdef CONFIG_SMP +static void route_irq(struct irqdesc *desc, unsigned int irq, unsigned int cpu) +{ + pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", irq, desc->cpu, cpu); + + spin_lock_irq(&irq_controller_lock); + desc->cpu = cpu; + desc->chip->set_cpu(desc, irq, cpu); + spin_unlock_irq(&irq_controller_lock); +} + +#ifdef CONFIG_PROC_FS +static int +irq_affinity_read_proc(char *page, char **start, off_t off, int count, + int *eof, void *data) +{ + struct irqdesc *desc = irq_desc + ((int)data); + int len = cpumask_scnprintf(page, count, desc->affinity); + + if (count - len < 2) + return -EINVAL; + page[len++] = '\n'; + page[len] = '\0'; + + return len; +} + +static int +irq_affinity_write_proc(struct file *file, const char __user *buffer, + unsigned long count, void *data) +{ + unsigned int irq = (unsigned int)data; + struct irqdesc *desc = irq_desc + irq; + cpumask_t affinity, tmp; + int ret = -EIO; + + if (!desc->chip->set_cpu) + goto out; + + ret = cpumask_parse(buffer, count, affinity); + if (ret) + goto out; + + cpus_and(tmp, affinity, cpu_online_map); + if (cpus_empty(tmp)) { + ret = -EINVAL; + goto out; + } + + desc->affinity = affinity; + route_irq(desc, irq, first_cpu(tmp)); + ret = count; + + out: + return ret; +} +#endif +#endif + void __init init_irq_proc(void) { +#if defined(CONFIG_SMP) && defined(CONFIG_PROC_FS) + struct proc_dir_entry *dir; + int irq; + + dir = proc_mkdir("irq", 0); + if (!dir) + return; + + for (irq = 0; irq < NR_IRQS; irq++) { + struct proc_dir_entry *entry; + struct irqdesc *desc; + char name[16]; + + desc = irq_desc + irq; + memset(name, 0, sizeof(name)); + snprintf(name, sizeof(name) - 1, "%u", irq); + + desc->procdir = proc_mkdir(name, dir); + if (!desc->procdir) + continue; + + entry = create_proc_entry("smp_affinity", 0600, desc->procdir); + if (entry) { + entry->nlink = 1; + entry->data = (void *)irq; + entry->read_proc = irq_affinity_read_proc; + entry->write_proc = irq_affinity_write_proc; + } + } +#endif } void __init init_IRQ(void) @@ -888,6 +1011,11 @@ void __init init_IRQ(void) extern void init_dma(void); int irq; +#ifdef CONFIG_SMP + bad_irq_desc.affinity = CPU_MASK_ALL; + bad_irq_desc.cpu = smp_processor_id(); +#endif + for (irq = 0, desc = irq_desc; irq < NR_IRQS; irq++, desc++) { *desc = bad_irq_desc; INIT_LIST_HEAD(&desc->pend); --- linux-2.6.11-rc1/arch/arm/kernel/process.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/kernel/process.c 2005-01-19 20:33:08.477094696 -0800 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -421,6 +422,7 @@ asm( ".section .text\n" pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) { struct pt_regs regs; + long pid; memset(®s, 0, sizeof(regs)); @@ -430,7 +432,12 @@ pid_t kernel_thread(int (*fn)(void *), v regs.ARM_pc = (unsigned long)kernel_thread_helper; regs.ARM_cpsr = SVC_MODE; - return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); + pid = do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); +#if (CONFIG_LTT) + if(pid >= 0) + ltt_ev_process(LTT_EV_PROCESS_KTHREAD, pid, (int) fn); +#endif + return pid; } EXPORT_SYMBOL(kernel_thread); --- linux-2.6.11-rc1/arch/arm/kernel/semaphore.c 2004-10-18 16:55:20.000000000 -0700 +++ 25/arch/arm/kernel/semaphore.c 2005-01-19 20:33:18.681543384 -0800 @@ -54,7 +54,7 @@ void __up(struct semaphore *sem) wake_up(&sem->wait); } -static spinlock_t semaphore_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(semaphore_lock); void __sched __down(struct semaphore * sem) { @@ -178,7 +178,7 @@ int __down_trylock(struct semaphore * se * registers (r0 to r3 and lr), but not ip, as we use it as a return * value in some cases.. */ -asm(" .section .sched.text \n\ +asm(" .section .sched.text,\"ax\" \n\ .align 5 \n\ .globl __down_failed \n\ __down_failed: \n\ --- linux-2.6.11-rc1/arch/arm/kernel/setup.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/kernel/setup.c 2005-01-19 20:34:09.094879392 -0800 @@ -92,8 +92,6 @@ struct cpu_user_fns cpu_user; struct cpu_cache_fns cpu_cache; #endif -unsigned char aux_device_present; - char elf_platform[ELF_PLATFORM_SIZE]; EXPORT_SYMBOL(elf_platform); @@ -221,12 +219,12 @@ static const char *proc_arch[] = { #define CACHE_M(y) ((y) & (1 << 2)) #define CACHE_LINE(y) ((y) & 3) -static inline void dump_cache(const char *prefix, unsigned int cache) +static inline void dump_cache(const char *prefix, int cpu, unsigned int cache) { unsigned int mult = 2 + (CACHE_M(cache) ? 1 : 0); - printk("%s: %d bytes, associativity %d, %d byte lines, %d sets\n", - prefix, + printk("CPU%u: %s: %d bytes, associativity %d, %d byte lines, %d sets\n", + cpu, prefix, mult << (8 + CACHE_SIZE(cache)), (mult << CACHE_ASSOC(cache)) >> 1, 8 << CACHE_LINE(cache), @@ -234,18 +232,18 @@ static inline void dump_cache(const char CACHE_LINE(cache))); } -static void __init dump_cpu_info(void) +static void __init dump_cpu_info(int cpu) { unsigned int info = read_cpuid(CPUID_CACHETYPE); if (info != processor_id) { - printk("CPU: D %s %s cache\n", cache_is_vivt() ? "VIVT" : "VIPT", + printk("CPU%u: D %s %s cache\n", cpu, cache_is_vivt() ? "VIVT" : "VIPT", cache_types[CACHE_TYPE(info)]); if (CACHE_S(info)) { - dump_cache("CPU: I cache", CACHE_ISIZE(info)); - dump_cache("CPU: D cache", CACHE_DSIZE(info)); + dump_cache("I cache", cpu, CACHE_ISIZE(info)); + dump_cache("D cache", cpu, CACHE_DSIZE(info)); } else { - dump_cache("CPU: cache", CACHE_ISIZE(info)); + dump_cache("cache", cpu, CACHE_ISIZE(info)); } } } @@ -267,9 +265,15 @@ int cpu_architecture(void) return cpu_arch; } +/* + * These functions re-use the assembly code in head.S, which + * already provide the required functionality. + */ +extern struct proc_info_list *lookup_processor_type(void); +extern struct machine_desc *lookup_machine_type(unsigned int); + static void __init setup_processor(void) { - extern struct proc_info_list __proc_info_begin, __proc_info_end; struct proc_info_list *list; /* @@ -277,15 +281,8 @@ static void __init setup_processor(void) * types. The linker builds this table for us from the * entries in arch/arm/mm/proc-*.S */ - for (list = &__proc_info_begin; list < &__proc_info_end ; list++) - if ((processor_id & list->cpu_mask) == list->cpu_val) - break; - - /* - * If processor type is unrecognised, then we - * can do nothing... - */ - if (list >= &__proc_info_end) { + list = lookup_processor_type(); + if (!list) { printk("CPU configuration botched (ID %08x), unable " "to continue.\n", processor_id); while (1); @@ -310,7 +307,7 @@ static void __init setup_processor(void) cpu_name, processor_id, (int)processor_id & 15, proc_arch[cpu_architecture()]); - dump_cpu_info(); + dump_cpu_info(smp_processor_id()); sprintf(system_utsname.machine, "%s%c", list->arch_name, ENDIANNESS); sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS); @@ -321,22 +318,14 @@ static void __init setup_processor(void) static struct machine_desc * __init setup_machine(unsigned int nr) { - extern struct machine_desc __arch_info_begin, __arch_info_end; struct machine_desc *list; /* - * locate architecture in the list of supported architectures. - */ - for (list = &__arch_info_begin; list < &__arch_info_end; list++) - if (list->nr == nr) - break; - - /* - * If the architecture type is not recognised, then we - * can co nothing... + * locate machine in the list of supported machines. */ - if (list >= &__arch_info_end) { - printk("Architecture configuration botched (nr %d), unable " + list = lookup_machine_type(nr); + if (!list) { + printk("Machine configuration botched (nr %d), unable " "to continue.\n", nr); while (1); } --- linux-2.6.11-rc1/arch/arm/kernel/signal.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/kernel/signal.c 2005-01-19 20:32:13.000000000 -0800 @@ -12,7 +12,6 @@ #include #include #include -#include #include #include @@ -689,10 +688,8 @@ static int do_signal(sigset_t *oldset, s if (!user_mode(regs)) return 0; - if (current->flags & PF_FREEZE) { - refrigerator(0); + if (try_to_freeze(0)) goto no_signal; - } if (current->ptrace & PT_SINGLESTEP) ptrace_cancel_bpt(current); --- linux-2.6.11-rc1/arch/arm/kernel/smp.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/kernel/smp.c 2005-01-19 20:33:18.682543232 -0800 @@ -17,16 +17,16 @@ #include #include #include +#include +#include #include #include +#include #include #include -#include -#include - -#include #include +#include /* * bitmask of present and online CPUs. @@ -42,6 +42,7 @@ cpumask_t cpu_online_map; */ struct ipi_data { spinlock_t lock; + unsigned long ipi_count; unsigned long bits; }; @@ -65,7 +66,7 @@ struct smp_call_struct { }; static struct smp_call_struct * volatile smp_call_function_data; -static spinlock_t smp_call_function_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(smp_call_function_lock); int __init __cpu_up(unsigned int cpu) { @@ -242,12 +243,12 @@ int smp_call_function(void (*func)(void void show_ipi_list(struct seq_file *p) { - int cpu; + unsigned int cpu; - seq_printf(p, "IPI: "); + seq_puts(p, "IPI:"); for_each_online_cpu(cpu) - seq_printf(p, "%10lu ", per_cpu(cpu_data, cpu).ipi_count); + seq_printf(p, " %10lu", per_cpu(ipi_data, cpu).ipi_count); seq_putc(p, '\n'); } @@ -283,7 +284,7 @@ static void ipi_call_function(unsigned i cpu_clear(cpu, data->unfinished); } -static spinlock_t stop_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(stop_lock); /* * ipi_cpu_stop - handle IPI from smp_send_stop() @@ -316,12 +317,11 @@ static void ipi_cpu_stop(unsigned int cp void do_IPI(unsigned int ipimask, struct pt_regs *regs) { unsigned int cpu = smp_processor_id(); + struct ipi_data *ipi = &per_cpu(ipi_data, cpu); - per_cpu(cpu_data, cpu).ipi_count++; + ipi->ipi_count++; if (ipimask & (1 << 0)) { - struct ipi_data *ipi = &per_cpu(ipi_data, cpu); - for (;;) { unsigned long msgs; --- linux-2.6.11-rc1/arch/arm/kernel/sys_arm.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/kernel/sys_arm.c 2005-01-19 20:33:08.477094696 -0800 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -167,6 +168,8 @@ asmlinkage int sys_ipc(uint call, int fi version = call >> 16; /* hack for backward compatibility */ call &= 0xffff; + ltt_ev_ipc(LTT_EV_IPC_CALL, call, first); + switch (call) { case SEMOP: return sys_semop(first, (struct sembuf __user *)ptr, second); --- linux-2.6.11-rc1/arch/arm/kernel/time.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/kernel/time.c 2005-01-19 20:33:18.682543232 -0800 @@ -48,7 +48,7 @@ struct sys_timer *system_timer; extern unsigned long wall_jiffies; /* this needs a better home */ -spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(rtc_lock); #ifdef CONFIG_SA1100_RTC_MODULE EXPORT_SYMBOL(rtc_lock); @@ -63,7 +63,7 @@ unsigned long profile_pc(struct pt_regs unsigned long fp, pc = instruction_pointer(regs); if (in_lock_functions(pc)) { - fp = thread_saved_fp(current); + fp = regs->ARM_fp; pc = pc_pointer(((unsigned long *)fp)[-1]); } --- linux-2.6.11-rc1/arch/arm/kernel/traps.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/kernel/traps.c 2005-01-19 20:33:18.684542928 -0800 @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -200,7 +201,70 @@ void show_stack(struct task_struct *tsk, barrier(); } -spinlock_t die_lock = SPIN_LOCK_UNLOCKED; +#if (CONFIG_LTT) +asmlinkage void trace_real_syscall_entry(int scno,struct pt_regs * regs) +{ + int depth = 0; + unsigned long end_code; + unsigned long *fp; /* frame pointer */ + unsigned long lower_bound; + unsigned long lr; /* link register */ + unsigned long *prev_fp; + int seek_depth; + unsigned long start_code; + unsigned long *start_stack; + ltt_syscall_entry trace_syscall_event; + unsigned long upper_bound; + int use_bounds; + int use_depth; + + trace_syscall_event.syscall_id = (uint8_t)scno; + trace_syscall_event.address = instruction_pointer(regs); + + if (! (user_mode(regs) )) + goto trace_syscall_end; + + if (ltt_get_trace_config(&use_depth, &use_bounds, &seek_depth, + (void*)&lower_bound, (void*)&upper_bound) < 0) + goto trace_syscall_end; + + if ((use_depth == 1) || (use_bounds == 1)) { + fp = (unsigned long *)regs->ARM_fp; + end_code = current->mm->end_code; + start_code = current->mm->start_code; + start_stack = (unsigned long *)current->mm->start_stack; + + while (!__get_user(lr, (unsigned long *)(fp - 1))) { + if ((lr > start_code) && (lr < end_code)) { + if (((use_depth == 1) && (depth >= seek_depth)) || + ((use_bounds == 1) && (lr > lower_bound) && (lr < upper_bound))) { + trace_syscall_event.address = lr; + goto trace_syscall_end; + } else { + depth++; + } + } + + if ((__get_user((unsigned long)prev_fp, (fp - 3))) || + (prev_fp > start_stack) || + (prev_fp <= fp)) { + goto trace_syscall_end; + } + fp = prev_fp; + } + } + +trace_syscall_end: + ltt_log_event(LTT_EV_SYSCALL_ENTRY, &trace_syscall_event); +} + +asmlinkage void trace_real_syscall_exit(void) +{ + ltt_log_event(LTT_EV_SYSCALL_EXIT, NULL); +} +#endif /* (CONFIG_LTT) */ + +DEFINE_SPINLOCK(die_lock); /* * This function is protected against re-entrancy. @@ -241,7 +305,7 @@ void die_if_kernel(const char *str, stru } static LIST_HEAD(undef_hook); -static spinlock_t undef_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(undef_lock); void register_undef_hook(struct undef_hook *hook) { @@ -307,8 +371,12 @@ asmlinkage void do_undefinstr(struct pt_ info.si_code = ILL_ILLOPC; info.si_addr = pc; + ltt_ev_trap_entry(current->thread.trap_no, (uint32_t)pc); + force_sig_info(SIGILL, &info, current); + ltt_ev_trap_exit(); + die_if_kernel("Oops - undefined instruction", regs, 0); } @@ -512,7 +580,12 @@ baddataabort(int code, unsigned long ins info.si_code = ILL_ILLOPC; info.si_addr = (void __user *)addr; + ltt_ev_trap_entry(18, addr); /* machine check */ + force_sig_info(SIGILL, &info, current); + + ltt_ev_trap_exit(); + die_if_kernel("unknown data abort code", regs, instr); } --- linux-2.6.11-rc1/arch/arm/lib/io-readsw-armv4.S 2003-10-08 15:07:08.000000000 -0700 +++ 25/arch/arm/lib/io-readsw-armv4.S 2005-01-19 20:32:13.000000000 -0800 @@ -18,25 +18,14 @@ #endif .endm -.insw_bad_alignment: - adr r0, .insw_bad_align_msg - mov r2, lr - b panic -.insw_bad_align_msg: - .asciz "insw: bad buffer alignment (0x%p, lr=0x%08lX)\n" - .align - -.insw_align: tst r1, #1 - bne .insw_bad_alignment - - ldrh r3, [r0] - strh r3, [r1], #2 - - subs r2, r2, #1 - RETINSTR(moveq, pc, lr) +.insw_align: movs ip, r1, lsl #31 + bne .insw_noalign + ldrh ip, [r0] + sub r2, r2, #1 + strh ip, [r1], #2 ENTRY(__raw_readsw) - teq r2, #0 @ do we have to check for the zero len? + teq r2, #0 moveq pc, lr tst r1, #3 bne .insw_align @@ -62,14 +51,10 @@ ENTRY(__raw_readsw) ldrh lr, [r0] pack ip, ip, lr - stmia r1!, {r3 - r5, ip} - subs r2, r2, #8 + stmia r1!, {r3 - r5, ip} bpl .insw_8_lp - tst r2, #7 - LOADREGS(eqfd, sp!, {r4, r5, pc}) - .no_insw_8: tst r2, #4 beq .no_insw_4 @@ -83,17 +68,63 @@ ENTRY(__raw_readsw) stmia r1!, {r3, r4} -.no_insw_4: tst r2, #2 - beq .no_insw_2 +.no_insw_4: movs r2, r2, lsl #31 + bcc .no_insw_2 ldrh r3, [r0] ldrh ip, [r0] pack r3, r3, ip - str r3, [r1], #4 -.no_insw_2: tst r2, #1 - ldrneh r3, [r0] +.no_insw_2: ldrneh r3, [r0] strneh r3, [r1] - LOADREGS(fd, sp!, {r4, r5, pc}) + ldmfd sp!, {r4, r5, pc} + +#ifdef __ARMEB__ +#define _BE_ONLY_(code...) code +#define _LE_ONLY_(code...) +#define push_hbyte0 lsr #8 +#define pull_hbyte1 lsl #24 +#else +#define _BE_ONLY_(code...) +#define _LE_ONLY_(code...) code +#define push_hbyte0 lsl #24 +#define pull_hbyte1 lsr #8 +#endif + +.insw_noalign: stmfd sp!, {r4, lr} + ldrccb ip, [r1, #-1]! + bcc 1f + + ldrh ip, [r0] + sub r2, r2, #1 + _BE_ONLY_( mov ip, ip, ror #8 ) + strb ip, [r1], #1 + _LE_ONLY_( mov ip, ip, lsr #8 ) + _BE_ONLY_( mov ip, ip, lsr #24 ) + +1: subs r2, r2, #2 + bmi 3f + _BE_ONLY_( mov ip, ip, lsl #24 ) + +2: ldrh r3, [r0] + ldrh r4, [r0] + subs r2, r2, #2 + orr ip, ip, r3, lsl #8 + orr ip, ip, r4, push_hbyte0 + str ip, [r1], #4 + mov ip, r4, pull_hbyte1 + bpl 2b + + _BE_ONLY_( mov ip, ip, lsr #24 ) + +3: tst r2, #1 + strb ip, [r1], #1 + ldrneh ip, [r0] + _BE_ONLY_( movne ip, ip, ror #8 ) + strneb ip, [r1], #1 + _LE_ONLY_( movne ip, ip, lsr #8 ) + _BE_ONLY_( movne ip, ip, lsr #24 ) + strneb ip, [r1] + ldmfd sp!, {r4, pc} --- linux-2.6.11-rc1/arch/arm/lib/io-writesw-armv4.S 2003-10-08 15:07:08.000000000 -0700 +++ 25/arch/arm/lib/io-writesw-armv4.S 2005-01-19 20:32:13.000000000 -0800 @@ -22,27 +22,17 @@ #endif .endm -.outsw_bad_alignment: - adr r0, .outsw_bad_align_msg - mov r2, lr - b panic -.outsw_bad_align_msg: - .asciz "outsw: bad buffer alignment (0x%p, lr=0x%08lX)\n" - .align - -.outsw_align: tst r1, #1 - bne .outsw_bad_alignment +.outsw_align: movs ip, r1, lsl #31 + bne .outsw_noalign ldrh r3, [r1], #2 + sub r2, r2, #1 strh r3, [r0] - subs r2, r2, #1 - RETINSTR(moveq, pc, lr) - ENTRY(__raw_writesw) - teq r2, #0 @ do we have to check for the zero len? + teq r2, #0 moveq pc, lr - tst r1, #3 + ands r3, r1, #3 bne .outsw_align stmfd sp!, {r4, r5, lr} @@ -51,16 +41,13 @@ ENTRY(__raw_writesw) bmi .no_outsw_8 .outsw_8_lp: ldmia r1!, {r3, r4, r5, ip} + subs r2, r2, #8 outword r3 outword r4 outword r5 outword ip - subs r2, r2, #8 bpl .outsw_8_lp - tst r2, #7 - LOADREGS(eqfd, sp!, {r4, r5, pc}) - .no_outsw_8: tst r2, #4 beq .no_outsw_4 @@ -68,14 +55,41 @@ ENTRY(__raw_writesw) outword r3 outword ip -.no_outsw_4: tst r2, #2 - beq .no_outsw_2 +.no_outsw_4: movs r2, r2, lsl #31 + bcc .no_outsw_2 ldr r3, [r1], #4 outword r3 -.no_outsw_2: tst r2, #1 - ldrneh r3, [r1] +.no_outsw_2: ldrneh r3, [r1] strneh r3, [r0] - LOADREGS(fd, sp!, {r4, r5, pc}) + ldmfd sp!, {r4, r5, pc} + +#ifdef __ARMEB__ +#define pull_hbyte0 lsl #8 +#define push_hbyte1 lsr #24 +#else +#define pull_hbyte0 lsr #24 +#define push_hbyte1 lsl #8 +#endif + +.outsw_noalign: ldr r3, [r1, -r3]! + subcs r2, r2, #1 + bcs 2f + subs r2, r2, #2 + bmi 3f + +1: mov ip, r3, lsr #8 + strh ip, [r0] +2: mov ip, r3, pull_hbyte0 + ldr r3, [r1, #4]! + subs r2, r2, #2 + orr ip, ip, r3, push_hbyte1 + strh ip, [r0] + bpl 2b + +3: tst r2, #1 +2: movne ip, r3, lsr #8 + strneh ip, [r0] + mov pc, lr --- linux-2.6.11-rc1/arch/arm/mach-footbridge/ebsa285-leds.c 2003-06-14 12:17:58.000000000 -0700 +++ 25/arch/arm/mach-footbridge/ebsa285-leds.c 2005-01-19 20:33:18.684542928 -0800 @@ -32,7 +32,7 @@ static char led_state; static char hw_led_state; -static spinlock_t leds_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(leds_lock); static void ebsa285_leds_event(led_event_t evt) { --- linux-2.6.11-rc1/arch/arm/mach-footbridge/Kconfig 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/mach-footbridge/Kconfig 2005-01-19 20:32:13.000000000 -0800 @@ -26,7 +26,7 @@ config ARCH_PERSONAL_SERVER If you have any questions or comments about the Compaq Personal - Server, send e-mail to skiff@crl.dec.com. + Server, send e-mail to . config ARCH_EBSA285_ADDIN bool "EBSA285 (addin mode)" --- linux-2.6.11-rc1/arch/arm/mach-footbridge/netwinder-hw.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/mach-footbridge/netwinder-hw.c 2005-01-19 20:33:18.685542776 -0800 @@ -68,7 +68,7 @@ static inline void wb977_ww(int reg, int /* * This is a lock for accessing ports GP1_IO_BASE and GP2_IO_BASE */ -spinlock_t gpio_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(gpio_lock); static unsigned int current_gpio_op; static unsigned int current_gpio_io; --- linux-2.6.11-rc1/arch/arm/mach-footbridge/netwinder-leds.c 2003-06-14 12:18:30.000000000 -0700 +++ 25/arch/arm/mach-footbridge/netwinder-leds.c 2005-01-19 20:33:18.685542776 -0800 @@ -32,7 +32,7 @@ static char led_state; static char hw_led_state; -static spinlock_t leds_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(leds_lock); extern spinlock_t gpio_lock; static void netwinder_leds_event(led_event_t evt) --- linux-2.6.11-rc1/arch/arm/mach-integrator/core.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/mach-integrator/core.c 2005-01-19 20:33:18.685542776 -0800 @@ -115,7 +115,7 @@ arch_initcall(integrator_init); #define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_CTRL_OFFSET -static spinlock_t cm_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(cm_lock); /** * cm_control - update the CM_CTRL register. --- linux-2.6.11-rc1/arch/arm/mach-integrator/pci_v3.c 2003-10-08 15:07:08.000000000 -0700 +++ 25/arch/arm/mach-integrator/pci_v3.c 2005-01-19 20:33:18.686542624 -0800 @@ -163,7 +163,7 @@ * 7:2 register number * */ -static spinlock_t v3_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(v3_lock); #define PCI_BUS_NONMEM_START 0x00000000 #define PCI_BUS_NONMEM_SIZE SZ_256M --- linux-2.6.11-rc1/arch/arm/mach-ixp2000/core.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-ixp2000/core.c 2005-01-19 20:33:18.687542472 -0800 @@ -40,7 +40,7 @@ #include #include -static spinlock_t ixp2000_slowport_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(ixp2000_slowport_lock); static unsigned long ixp2000_slowport_irq_flags; /************************************************************************* @@ -171,22 +171,9 @@ static unsigned next_jiffy_time; unsigned long ixp2000_gettimeoffset (void) { - unsigned long elapsed1, elapsed2, pending; unsigned long offset; - elapsed1 = *IXP2000_T1_CSR; - pending = (*IXP2000_IRQ_STATUS & IRQ_MASK_TIMER1); - elapsed2 = *IXP2000_T1_CSR; - - offset = ticks_per_jiffy - elapsed2; - - /* - * We have two cases to cover, one where we were pending - * already, and another where it overflowed while we were - * checking the timers. - */ - if ((elapsed2 > elapsed1) || pending) - offset += ticks_per_jiffy; + offset = next_jiffy_time - *IXP2000_T4_CSR; return offset / ticks_per_usec; } --- linux-2.6.11-rc1/arch/arm/mach-ixp2000/Kconfig 2004-10-18 16:55:20.000000000 -0700 +++ 25/arch/arm/mach-ixp2000/Kconfig 2005-01-19 20:32:13.000000000 -0800 @@ -14,21 +14,21 @@ config ARCH_ENP2611 help Say 'Y' here if you want your kernel to support the Radisys ENP2611 PCI network processing card. For more information on - this card, see Documentation/arm/ENP2611. + this card, see . config ARCH_IXDP2400 bool "Support Intel IXDP2400" help Say 'Y' here if you want your kernel to support the Intel IXDP2400 reference platform. For more information on - this platform, see Documentation/arm/IXP2000. + this platform, see . config ARCH_IXDP2800 bool "Support Intel IXDP2800" help Say 'Y' here if you want your kernel to support the Intel IXDP2800 reference platform. For more information on - this platform, see Documentation/arm/IXP2000. + this platform, see . config ARCH_IXDP2X00 bool @@ -40,14 +40,14 @@ config ARCH_IXDP2401 help Say 'Y' here if you want your kernel to support the Intel IXDP2401 reference platform. For more information on - this platform, see Documentation/arm/IXP2000. + this platform, see . config ARCH_IXDP2801 bool "Support Intel IXDP2801" help Say 'Y' here if you want your kernel to support the Intel IXDP2801 reference platform. For more information on - this platform, see Documentation/arm/IXP2000. + this platform, see . config ARCH_IXDP2X01 bool --- linux-2.6.11-rc1/arch/arm/mach-ixp4xx/common-pci.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-ixp4xx/common-pci.c 2005-01-19 20:33:18.687542472 -0800 @@ -53,7 +53,7 @@ unsigned long ixp4xx_pci_reg_base = 0; * these transactions are atomic or we will end up * with corrupt data on the bus or in a driver. */ -static spinlock_t ixp4xx_pci_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(ixp4xx_pci_lock); /* * Read from PCI config space --- linux-2.6.11-rc1/arch/arm/mach-ixp4xx/coyote-pci.c 2004-06-15 23:29:40.000000000 -0700 +++ 25/arch/arm/mach-ixp4xx/coyote-pci.c 2005-01-19 20:32:13.000000000 -0800 @@ -14,6 +14,7 @@ * */ +#include #include #include --- linux-2.6.11-rc1/arch/arm/mach-ixp4xx/coyote-setup.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-ixp4xx/coyote-setup.c 2005-01-19 20:32:13.000000000 -0800 @@ -8,6 +8,7 @@ * Author: Deepak Saxena */ +#include #include #include #include --- linux-2.6.11-rc1/arch/arm/mach-ixp4xx/ixdp425-pci.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-ixp4xx/ixdp425-pci.c 2005-01-19 20:32:13.000000000 -0800 @@ -14,6 +14,7 @@ * */ +#include #include #include #include --- linux-2.6.11-rc1/arch/arm/mach-ixp4xx/ixdp425-setup.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-ixp4xx/ixdp425-setup.c 2005-01-19 20:32:13.000000000 -0800 @@ -8,6 +8,7 @@ * Author: Deepak Saxena */ +#include #include #include #include --- linux-2.6.11-rc1/arch/arm/mach-ixp4xx/ixdpg425-pci.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/mach-ixp4xx/ixdpg425-pci.c 2005-01-19 20:32:13.000000000 -0800 @@ -13,6 +13,7 @@ * */ +#include #include #include --- linux-2.6.11-rc1/arch/arm/mach-ixp4xx/Kconfig 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-ixp4xx/Kconfig 2005-01-19 20:32:13.000000000 -0800 @@ -13,28 +13,28 @@ config ARCH_AVILA help Say 'Y' here if you want your kernel to support the Gateworks Avila Network Platform. For more information on this platform, - see Documentation/arm/IXP4xx. + see . config ARCH_ADI_COYOTE bool "Coyote" help Say 'Y' here if you want your kernel to support the ADI Engineering Coyote Gateway Reference Platform. For more - information on this platform, see Documentation/arm/IXP4xx. + information on this platform, see . config ARCH_IXDP425 bool "IXDP425" help Say 'Y' here if you want your kernel to support Intel's IXDP425 Development Platform (Also known as Richfield). - For more information on this platform, see Documentation/arm/IXP4xx. + For more information on this platform, see . config MACH_IXDPG425 bool "IXDPG425" help Say 'Y' here if you want your kernel to support Intel's IXDPG425 Development Platform (Also known as Montajade). - For more information on this platform, see Documentation/arm/IXP4xx. + For more information on this platform, see . config MACH_IXDP465 bool "IXDP465" @@ -59,7 +59,7 @@ config ARCH_PRPMC1100 help Say 'Y' here if you want your kernel to support the Motorola PrPCM1100 Processor Mezanine Module. For more information on - this platform, see Documentation/arm/IXP4xx. + this platform, see . # # Avila and IXDP share the same source for now. Will change in future @@ -87,7 +87,7 @@ config IXP4XX_INDIRECT_PCI 1) A direct mapped window from 0x48000000 to 0x4bffffff (64MB). To access PCI via this space, we simply ioremap() the BAR into the kernel and we can use the standard read[bwl]/write[bwl] - macros. This is the preffered method due to speed but it + macros. This is the preferred method due to speed but it limits the system to just 64MB of PCI memory. This can be problamatic if using video cards and other memory-heavy devices. --- linux-2.6.11-rc1/arch/arm/mach-ixp4xx/prpmc1100-pci.c 2004-06-15 23:29:40.000000000 -0700 +++ 25/arch/arm/mach-ixp4xx/prpmc1100-pci.c 2005-01-19 20:32:13.000000000 -0800 @@ -19,6 +19,7 @@ * */ +#include #include #include #include --- linux-2.6.11-rc1/arch/arm/mach-ixp4xx/prpmc1100-setup.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-ixp4xx/prpmc1100-setup.c 2005-01-19 20:32:13.000000000 -0800 @@ -8,6 +8,7 @@ * Author: Deepak Saxena */ +#include #include #include #include --- linux-2.6.11-rc1/arch/arm/mach-omap/clock.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/mach-omap/clock.c 2005-01-19 20:33:18.688542320 -0800 @@ -22,7 +22,7 @@ static LIST_HEAD(clocks); static DECLARE_MUTEX(clocks_sem); -static spinlock_t clockfw_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(clockfw_lock); static void propagate_rate(struct clk * clk); /* MPU virtual clock functions */ static int select_table_rate(unsigned long rate); --- linux-2.6.11-rc1/arch/arm/mach-omap/mux.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/mach-omap/mux.c 2005-01-19 20:33:18.689542168 -0800 @@ -40,7 +40,7 @@ int __init_or_module omap_cfg_reg(const reg_cfg_t reg_cfg) { - static spinlock_t mux_spin_lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(mux_spin_lock); unsigned long flags; reg_cfg_set *cfg; --- linux-2.6.11-rc1/arch/arm/mach-pxa/corgi.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-pxa/corgi.c 2005-01-19 20:32:13.000000000 -0800 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -32,19 +33,18 @@ #include #include +#include #include #include +#include