--- 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-13 23:01:32.000000000 -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-13 23:01:32.000000000 -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/smc37c669.c 2004-08-15 00:35:02.000000000 -0700 +++ 25/arch/alpha/kernel/smc37c669.c 2005-01-13 23:01:32.000000000 -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-13 23:01:32.000000000 -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-13 23:01:32.000000000 -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-13 23:01:32.000000000 -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-13 23:01:32.000000000 -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-13 23:01:32.000000000 -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-13 23:01:32.000000000 -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-13 23:01:32.000000000 -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-13 23:43:22.218721160 -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-13 23:01:29.000000000 -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-13 23:01:29.000000000 -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-13 23:01:29.000000000 -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-13 23:01:29.000000000 -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) --- 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-13 23:01:29.000000000 -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-13 23:01:29.000000000 -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-13 23:01:29.000000000 -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-13 23:01:31.000000000 -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-13 23:01:31.000000000 -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/Kconfig 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/Kconfig 2005-01-13 23:43:22.219721008 -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 @@ -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-13 23:01:31.000000000 -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-13 23:01:31.000000000 -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-13 23:42:55.679755696 -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-13 23:01:17.000000000 -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/irq.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/kernel/irq.c 2005-01-13 23:01:31.000000000 -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-13 23:01:17.000000000 -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-13 23:01:31.000000000 -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/signal.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/kernel/signal.c 2005-01-13 22:14:26.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-13 23:01:31.000000000 -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-13 23:01:17.000000000 -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-13 23:01:31.000000000 -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); --- 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-13 23:01:31.000000000 -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-13 22:14:00.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-13 22:14:00.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-13 23:01:31.000000000 -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-13 23:43:22.219721008 -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-13 23:01:31.000000000 -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-13 23:01:31.000000000 -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-13 23:01:31.000000000 -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-13 23:01:31.000000000 -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-13 23:01:31.000000000 -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; /************************************************************************* --- 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-13 23:43:22.220720856 -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-13 23:01:31.000000000 -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-13 22:14:00.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-13 22:14:00.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-13 22:14:00.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-13 22:14:00.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-13 22:14:00.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-13 23:43:22.220720856 -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-13 22:14:00.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-13 22:14:00.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-13 23:01:31.000000000 -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-13 23:01:31.000000000 -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-13 22:14:00.000000000 -0800 @@ -68,8 +68,14 @@ static struct platform_device corgiscoop .resource = corgi_scoop_resources, }; +static struct platform_device corgissp_device = { + .name = "corgi-ssp", + .id = -1, +}; + static struct platform_device *devices[] __initdata = { &corgiscoop_device, + &corgissp_device, }; static struct sharpsl_flash_param_info sharpsl_flash_param; --- /dev/null 2003-09-15 06:40:47.000000000 -0700 +++ 25/arch/arm/mach-pxa/corgi_ssp.c 2005-01-13 22:14:00.000000000 -0800 @@ -0,0 +1,247 @@ +/* + * SSP control code for Sharp Corgi devices + * + * Copyright (c) 2004 Richard Purdie + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +static spinlock_t corgi_ssp_lock = SPIN_LOCK_UNLOCKED; +static struct ssp_dev corgi_ssp_dev; +static struct ssp_state corgi_ssp_state; + +/* + * There are three devices connected to the SSP interface: + * 1. A touchscreen controller (TI ADS7846 compatible) + * 2. An LCD contoller (with some Backlight functionality) + * 3. A battery moinitoring IC (Maxim MAX1111) + * + * Each device uses a different speed/mode of communication. + * + * The touchscreen is very sensitive and the most frequently used + * so the port is left configured for this. + * + * Devices are selected using Chip Selects on GPIOs. + */ + +/* + * ADS7846 Routines + */ +unsigned long corgi_ssp_ads7846_putget(ulong data) +{ + unsigned long ret,flag; + + spin_lock_irqsave(&corgi_ssp_lock, flag); + GPCR0 = GPIO_bit(CORGI_GPIO_ADS7846_CS); + + ssp_write_word(&corgi_ssp_dev,data); + ret = ssp_read_word(&corgi_ssp_dev); + + GPSR0 = GPIO_bit(CORGI_GPIO_ADS7846_CS); + spin_unlock_irqrestore(&corgi_ssp_lock, flag); + + return ret; +} + +/* + * NOTE: These functions should always be called in interrupt context + * and use the _lock and _unlock functions. They are very time sensitive. + */ +void corgi_ssp_ads7846_lock(void) +{ + spin_lock(&corgi_ssp_lock); + GPCR0 = GPIO_bit(CORGI_GPIO_ADS7846_CS); +} + +void corgi_ssp_ads7846_unlock(void) +{ + GPSR0 = GPIO_bit(CORGI_GPIO_ADS7846_CS); + spin_unlock(&corgi_ssp_lock); +} + +void corgi_ssp_ads7846_put(ulong data) +{ + ssp_write_word(&corgi_ssp_dev,data); +} + +unsigned long corgi_ssp_ads7846_get(void) +{ + return ssp_read_word(&corgi_ssp_dev); +} + +EXPORT_SYMBOL(corgi_ssp_ads7846_putget); +EXPORT_SYMBOL(corgi_ssp_ads7846_lock); +EXPORT_SYMBOL(corgi_ssp_ads7846_unlock); +EXPORT_SYMBOL(corgi_ssp_ads7846_put); +EXPORT_SYMBOL(corgi_ssp_ads7846_get); + + +/* + * LCD/Backlight Routines + */ +unsigned long corgi_ssp_dac_put(ulong data) +{ + unsigned long flag; + + spin_lock_irqsave(&corgi_ssp_lock, flag); + GPCR0 = GPIO_bit(CORGI_GPIO_LCDCON_CS); + + ssp_disable(&corgi_ssp_dev); + ssp_config(&corgi_ssp_dev, (SSCR0_Motorola | (SSCR0_DSS & 0x07 )), SSCR1_SPH, 0, SSCR0_SerClkDiv(76)); + ssp_enable(&corgi_ssp_dev); + + ssp_write_word(&corgi_ssp_dev,data); + /* Read null data back from device to prevent SSP overflow */ + ssp_read_word(&corgi_ssp_dev); + + ssp_disable(&corgi_ssp_dev); + ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(2)); + ssp_enable(&corgi_ssp_dev); + GPSR0 = GPIO_bit(CORGI_GPIO_LCDCON_CS); + spin_unlock_irqrestore(&corgi_ssp_lock, flag); + + return 0; +} + +void corgi_ssp_lcdtg_send(u8 adrs, u8 data) +{ + corgi_ssp_dac_put(((adrs & 0x07) << 5) | (data & 0x1f)); +} + +void corgi_ssp_blduty_set(int duty) +{ + corgi_ssp_lcdtg_send(0x02,duty); +} + +EXPORT_SYMBOL(corgi_ssp_lcdtg_send); +EXPORT_SYMBOL(corgi_ssp_blduty_set); + +/* + * Max1111 Routines + */ +int corgi_ssp_max1111_get(ulong data) +{ + unsigned long flag; + int voltage,voltage1,voltage2; + + spin_lock_irqsave(&corgi_ssp_lock, flag); + GPCR0 = GPIO_bit(CORGI_GPIO_MAX1111_CS); + ssp_disable(&corgi_ssp_dev); + ssp_config(&corgi_ssp_dev, (SSCR0_Motorola | (SSCR0_DSS & 0x07 )), 0, 0, SSCR0_SerClkDiv(8)); + ssp_enable(&corgi_ssp_dev); + + udelay(1); + + /* TB1/RB1 */ + ssp_write_word(&corgi_ssp_dev,data); + ssp_read_word(&corgi_ssp_dev); /* null read */ + + /* TB12/RB2 */ + ssp_write_word(&corgi_ssp_dev,0); + voltage1=ssp_read_word(&corgi_ssp_dev); + + /* TB13/RB3*/ + ssp_write_word(&corgi_ssp_dev,0); + voltage2=ssp_read_word(&corgi_ssp_dev); + + ssp_disable(&corgi_ssp_dev); + ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(2)); + ssp_enable(&corgi_ssp_dev); + GPSR0 = GPIO_bit(CORGI_GPIO_MAX1111_CS); + spin_unlock_irqrestore(&corgi_ssp_lock, flag); + + if (voltage1 & 0xc0 || voltage2 & 0x3f) + voltage = -1; + else + voltage = ((voltage1 << 2) & 0xfc) | ((voltage2 >> 6) & 0x03); + + return voltage; +} + +EXPORT_SYMBOL(corgi_ssp_max1111_get); + +/* + * Support Routines + */ +int __init corgi_ssp_probe(struct device *dev) +{ + int ret; + + /* Chip Select - Disable All */ + GPDR0 |= GPIO_bit(CORGI_GPIO_LCDCON_CS); /* output */ + GPSR0 = GPIO_bit(CORGI_GPIO_LCDCON_CS); /* High - Disable LCD Control/Timing Gen */ + GPDR0 |= GPIO_bit(CORGI_GPIO_MAX1111_CS); /* output */ + GPSR0 = GPIO_bit(CORGI_GPIO_MAX1111_CS); /* High - Disable MAX1111*/ + GPDR0 |= GPIO_bit(CORGI_GPIO_ADS7846_CS); /* output */ + GPSR0 = GPIO_bit(CORGI_GPIO_ADS7846_CS); /* High - Disable ADS7846*/ + + ret=ssp_init(&corgi_ssp_dev,1); + + if (ret) + printk(KERN_ERR "Unable to register SSP handler!\n"); + else { + ssp_disable(&corgi_ssp_dev); + ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(2)); + ssp_enable(&corgi_ssp_dev); + } + + return ret; +} + +static int corgi_ssp_remove(struct device *dev) +{ + ssp_exit(&corgi_ssp_dev); + return 0; +} + +static int corgi_ssp_suspend(struct device *dev, u32 state, u32 level) +{ + if (level == SUSPEND_POWER_DOWN) { + ssp_save_state(&corgi_ssp_dev,&corgi_ssp_state); + } + return 0; +} + +static int corgi_ssp_resume(struct device *dev, u32 level) +{ + if (level == RESUME_POWER_ON) { + GPSR0 = GPIO_bit(CORGI_GPIO_LCDCON_CS); /* High - Disable LCD Control/Timing Gen */ + GPSR0 = GPIO_bit(CORGI_GPIO_MAX1111_CS); /* High - Disable MAX1111*/ + GPSR0 = GPIO_bit(CORGI_GPIO_ADS7846_CS); /* High - Disable ADS7846*/ + ssp_restore_state(&corgi_ssp_dev,&corgi_ssp_state); + ssp_enable(&corgi_ssp_dev); + } + return 0; +} + +static struct device_driver corgissp_driver = { + .name = "corgi-ssp", + .bus = &platform_bus_type, + .probe = corgi_ssp_probe, + .remove = corgi_ssp_remove, + .suspend = corgi_ssp_suspend, + .resume = corgi_ssp_resume, +}; + +int __init corgi_ssp_init(void) +{ + return driver_register(&corgissp_driver); +} + +arch_initcall(corgi_ssp_init); --- linux-2.6.11-rc1/arch/arm/mach-pxa/Makefile 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-pxa/Makefile 2005-01-13 22:14:00.000000000 -0800 @@ -11,7 +11,7 @@ obj-$(CONFIG_PXA27x) += pxa27x.o obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o obj-$(CONFIG_ARCH_PXA_IDP) += idp.o -obj-$(CONFIG_PXA_SHARPSL) += corgi.o +obj-$(CONFIG_PXA_SHARPSL) += corgi.o corgi_ssp.o ssp.o # Support for blinky lights led-y := leds.o --- linux-2.6.11-rc1/arch/arm/mach-s3c2410/cpu.h 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-s3c2410/cpu.h 2005-01-13 22:14:00.000000000 -0800 @@ -13,6 +13,7 @@ * 24-Aug-2004 BJD Start of generic S3C24XX support * 18-Oct-2004 BJD Moved board struct into this file * 04-Jan-2005 BJD New uart initialisation + * 10-Jan-2005 BJD Moved generic init here, specific to cpu headers */ #define IODESC_ENT(x) { S3C2410_VA_##x, S3C2410_PA_##x, S3C2410_SZ_##x, MT_DEVICE } @@ -26,25 +27,9 @@ /* forward declaration */ struct s3c2410_uartcfg; -#ifdef CONFIG_CPU_S3C2410 -extern int s3c2410_init(void); -extern void s3c2410_map_io(struct map_desc *mach_desc, int size); -extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no); -#else -#define s3c2410_init_uarts NULL -#define s3c2410_map_io NULL -#define s3c2410_init NULL -#endif +/* core initialisation functions */ -#ifdef CONFIG_CPU_S3C2440 -extern int s3c2440_init(void); -extern void s3c2440_map_io(struct map_desc *mach_desc, int size); -extern void s3c2440_init_uarts(struct s3c2410_uartcfg *cfg, int no); -#else -#define s3c2440_init_uarts NULL -#define s3c2440_map_io NULL -#define s3c2440_init NULL -#endif +extern void s3c24xx_init_irq(void); extern void s3c24xx_init_io(struct map_desc *mach_desc, int size); @@ -65,3 +50,8 @@ struct s3c24xx_board { }; extern void s3c24xx_set_board(struct s3c24xx_board *board); + +/* timer for 2410/2440 */ + +struct sys_timer; +extern struct sys_timer s3c24xx_timer; --- linux-2.6.11-rc1/arch/arm/mach-s3c2410/irq.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/mach-s3c2410/irq.c 2005-01-13 22:14:00.000000000 -0800 @@ -628,12 +628,12 @@ s3c_irq_demux_uart2(unsigned int irq, s3c_irq_demux_uart(IRQ_S3CUART_RX2, regs); } -/* s3c2410_init_irq +/* s3c24xx_init_irq * * Initialise S3C2410 IRQ system */ -void __init s3c2410_init_irq(void) +void __init s3c24xx_init_irq(void) { unsigned long pend; unsigned long last; --- linux-2.6.11-rc1/arch/arm/mach-s3c2410/Kconfig 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/mach-s3c2410/Kconfig 2005-01-13 23:43:22.221720704 -0800 @@ -41,7 +41,7 @@ config MACH_RX3715 help Say Y here if you are using the HP iPAQ rx3715. - See http://www.handhelds.org/projects/rx3715.html for more + See for more information on this project endmenu @@ -77,7 +77,7 @@ config S3C2410_DMA_DEBUG to the kernel log, at priority KERN_DEBUG. Note, it is easy to create and fill the log buffer in a small - amount of time, as well as using an significant percantage of + amount of time, as well as using an significant percentage of the CPU time doing so. @@ -115,9 +115,9 @@ config S3C2410_LOWLEVEL_UART_PORT Choice of which UART port to use for the low-level messages, such as the `Uncompressing...` at start time. The value of this configuration should be between zero and two. The port - must have been initalised by the boot-loader before use. + must have been initialised by the boot-loader before use. Note, this does not affect the port used by the debug messages, - which is a seperate configuration. + which is a separate configuration. endif --- linux-2.6.11-rc1/arch/arm/mach-s3c2410/mach-bast.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-s3c2410/mach-bast.c 2005-01-13 22:14:00.000000000 -0800 @@ -20,7 +20,8 @@ * 18-Jan-2003 BJD Added serial port configuration * 05-Oct-2004 BJD Power management code * 04-Nov-2004 BJD Updated serial port clocks - * 04-Jan-2004 BJD New uart init call + * 04-Jan-2006 BJD New uart init call + * 10-Jan-2005 BJD Removed include of s3c2410.h */ #include @@ -48,7 +49,6 @@ #include #include -#include "s3c2410.h" #include "clock.h" #include "devs.h" #include "cpu.h" @@ -270,7 +270,7 @@ void __init bast_map_io(void) void __init bast_init_irq(void) { - s3c2410_init_irq(); + s3c24xx_init_irq(); } #ifdef CONFIG_PM @@ -307,5 +307,5 @@ MACHINE_START(BAST, "Simtec-BAST") MAPIO(bast_map_io) INITIRQ(bast_init_irq) .init_machine = bast_init_machine, - .timer = &s3c2410_timer, + .timer = &s3c24xx_timer, MACHINE_END --- linux-2.6.11-rc1/arch/arm/mach-s3c2410/mach-h1940.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-s3c2410/mach-h1940.c 2005-01-13 22:14:00.000000000 -0800 @@ -21,6 +21,7 @@ * 18-Oct-2004 BJD Updated new board structure name * 04-Nov-2004 BJD Change for new serial clock * 04-Jan-2005 BJD Updated uart init call + * 10-Jan-2005 BJD Removed include of s3c2410.h */ #include @@ -45,7 +46,6 @@ #include -#include "s3c2410.h" #include "clock.h" #include "devs.h" #include "cpu.h" @@ -109,7 +109,7 @@ void __init h1940_map_io(void) void __init h1940_init_irq(void) { - s3c2410_init_irq(); + s3c24xx_init_irq(); } @@ -119,5 +119,5 @@ MACHINE_START(H1940, "IPAQ-H1940") BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) MAPIO(h1940_map_io) INITIRQ(h1940_init_irq) - .timer = &s3c2410_timer, + .timer = &s3c24xx_timer, MACHINE_END --- linux-2.6.11-rc1/arch/arm/mach-s3c2410/mach-rx3715.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-s3c2410/mach-rx3715.c 2005-01-13 22:14:00.000000000 -0800 @@ -12,6 +12,7 @@ * Modifications: * 16-Sep-2004 BJD Copied from mach-h1940.c * 25-Oct-2004 BJD Updates for 2.6.10-rc1 + * 10-Jan-2005 BJD Removed include of s3c2410.h s3c2440.h */ #include @@ -38,8 +39,6 @@ #include #include -#include "s3c2410.h" -#include "s3c2440.h" #include "clock.h" #include "devs.h" #include "cpu.h" @@ -101,7 +100,7 @@ void __init rx3715_map_io(void) void __init rx3715_init_irq(void) { - s3c2410_init_irq(); + s3c24xx_init_irq(); } #ifdef CONFIG_PM @@ -120,5 +119,5 @@ MACHINE_START(RX3715, "IPAQ-RX3715") MAPIO(rx3715_map_io) INITIRQ(rx3715_init_irq) INIT_MACHINE(rx3715_init_machine) - .timer = &s3c2410_timer, + .timer = &s3c24xx_timer, MACHINE_END --- linux-2.6.11-rc1/arch/arm/mach-s3c2410/mach-smdk2410.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-s3c2410/mach-smdk2410.c 2005-01-13 22:14:00.000000000 -0800 @@ -46,7 +46,6 @@ #include -#include "s3c2410.h" #include "devs.h" #include "cpu.h" @@ -104,7 +103,7 @@ void __init smdk2410_map_io(void) void __init smdk2410_init_irq(void) { - s3c2410_init_irq(); + s3c24xx_init_irq(); } MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch @@ -114,7 +113,7 @@ MACHINE_START(SMDK2410, "SMDK2410") /* @ BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) MAPIO(smdk2410_map_io) INITIRQ(smdk2410_init_irq) - .timer = &s3c2410_timer, + .timer = &s3c24xx_timer, MACHINE_END --- linux-2.6.11-rc1/arch/arm/mach-s3c2410/mach-vr1000.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-s3c2410/mach-vr1000.c 2005-01-13 22:14:00.000000000 -0800 @@ -18,7 +18,8 @@ * 05-Apr-2004 BJD Copied to make mach-vr1000.c * 18-Oct-2004 BJD Updated board struct * 04-Nov-2004 BJD Clock and serial configuration update - * 04-Jan-2004 BJD Updated uart init call + * 04-Jan-2005 BJD Updated uart init call + * 10-Jan-2005 BJD Removed include of s3c2410.h */ #include @@ -43,7 +44,6 @@ //#include #include -#include "s3c2410.h" #include "clock.h" #include "devs.h" #include "cpu.h" @@ -212,7 +212,7 @@ void __init vr1000_map_io(void) void __init vr1000_init_irq(void) { - s3c2410_init_irq(); + s3c24xx_init_irq(); } MACHINE_START(VR1000, "Thorcom-VR1000") @@ -221,5 +221,5 @@ MACHINE_START(VR1000, "Thorcom-VR1000") BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) MAPIO(vr1000_map_io) INITIRQ(vr1000_init_irq) - .timer = &s3c2410_timer, + .timer = &s3c24xx_timer, MACHINE_END --- linux-2.6.11-rc1/arch/arm/mach-s3c2410/s3c2410.h 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-s3c2410/s3c2410.h 2005-01-13 22:14:00.000000000 -0800 @@ -1,7 +1,7 @@ /* arch/arm/mach-s3c2410/s3c2410.h * * Copyright (c) 2004 Simtec Electronics - * Ben Dooks + * Ben Dooks * * Header file for s3c2410 machine directory * @@ -15,13 +15,19 @@ * 04-Sep-2004 BJD Added s3c2410_init_uarts() call * 17-Oct-2004 BJD Moved board out to cpu * 04-Jan-2005 BJD Changed uart init + * 10-Jan-2005 BJD Removed timer to cpu.h, moved 2410 specific bits here */ -extern void s3c2410_map_io(struct map_desc *, int count); +#ifdef CONFIG_CPU_S3C2410 -extern void s3c2410_init_irq(void); +extern int s3c2410_init(void); -struct sys_timer; -extern struct sys_timer s3c2410_timer; +extern void s3c2410_map_io(struct map_desc *mach_desc, int size); +extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no); +#else +#define s3c2410_init_uarts NULL +#define s3c2410_map_io NULL +#define s3c2410_init NULL +#endif --- linux-2.6.11-rc1/arch/arm/mach-s3c2410/s3c2440-dsc.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/mach-s3c2410/s3c2440-dsc.c 2005-01-13 22:14:00.000000000 -0800 @@ -1,6 +1,6 @@ /* linux/arch/arm/mach-s3c2410/s3c2440-dsc.c * - * Copyright (c) 2004 Simtec Electronics + * Copyright (c) 2004-2005 Simtec Electronics * Ben Dooks * * Samsung S3C2440 Drive Strength Control support @@ -12,6 +12,7 @@ * Modifications: * 29-Aug-2004 BJD Start of drive-strength control * 09-Nov-2004 BJD Added symbol export + * 11-Jan-2005 BJD Include fix */ #include @@ -31,8 +32,8 @@ #include #include -#include "s3c2440.h" #include "cpu.h" +#include "s3c2440.h" int s3c2440_set_dsc(unsigned int pin, unsigned int value) { --- linux-2.6.11-rc1/arch/arm/mach-s3c2410/s3c2440.h 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mach-s3c2410/s3c2440.h 2005-01-13 22:14:00.000000000 -0800 @@ -1,7 +1,7 @@ /* arch/arm/mach-s3c2410/s3c2440.h * - * Copyright (c) 2004 Simtec Electronics - * Ben Dooks + * Copyright (c) 2004-2005 Simtec Electronics + * Ben Dooks * * Header file for s3c2440 cpu support * @@ -12,9 +12,20 @@ * Modifications: * 24-Aug-2004 BJD Start of S3C2440 CPU support * 04-Nov-2004 BJD Added s3c2440_init_uarts() - * 04-Jan-2004 BJD Moved uart init to cpu code + * 04-Jan-2005 BJD Moved uart init to cpu code + * 10-Jan-2005 BJD Moved 2440 specific init here */ -extern void s3c2440_init_irq(void); +#ifdef CONFIG_CPU_S3C2440 -extern void s3c2440_init_time(void); +extern int s3c2440_init(void); + +extern void s3c2440_map_io(struct map_desc *mach_desc, int size); + +extern void s3c2440_init_uarts(struct s3c2410_uartcfg *cfg, int no); + +#else +#define s3c2440_init_uarts NULL +#define s3c2440_map_io NULL +#define s3c2440_init NULL +#endif --- linux-2.6.11-rc1/arch/arm/mach-s3c2410/time.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/mach-s3c2410/time.c 2005-01-13 22:14:00.000000000 -0800 @@ -232,7 +232,7 @@ static void __init s3c2410_timer_init (v setup_irq(IRQ_TIMER4, &s3c2410_timer_irq); } -struct sys_timer s3c2410_timer = { +struct sys_timer s3c24xx_timer = { .init = s3c2410_timer_init, .offset = s3c2410_gettimeoffset, .resume = s3c2410_timer_setup --- linux-2.6.11-rc1/arch/arm/mach-shark/leds.c 2003-06-14 12:18:09.000000000 -0700 +++ 25/arch/arm/mach-shark/leds.c 2005-01-13 23:01:31.000000000 -0800 @@ -33,7 +33,7 @@ static char led_state; static short hw_led_state; static short saved_state; -static spinlock_t leds_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(leds_lock); short sequoia_read(int addr) { outw(addr,0x24); --- linux-2.6.11-rc1/arch/arm/mm/consistent.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mm/consistent.c 2005-01-13 23:01:31.000000000 -0800 @@ -30,7 +30,7 @@ * This is the page table (2MB) covering uncached, DMA consistent allocations */ static pte_t *consistent_pte; -static spinlock_t consistent_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(consistent_lock); /* * VM region handling support. --- linux-2.6.11-rc1/arch/arm/mm/copypage-v6.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/mm/copypage-v6.c 2005-01-13 23:01:31.000000000 -0800 @@ -28,7 +28,7 @@ static pte_t *from_pte; static pte_t *to_pte; -static spinlock_t v6_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(v6_lock); #define DCACHE_COLOUR(vaddr) ((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT) --- linux-2.6.11-rc1/arch/arm/mm/ioremap.c 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/arm/mm/ioremap.c 2005-01-13 22:14:08.000000000 -0800 @@ -148,7 +148,7 @@ __ioremap(unsigned long phys_addr, size_ */ offset = phys_addr & ~PAGE_MASK; phys_addr &= PAGE_MASK; - size = PAGE_ALIGN(last_addr) - phys_addr; + size = PAGE_ALIGN(last_addr + 1) - phys_addr; /* * Ok, go for it.. --- linux-2.6.11-rc1/arch/arm/mm/Kconfig 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/arm/mm/Kconfig 2005-01-13 23:43:22.222720552 -0800 @@ -394,7 +394,7 @@ config CPU_DCACHE_WRITETHROUGH depends on (CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020) && !CPU_DISABLE_DCACHE default y if CPU_ARM925T help - Say Y here to use the data cache in writethough mode. Unless you + Say Y here to use the data cache in writethrough mode. Unless you specifically require this or are unsure, say N. config CPU_CACHE_ROUND_ROBIN --- linux-2.6.11-rc1/arch/arm/vfp/entry.S 2004-08-15 00:35:02.000000000 -0700 +++ 25/arch/arm/vfp/entry.S 2005-01-13 22:14:08.000000000 -0800 @@ -17,6 +17,7 @@ */ #include #include +#include #include #include --- linux-2.6.11-rc1/arch/cris/arch-v10/drivers/Kconfig 2004-12-24 17:09:54.000000000 -0800 +++ 25/arch/cris/arch-v10/drivers/Kconfig 2005-01-13 23:43:22.222720552 -0800 @@ -557,7 +557,7 @@ config ETRAX_IDE select DMA_NONPCI help Enable this to get support for ATA/IDE. - You can't use parallell ports or SCSI ports + You can't use paralell ports or SCSI ports at the same time. --- linux-2.6.11-rc1/arch/frv/kernel/dma.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/frv/kernel/dma.c 2005-01-13 23:01:33.000000000 -0800 @@ -107,7 +107,7 @@ static struct frv_dma_channel frv_dma_ch }, }; -static rwlock_t frv_dma_channels_lock = RW_LOCK_UNLOCKED; +static DEFINE_RWLOCK(frv_dma_channels_lock); unsigned long frv_dma_inprogress; --- linux-2.6.11-rc1/arch/frv/kernel/entry.S 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/frv/kernel/entry.S 2005-01-13 22:14:22.000000000 -0800 @@ -821,7 +821,6 @@ system_call: ori gr4,#_TIF_SYSCALL_TRACE,gr4 andicc gr4,#_TIF_SYSCALL_TRACE,gr0,icc0 bne icc0,#0,__syscall_trace_entry - bra __syscall_trace_entry __syscall_call: slli.p gr7,#2,gr7 @@ -858,7 +857,6 @@ __syscall_exit: movgs gr23,psr ldi @(gr15,#TI_FLAGS),gr4 -// ori gr4,#_TIF_SYSCALL_TRACE,gr4 ///////////////////////////////// sethi.p %hi(_TIF_ALLWORK_MASK),gr5 setlo %lo(_TIF_ALLWORK_MASK),gr5 andcc gr4,gr5,gr0,icc0 @@ -1075,7 +1073,7 @@ __entry_work_resched: andicc gr4,#_TIF_NEED_RESCHED,gr0,icc0 bne icc0,#1,__entry_work_resched - __entry_work_notifysig: +__entry_work_notifysig: LEDS 0x6410 ori.p gr4,#0,gr8 call do_notify_resume --- linux-2.6.11-rc1/arch/frv/mb93090-mb00/pci-dma-nommu.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/frv/mb93090-mb00/pci-dma-nommu.c 2005-01-13 23:01:33.000000000 -0800 @@ -30,7 +30,7 @@ struct dma_alloc_record { unsigned long len; }; -static spinlock_t dma_alloc_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(dma_alloc_lock); static LIST_HEAD(dma_alloc_list); void *dma_alloc_coherent(struct device *hwdev, size_t size, dma_addr_t *dma_handle, int gfp) --- linux-2.6.11-rc1/arch/frv/mb93090-mb00/pci-frv.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/frv/mb93090-mb00/pci-frv.c 2005-01-13 22:14:32.000000000 -0800 @@ -31,7 +31,7 @@ pcibios_update_resource(struct pci_dev * if (resource < 6) { reg = PCI_BASE_ADDRESS_0 + 4*resource; } else if (resource == PCI_ROM_RESOURCE) { - res->flags |= PCI_ROM_ADDRESS_ENABLE; + res->flags |= IORESOURCE_ROM_ENABLE; new |= PCI_ROM_ADDRESS_ENABLE; reg = dev->rom_base_reg; } else { @@ -170,11 +170,11 @@ static void __init pcibios_allocate_reso } if (!pass) { r = &dev->resource[PCI_ROM_RESOURCE]; - if (r->flags & PCI_ROM_ADDRESS_ENABLE) { + if (r->flags & IORESOURCE_ROM_ENABLE) { /* Turn the ROM off, leave the resource region, but keep it unregistered. */ u32 reg; DBG("PCI: Switching off ROM of %s\n", pci_name(dev)); - r->flags &= ~PCI_ROM_ADDRESS_ENABLE; + r->flags &= ~IORESOURCE_ROM_ENABLE; pci_read_config_dword(dev, dev->rom_base_reg, ®); pci_write_config_dword(dev, dev->rom_base_reg, reg & ~PCI_ROM_ADDRESS_ENABLE); } --- linux-2.6.11-rc1/arch/frv/mm/mmu-context.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/frv/mm/mmu-context.c 2005-01-13 23:01:33.000000000 -0800 @@ -17,7 +17,7 @@ static unsigned long cxn_bitmap[NR_CXN / (sizeof(unsigned long) * 8)]; static LIST_HEAD(cxn_owners_lru); -static spinlock_t cxn_owners_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(cxn_owners_lock); int __nongpreldata cxn_pinned = -1; --- linux-2.6.11-rc1/arch/frv/mm/pgalloc.c 2005-01-11 21:24:31.000000000 -0800 +++ 25/arch/frv/mm/pgalloc.c 2005-01-13 23:01:33.000000000 -0800 @@ -77,7 +77,7 @@ void __set_pmd(pmd_t *pmdptr, unsigned l * manfred's recommendations and having no core impact whatsoever. * -- wli */ -spinlock_t pgd_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(pgd_lock); struct page *pgd_list; static inline void pgd_list_add(pgd_t *pgd) --- linux-2.6.11-rc1/arch/i386/boot/compressed/head.S 2003-06-14 12:18:34.000000000 -0700 +++ 25/arch/i386/boot/compressed/head.S 2005-01-13 23:43:03.841514920 -0800 @@ -74,7 +74,7 @@ startup_32: popl %esi # discard address popl %esi # real mode pointer xorl %ebx,%ebx - ljmp $(__BOOT_CS), $0x100000 + ljmp $(__BOOT_CS), $KERN_PHYS_OFFSET /* * We come here, if we were loaded high. @@ -99,7 +99,7 @@ startup_32: popl %ecx # lcount popl %edx # high_buffer_start popl %eax # hcount - movl $0x100000,%edi + movl $KERN_PHYS_OFFSET,%edi cli # make sure we don't get interrupted ljmp $(__BOOT_CS), $0x1000 # and jump to the move routine @@ -124,5 +124,5 @@ move_routine_start: movsl movl %ebx,%esi # Restore setup pointer xorl %ebx,%ebx - ljmp $(__BOOT_CS), $0x100000 + ljmp $(__BOOT_CS), $KERN_PHYS_OFFSET move_routine_end: --- linux-2.6.11-rc1/arch/i386/boot/compressed/misc.c 2004-08-15 00:35:02.000000000 -0700 +++ 25/arch/i386/boot/compressed/misc.c 2005-01-13 23:43:03.842514768 -0800 @@ -14,6 +14,7 @@ #include #include