Skip to contentSkip to conversation

kernel boot problem, possibly hanging on interrupts

Adeos-main Will Wiles 3 participants 4 messages Jul 3, 2007 – Jul 26, 2007

Subsystems (16)
lore
Share & tools
lore

Will Wiles

author
#0 lore raw

I'm working with a PXA based embedded board attempting to get Adeos on it's feet. Right now at boot after the pipeline is enabled (a few printk's for devices later) the process stalls without any information as to why.

I've checked arch/arm/mach-pxa/time.c & irq.c against the information here,

http://www.xenomai.org/index.php/I-pipe:ArmPorting

and everything seems to be in order. I'm not too versed in interrupt handling as it relates specifically to the linux implementation, but Gilles was mentioning this as a likely culprit, and it seems fairly plausible.

If anyone has seen a similar problem (I'm hoping it's something simple as an incorrect register name), or a good strategy for trying to track down the offending routine, information would be appreciated.

Will Wiles

author
#1 lore raw
Quoted 18 lines · WILLIAM QUINTON

I'm working with a PXA based embedded board attempting to get Adeos on it's feet. Right now at boot after the pipeline is enabled (a few printk's for devices later) the process stalls without any information as to why.

I've checked arch/arm/mach-pxa/time.c & irq.c against the information here,

http://www.xenomai.org/index.php/I-pipe:ArmPorting

and everything seems to be in order. I'm not too versed in interrupt handling as it relates specifically to the linux implementation, but Gilles was mentioning this as a likely culprit, and it seems fairly plausible.

If anyone has seen a similar problem (I'm hoping it's something simple as an incorrect register name), or a good strategy for trying to track down the offending routine, information would be appreciated.

Quoted 7 lines

Will Wiles

_______________________________________________
Adeos-main mailing list
[email protected]
https://mail.gna.org/listinfo/adeos-main

Using the low-level debugging tools makes the kernel hang earlier, so I'm starting to think it is a more serious problem with the interrupt handling that I first expected.

Below is the 2.6.17 patch, I was wondering if anyone had an ARM setup around that they could use this ipipe patch on and get a successful boot. It's hard for me to verify since I only have one setup and the debugging tools aren't helpful in this scenario.

ipipe-2.6.17-arm.diff

arch/arm/boot/compressed/head.S 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/boot/compressed/head.S 2007-01-02 11:00:54.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/arch/arm/boot/compressed/head.S ipipe-2.6.17-arm/arch/arm/boot/compressed/head.S
@@ -820,6 +820,16 @@ memdump:    mov    r12, r0
        mov    pc, r10

#endif

+#ifdef CONFIG_IPIPE_TRACE_MCOUNT

+                .text
+                .align 0
+                .type mcount %function
+                .global mcount

+mcount:
+ mov pc, lr @ just return
+#endif
+
+
reloc_end:

.align

arch/arm/Kconfig 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/Kconfig 2007-01-02 11:00:54.000000000 +0100 +2 -0
diff -Naurdp linux-2.6.17/arch/arm/Kconfig ipipe-2.6.17-arm/arch/arm/Kconfig
@@ -429,6 +429,8 @@ config LOCAL_TIMERS
      accounting to be spread across the timer interval, preventing a
      "thundering herd" at every timer tick.
 
+source "kernel/ipipe/Kconfig"
+

config PREEMPT
bool "Preemptible Kernel (EXPERIMENTAL)"
depends on EXPERIMENTAL

arch/arm/kernel/entry-armv.S 2007-06-28 16:24:27.000000000 +0200 renamed from arch/arm/kernel/entry-armv.S 2007-01-02 11:00:54.000000000 +0100 +10 -1
diff -Naurdp linux-2.6.17/arch/arm/kernel/entry-armv.S ipipe-2.6.17-arm/arch/arm/kernel/entry-armv.S
@@ -4,6 +4,7 @@
 *  Copyright (C) 1996,1997,1998 Russell King.
 *  ARM700 fix by Matthew Godbolt ([email protected])
 *  nommu support by Hyok S. Choi ([email protected])
+ *  Copyright (C) 2005 Stelian Pop.
 *
 * 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
@@ -27,13 +28,21 @@
 * Interrupt handling.  Preserves r7, r8, r9
 */
    .macro    irq_handler
-1:    get_irqnr_and_base r0, r6, r5, lr
+#ifdef CONFIG_IPIPE
+    mov r0, #2
+#endif
+1:    get_irqnr_and_base r1, r6, r5, lr
+    movne    r0, r1
    movne    r1, sp
    @
    @ routine called with r0 = irq number, r1 = struct pt_regs *
    @
    adrne    lr, 1b
+#ifdef CONFIG_IPIPE
+    bne    __ipipe_grab_irq
+#else
    bne    asm_do_IRQ
+#endif
 
#ifdef CONFIG_SMP
    /*

@@ -42,18 +51,22 @@
* this macro assumes that irqstat (r6) and base (r5) are
* preserved from get_irqnr_and_base above
*/
- test_for_ipi r0, r6, r5, lr
+ test_for_ipi r1, r6, r5, lr
movne r0, sp
adrne lr, 1b
bne do_IPI

#ifdef CONFIG_LOCAL_TIMERS
- test_for_ltirq r0, r6, r5, lr
+ test_for_ltirq r1, r6, r5, lr
movne r0, sp
adrne lr, 1b
bne do_local_timer
#endif
#endif
+#ifdef CONFIG_IPIPE
+ cmp r0, #2
+ bleq __ipipe_check_root_interruptible
+#endif

.endm

@@ -193,14 +206,25 @@ __irq_svc:

#ifdef CONFIG_PREEMPT
get_thread_info tsk
+#ifndef CONFIG_IPIPE

    ldr    r8, [tsk, #TI_PREEMPT]        @ get preempt count
    add    r7, r8, #1            @ increment it
    str    r7, [tsk, #TI_PREEMPT]

#endif
+#endif

irq_handler
+#ifdef CONFIG_IPIPE

+    cmp    r0, #0
+    beq    __ipipe_fast_svc_irq_exit

+#endif
+
#ifdef CONFIG_PREEMPT
ldr r0, [tsk, #TI_FLAGS] @ get flags
+#ifdef CONFIG_IPIPE
+ ldr r8, [tsk, #TI_PREEMPT] @ get preempt count
+ mov r7, r8
+#endif
tst r0, #_TIF_NEED_RESCHED
blne svc_preempt
preempt_return:
@@ -209,6 +233,9 @@ preempt_return:
teq r0, r7
strne r0, [r0, -r0] @ bug()
#endif
+#ifdef CONFIG_IPIPE
+__ipipe_fast_svc_irq_exit:
+#endif
ldr r0, [sp, #S_PSR] @ irqs are already disabled
msr spsr_cxsf, r0
ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
@@ -224,19 +251,33 @@ svc_preempt:
ldr r1, [r6, #8] @ local_bh_count
adds r0, r0, r1
movne pc, lr
+#ifdef CONFIG_IPIPE
+ bl __ipipe_fast_stall_root
+ enable_irq
+#endif
mov r7, #0 @ preempt_schedule_irq
str r7, [tsk, #TI_PREEMPT] @ expects preempt_count == 0
1: bl preempt_schedule_irq @ irq en/disable is done inside
ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS
tst r0, #_TIF_NEED_RESCHED

-    beq    preempt_return            @ go again
-    b    1b
+    bne    1b

+#ifdef CONFIG_IPIPE
+ disable_irq
+ bl __ipipe_fast_unstall_root
+#endif
+ b preempt_return @ go again
#endif

.align 5
__und_svc:
svc_entry

+#ifdef CONFIG_IPIPE

+    mov    r1, sp                @ r0 = trapno, r1 = &regs
+    bl    __ipipe_dispatch_event        @ branch to trap handler
+    cmp    r0, #0
+    bne    1f

+#endif /* CONFIG_IPIPE */
@
@ call emulation code, which returns using r9 if it has emulated @ the instruction, or the more conventional lr if we are to treat
@@ -400,18 +441,28 @@ __irq_usr:

get_thread_info tsk
#ifdef CONFIG_PREEMPT
+#ifndef CONFIG_IPIPE

    ldr    r8, [tsk, #TI_PREEMPT]        @ get preempt count
    add    r7, r8, #1            @ increment it
    str    r7, [tsk, #TI_PREEMPT]

#endif
+#endif

irq_handler
+#ifdef CONFIG_IPIPE

+    cmp    r0, #0
+    bne    __ipipe_usr_irq_continue
+    slow_restore_user_regs            @ Fast exit path over non-root domains

+__ipipe_usr_irq_continue:
+#endif
#ifdef CONFIG_PREEMPT
+#ifndef CONFIG_IPIPE

    ldr    r0, [tsk, #TI_PREEMPT]
    str    r8, [tsk, #TI_PREEMPT]
    teq    r0, r7
    strne    r0, [r0, -r0]

#endif
+#endif

mov why, #0
b ret_to_user
@@ -498,8 +549,8 @@ call_fpe:

    mov    pc, lr                @ CP#8
    mov    pc, lr                @ CP#9
#ifdef CONFIG_VFP
-    b    do_vfp                @ CP#10 (VFP)
-    b    do_vfp                @ CP#11 (VFP)
+    b    _do_vfp                @ CP#10 (VFP)
+    b    _do_vfp                @ CP#11 (VFP)
#else
    mov    pc, lr                @ CP#10 (VFP)
    mov    pc, lr                @ CP#11 (VFP)

@@ -511,10 +562,33 @@ call_fpe:

do_fpe:
enable_irq
+#ifdef CONFIG_IPIPE

+    mov    r4, r0
+    mov    r0, #5                @ == IPIPE_TRAP_FPU
+    mov    r1, sp                @ r0 = trapno, r1 = &regs
+    bl    __ipipe_dispatch_event        @ branch to trap handler
+    cmp    r0, #0
+    ldrne    pc, [r9]
+    mov    r0, r4
+#endif
    ldr    r4, .LCfp
    add    r10, r10, #TI_FPSTATE        @ r10 = workspace
    ldr    pc, [r4]            @ Call FP module USR entry point

+#ifdef CONFIG_VFP
+_do_vfp:
+#ifdef CONFIG_IPIPE

+    mov    r4, r0
+    mov    r0, #6                @ == IPIPE_TRAP_VFP
+    mov    r1, sp                @ r0 = trapno, r1 = &regs
+    bl    __ipipe_dispatch_event        @ branch to trap handler
+    cmp    r0, #0
+    ldrne    pc, [r9]
+    mov    r0, r4

+#endif
+ b do_vfp
+#endif
+
/*
* The FP module is called with these registers set:
* r0 = instruction
@@ -547,6 +621,13 @@ __pabt_usr:
* This is the return code to user mode for abort handlers */
ENTRY(ret_from_exception)
+#ifdef CONFIG_IPIPE

+    bl     __ipipe_check_root
+    cmp     r0, #0
+    bne     1f
+    slow_restore_user_regs          @ Fast exit path over non-root domains

+1:
+#endif /* CONFIG_IPIPE */
get_thread_info tsk
mov why, #0
b ret_to_user

arch/arm/kernel/entry-common.S 2007-06-28 16:27:35.000000000 +0200 renamed from arch/arm/kernel/entry-common.S 2007-01-02 10:59:31.000000000 +0100 +6 -0
diff -Naurdp linux-2.6.17/arch/arm/kernel/entry-common.S ipipe-2.6.17-arm/arch/arm/kernel/entry-common.S
@@ -2,6 +2,7 @@
 *  linux/arch/arm/kernel/entry-common.S
 *
 *  Copyright (C) 2000 Russell King
+ *  Copyright (C) 2005 Stelian Pop.
 *
 * 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
@@ -20,13 +21,18 @@
 * possible here, and this includes saving r0 back into the SVC
 * stack.
 */
+#ifdef CONFIG_IPIPE
+__ipipe_ret_fast_syscall:
+    ldr    r0, [sp, #S_R0+S_OFF]        @ returned r0
+    /* fall through */
+#endif

ret_fast_syscall:
disable_irq @ disable interrupts
ldr r1, [tsk, #TI_FLAGS]
tst r1, #_TIF_WORK_MASK
bne fast_work_pending

- @ fast_restore_user_regs
+fast_restore_user_regs:

    ldr    r1, [sp, #S_OFF + S_PSR]    @ get calling cpsr
    ldr    lr, [sp, #S_OFF + S_PC]!    @ get pc
    msr    spsr_cxsf, r1            @ save in spsr_svc

@@ -35,6 +41,13 @@ ret_fast_syscall:
add sp, sp, #S_FRAME_SIZE - S_PC
movs pc, lr @ return & move spsr_svc into cpsr

+#ifdef CONFIG_IPIPE
+__ipipe_fast_exit_syscall:

+    ldr    r0, [sp, #S_R0+S_OFF]        @ returned r0
+    disable_irq                @ disable interrupts
+    b    fast_restore_user_regs

+#endif /* CONFIG_IPIPE */
+
/*
* Ok, we need to do extra processing, enter the slow path. */
@@ -62,19 +75,15 @@ ret_slow_syscall:
tst r1, #_TIF_WORK_MASK
bne work_pending
no_work_pending:

-    @ slow_restore_user_regs
-    ldr    r1, [sp, #S_PSR]        @ get calling cpsr
-    ldr    lr, [sp, #S_PC]!        @ get pc
-    msr    spsr_cxsf, r1            @ save in spsr_svc
-    ldmdb    sp, {r0 - lr}^            @ get calling r1 - lr
-    mov    r0, r0
-    add    sp, sp, #S_FRAME_SIZE - S_PC
-    movs    pc, lr                @ return & move spsr_svc into cpsr
+    slow_restore_user_regs

/*
* This is how we return from a fork.
*/
ENTRY(ret_from_fork)
+#ifdef CONFIG_IPIPE
+ enable_irq
+#endif /* CONFIG_IPIPE */
bl schedule_tail
get_thread_info tsk
ldr r1, [tsk, #TI_FLAGS] @ check for syscall tracing
@@ -197,8 +206,22 @@ ENTRY(vector_swi)
bic scno, scno, #0xff000000 @ mask off SWI op-code
eor scno, scno, #__NR_SYSCALL_BASE @ check OS number
#endif
+#ifdef CONFIG_IPIPE
+ .word __ipipe_syscall_root
+#endif

stmdb sp!, {r4, r5} @ push fifth and sixth args
+#ifdef CONFIG_IPIPE

+    stmfd    sp!, {r0-r3, ip}
+    add    r1, sp, #S_OFF
+    add    r1, r1, #20
+    mov    r0, scno
+    bl    __ipipe_syscall_root
+    cmp    r0, #0
+    ldmfd    sp!, {r0-r3, ip}
+    blt    __ipipe_ret_fast_syscall
+    bgt    __ipipe_fast_exit_syscall

+#endif /* CONFIG_IPIPE */
tst ip, #_TIF_SYSCALL_TRACE @ are we tracing syscalls?
bne __sys_trace

@@ -391,3 +414,28 @@ ENTRY(sys_oabi_call_table)

#endif

+#ifdef CONFIG_FRAME_POINTER
+

+    .text
+    .align 0
+    .type arm_return_addr %function
+    .global arm_return_addr
+
+arm_return_addr:
+    mov    ip, r0
+    mov    r0, fp
+3:
+    cmp    r0, #0
+    beq    1f        @ frame list hit end, bail
+    cmp    ip, #0
+    beq    2f        @ reached desired frame
+    ldr    r0, [r0, #-12]  @ else continue, get next fp
+    sub    ip, ip, #1
+    b    3b

+2:
+ ldr r0, [r0, #-4] @ get target return address
+1:
+ mov pc, lr
+
+#endif
+

arch/arm/kernel/entry-header.S 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/kernel/entry-header.S 2007-01-02 11:00:54.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/arch/arm/kernel/entry-header.S ipipe-2.6.17-arm/arch/arm/kernel/entry-header.S
@@ -50,6 +50,15 @@

#endif
.endm

+    .macro slow_restore_user_regs
+    ldr    r1, [sp, #S_PSR]        @ get calling cpsr
+    ldr    lr, [sp, #S_PC]!        @ get pc
+    msr    spsr_cxsf, r1            @ save in spsr_svc
+    ldmdb    sp, {r0 - lr}^            @ get calling r1 - lr
+    mov    r0, r0
+    add    sp, sp, #S_FRAME_SIZE - S_PC
+    movs    pc, lr                @ return & move spsr_svc into cpsr
+    .endm

/*
* These are the registers used in the syscall handler, and allow us to

arch/arm/kernel/ipipe-core.c 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/kernel/ipipe-core.c 1970-01-01 01:00:00.000000000 +0100 +239 -0

239 lines not on this page · raw message

arch/arm/kernel/ipipe-mcount.S 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/kernel/ipipe-mcount.S 1970-01-01 01:00:00.000000000 +0100 +40 -0
diff -Naurdp linux-2.6.17/arch/arm/kernel/ipipe-mcount.S ipipe-2.6.17-arm/arch/arm/kernel/ipipe-mcount.S
@@ -0,0 +1,40 @@
+/*
+ *  linux/arch/arm/kernel/ipipe-mcount.S
+ *
+ *  Copyright (C) 2006 Sebastian Smolorz <[email protected]>, emlix GmbH
+ */
+
+#include <linux/config.h>
+
+#ifdef CONFIG_FRAME_POINTER
+
+    .text
+    .align 0
+    .type mcount %function
+    .global mcount
+
+mcount:
+
+    ldr    ip, =ipipe_trace_enable    @ leave early, if disabled
+    ldr    ip, [ip]
+    cmp    ip, #0
+    moveq    pc,lr
+
+    mov    ip,  sp
+    stmdb   sp!, {r0 - r3, fp, ip, lr, pc}    @ create stack frame
+
+    mov    r3, #0            @ no additional value (v)
+    ldr    r2, [fp, #-4]        @ get lr (the return address
+                    @ of the caller of the
+                    @ instrumented function)
+    mov    r1, lr            @ get lr - (the return address
+                    @ of the instrumented function)
+    mov    r0, #0            @ IPIPE_TRACE_FN
+
+    sub    fp, ip, #4        @ point fp at this frame
+
+    bl    __ipipe_trace
+
+    ldmdb   fp, {r0 - r3, fp, sp, pc}    @ pop entry frame and return
+
+#endif
arch/arm/kernel/ipipe-root.c 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/kernel/ipipe-root.c 1970-01-01 01:00:00.000000000 +0100 +417 -0

417 lines not on this page · raw message

arch/arm/kernel/irq.c 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/kernel/irq.c 2007-01-02 11:00:54.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/arch/arm/kernel/irq.c ipipe-2.6.17-arm/arch/arm/kernel/irq.c
@@ -54,10 +54,11 @@
 

static int noirqdebug;
static volatile unsigned long irq_err_count;
-static DEFINE_SPINLOCK(irq_controller_lock);
+DEFINE_SPINLOCK(irq_controller_lock);
static LIST_HEAD(irq_pending);

struct irqdesc irq_desc[NR_IRQS];
+EXPORT_SYMBOL(irq_desc);
void (*init_arch_irq)(void) __initdata = NULL;

/*
@@ -417,7 +418,9 @@ do_edge_IRQ(unsigned int irq, struct irq

    /*
     * Acknowledge and clear the IRQ, but don't mask it.
     */
+#ifndef CONFIG_IPIPE
    desc->chip->ack(irq);

+#endif /* CONFIG_IPIPE */

/*
* Mark the IRQ currently in progress.
@@ -455,8 +458,10 @@ do_edge_IRQ(unsigned int irq, struct irq

     * currently running.  Delay it.
     */
    desc->pending = 1;
+#ifndef CONFIG_IPIPE
    desc->chip->mask(irq);
    desc->chip->ack(irq);

+#endif /* CONFIG_IPIPE */
}

/*
@@ -473,7 +478,9 @@ do_level_IRQ(unsigned int irq, struct ir

    /*
     * Acknowledge, clear _AND_ disable the interrupt.
     */
+#ifndef CONFIG_IPIPE
    desc->chip->ack(irq);

+#endif /* CONFIG_IPIPE */

    if (likely(!desc->disable_depth)) {
        kstat_cpu(cpu).irqs[irq]++;
@@ -559,7 +566,9 @@ asmlinkage void asm_do_IRQ(unsigned int
    if (!list_empty(&irq_pending))
        do_pending_irqs(regs);

+#ifndef CONFIG_IPIPE

    irq_finish(irq);

+#endif /* CONFIG_IPIPE */

    spin_unlock(&irq_controller_lock);
    irq_exit();
arch/arm/kernel/Makefile 2007-06-28 16:21:24.000000000 +0200 renamed from arch/arm/kernel/Makefile 2007-01-02 11:00:54.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/arch/arm/kernel/Makefile ipipe-2.6.17-arm/arch/arm/kernel/Makefile
@@ -21,6 +21,8 @@ obj-$(CONFIG_ISA_DMA)        += dma-isa.o

obj-$(CONFIG_PCI) += bios32.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o
+obj-$(CONFIG_IPIPE) += ipipe-core.o ipipe-root.o
+obj-$(CONFIG_IPIPE_TRACE_MCOUNT) += ipipe-mcount.o

obj-$(CONFIG_IWMMXT) += iwmmxt.o
AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt

arch/arm/kernel/process.c 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/kernel/process.c 2007-01-02 11:00:54.000000000 +0100 +7 -0
diff -Naurdp linux-2.6.17/arch/arm/kernel/process.c ipipe-2.6.17-arm/arch/arm/kernel/process.c
@@ -92,6 +92,12 @@ static void default_idle(void)
        local_irq_disable();
        if (!need_resched()) {
            timer_dyn_reprogram();
+#ifdef CONFIG_IPIPE
+            __ipipe_unstall_root();
+#ifdef CONFIG_IPIPE_TRACE_IRQSOFF
+            ipipe_trace_end(0x8000000E);
+#endif /* CONFIG_IPIPE_TRACE_IRQSOFF */
+#endif /* CONFIG_IPIPE */
            arch_idle();
        }
        local_irq_enable();
@@ -120,6 +126,7 @@ void cpu_idle(void)
 
        if (!idle)
            idle = default_idle;
+         ipipe_suspend_domain();
        leds_event(led_idle_start);
        while (!need_resched())
            idle();
arch/arm/kernel/ptrace.c 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/kernel/ptrace.c 2007-01-02 10:59:31.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/arch/arm/kernel/ptrace.c ipipe-2.6.17-arm/arch/arm/kernel/ptrace.c
@@ -486,6 +486,10 @@ void ptrace_break(struct task_struct *ts
 

static int break_trap(struct pt_regs *regs, unsigned int instr) {
+
+ if (ipipe_trap_notify(IPIPE_TRAP_BREAK,regs))
+ return 0;
+

    ptrace_break(current, regs);
    return 0;
}
arch/arm/kernel/traps.c 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/kernel/traps.c 2007-01-02 11:00:54.000000000 +0100 +3 -0
diff -Naurdp linux-2.6.17/arch/arm/kernel/traps.c ipipe-2.6.17-arm/arch/arm/kernel/traps.c
@@ -310,6 +310,9 @@ asmlinkage void do_undefinstr(struct pt_
    }
    spin_unlock_irq(&undef_lock);
 
+    if (ipipe_trap_notify(IPIPE_TRAP_UNDEFINSTR,regs))
+        return;
+

#ifdef CONFIG_DEBUG_USER
if (user_debug & UDBG_UNDEFINED) {
printk(KERN_INFO "%s (%d): undefined instruction: pc=%p\n",

arch/arm/mach-integrator/core.c 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/mach-integrator/core.c 2007-01-02 11:00:54.000000000 +0100 +1 -0
diff -Naurdp linux-2.6.17/arch/arm/mach-integrator/core.c ipipe-2.6.17-arm/arch/arm/mach-integrator/core.c
@@ -2,6 +2,7 @@
 *  linux/arch/arm/mach-integrator/core.c
 *
 *  Copyright (C) 2000-2003 Deep Blue Solutions Ltd
+ *  Copyright (C) 2005 Stelian Pop.
 *
 * 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
@@ -194,53 +195,57 @@ EXPORT_SYMBOL(cm_control);

/*
* How long is the timer interval?
*/
-#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10)
-#if TIMER_INTERVAL >= 0x100000
-#define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC)
-#elif TIMER_INTERVAL >= 0x10000
-#define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC)
-#else
#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)
-#endif

static unsigned long timer_reload;
+static unsigned long timer_interval;
+static unsigned long timer_lxlost;
+static int tscok;
+
+#ifdef CONFIG_IPIPE
+int __ipipe_mach_timerint = IRQ_TIMERINT1;
+static unsigned long long __ipipe_mach_tsc;
+static DEFINE_SPINLOCK(timer_lock);
+
+int __ipipe_mach_timerstolen = 0;
+EXPORT_SYMBOL(__ipipe_mach_timerstolen);
+#endif

/*
- * Returns number of ms since last clock interrupt. Note that interrupts
- * will have been disabled by do_gettimeoffset()
+ * Called with IRQ disabled from do_gettimeofday().
*/
-unsigned long integrator_gettimeoffset(void)
+static inline unsigned long integrator_getticksoffset(void)
{
- unsigned long ticks1, ticks2, status;
+ unsigned long ticks;

- /*

-     * Get the current number of ticks.  Note that there is a race
-     * condition between us reading the timer and checking for
-     * an interrupt.  We get around this by ensuring that the
-     * counter has not reloaded between our two reads.
-     */
-    ticks2 = readl(TIMER1_VA_BASE + TIMER_VALUE) & 0xffff;
-    do {
-        ticks1 = ticks2;
-        status = __raw_readl(VA_IC_BASE + IRQ_RAW_STATUS);
-        ticks2 = readl(TIMER1_VA_BASE + TIMER_VALUE) & 0xffff;

- } while (ticks2 > ticks1);
+ if (!tscok)
+ return 0;

- /*
- * Number of ticks since last interrupt.
- */
- ticks1 = timer_reload - ticks2;
+ ticks = readl(TIMER1_VA_BASE + TIMER_VALUE) & 0xffff;

- /*
- * Interrupt pending? If so, we've reloaded once already.
- */
- if (status & (1 << IRQ_TIMERINT1))
- ticks1 += timer_reload;
+ if (ticks > timer_reload)
+ ticks = 0xffff + timer_reload - ticks;
+ else
+ ticks = timer_reload - ticks;

+ if (timer_interval < 0x10000)
+ return ticks;
+ else if (timer_interval < 0x100000)
+ return ticks * 16;
+ else
+ return ticks * 256;
+}
+
+/*
+ * Returns number of ms since last clock interrupt. Note that interrupts
+ * will have been disabled by do_gettimeoffset()
+ */
+unsigned long integrator_gettimeoffset(void)

+{
    /*
     * Convert the ticks to usecs
     */

- return TICKS2USECS(ticks1);
+ return TICKS2USECS(timer_lxlost + integrator_getticksoffset());
}

/*
@@ -251,10 +256,22 @@ integrator_timer_interrupt(int irq, void

{
    write_seqlock(&xtime_lock);

+ timer_lxlost = 0;
+
+#ifdef CONFIG_IPIPE

    /*
-     * clear the interrupt
+     * If Linux is the only domain, ack the timer and reprogram it
     */

- writel(1, TIMER1_VA_BASE + TIMER_INTCLR);
+ if (!__ipipe_mach_timerstolen) {
+ __ipipe_mach_tsc += integrator_getticksoffset();
+#else
+ writel(1, TIMER1_VA_BASE + TIMER_INTCLR);
+#endif
+
+ writel(timer_reload, TIMER1_VA_BASE + TIMER_LOAD);
+#ifdef CONFIG_IPIPE
+ }
+#endif

/*
* the clock tick routines are only processed on the
@@ -285,24 +302,30 @@ static struct irqaction integrator_timer
.handler = integrator_timer_interrupt,
};

-/*
- * Set up timer interrupt, and return the current time in seconds.
- */
-void __init integrator_time_init(unsigned long reload, unsigned int ctrl) +static inline void set_dec(unsigned long reload)
{
- unsigned int timer_ctrl = TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC;
+ unsigned int ctrl = TIMER_CTRL_ENABLE | TIMER_CTRL_IE;

    timer_reload = reload;

- timer_ctrl |= ctrl;
+ timer_interval = reload;

- if (timer_reload > 0x100000) {

+    if (timer_reload >= 0x100000) {
        timer_reload >>= 8;
-        timer_ctrl |= TIMER_CTRL_DIV256;
-    } else if (timer_reload > 0x010000) {
+        ctrl |= TIMER_CTRL_DIV256;
+    } else if (timer_reload >= 0x010000) {
        timer_reload >>= 4;
-        timer_ctrl |= TIMER_CTRL_DIV16;
+        ctrl |= TIMER_CTRL_DIV16;
    }

+ writel(ctrl, TIMER1_VA_BASE + TIMER_CTRL);
+ writel(timer_reload, TIMER1_VA_BASE + TIMER_LOAD);
+}
+
+/*
+ * Set up timer interrupt, and return the current time in seconds.
+ */
+void __init integrator_time_init(unsigned long reload, unsigned int ctrl)

+{
    /*
     * Initialise to a known state (all timers off)
     */
@@ -310,12 +333,57 @@ void __init integrator_time_init(unsigne
    writel(0, TIMER1_VA_BASE + TIMER_CTRL);
    writel(0, TIMER2_VA_BASE + TIMER_CTRL);
-    writel(timer_reload, TIMER1_VA_BASE + TIMER_LOAD);
-    writel(timer_reload, TIMER1_VA_BASE + TIMER_VALUE);
-    writel(timer_ctrl, TIMER1_VA_BASE + TIMER_CTRL);
+    set_dec(reload);
    /*
     * Make irqs happen for the system timer
     */
    setup_irq(IRQ_TIMERINT1, &integrator_timer_irq);

+
+ tscok = 1;
+}
+
+#ifdef CONFIG_IPIPE
+void __ipipe_mach_acktimer(void)
+{
+ writel(1, TIMER1_VA_BASE + TIMER_INTCLR);
}
+
+notrace unsigned long long __ipipe_mach_get_tsc(void) +{
+ unsigned long long result;
+ unsigned long flags;
+

+    spin_lock_irqsave_hw(&timer_lock, flags);
+    result = __ipipe_mach_tsc + integrator_getticksoffset();
+    spin_unlock_irqrestore_hw(&timer_lock, flags);
+    return result;

+}
+EXPORT_SYMBOL(__ipipe_mach_get_tsc);
+
+void __ipipe_mach_set_dec(unsigned long reload)
+{
+ unsigned long ticks;
+ unsigned long flags;
+

+    spin_lock_irqsave_hw(&timer_lock, flags);
+    ticks = integrator_getticksoffset();
+    __ipipe_mach_tsc += ticks;
+    timer_lxlost += ticks;

+
+ set_dec(reload);
+ spin_unlock_irqrestore_hw(&timer_lock, flags);
+}
+EXPORT_SYMBOL(__ipipe_mach_set_dec);
+
+void __ipipe_mach_release_timer(void)
+{
+ __ipipe_mach_set_dec(__ipipe_mach_ticks_per_jiffy);
+}
+EXPORT_SYMBOL(__ipipe_mach_release_timer);
+
+unsigned long __ipipe_mach_get_dec(void)
+{
+ return readl(TIMER1_VA_BASE + TIMER_VALUE);
+}
+#endif /* CONFIG_IPIPE */

arch/arm/mach-integrator/integrator_cp.c 2007-06-28 16:19:48.000000000 +0200 renamed from arch/arm/mach-integrator/integrator_cp.c 2007-01-02 11:00:54.000000000 +0100 +1 -0
diff -Naurdp linux-2.6.17/arch/arm/mach-integrator/integrator_cp.c ipipe-2.6.17-arm/arch/arm/mach-integrator/integrator_cp.c
@@ -2,6 +2,7 @@
 *  linux/arch/arm/mach-integrator/integrator_cp.c
 *
 *  Copyright (C) 2003 Deep Blue Solutions Ltd
+ *  Copyright (C) 2005 Stelian Pop.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -19,6 +20,7 @@

#include <linux/amba/bus.h>
#include <linux/amba/kmi.h>
#include <linux/amba/clcd.h>
+#include <linux/ipipe.h>

#include <asm/hardware.h>
#include <asm/io.h>
@@ -219,6 +221,31 @@ sic_handle_irq(unsigned int irq, struct

    } while (status);
}

+#ifdef CONFIG_IPIPE
+void __ipipe_mach_demux_irq(unsigned irq, struct pt_regs *regs) +{

+    unsigned long status = sic_readl(INTCP_VA_SIC_BASE + IRQ_STATUS);
+    struct irqdesc *desc_unused = irq_desc + irq;
+    unsigned irq_unused = irq;

+
+ if (status == 0) {
+ do_bad_IRQ(irq, desc_unused, regs);
+ return;
+ }
+
+ do {
+ irq = ffs(status) - 1;
+ status &= ~(1 << irq);
+
+ irq += IRQ_SIC_START;
+
+ __ipipe_handle_irq(irq, regs);
+ } while (status);
+
+ desc_unused->chip->unmask(irq_unused);
+}
+#endif /* CONFIG_IPIPE */
+
static void __init intcp_init_irq(void)

{
    unsigned int i;

@@ -565,9 +592,14 @@ static void __init intcp_init(void)

#define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable */

+#ifdef CONFIG_IPIPE
+unsigned int __ipipe_mach_ticks_per_jiffy = 1000000 * TICKS_PER_uSEC / HZ; +EXPORT_SYMBOL(__ipipe_mach_ticks_per_jiffy);
+#endif
+
static void __init intcp_timer_init(void)
{
- integrator_time_init(1000000 / HZ, TIMER_CTRL_IE);
+ integrator_time_init(1000000 * TICKS_PER_uSEC / HZ, TIMER_CTRL_IE);
}

static struct sys_timer cp_timer = {

arch/arm/mach-pxa/irq.c 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/mach-pxa/irq.c 2007-01-02 10:57:37.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/arch/arm/mach-pxa/irq.c ipipe-2.6.17-arm/arch/arm/mach-pxa/irq.c
@@ -16,6 +16,7 @@

#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h>
+#include <linux/ipipe.h>

#include <asm/hardware.h>
#include <asm/irq.h>
@@ -214,6 +215,42 @@ static void pxa_gpio_demux_handler(unsig

    } while (loop);
}

+#ifdef CONFIG_IPIPE
+void __ipipe_mach_demux_irq(unsigned irq, struct pt_regs *regs) +{

+    struct irqdesc *desc_unused = irq_desc + irq;
+    unsigned irq_unused = irq;
+    unsigned int i, mask[4];
+    int loop;

+
+ do {
+ loop = 0;
+

+        mask[0] = GEDR0 & ~3;
+        mask[1] = GEDR1;
+        mask[2] = GEDR2;

+#if PXA_LAST_GPIO < 96
+ i = 3;
+#else /* PXA_LAST_GPIO >= 96 */
+ mask[3] = GEDR3;
+ i = 4;
+#endif /* PXA_LAST_GPIO >= 96 */
+ for (; i; i--) {
+ loop |= mask[i - 1];
+ while (mask[i - 1]) {

+                irq = fls(mask[i - 1]) - 1;
+                mask[i - 1] &= ~(1 << irq);
+                irq = IRQ_GPIO((i - 1) * 32 + irq);

+
+ __ipipe_handle_irq(irq, regs);
+ }
+ }
+ } while (loop);
+
+ desc_unused->chip->unmask(irq_unused);
+}
+#endif /* CONFIG_IPIPE */
+
static void pxa_ack_muxed_gpio(unsigned int irq)

{
    int gpio = irq - IRQ_GPIO(2) + 2;
arch/arm/mach-pxa/time.c 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/mach-pxa/time.c 2007-01-02 10:58:32.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/arch/arm/mach-pxa/time.c ipipe-2.6.17-arm/arch/arm/mach-pxa/time.c
@@ -19,6 +19,7 @@

#include <linux/signal.h>
#include <linux/errno.h>
#include <linux/sched.h>
+#include <linux/module.h>

#include <asm/system.h>
#include <asm/hardware.h>
@@ -30,6 +31,23 @@
#include <asm/arch/pxa-regs.h>

+#ifdef CONFIG_IPIPE
+#ifdef CONFIG_NO_IDLE_HZ
+#error "dynamic tick timer not yet supported with IPIPE" +#endif /* CONFIG_NO_IDLE_HZ */
+int __ipipe_mach_timerint = IRQ_OST0; +EXPORT_SYMBOL(__ipipe_mach_timerint);
+
+int __ipipe_mach_timerstolen = 0; +EXPORT_SYMBOL(__ipipe_mach_timerstolen);
+
+unsigned int __ipipe_mach_ticks_per_jiffy = LATCH; +EXPORT_SYMBOL(__ipipe_mach_ticks_per_jiffy);
+
+static int pxa_timer_initialized;
+static unsigned long last_jiffy_time;
+#endif /* CONFIG_IPIPE */
+
static inline unsigned long pxa_get_rtc_time(void)

{
    return RCNR;
@@ -54,6 +72,9 @@ static unsigned long pxa_gettimeoffset (
{
    long ticks_to_match, elapsed, usec;

+#ifdef CONFIG_IPIPE
+ if (!__ipipe_mach_timerstolen) {
+#endif

    /* Get ticks before next timer match */
    ticks_to_match = OSMR0 - OSCR;

@@ -63,6 +84,10 @@ static unsigned long pxa_gettimeoffset (

    /* don't get fooled by the workaround in pxa_timer_interrupt() */
    if (elapsed <= 0)
        return 0;

+#ifdef CONFIG_IPIPE
+ } else
+ elapsed = OSCR - last_jiffy_time;
+#endif

    /* Now convert them to usec */
    usec = (unsigned long)(elapsed * (tick_nsec / 1000))/LATCH;

@@ -105,9 +130,27 @@ pxa_timer_interrupt(int irq, void *dev_i
* affect things only when the timer IRQ has been delayed by nearly
* exactly one tick period which should be a pretty rare event. */
+#ifdef CONFIG_IPIPE
+ /*

+     * - if Linux is running natively (no ipipe), ack and reprogram the timer
+     * - if Linux is running under ipipe, but it still has the control over
+     *   the timer (no Xenomai for example), then reprogram the timer (ipipe
+     *   has already acked it)
+     * - if some other domain has taken over the timer, then do nothing
+     *   (ipipe has acked it, and the other domain has reprogramed it)
+     */

+ if (__ipipe_mach_timerstolen) {
+ timer_tick(regs);
+ last_jiffy_time += LATCH;
+ } else
+#endif /* CONFIG_IPIPE */

    do {
        timer_tick(regs);

+#ifdef CONFIG_IPIPE
+ last_jiffy_time += LATCH;
+#else /* !CONFIG_IPIPE */
OSSR = OSSR_M0; /* Clear match on timer 0 */
+#endif /* !CONFIG_IPIPE */

        next_match = (OSMR0 += LATCH);
    } while( (signed long)(next_match - OSCR) <= 8 );

@@ -139,6 +182,10 @@ static void __init pxa_timer_init(void)
setup_irq(IRQ_OST0, &pxa_timer_irq);
OIER = OIER_E0; /* enable match on timer 0 to cause
interrupts */
OSCR = 0; /* initialize free-running timer */
+
+#ifdef CONFIG_IPIPE
+ pxa_timer_initialized = 1;
+#endif /* CONFIG_IPIPE */
}

#ifdef CONFIG_NO_IDLE_HZ
@@ -216,3 +263,75 @@ struct sys_timer pxa_timer = {
.dyn_tick = &pxa_dyn_tick,
#endif
};
+
+#ifdef CONFIG_IPIPE
+void __ipipe_mach_acktimer(void)
+{
+ OSSR = OSSR_M0; /* Clear match on timer 0 */
+}
+
+notrace unsigned long long __ipipe_mach_get_tsc(void) +{
+ if (likely(pxa_timer_initialized)) {
+ static union {
+#ifdef __BIG_ENDIAN
+ struct {
+ unsigned long high;
+ unsigned long low;
+ };
+#else /* __LITTLE_ENDIAN */
+ struct {
+ unsigned long low;
+ unsigned long high;
+ };
+#endif /* __LITTLE_ENDIAN */
+ unsigned long long full;

+        } tsc[NR_CPUS], *local_tsc;
+        unsigned long stamp, flags;
+        unsigned long long result;
+
+        local_irq_save_hw(flags);
+        local_tsc = &tsc[ipipe_processor_id()];
+        stamp = OSCR;
+        if (unlikely(stamp < local_tsc->low))
+            /* 32 bit counter wrapped, increment high word. */
+            local_tsc->high++;
+        local_tsc->low = stamp;
+        result = local_tsc->full;
+        local_irq_restore_hw(flags);

+
+ return result;
+ }
+ + return 0;
+}
+EXPORT_SYMBOL(__ipipe_mach_get_tsc);
+
+/*
+ * Reprogram the timer
+ */
+
+void __ipipe_mach_set_dec(unsigned long delay)
+{
+ if (delay > 8) {
+ unsigned long flags;
+

+        local_irq_save_hw(flags);
+        OSMR0 = delay + OSCR;
+        local_irq_restore_hw(flags);

+ } else
+ ipipe_trigger_irq(IRQ_OST0);
+}
+EXPORT_SYMBOL(__ipipe_mach_set_dec);
+
+void __ipipe_mach_release_timer(void)
+{
+ __ipipe_mach_set_dec(__ipipe_mach_ticks_per_jiffy);
+}
+EXPORT_SYMBOL(__ipipe_mach_release_timer);
+
+unsigned long __ipipe_mach_get_dec(void)
+{
+ return OSMR0 - OSCR;
+}
+#endif /* CONFIG_IPIPE */

arch/arm/mach-s3c2410/irq.c 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/mach-s3c2410/irq.c 2007-01-02 10:57:37.000000000 +0100 +6 -1
diff -Naurdp linux-2.6.17/arch/arm/mach-s3c2410/irq.c ipipe-2.6.17-arm/arch/arm/mach-s3c2410/irq.c
@@ -3,6 +3,8 @@
 * Copyright (c) 2003,2004 Simtec Electronics
 *    Ben Dooks <[email protected]>
 *
+ * Copyright (C) 2006 Sebastian Smolorz <[email protected]>, emlix GmbH
+ *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
@@ -48,7 +50,10 @@
 *
 *   25-Jul-2005  Ben Dooks
 *          Split the S3C2440 IRQ code to seperate file
-*/
+ *
+ *   30-Oct-2006  Sebastian Smolorz
+ *          Added Adeos/I-pipe support
+ */
 

#include <linux/init.h>
#include <linux/module.h>
@@ -56,6 +61,7 @@
#include <linux/ioport.h>
#include <linux/ptrace.h>
#include <linux/sysdev.h>
+#include <linux/ipipe.h>

#include <asm/hardware.h>
#include <asm/irq.h>
@@ -70,6 +76,14 @@
#include "pm.h"
#include "irq.h"

+#ifdef CONFIG_IPIPE
+#ifdef CONFIG_CPU_S3C2440
+extern void __ipipe_s3c_irq_demux_wdtac97(unsigned int irq,
+ struct pt_regs *regs);
+extern void __ipipe_s3c_irq_demux_cam(unsigned int irq, struct pt_regs *regs); +#endif /* CONFIG_CPU_S3C2440 */
+#endif /* CONFIG_IPIPE */
+
/* wakeup irq control */

#ifdef CONFIG_PM
@@ -573,6 +587,79 @@ s3c_irq_demux_uart2(unsigned int irq, }

+#ifdef CONFIG_IPIPE
+static void __ipipe_s3c_irq_demux_uart(unsigned int start,
+ unsigned int subsrc,
+ struct pt_regs *regs)
+{
+ unsigned int offset = start - IRQ_S3CUART_RX0;
+
+ subsrc >>= offset;
+ subsrc &= 7;
+
+ if (subsrc != 0) {
+ if (subsrc & 1)
+ __ipipe_handle_irq(start, regs);
+ if (subsrc & 2)
+ __ipipe_handle_irq(start+1, regs);
+ if (subsrc & 4)
+ __ipipe_handle_irq(start+2, regs);
+ }
+}
+
+static void __ipipe_s3c_irq_demux_adc(unsigned int subsrc,
+ struct pt_regs *regs)
+{
+ subsrc >>= 9;
+ subsrc &= 3;
+
+ if (subsrc != 0) {
+ if (subsrc & 1)
+ __ipipe_handle_irq(IRQ_TC, regs);
+ if (subsrc & 2)
+ __ipipe_handle_irq(IRQ_ADC, regs);
+ }
+}
+
+void __ipipe_mach_demux_irq(unsigned irq, struct pt_regs *regs) +{
+ unsigned int subsrc, submsk;
+ struct irqdesc *desc_unused = irq_desc + irq;
+
+ /* read the current pending interrupts, and the mask
+ * for what it is available */
+ subsrc = __raw_readl(S3C2410_SUBSRCPND);
+ submsk = __raw_readl(S3C2410_INTSUBMSK);
+
+ subsrc &= ~submsk;
+
+ switch (irq) {
+ case IRQ_UART0:
+ __ipipe_s3c_irq_demux_uart(IRQ_S3CUART_RX0, subsrc, regs);
+ break;
+ case IRQ_UART1:
+ __ipipe_s3c_irq_demux_uart(IRQ_S3CUART_RX1, subsrc, regs);
+ break;
+ case IRQ_UART2:
+ __ipipe_s3c_irq_demux_uart(IRQ_S3CUART_RX2, subsrc, regs);
+ break;
+ case IRQ_ADCPARENT:
+ __ipipe_s3c_irq_demux_adc(subsrc, regs);
+ break;
+#ifdef CONFIG_CPU_S3C2440
+ case IRQ_WDT:
+ __ipipe_s3c_irq_demux_wdtac97(subsrc, regs);
+ break;
+ case IRQ_CAM:
+ __ipipe_s3c_irq_demux_cam(subsrc, regs);
+ break;
+#endif /* CONFIG_CPU_S3C2440 */
+ }
+
+ desc_unused->chip->unmask(irq);
+}
+#endif /* CONFIG_IPIPE */
+
/* s3c24xx_init_irq
*
* Initialise S3C2410 IRQ system

arch/arm/mach-s3c2410/s3c2440-irq.c 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/mach-s3c2410/s3c2440-irq.c 2007-01-02 10:57:37.000000000 +0100 +5 -1
diff -Naurdp linux-2.6.17/arch/arm/mach-s3c2410/s3c2440-irq.c ipipe-2.6.17-arm/arch/arm/mach-s3c2410/s3c2440-irq.c
@@ -3,6 +3,8 @@
 * Copyright (c) 2003,2004 Simtec Electronics
 *    Ben Dooks <[email protected]>
 *
+ * Copyright (C) 2006 Sebastian Smolorz <[email protected]>, emlix GmbH
+ *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
@@ -19,8 +21,10 @@
 *
 * Changelog:
 *    25-Jul-2005 BJD        Split from irq.c
+ *       11-Oct-2006 Sebastian Smolorz
+ *            Added Adeos/Ipipe support
 *
-*/
+ */
 

#include <linux/init.h>
#include <linux/module.h>
@@ -28,6 +32,7 @@
#include <linux/ioport.h>
#include <linux/ptrace.h>
#include <linux/sysdev.h>
+#include <linux/ipipe.h>

#include <asm/hardware.h>
#include <asm/irq.h>
@@ -157,6 +162,34 @@ static struct irqchip s3c_irq_cam = {
.ack = s3c_irq_cam_ack,
};

+#ifdef CONFIG_IPIPE
+void __ipipe_s3c_irq_demux_wdtac97(unsigned int subsrc, struct pt_regs *regs) +{
+ subsrc >>= 13;
+ subsrc &= 3;
+
+ if (subsrc != 0) {
+ if (subsrc & 1)
+ __ipipe_handle_irq(IRQ_S3C2440_WDT, regs);
+ if (subsrc & 2)
+ __ipipe_handle_irq(IRQ_S3C2440_AC97, regs);
+ }
+}
+
+void __ipipe_s3c_irq_demux_cam(unsigned int subsrc, struct pt_regs *regs) +{
+ subsrc >>= 11;
+ subsrc &= 3;
+
+ if (subsrc != 0) {
+ if (subsrc & 1)
+ __ipipe_handle_irq(IRQ_S3C2440_CAM_C, regs);
+ if (subsrc & 2)
+ __ipipe_handle_irq(IRQ_S3C2440_CAM_P, regs);
+ }
+}
+#endif /* CONFIG_IPIPE */
+
static int s3c2440_irq_add(struct sys_device *sysdev)

{
    unsigned int irqno;
arch/arm/mach-s3c2410/time.c 2007-06-28 16:28:45.000000000 +0200 renamed from arch/arm/mach-s3c2410/time.c 2007-01-02 11:00:54.000000000 +0100 +2 -0
diff -Naurdp linux-2.6.17/arch/arm/mach-s3c2410/time.c ipipe-2.6.17-arm/arch/arm/mach-s3c2410/time.c
@@ -3,6 +3,8 @@
 * Copyright (C) 2003-2005 Simtec Electronics
 *    Ben Dooks, <[email protected]>
 *
+ * Copyright (C) 2006 Sebastian Smolorz <[email protected]>, emlix GmbH
+ *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
@@ -25,6 +27,7 @@

#include <linux/interrupt.h>
#include <linux/err.h>
#include <linux/clk.h>
+#include <linux/module.h>

#include <asm/system.h>
#include <asm/leds.h>
@@ -40,7 +43,6 @@
#include "clock.h"
#include "cpu.h"

-static unsigned long timer_startval;
static unsigned long timer_usec_ticks;

#define TIMER_USEC_SHIFT 16
@@ -55,6 +57,24 @@ static unsigned long timer_usec_ticks;
* Original patch by Dimitry Andric, updated by Ben Dooks
*/

+static unsigned long last_free_running_tcnt = 0;
+static unsigned long free_running_tcon = 0;
+static unsigned long timer_lxlost = 0;
+
+#ifdef CONFIG_IPIPE
+unsigned int __ipipe_mach_ticks_per_jiffy; +EXPORT_SYMBOL(__ipipe_mach_ticks_per_jiffy);
+
+int __ipipe_mach_timerint = IRQ_TIMER4; +EXPORT_SYMBOL(__ipipe_mach_timerint);
+
+static unsigned long long __ipipe_mach_tsc = 0;
+static unsigned long timer_ackval = 1UL << (IRQ_TIMER4 - IRQ_EINT0); +static DEFINE_SPINLOCK(timer_lock);
+
+int __ipipe_mach_timerstolen = 0; +EXPORT_SYMBOL(__ipipe_mach_timerstolen);
+#endif /* CONFIG_IPIPE */

/* timer_mask_usec_ticks
*
@@ -85,44 +105,46 @@ static inline unsigned long timer_ticks_

    return res >> TIMER_USEC_SHIFT;
}

-/***
- * Returns microsecond since last clock interrupt. Note that interrupts
- * will have been disabled by do_gettimeoffset()
- * IRQs are disabled before entering here from do_gettimeofday()
- */
-
-#define SRCPND_TIMER4 (1<<(IRQ_TIMER4 - IRQ_EINT0))

-static unsigned long s3c2410_gettimeoffset (void) +static inline unsigned long timer_freerunning_getvalue(void) {

-    unsigned long tdone;
-    unsigned long irqpend;
-    unsigned long tval;

-
- /* work out how many ticks have gone since last timer interrupt */
+ return __raw_readl(S3C2410_TCNTO(3));
+}

- tval = __raw_readl(S3C2410_TCNTO(4));
- tdone = timer_startval - tval;
+static inline unsigned long timer_freerunning_getticksoffset(unsigned long tval) +{
+ long tdone;

-    /* check to see if there is an interrupt pending */
+    tdone =  last_free_running_tcnt - tval;
+    if (tdone < 0)

+ tdone += 0x10000;

- irqpend = __raw_readl(S3C2410_SRCPND);
- if (irqpend & SRCPND_TIMER4) {
- /* re-read the timer, and try and fix up for the missed

-         * interrupt. Note, the interrupt may go off before the
-         * timer has re-loaded from wrapping.
-         */

+ return tdone;
+}

- tval = __raw_readl(S3C2410_TCNTO(4));
- tdone = timer_startval - tval;
+static inline unsigned long getticksoffset(void)
+{
+ return timer_freerunning_getticksoffset(timer_freerunning_getvalue());
+}

- if (tval != 0)
- tdone += timer_startval;
- }
+#ifdef CONFIG_IPIPE
+static inline unsigned long getticksoffset_tscupdate(void) +{
+ unsigned long tval;
+ unsigned long ticks;

-    return timer_ticks_to_usec(tdone);
+    tval = timer_freerunning_getvalue();
+    ticks = timer_freerunning_getticksoffset(tval);
+    last_free_running_tcnt = tval;
+    __ipipe_mach_tsc += ticks;
+    return ticks;

}
+#endif /* CONFIG_IPIPE */

+static unsigned long s3c2410_gettimeoffset (void) +{
+ return timer_ticks_to_usec(timer_lxlost + getticksoffset());
+}

/*
* IRQ handler for the timer
@@ -131,6 +153,14 @@ static irqreturn_t s3c2410_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)

{
    write_seqlock(&xtime_lock);

+
+#ifdef CONFIG_IPIPE
+ timer_lxlost = 0;
+
+ if (!__ipipe_mach_timerstolen)
+ getticksoffset_tscupdate();
+#endif /* CONFIG_IPIPE */
+

    timer_tick(regs);
    write_sequnlock(&xtime_lock);
    return IRQ_HANDLED;

@@ -149,10 +179,10 @@ static struct irqaction s3c2410_timer_ir
machine_is_osiris() )

/*
- * Set up timer interrupt, and return the current time in seconds.
+ * Set up timer interrupt.
*
- * Currently we only use timer4, as it is the only timer which has no
- * other function that can be exploited externally
+ * Currently we use timer4 as event timer and timer3 as tick counter which
+ * permanently counts ticks without interrupt generation.
*/
static void s3c2410_timer_setup (void)
{
@@ -160,6 +190,7 @@ static void s3c2410_timer_setup (void)

    unsigned long tcnt;
    unsigned long tcfg1;
    unsigned long tcfg0;

+ unsigned long intmask;

    tcnt = 0xffff;  /* default value for tcnt */

@@ -176,8 +207,8 @@ static void s3c2410_timer_setup (void)

        timer_usec_ticks = timer_mask_usec_ticks(1, 12000000);
        tcnt = 12000000 / HZ;
-        tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK;
-        tcfg1 |= S3C2410_TCFG1_MUX4_TCLK1;
+        tcfg1 &= ~(S3C2410_TCFG1_MUX4_MASK | S3C2410_TCFG1_MUX3_MASK);
+        tcfg1 |= (S3C2410_TCFG1_MUX4_TCLK1 | S3C2410_TCFG1_MUX3_TCLK1);
    } else {
        unsigned long pclk;
        struct clk *clk;

@@ -205,8 +236,8 @@ static void s3c2410_timer_setup (void)

        timer_usec_ticks = timer_mask_usec_ticks(6, pclk);
-        tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK;
-        tcfg1 |= S3C2410_TCFG1_MUX4_DIV2;
+        tcfg1 &= ~(S3C2410_TCFG1_MUX4_MASK | S3C2410_TCFG1_MUX3_MASK);
+        tcfg1 |= (S3C2410_TCFG1_MUX4_DIV2 | S3C2410_TCFG1_MUX3_DIV2);
        tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK;
        tcfg0 |= ((6 - 1) / 2) << S3C2410_TCFG_PRESCALER1_SHIFT;
@@ -214,6 +245,10 @@ static void s3c2410_timer_setup (void)
        tcnt = (pclk / 6) / HZ;
    }

+#ifdef CONFIG_IPIPE
+ __ipipe_mach_ticks_per_jiffy = tcnt;
+#endif /* CONFIG_IPIPE */
+

    /* timers reload after counting zero, so reduce the count by 1 */

    tcnt--;
@@ -230,23 +265,37 @@ static void s3c2410_timer_setup (void)
    __raw_writel(tcfg1, S3C2410_TCFG1);
    __raw_writel(tcfg0, S3C2410_TCFG0);

- timer_startval = tcnt;
- __raw_writel(tcnt, S3C2410_TCNTB(4));
-

-    /* ensure timer is stopped... */
+    /* ensure timers are stopped... */
+    tcon &= ~(0x3f<<17);
+    __raw_writel(tcon, S3C2410_TCON);
-    tcon &= ~(7<<20);
-    tcon |= S3C2410_TCON_T4RELOAD;
-    tcon |= S3C2410_TCON_T4MANUALUPD;
+    /* Mask timer3 interrupt. */
+    intmask = __raw_readl(S3C2410_INTMSK);
+    intmask |= 1UL << (IRQ_TIMER3 - IRQ_EINT0);
+    __raw_writel(intmask, S3C2410_INTMSK);

- __raw_writel(tcon, S3C2410_TCON);
+ /* Set timer values */

    __raw_writel(tcnt, S3C2410_TCNTB(4));
    __raw_writel(tcnt, S3C2410_TCMPB(4));

+ __raw_writel(0xffff, S3C2410_TCNTB(3));
+ __raw_writel(0xffff, S3C2410_TCMPB(3));

-    /* start the timer running */
-    tcon |= S3C2410_TCON_T4START;
-    tcon &= ~S3C2410_TCON_T4MANUALUPD;
+    /* Set base tcon value for later programming of timer 4 by Xenomai. */
+    free_running_tcon = tcon |  S3C2410_TCON_T3RELOAD | S3C2410_TCON_T3START;

+
+ /* Set auto reloads for both timers. */
+ tcon |= S3C2410_TCON_T3RELOAD | S3C2410_TCON_T4RELOAD;
+
+ /* Manual update */
+ __raw_writel(tcon | S3C2410_TCON_T3MANUALUPD
+ | S3C2410_TCON_T4MANUALUPD, S3C2410_TCON);
+
+ tcon |= S3C2410_TCON_T3START | S3C2410_TCON_T4START;
+ /* Start timers.*/

    __raw_writel(tcon, S3C2410_TCON);

+
+ /* Save start value of timer 3 as begining of first period. */
+ last_free_running_tcnt = 0xffff;
}

static void __init s3c2410_timer_init (void) @@ -260,3 +309,56 @@ struct sys_timer s3c24xx_timer = {
.offset = s3c2410_gettimeoffset,
.resume = s3c2410_timer_setup
};
+
+#ifdef CONFIG_IPIPE
+void __ipipe_mach_acktimer(void)
+{
+ __raw_writel(timer_ackval, S3C2410_SRCPND);
+ __raw_writel(timer_ackval, S3C2410_INTPND);
+}
+
+notrace unsigned long long __ipipe_mach_get_tsc(void) +{
+ unsigned long long result;
+ unsigned long flags;
+

+    spin_lock_irqsave_hw(&timer_lock, flags);
+    result = __ipipe_mach_tsc + getticksoffset();
+    spin_unlock_irqrestore_hw(&timer_lock, flags);
+    return result;

+}
+EXPORT_SYMBOL(__ipipe_mach_get_tsc);
+
+static inline void set_dec(unsigned long reload)
+{

+    __raw_writel(reload, S3C2410_TCNTB(4));
+    /* Manual update */
+    __raw_writel(free_running_tcon | S3C2410_TCON_T4MANUALUPD, S3C2410_TCON);
+    /* Start timer */
+    __raw_writel(free_running_tcon | S3C2410_TCON_T4START, S3C2410_TCON);

+}
+
+void __ipipe_mach_set_dec(unsigned long reload)
+{
+ unsigned long flags;
+

+    spin_lock_irqsave_hw(&timer_lock, flags);
+    timer_lxlost += getticksoffset_tscupdate();
+    set_dec(reload);
+    spin_unlock_irqrestore_hw(&timer_lock, flags);

+}
+EXPORT_SYMBOL(__ipipe_mach_set_dec);
+
+void __ipipe_mach_release_timer(void)
+{

+    free_running_tcon |= S3C2410_TCON_T4RELOAD;
+    __ipipe_mach_set_dec(__ipipe_mach_ticks_per_jiffy - 1);
+    free_running_tcon &= ~S3C2410_TCON_T4RELOAD;

+}
+EXPORT_SYMBOL(__ipipe_mach_release_timer);
+
+unsigned long __ipipe_mach_get_dec(void)
+{
+ return __raw_readl(S3C2410_TCNTO(4));
+}
+#endif /* CONFIG_IPIPE */

arch/arm/mach-sa1100/irq.c 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/mach-sa1100/irq.c 2007-01-02 11:00:54.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/arch/arm/mach-sa1100/irq.c ipipe-2.6.17-arm/arch/arm/mach-sa1100/irq.c
@@ -14,6 +14,7 @@

#include <linux/ioport.h>
#include <linux/ptrace.h>
#include <linux/sysdev.h>
+#include <linux/ipipe.h>

#include <asm/hardware.h>
#include <asm/irq.h>
@@ -136,6 +137,37 @@ sa1100_high_gpio_handler(unsigned int ir

    } while (mask);
}

+#ifdef CONFIG_IPIPE
+void __ipipe_mach_demux_irq(unsigned irq, struct pt_regs *regs) +{

+    struct irqdesc *desc_unused = irq_desc + irq;
+    unsigned irq_unused = irq;
+    unsigned int mask;

+
+ mask = GEDR & 0xfffff800;
+ do {
+ /*

+         * clear down all currently active IRQ sources.
+         * We will be processing them all.
+         */
+        GEDR = mask;
+
+        irq = IRQ_GPIO11;
+        mask >>= 11;
+        do {

+ if (mask & 1)
+ __ipipe_handle_irq(irq, regs);
+ mask >>= 1;
+ irq++;
+ } while (mask);
+
+ mask = GEDR & 0xfffff800;
+ } while (mask);
+
+ desc_unused->chip->unmask(irq_unused);
+}
+#endif /* CONFIG_IPIPE */
+
/*
* Like GPIO0 to 10, GPIO11-27 IRQs need to be handled specially.
* In addition, the IRQs are all collected up into one bit in the

arch/arm/mach-sa1100/time.c 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/mach-sa1100/time.c 2007-01-02 10:58:32.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/arch/arm/mach-sa1100/time.c ipipe-2.6.17-arm/arch/arm/mach-sa1100/time.c
@@ -13,6 +13,7 @@

#include <linux/interrupt.h>
#include <linux/timex.h>
#include <linux/signal.h>
+#include <linux/module.h>

#include <asm/mach/time.h>
#include <asm/hardware.h>
@@ -20,6 +21,23 @@
#define RTC_DEF_DIVIDER (32768 - 1)
#define RTC_DEF_TRIM 0

+#ifdef CONFIG_IPIPE
+#ifdef CONFIG_NO_IDLE_HZ
+#error "dynamic tick timer not yet supported with IPIPE" +#endif /* CONFIG_NO_IDLE_HZ */
+int __ipipe_mach_timerint = IRQ_OST0; +EXPORT_SYMBOL(__ipipe_mach_timerint);
+
+int __ipipe_mach_timerstolen = 0; +EXPORT_SYMBOL(__ipipe_mach_timerstolen);
+
+unsigned int __ipipe_mach_ticks_per_jiffy = LATCH; +EXPORT_SYMBOL(__ipipe_mach_ticks_per_jiffy);
+
+static int sa1100_timer_initialized;
+static unsigned long last_jiffy_time;
+#endif /* CONFIG_IPIPE */
+
static unsigned long __init sa1100_get_rtc_time(void)

{
    /*
@@ -58,11 +76,18 @@ static unsigned long sa1100_gettimeoffse
{
    unsigned long ticks_to_match, elapsed, usec;

+#ifdef CONFIG_IPIPE
+ if (!__ipipe_mach_timerstolen) {
+#endif

    /* Get ticks before next timer match */
    ticks_to_match = OSMR0 - OSCR;

    /* We need elapsed ticks since last match */
    elapsed = LATCH - ticks_to_match;

+#ifdef CONFIG_IPIPE
+ } else
+ elapsed = OSCR - last_jiffy_time;
+#endif

    /* Now convert them to usec */
    usec = (unsigned long)(elapsed * (tick_nsec / 1000))/LATCH;

@@ -97,9 +122,27 @@ sa1100_timer_interrupt(int irq, void *de
* ensured, hence we can use do_gettimeofday() from interrupt
* handlers.
*/
+#ifdef CONFIG_IPIPE
+ /*

+     * - if Linux is running natively (no ipipe), ack and reprogram the timer
+     * - if Linux is running under ipipe, but it still has the control over
+     *   the timer (no Xenomai for example), then reprogram the timer (ipipe
+     *   has already acked it)
+     * - if some other domain has taken over the timer, then do nothing
+     *   (ipipe has acked it, and the other domain has reprogramed it)
+     */

+ if (__ipipe_mach_timerstolen) {
+ timer_tick(regs);
+ last_jiffy_time += LATCH;
+ } else
+#endif /* CONFIG_IPIPE */

    do {
        timer_tick(regs);

+#ifdef CONFIG_IPIPE
+ last_jiffy_time += LATCH;
+#else /* !CONFIG_IPIPE */
OSSR = OSSR_M0; /* Clear match on timer 0 */
+#endif /* !CONFIG_IPIPE */

        next_match = (OSMR0 += LATCH);
    } while ((signed long)(next_match - OSCR) <= 0);

@@ -131,6 +174,10 @@ static void __init sa1100_timer_init(voi
setup_irq(IRQ_OST0, &sa1100_timer_irq);
OIER = OIER_E0; /* enable match on timer 0 to cause
interrupts */
OSCR = 0; /* initialize free-running timer */
+
+#ifdef CONFIG_IPIPE
+ sa1100_timer_initialized = 1;
+#endif /* CONFIG_IPIPE */
}

#ifdef CONFIG_NO_IDLE_HZ

@@ -209,3 +256,72 @@ struct sys_timer sa1100_timer = {
    .dyn_tick    = &sa1100_dyn_tick,

#endif
};
+
+#ifdef CONFIG_IPIPE
+void __ipipe_mach_acktimer(void)
+{
+ OSSR = OSSR_M0; /* Clear match on timer 0 */
+}
+
+notrace unsigned long long __ipipe_mach_get_tsc(void) +{
+ if (likely(sa1100_timer_initialized)) {
+ static union {
+#ifdef __BIG_ENDIAN
+ struct {
+ unsigned long high;
+ unsigned long low;
+ };
+#else /* __LITTLE_ENDIAN */
+ struct {
+ unsigned long low;
+ unsigned long high;
+ };
+#endif /* __LITTLE_ENDIAN */
+ unsigned long long full;

+        } tsc[NR_CPUS], *local_tsc;
+        unsigned long stamp, flags;
+        unsigned long long result;
+
+        local_irq_save_hw(flags);
+        local_tsc = &tsc[ipipe_processor_id()];
+        stamp = OSCR;
+        if (unlikely(stamp < local_tsc->low))
+            /* 32 bit counter wrapped, increment high word. */
+            local_tsc->high++;
+        local_tsc->low = stamp;
+        result = local_tsc->full;
+        local_irq_restore_hw(flags);

+
+ return result;
+ }
+ + return 0;
+}
+EXPORT_SYMBOL(__ipipe_mach_get_tsc);
+
+/*
+ * Reprogram the timer
+ */
+
+void __ipipe_mach_set_dec(unsigned long delay)
+{
+ unsigned long flags;
+
+ local_irq_save_hw(flags);
+ OSMR0 = delay + OSCR;
+ local_irq_restore_hw(flags);
+}
+EXPORT_SYMBOL(__ipipe_mach_set_dec);
+
+void __ipipe_mach_release_timer(void)
+{
+ __ipipe_mach_set_dec(__ipipe_mach_ticks_per_jiffy);
+}
+EXPORT_SYMBOL(__ipipe_mach_release_timer);
+
+unsigned long __ipipe_mach_get_dec(void)
+{
+ return OSMR0 - OSCR;
+}
+#endif /* CONFIG_IPIPE */

arch/arm/mm/copypage-v4mc.c 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/mm/copypage-v4mc.c 2005-06-17 21:48:29.000000000 +0200 +0 -0
diff -Naurdp linux-2.6.17/arch/arm/mm/copypage-v4mc.c ipipe-2.6.17-arm/arch/arm/mm/copypage-v4mc.c
@@ -43,7 +43,7 @@ static DEFINE_SPINLOCK(minicache_lock);
 * instruction.  If your processor does not supply this, you have to 

write your
* own copy_user_page that does the right thing.
*/
-static void __attribute__((naked))
+static void notrace __attribute__((naked))
mc_copy_user_page(void *from, void *to)

{
    asm volatile(

@@ -82,7 +82,7 @@ void v4_mc_copy_user_page(void *kto, con /*
* ARMv4 optimised clear_user_page
*/
-void __attribute__((naked))
+void notrace __attribute__((naked)) v4_mc_clear_user_page(void *kaddr, unsigned long vaddr)

{
    asm volatile(
arch/arm/mm/copypage-xscale.c 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/mm/copypage-xscale.c 2005-06-17 21:48:29.000000000 +0200 +0 -0
diff -Naurdp linux-2.6.17/arch/arm/mm/copypage-xscale.c ipipe-2.6.17-arm/arch/arm/mm/copypage-xscale.c
@@ -41,7 +41,7 @@ static DEFINE_SPINLOCK(minicache_lock);
 * Dcache aliasing issue.  The writes will be forwarded to the write 

buffer,
* and merged as appropriate.
*/
-static void __attribute__((naked))
+static void notrace __attribute__((naked))
mc_copy_user_page(void *from, void *to)

{
    /*

@@ -104,7 +104,7 @@ void xscale_mc_copy_user_page(void *kto, /*
* XScale optimised clear_user_page
*/
-void __attribute__((naked))
+void notrace __attribute__((naked)) xscale_mc_clear_user_page(void *kaddr, unsigned long vaddr)

{
    asm volatile(
arch/arm/mm/fault.c 2007-06-28 16:05:47.000000000 +0200 renamed from arch/arm/mm/fault.c 2007-01-02 10:57:37.000000000 +0100 +3 -0
diff -Naurdp linux-2.6.17/arch/arm/mm/fault.c ipipe-2.6.17-arm/arch/arm/mm/fault.c
@@ -223,6 +223,9 @@ do_page_fault(unsigned long addr, unsign
    struct mm_struct *mm;
    int fault, sig, code;
 
+    if (ipipe_trap_notify(IPIPE_TRAP_ACCESS,regs))
+        return 0;
+
    tsk = current;
    mm  = tsk->mm;
 
@@ -354,6 +357,9 @@ do_translation_fault(unsigned long addr,

bad_area:

    tsk = current;

+ if (ipipe_trap_notify(IPIPE_TRAP_ACCESS,regs))
+ return 0;
+

    do_bad_area(tsk, tsk->active_mm, addr, fsr, regs);
    return 0;
}
@@ -366,6 +372,10 @@ static int
do_sect_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
{
    struct task_struct *tsk = current;

+
+ if (ipipe_trap_notify(IPIPE_TRAP_SECTION,regs))
+ return 0;
+

    do_bad_area(tsk, tsk->active_mm, addr, fsr, regs);
    return 0;
}

@@ -376,6 +386,9 @@ do_sect_fault(unsigned long addr, unsign static int
do_bad(unsigned long addr, unsigned int fsr, struct pt_regs *regs) {
+ if (ipipe_trap_notify(IPIPE_TRAP_DABT,regs))
+ return 0;
+

    return 1;
}

@@ -451,6 +464,9 @@ do_DataAbort(unsigned long addr, unsigne

    if (!inf->fn(addr, fsr, regs))
        return;

+ if (ipipe_trap_notify(IPIPE_TRAP_UNKNOWN,regs))
+ return;
+

    printk(KERN_ALERT "Unhandled fault: %s (0x%03x) at 0x%08lx\n",
        inf->name, fsr, addr);
drivers/pci/msi.c 2007-06-28 16:05:47.000000000 +0200 renamed from drivers/pci/msi.c 2007-01-02 11:01:05.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/drivers/pci/msi.c ipipe-2.6.17-arm/drivers/pci/msi.c
@@ -151,6 +151,21 @@ static void unmask_MSI_irq(unsigned int
    msi_set_mask_bit(vector, 0);

}

+#ifdef CONFIG_IPIPE
+static void ack_MSI_irq_w_maskbit(unsigned int vector) +{
+ mask_MSI_irq(vector);
+ __ack_APIC_irq();
+}
+static void ack_MSI_irq_wo_maskbit(unsigned int vector) +{
+ __ack_APIC_irq();
+}
+#else /* !CONFIG_IPIPE */
+#define ack_MSI_irq_wo_maskbit do_nothing
+#define ack_MSI_irq_w_maskbit mask_MSI_irq
+#endif /* CONFIG_IPIPE */
+
static unsigned int startup_msi_irq_wo_maskbit(unsigned int vector)

{
    struct msi_desc *entry;

@@ -214,7 +229,7 @@ static struct hw_interrupt_type msix_irq
.shutdown = shutdown_msi_irq,
.enable = unmask_MSI_irq,
.disable = mask_MSI_irq,

-    .ack        = mask_MSI_irq,
+    .ack        = ack_MSI_irq_w_maskbit,

.end = end_msi_irq_w_maskbit,
.set_affinity = set_msi_affinity
};
@@ -230,7 +245,7 @@ static struct hw_interrupt_type msi_irq_
.shutdown = shutdown_msi_irq,
.enable = unmask_MSI_irq,
.disable = mask_MSI_irq,

-    .ack        = mask_MSI_irq,
+    .ack        = ack_MSI_irq_w_maskbit,

.end = end_msi_irq_w_maskbit,
.set_affinity = set_msi_affinity
};
@@ -246,7 +261,7 @@ static struct hw_interrupt_type msi_irq_
.shutdown = shutdown_msi_irq,
.enable = do_nothing,
.disable = do_nothing,

-    .ack        = do_nothing,
+    .ack        = ack_MSI_irq_wo_maskbit,

.end = end_msi_irq_wo_maskbit,
.set_affinity = set_msi_affinity
};

include/asm-arm/arch-integrator/entry-macro.S 2007-06-28 16:05:47.000000000 +0200 renamed from include/asm-arm/arch-integrator/entry-macro.S 2007-01-02 10:59:45.000000000 +0100 +5 -1
diff -Naurdp linux-2.6.17/include/asm-arm/arch-integrator/entry-macro.S ipipe-2.6.17-arm/include/asm-arm/arch-integrator/entry-macro.S
@@ -22,7 +22,11 @@
        teq    \irqstat, #0
        ldreq    \irqstat, [\base, #(INTEGRATOR_HDR_IC_OFFSET+IRQ_STATUS)]
        moveq    \irqnr, #IRQ_CIC_START
-
+#ifdef CONFIG_IPIPE
+        tst    \irqstat, #0x00000040            @ check IRQ_TIMERINT1 first
+        movne    \irqnr, #6
+        bne    1003f
+#endif /* CONFIG_IPIPE */

1001: tst \irqstat, #15
bne 1002f
add \irqnr, \irqnr, #4

include/asm-arm/arch-integrator/irqs.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/asm-arm/arch-integrator/irqs.h 2005-06-17 21:48:29.000000000 +0200 +0 -0
diff -Naurdp linux-2.6.17/include/asm-arm/arch-integrator/irqs.h ipipe-2.6.17-arm/include/asm-arm/arch-integrator/irqs.h
@@ -80,3 +80,6 @@
 

#define NR_IRQS 47

+#ifdef CONFIG_IPIPE
+#define __ipipe_mach_irq_mux_p(irq) ((irq) == IRQ_CP_CPPLDINT) +#endif /* CONFIG_IPIPE */

include/asm-arm/arch-integrator/platform.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/asm-arm/arch-integrator/platform.h 2005-06-17 21:48:29.000000000 +0200 +1 -1
diff -Naurdp linux-2.6.17/include/asm-arm/arch-integrator/platform.h ipipe-2.6.17-arm/include/asm-arm/arch-integrator/platform.h
@@ -26,13 +26,15 @@
 *     NOTE: This is a multi-hosted header file for use with uHAL and
 *           supported debuggers.
 *
- *     $Id: platform.s,v 1.32 2000/02/18 10:51:39 asims Exp $
+ *     $Id: platform.h,v 1.2 2006/02/20 13:54:22 rpm Exp $
 *
 * ***********************************************************************/
 

#ifndef __address_h
#define __address_h 1

+#include <linux/config.h>
+
/* ========================================================================
* Integrator definitions
* ========================================================================
@@ -436,7 +438,7 @@
* Timer definitions
*
* Only use timer 1 & 2
- * (both run at 24MHz and will need the clock divider set to 16).
+ * (both run at 1MHZ on /CP and at 24MHz on /AP)
*
* Timer 0 runs at bus frequency and therefore could vary and currently
* uHAL can't handle that.
@@ -449,7 +451,12 @@

#define MAX_TIMER 2
#define MAX_PERIOD 699050
+
+#ifdef CONFIG_ARCH_INTEGRATOR_CP
+#define TICKS_PER_uSEC 1
+#else
#define TICKS_PER_uSEC 24
+#endif

/*
* These are useconds NOT ticks.

include/asm-arm/arch-integrator/timex.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/asm-arm/arch-integrator/timex.h 2005-06-17 21:48:29.000000000 +0200 +0 -0
diff -Naurdp linux-2.6.17/include/asm-arm/arch-integrator/timex.h ipipe-2.6.17-arm/include/asm-arm/arch-integrator/timex.h
@@ -21,6 +21,6 @@
 */
 

/*
- * ??
+ * Timer rate
*/
-#define CLOCK_TICK_RATE (50000000 / 16)
+#define CLOCK_TICK_RATE (1000000)

include/asm-arm/arch-pxa/irqs.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/asm-arm/arch-pxa/irqs.h 2007-01-02 11:01:15.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/include/asm-arm/arch-pxa/irqs.h ipipe-2.6.17-arm/include/asm-arm/arch-pxa/irqs.h
@@ -73,6 +73,10 @@
            ((i) - IRQ_GPIO(2) + 2)

#define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i))

+#ifdef CONFIG_IPIPE
+#define __ipipe_mach_irq_mux_p(irq) ((irq) == IRQ_GPIO_2_x) +#endif /* CONFIG_IPIPE */
+
#if defined(CONFIG_PXA25x)
#define PXA_LAST_GPIO 80
#elif defined(CONFIG_PXA27x)

include/asm-arm/arch-s3c2410/irqs.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/asm-arm/arch-s3c2410/irqs.h 2005-06-17 21:48:29.000000000 +0200 +3 -0
diff -Naurdp linux-2.6.17/include/asm-arm/arch-s3c2410/irqs.h ipipe-2.6.17-arm/include/asm-arm/arch-s3c2410/irqs.h
@@ -3,6 +3,8 @@
 * Copyright (c) 2003-2005 Simtec Electronics
 *   Ben Dooks <[email protected]>
 *
+ * Copyright (C) 2006 Sebastian Smolorz <[email protected]>, emlix GmbH
+ *
 * 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.
@@ -13,6 +15,7 @@
 *  12-Mar-2004 BJD  Fixed bug in header protection
 *  10-Feb-2005 BJD  Added camera IRQ from [email protected]
 *  28-Feb-2005 BJD  Updated s3c2440 IRQs
+ *  30-Oct-2006      Added Adeos/I-pipe support
 */
 
 
@@ -123,4 +126,26 @@

#define NR_IRQS (IRQ_S3C2440_AC97+1)

+#ifdef CONFIG_IPIPE
+#define __ipipe_irqbit(irq) (1 << ((irq) - S3C2410_CPUIRQ_OFFSET))
+
+#ifdef CONFIG_CPU_S3C2440
+#define __ipipe_muxed_irqmask (__ipipe_irqbit(IRQ_UART0) | \

+                 __ipipe_irqbit(IRQ_UART1)    |    \
+                 __ipipe_irqbit(IRQ_UART2)    |    \
+                 __ipipe_irqbit(IRQ_ADCPARENT)    |    \
+                 __ipipe_irqbit(IRQ_WDT)    |    \
+                 __ipipe_irqbit(IRQ_CAM))
+#else /* !CONFIG_CPU_S3C2440 */
+#define __ipipe_muxed_irqmask    (__ipipe_irqbit(IRQ_UART0)    |    \
+                 __ipipe_irqbit(IRQ_UART1)    |    \
+                 __ipipe_irqbit(IRQ_UART2)    |    \
+                 __ipipe_irqbit(IRQ_ADCPARENT))

+#endif /* CONFIG_CPU_S3C2440 */
+
+#define __ipipe_mach_irq_mux_p(irq) ((irq) <= IRQ_ADCPARENT && \
+ (__ipipe_irqbit(irq) & \
+ __ipipe_muxed_irqmask))
+#endif /* CONFIG_IPIPE */
+
#endif /* __ASM_ARCH_IRQ_H */

include/asm-arm/arch-sa1100/irqs.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/asm-arm/arch-sa1100/irqs.h 2005-06-17 21:48:29.000000000 +0200 +0 -0
diff -Naurdp linux-2.6.17/include/asm-arm/arch-sa1100/irqs.h ipipe-2.6.17-arm/include/asm-arm/arch-sa1100/irqs.h
@@ -145,6 +145,10 @@

#define IRQ_LOCOMO_SPI_OVRN (IRQ_BOARD_END + 20)
#define IRQ_LOCOMO_SPI_TEND (IRQ_BOARD_END + 21)

+#ifdef CONFIG_IPIPE
+#define __ipipe_mach_irq_mux_p(irq) ((irq) == IRQ_GPIO11_27) +#endif /* CONFIG_IPIPE */
+
/*
* Figure out the MAX IRQ number.
*

include/asm-arm/atomic.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/asm-arm/atomic.h 2007-01-02 10:59:45.000000000 +0100 +1 -1
diff -Naurdp linux-2.6.17/include/asm-arm/atomic.h ipipe-2.6.17-arm/include/asm-arm/atomic.h
@@ -104,9 +104,9 @@ static inline void atomic_clear_mask(uns
    unsigned long tmp, tmp2;
 
    __asm__ __volatile__("@ atomic_clear_mask\n"
-"1:    ldrex    %0, %2\n"
+"1:    ldrex    %0, [%2]\n"

" bic %0, %0, %3\n"

-"    strex    %1, %0, %2\n"
+"    strex    %1, %0, [%2]\n"
"    teq    %1, #0\n"
"    bne    1b"
    : "=&r" (tmp), "=&r" (tmp2)
@@ -129,10 +129,10 @@ static inline int atomic_add_return(int
    unsigned long flags;
    int val;

- local_irq_save(flags);

+    local_irq_save_hw(flags);
    val = v->counter;
    v->counter = val += i;

- local_irq_restore(flags);
+ local_irq_restore_hw(flags);

    return val;
}
@@ -142,10 +142,10 @@ static inline int atomic_sub_return(int
    unsigned long flags;
    int val;

- local_irq_save(flags);

+    local_irq_save_hw(flags);
    val = v->counter;
    v->counter = val -= i;

- local_irq_restore(flags);
+ local_irq_restore_hw(flags);

    return val;
}
@@ -155,11 +155,11 @@ static inline int atomic_cmpxchg(atomic_
    int ret;
    unsigned long flags;

- local_irq_save(flags);

+    local_irq_save_hw(flags);
    ret = v->counter;
    if (likely(ret == old))
        v->counter = new;

- local_irq_restore(flags);
+ local_irq_restore_hw(flags);

    return ret;
}
@@ -168,9 +168,9 @@ static inline void atomic_clear_mask(uns
{
    unsigned long flags;

- local_irq_save(flags);

+    local_irq_save_hw(flags);
    *addr &= ~mask;

- local_irq_restore(flags);
+ local_irq_restore_hw(flags);
}

#endif /* __LINUX_ARM_ARCH__ */

include/asm-arm/bitops.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/asm-arm/bitops.h 2007-01-02 11:01:15.000000000 +0100 +2 -2
diff -Naurdp linux-2.6.17/include/asm-arm/bitops.h ipipe-2.6.17-arm/include/asm-arm/bitops.h
@@ -37,9 +37,9 @@ static inline void ____atomic_set_bit(un
 
    p += bit >> 5;
 
-    local_irq_save(flags);
+    local_irq_save_hw(flags);
    *p |= mask;
-    local_irq_restore(flags);
+    local_irq_restore_hw(flags);

}

static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p) @@ -49,9 +49,9 @@ static inline void ____atomic_clear_bit(

    p += bit >> 5;

- local_irq_save(flags);

+    local_irq_save_hw(flags);
    *p &= ~mask;

- local_irq_restore(flags);
+ local_irq_restore_hw(flags);
}

static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p) @@ -61,9 +61,9 @@ static inline void ____atomic_change_bit

    p += bit >> 5;

- local_irq_save(flags);

+    local_irq_save_hw(flags);
    *p ^= mask;

- local_irq_restore(flags);
+ local_irq_restore_hw(flags);
}

static inline int
@@ -75,10 +75,10 @@ ____atomic_test_and_set_bit(unsigned int

    p += bit >> 5;

- local_irq_save(flags);

+    local_irq_save_hw(flags);
    res = *p;
    *p = res | mask;

- local_irq_restore(flags);
+ local_irq_restore_hw(flags);

    return res & mask;
}

@@ -92,10 +92,10 @@ ____atomic_test_and_clear_bit(unsigned i

    p += bit >> 5;

- local_irq_save(flags);

+    local_irq_save_hw(flags);
    res = *p;
    *p = res & ~mask;

- local_irq_restore(flags);
+ local_irq_restore_hw(flags);

    return res & mask;
}

@@ -109,10 +109,10 @@ ____atomic_test_and_change_bit(unsigned

    p += bit >> 5;

- local_irq_save(flags);

+    local_irq_save_hw(flags);
    res = *p;
    *p = res ^ mask;

- local_irq_restore(flags);
+ local_irq_restore_hw(flags);

    return res & mask;
}
include/asm-arm/ipipe.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/asm-arm/ipipe.h 1970-01-01 01:00:00.000000000 +0100 +217 -0

217 lines not on this page · raw message

include/asm-arm/mmu_context.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/asm-arm/mmu_context.h 2007-01-02 10:58:45.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/include/asm-arm/mmu_context.h ipipe-2.6.17-arm/include/asm-arm/mmu_context.h
@@ -82,14 +82,17 @@ static inline void

switch_mm(struct mm_struct *prev, struct mm_struct *next,
struct task_struct *tsk)
{
- unsigned int cpu = smp_processor_id();
+ unsigned int cpu = smp_processor_id_hw();

    if (prev != next) {
+        unsigned long flags;
+        local_irq_save_hw_cond(flags);
        cpu_set(cpu, next->cpu_vm_mask);
        check_context(next);
        cpu_switch_mm(next->pgd, next);
        if (cache_is_vivt())
            cpu_clear(cpu, prev->cpu_vm_mask);
+        local_irq_restore_hw_cond(flags);
    }
}
include/asm-arm/pgalloc.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/asm-arm/pgalloc.h 2007-01-02 11:01:15.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/include/asm-arm/pgalloc.h ipipe-2.6.17-arm/include/asm-arm/pgalloc.h
@@ -34,6 +34,11 @@ extern void free_pgd_slow(pgd_t *pgd);
 

#define check_pgt_cache() do { } while (0)

+static inline void set_pgdir(unsigned long address, pgd_t entry) +{
+ /* nop */
+}
+
/*
* Allocate one PTE table.
*

include/asm-arm/system.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/asm-arm/system.h 2007-01-02 11:01:15.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/include/asm-arm/system.h ipipe-2.6.17-arm/include/asm-arm/system.h
@@ -4,6 +4,7 @@

#ifdef __KERNEL__

#include <linux/config.h>
+#include <asm/ptrace.h>

#define CPU_ARCH_UNKNOWN 0
#define CPU_ARCH_ARMv3 1
@@ -211,30 +212,30 @@ static inline void sched_cacheflush(void
*/
#if __LINUX_ARM_ARCH__ >= 6

-#define local_irq_save(x) \

+#define local_irq_save_hw_notrace(x)                \
    ({                            \
    __asm__ __volatile__(                    \
-    "mrs    %0, cpsr        @ local_irq_save\n"    \
+    "mrs    %0, cpsr        @ local_irq_save_hw\n"    \
    "cpsid    i"                        \
    : "=r" (x) : : "memory", "cc");                \
    })
-#define local_irq_enable()  __asm__("cpsie i    @ __sti" : : : "memory", "cc")
-#define local_irq_disable() __asm__("cpsid i    @ __cli" : : : "memory", "cc")
-#define local_fiq_enable()  __asm__("cpsie f    @ __stf" : : : "memory", "cc")
-#define local_fiq_disable() __asm__("cpsid f    @ __clf" : : : "memory", "cc")
+#define local_irq_enable_hw_notrace()  __asm__("cpsie i    @ __sti" : : : "memory", "cc")
+#define local_irq_disable_hw_notrace() __asm__("cpsid i    @ __cli" : : : "memory", "cc")
+#define local_fiq_enable_hw_notrace()  __asm__("cpsie f    @ __stf" : : : "memory", "cc")
+#define local_fiq_disable_hw_notrace() __asm__("cpsid f    @ __clf" : : : "memory", "cc")

#else

/*
* Save the current interrupt enable state & disable IRQs */
-#define local_irq_save(x) \

+#define local_irq_save_hw_notrace(x)                \
    ({                            \
        unsigned long temp;                \
        (void) (&temp == &x);                \
    __asm__ __volatile__(                    \
-    "mrs    %0, cpsr        @ local_irq_save\n"    \
+    "mrs    %0, cpsr        @ local_irq_save_hw\n"    \
"    orr    %1, %0, #128\n"                    \
"    msr    cpsr_c, %1"                    \
    : "=r" (x), "=r" (temp)                    \

@@ -245,11 +246,11 @@ static inline void sched_cacheflush(void /*
* Enable IRQs
*/
-#define local_irq_enable() \

+#define local_irq_enable_hw_notrace()                \
    ({                            \
        unsigned long temp;                \
    __asm__ __volatile__(                    \
-    "mrs    %0, cpsr        @ local_irq_enable\n"    \
+    "mrs    %0, cpsr        @ local_irq_enable_hw\n"\
"    bic    %0, %0, #128\n"                    \
"    msr    cpsr_c, %0"                    \
    : "=r" (temp)                        \

@@ -260,11 +261,11 @@ static inline void sched_cacheflush(void /*
* Disable IRQs
*/
-#define local_irq_disable() \

+#define local_irq_disable_hw_notrace()                \
    ({                            \
        unsigned long temp;                \
    __asm__ __volatile__(                    \
-    "mrs    %0, cpsr        @ local_irq_disable\n"    \
+    "mrs    %0, cpsr        @ local_irq_disable_hw\n"\
"    orr    %0, %0, #128\n"                    \
"    msr    cpsr_c, %0"                    \
    : "=r" (temp)                        \

@@ -275,7 +276,7 @@ static inline void sched_cacheflush(void /*
* Enable FIQs
*/
-#define local_fiq_enable() \

+#define local_fiq_enable_hw_notrace()                \
    ({                            \
        unsigned long temp;                \
    __asm__ __volatile__(                    \

@@ -290,7 +291,7 @@ static inline void sched_cacheflush(void /*
* Disable FIQs
*/
-#define local_fiq_disable() \

+#define local_fiq_disable_hw_notrace()                \
    ({                            \
        unsigned long temp;                \
    __asm__ __volatile__(                    \

@@ -307,29 +308,112 @@ static inline void sched_cacheflush(void /*
* Save the current interrupt enable state.
*/
-#define local_save_flags(x) \

+#define local_save_flags_hw(x)                    \
    ({                            \
    __asm__ __volatile__(                    \
-    "mrs    %0, cpsr        @ local_save_flags"    \
+    "mrs    %0, cpsr        @ local_save_flags_hw"    \
    : "=r" (x) : : "memory", "cc");                \
    })

/*
* restore saved IRQ & FIQ state
*/
-#define local_irq_restore(x) \

+#define local_irq_restore_hw_notrace(x)                \
    __asm__ __volatile__(                    \
-    "msr    cpsr_c, %0        @ local_irq_restore\n"    \
+    "msr    cpsr_c, %0        @ local_irq_restore_hw\n"\
    :                            \
    : "r" (x)                        \
    : "memory", "cc")

-#define irqs_disabled() \
-({ \
+#define irqs_disabled_hw() \

+    ({                \
    unsigned long flags;        \
-    local_save_flags(flags);    \
+    local_save_flags_hw(flags);    \
    (int)(flags & PSR_I_BIT);    \

-})
+ })
+
+
+#ifdef CONFIG_IPIPE
+
+void __ipipe_stall_root(void);
+void __ipipe_unstall_root(void);
+unsigned long __ipipe_test_root(void);
+unsigned long __ipipe_test_and_stall_root(void);
+void __ipipe_restore_root(unsigned long flags);
+
+#define local_test_iflag_hw(x) (!((x) & PSR_I_BIT))
+
+/* PSR_I_BIT is bit no. 7 and is set if interrupts are _disabled_ */
+#define local_irq_save(flags) ((flags) = __ipipe_test_and_stall_root() << 7)
+#define local_irq_enable() __ipipe_unstall_root()
+#define local_irq_disable() __ipipe_stall_root()
+#define local_fiq_enable() __ipipe_unstall_root()
+#define local_fiq_disable() __ipipe_stall_root()
+#define local_save_flags(flags) ((flags) = __ipipe_test_root() << 7)
+#define local_irq_restore(flags) __ipipe_restore_root(flags & (1 << 7))
+
+#define irqs_disabled() __ipipe_test_root()
+
+#ifdef CONFIG_IPIPE_TRACE_IRQSOFF
+
+#include <linux/ipipe_trace.h>
+
+#define local_irq_disable_hw() do { \
+ if (!irqs_disabled_hw()) { \
+ local_irq_disable_hw_notrace(); \
+ ipipe_trace_begin(0x80000000); \
+ } \
+} while (0)
+#define local_irq_enable_hw() do { \
+ if (irqs_disabled_hw()) { \
+ ipipe_trace_end(0x80000000); \
+ local_irq_enable_hw_notrace(); \
+ } \
+} while (0)
+#define local_irq_save_hw(x) do { \
+ local_save_flags_hw(x); \
+ if (local_test_iflag_hw(x)) { \
+ local_irq_disable_hw_notrace(); \
+ ipipe_trace_begin(0x80000001); \
+ } \
+} while (0)
+#define local_irq_restore_hw(x) do { \
+ if (local_test_iflag_hw(x)) \
+ ipipe_trace_end(0x80000001); \
+ local_irq_restore_hw_notrace(x); \
+} while (0)
+
+#else /* !CONFIG_IPIPE_TRACE_IRQSOFF */
+
+#define local_irq_save_hw(flags) local_irq_save_hw_notrace(flags)
+#define local_irq_enable_hw() local_irq_enable_hw_notrace()
+#define local_irq_disable_hw() local_irq_disable_hw_notrace()
+#define local_fiq_enable_hw() local_fiq_enable_hw_notrace()
+#define local_fiq_disable_hw() local_fiq_disable_hw_notrace()
+#define local_irq_restore_hw(flags) local_irq_restore_hw_notrace(flags)
+
+#endif /* CONFIG_IPIPE_TRACE_IRQSOFF */
+
+#else /* !CONFIG_IPIPE */
+
+#define local_irq_save(flags) local_irq_save_hw_notrace(flags)
+#define local_irq_enable() local_irq_enable_hw_notrace()
+#define local_irq_disable() local_irq_disable_hw_notrace()
+#define local_fiq_enable() local_fiq_enable_hw_notrace()
+#define local_fiq_disable() local_fiq_disable_hw_notrace()
+#define local_save_flags(flags) local_save_flags_hw(flags)
+#define local_irq_restore(flags) local_irq_restore_hw_notrace(flags)
+
+#define local_irq_save_hw(flags) local_irq_save_hw_notrace(flags)
+#define local_irq_enable_hw() local_irq_enable_hw_notrace()
+#define local_irq_disable_hw() local_irq_disable_hw_notrace()
+#define local_fiq_enable_hw() local_fiq_enable_hw_notrace()
+#define local_fiq_disable_hw() local_fiq_disable_hw_notrace()
+#define local_irq_restore_hw(flags) local_irq_restore_hw_notrace(flags)
+
+#define irqs_disabled() irqs_disabled_hw()
+
+#endif /* CONFIG_IPIPE */

#ifdef CONFIG_SMP

@@ -404,17 +488,17 @@ static inline unsigned long __xchg(unsig #error SMP is not supported on this platform

#endif
    case 1:
-        local_irq_save(flags);
+        local_irq_save_hw(flags);
        ret = *(volatile unsigned char *)ptr;
        *(volatile unsigned char *)ptr = x;
-        local_irq_restore(flags);
+        local_irq_restore_hw(flags);
        break;

    case 4:
-        local_irq_save(flags);
+        local_irq_save_hw(flags);
        ret = *(volatile unsigned long *)ptr;
        *(volatile unsigned long *)ptr = x;
-        local_irq_restore(flags);
+        local_irq_restore_hw(flags);
        break;
#else
    case 1:
include/linux/hardirq.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/linux/hardirq.h 2007-01-02 10:59:47.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/include/linux/hardirq.h ipipe-2.6.17-arm/include/linux/hardirq.h
@@ -87,8 +87,21 @@ extern void synchronize_irq(unsigned int
# define synchronize_irq(irq)    barrier()
#endif

+#ifdef CONFIG_IPIPE
+#define nmi_enter() \
+do { \
+ if (ipipe_current_domain == ipipe_root_domain) \
+ irq_enter(); \
+} while(0)
+#define nmi_exit() \
+do { \
+ if (ipipe_current_domain == ipipe_root_domain) \
+ sub_preempt_count(HARDIRQ_OFFSET); \
+} while(0)
+#else /* !CONFIG_IPIPE */
#define nmi_enter() irq_enter()
#define nmi_exit() sub_preempt_count(HARDIRQ_OFFSET)
+#endif /* CONFIG_IPIPE */

struct task_struct;

include/linux/ipipe.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/linux/ipipe.h 1970-01-01 01:00:00.000000000 +0100 +772 -0

772 lines not on this page · raw message

include/linux/ipipe_trace.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/linux/ipipe_trace.h 1970-01-01 01:00:00.000000000 +0100 +40 -0
diff -Naurdp linux-2.6.17/include/linux/ipipe_trace.h ipipe-2.6.17-arm/include/linux/ipipe_trace.h
@@ -0,0 +1,40 @@
+/* -*- linux-c -*-
+ * include/linux/ipipe_trace.h
+ *
+ * Copyright (C) 2005 Luotao Fu.
+ *               2005, 2006 Jan Kiszka.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
+ * USA; either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef _LINUX_IPIPE_TRACE_H
+#define _LINUX_IPIPE_TRACE_H
+
+#include <linux/types.h>
+
+void ipipe_trace_begin(unsigned long v);
+void ipipe_trace_end(unsigned long v);
+void ipipe_trace_freeze(unsigned long v);
+void ipipe_trace_special(unsigned char special_id, unsigned long v);
+void ipipe_trace_pid(pid_t pid, short prio);
+
+int ipipe_trace_max_reset(void);
+int ipipe_trace_frozen_reset(void);
+
+void ipipe_trace_panic_freeze(void);
+void ipipe_trace_panic_dump(void);
+
+#endif    /* !__LINUX_IPIPE_H */
include/linux/linkage.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/linux/linkage.h 2007-01-02 11:01:17.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/include/linux/linkage.h ipipe-2.6.17-arm/include/linux/linkage.h
@@ -61,4 +61,8 @@

#define fastcall
#endif

+#ifndef notrace
+#define notrace __attribute__((no_instrument_function))
+#endif
+
#endif

include/linux/mm.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/linux/mm.h 2007-01-02 11:01:17.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/include/linux/mm.h ipipe-2.6.17-arm/include/linux/mm.h
@@ -166,6 +166,7 @@ extern unsigned int kobjsize(const void

#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */
#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */
#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */
+#define VM_PINNED 0x08000000 /* Disable faults for the vma */

#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */
#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS

include/linux/preempt.h 2007-06-28 16:05:47.000000000 +0200 renamed from include/linux/preempt.h 2007-01-02 10:58:50.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/include/linux/preempt.h ipipe-2.6.17-arm/include/linux/preempt.h
@@ -27,29 +27,44 @@
 

asmlinkage void preempt_schedule(void);

-#define preempt_disable() \
-do { \
- inc_preempt_count(); \
- barrier(); \
+#ifdef CONFIG_IPIPE
+#include <asm/ipipe.h>
+DECLARE_PER_CPU(struct ipipe_domain *, ipipe_percpu_domain);
+extern struct ipipe_domain ipipe_root;
+#define ipipe_preempt_guard() (per_cpu(ipipe_percpu_domain, ipipe_processor_id()) == &ipipe_root) +#else /* !CONFIG_IPIPE */
+#define ipipe_preempt_guard() 1
+#endif /* CONFIG_IPIPE */
+
+#define preempt_disable() \
+do { \
+ if (ipipe_preempt_guard()) { \
+ inc_preempt_count(); \
+ barrier(); \
+ } \
} while (0)

-#define preempt_enable_no_resched() \
-do { \
- barrier(); \
- dec_preempt_count(); \
+#define preempt_enable_no_resched() \
+do { \
+ if (ipipe_preempt_guard()) { \
+ barrier(); \
+ dec_preempt_count(); \
+ } \
} while (0)

-#define preempt_check_resched() \
-do { \
- if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \
- preempt_schedule(); \
+#define preempt_check_resched() \
+do { \
+ if (ipipe_preempt_guard()) { \
+ if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \
+ preempt_schedule(); \
+ } \
} while (0)

-#define preempt_enable() \
-do { \
- preempt_enable_no_resched(); \
+#define preempt_enable() \
+do { \

+    preempt_enable_no_resched();                    \
    barrier(); \

- preempt_check_resched(); \
+ preempt_check_resched(); \
} while (0)

#else

include/linux/sched.h 2007-06-28 16:08:55.000000000 +0200 renamed from include/linux/sched.h 2007-01-02 11:01:18.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/include/linux/sched.h ipipe-2.6.17-arm/include/linux/sched.h
@@ -4,6 +4,7 @@

#include <asm/param.h> /* for HZ */

#include <linux/config.h>
+#include <linux/ipipe.h>
#include <linux/capability.h>
#include <linux/threads.h>
#include <linux/kernel.h>
@@ -131,6 +132,13 @@ extern unsigned long nr_iowait(void);
#define EXIT_DEAD 32
/* in tsk->state again */
#define TASK_NONINTERACTIVE 64
+#ifdef CONFIG_IPIPE
+#define TASK_ATOMICSWITCH 512
+#define TASK_NOWAKEUP 1024
+#else /* !CONFIG_IPIPE */
+#define TASK_ATOMICSWITCH 0
+#define TASK_NOWAKEUP 0
+#endif /* CONFIG_IPIPE */

#define __set_task_state(tsk, state_value)        \
    do { (tsk)->state = (state_value); } while (0)
@@ -888,6 +896,9 @@ struct task_struct {
     * cache last used pipe for splice
     */
    struct pipe_inode_info *splice_pipe;

+#ifdef CONFIG_IPIPE
+ void *ptd[IPIPE_ROOT_NPTDKEYS];
+#endif
};

static inline pid_t process_group(struct task_struct *tsk) @@ -948,6 +959,11 @@ static inline void put_task_struct(struc

#define PF_SPREAD_PAGE    0x04000000    /* Spread page cache over cpuset */
#define PF_SPREAD_SLAB    0x08000000    /* Spread some slab caches over cpuset */

#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */
+#ifdef CONFIG_IPIPE
+#define PF_EVNOTIFY 0x40000000 /* Notify other domains about internal events */
+#else
+#define PF_EVNOTIFY 0
+#endif /* CONFIG_IPIPE */

/*
* Only the _current_ task can read/write to tsk->flags, but other

init/Kconfig 2007-06-28 16:05:47.000000000 +0200 renamed from init/Kconfig 2007-01-02 11:01:18.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/init/Kconfig ipipe-2.6.17-arm/init/Kconfig
@@ -58,6 +58,7 @@ menu "General setup"
 

config LOCALVERSION
string "Local version - append to kernel release"
+ default "-ipipe"
help
Append an extra string to the end of your kernel version. This will show up when you type uname, for example.

init/main.c 2007-06-28 16:05:47.000000000 +0200 renamed from init/main.c 2007-01-02 11:01:18.000000000 +0100 +5 -0
diff -Naurdp linux-2.6.17/init/main.c ipipe-2.6.17-arm/init/main.c
@@ -490,6 +490,11 @@ asmlinkage void __init start_kernel(void
    hrtimers_init();
    softirq_init();
    time_init();
+    /*
+     * We need to wait for the interrupt and time subsystems to be
+     * initialized before enabling the pipeline.
+     */
+     ipipe_init();
 
    /*
     * HACK ALERT! This is early. We're enabling the console before
@@ -623,6 +628,7 @@ static void __init do_basic_setup(void)
#ifdef CONFIG_SYSCTL
    sysctl_init();

#endif
+ ipipe_init_proc();

    do_initcalls();
}
kernel/exit.c 2007-06-28 16:18:52.000000000 +0200 renamed from kernel/exit.c 2007-01-02 11:01:18.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/kernel/exit.c ipipe-2.6.17-arm/kernel/exit.c
@@ -905,6 +905,7 @@ fastcall NORET_TYPE void do_exit(long co
#endif
    if (unlikely(tsk->audit_context))
        audit_free(tsk);
+    ipipe_exit_notify(tsk);
    exit_mm(tsk);

    exit_sem(tsk);
kernel/fork.c 2007-06-28 16:13:58.000000000 +0200 renamed from kernel/fork.c 2007-01-02 11:01:18.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/kernel/fork.c ipipe-2.6.17-arm/kernel/fork.c
@@ -369,6 +369,7 @@ void fastcall __mmdrop(struct mm_struct

void mmput(struct mm_struct *mm)

{
    if (atomic_dec_and_test(&mm->mm_users)) {
+        ipipe_cleanup_notify(mm);
        exit_aio(mm);
        exit_mmap(mm);
        if (!list_empty(&mm->mmlist)) {
@@ -895,7 +896,7 @@ static inline void copy_flags(unsigned l
{
    unsigned long new_flags = p->flags;
-    new_flags &= ~(PF_SUPERPRIV | PF_NOFREEZE);
+    new_flags &= ~(PF_SUPERPRIV | PF_NOFREEZE | PF_EVNOTIFY);
    new_flags |= PF_FORKNOEXEC;
    if (!(clone_flags & CLONE_PTRACE))
        p->ptrace = 0;
@@ -1214,6 +1215,14 @@ static task_t *copy_process(unsigned lon
    spin_unlock(&current->sighand->siglock);
    write_unlock_irq(&tasklist_lock);
    proc_fork_connector(p);

+#ifdef CONFIG_IPIPE
+ {
+ int k;
+
+ for (k = 0; k < IPIPE_ROOT_NPTDKEYS; k++)
+ p->ptd[k] = NULL;
+ }
+#endif /* CONFIG_IPIPE */

    return p;

bad_fork_cleanup_namespace:

kernel/ipipe/core.c 2007-06-28 16:05:47.000000000 +0200 renamed from kernel/ipipe/core.c 1970-01-01 01:00:00.000000000 +0100 +1050 -0

1,050 lines not on this page · raw message

kernel/ipipe/generic.c 2007-06-28 16:05:47.000000000 +0200 renamed from kernel/ipipe/generic.c 1970-01-01 01:00:00.000000000 +0100 +423 -0

19 lines not on this page · raw message

kernel/ipipe/Kconfig 2007-06-28 16:05:47.000000000 +0200 renamed from kernel/ipipe/Kconfig 1970-01-01 01:00:00.000000000 +0100 +6 -0
diff -Naurdp linux-2.6.17/kernel/ipipe/Kconfig ipipe-2.6.17-arm/kernel/ipipe/Kconfig

Lines of this file are not shown. View the raw message.

kernel/ipipe/Kconfig.debug 2007-06-28 16:05:47.000000000 +0200 renamed from kernel/ipipe/Kconfig.debug 1970-01-01 01:00:00.000000000 +0100 +69 -0

69 lines not on this page · raw message

kernel/ipipe/Makefile 2007-06-28 16:05:47.000000000 +0200 renamed from kernel/ipipe/Makefile 1970-01-01 01:00:00.000000000 +0100 +3 -0
diff -Naurdp linux-2.6.17/kernel/ipipe/Makefile ipipe-2.6.17-arm/kernel/ipipe/Makefile

Lines of this file are not shown. View the raw message.

kernel/ipipe/tracer.c 2007-06-28 16:05:47.000000000 +0200 renamed from kernel/ipipe/tracer.c 1970-01-01 01:00:00.000000000 +0100 +1240 -0

1,240 lines not on this page · raw message

kernel/irq/handle.c 2007-06-28 16:05:48.000000000 +0200 renamed from kernel/irq/handle.c 2007-01-02 10:58:50.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/kernel/irq/handle.c ipipe-2.6.17-arm/kernel/irq/handle.c
@@ -81,6 +81,17 @@ fastcall int handle_IRQ_event(unsigned i

The rest of this diff is not shown. View the raw message.

{
    int ret, retval = 0, status = 0;

+#ifdef CONFIG_IPIPE
+ /*

+     * If processing a timer tick, pass the original regs as
+     * collected during preemption and not our phony - always
+     * kernel-originated - frame, so that we don't wreck the
+     * profiling code.
+     */

+ if (__ipipe_tick_irq == irq)
+ regs = __ipipe_tick_regs + smp_processor_id();
+#endif /* CONFIG_IPIPE */
+

    if (!(action->flags & SA_INTERRUPT))
        local_irq_enable();

@@ -117,16 +128,20 @@ fastcall unsigned int __do_IRQ(unsigned

        /*
         * No locking required for CPU-local interrupts:
         */
+#ifndef CONFIG_IPIPE
        if (desc->handler->ack)
            desc->handler->ack(irq);
+#endif /* !CONFIG_IPIPE */
        action_ret = handle_IRQ_event(irq, regs, desc->action);
        desc->handler->end(irq);
        return 1;
    }

    spin_lock(&desc->lock);
+#ifndef CONFIG_IPIPE
    if (desc->handler->ack)
        desc->handler->ack(irq);

+#endif /* !CONFIG_IPIPE */
/*
* REPLAY is when Linux resends an IRQ that was dropped earlier
* WAITING is used by probe to mark irqs that are being tested

kernel/Makefile 2007-06-28 16:10:14.000000000 +0200 renamed from kernel/Makefile 2007-01-02 11:01:18.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/kernel/Makefile ipipe-2.6.17-arm/kernel/Makefile
@@ -38,6 +38,7 @@ obj-$(CONFIG_GENERIC_HARDIRQS) += irq/

obj-$(CONFIG_SECCOMP) += seccomp.o
obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o
obj-$(CONFIG_RELAY) += relay.o
+obj-$(CONFIG_IPIPE) += ipipe/

ifneq ($(CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER),y)
# According to Alan Modra <[email protected]>, the -fno-omit-frame-pointer is

kernel/printk.c 2007-06-28 16:05:48.000000000 +0200 renamed from kernel/printk.c 2007-01-02 11:01:18.000000000 +0100 +72 -0

72 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

asmlinkage int printk(const char *fmt, ...)

{
    va_list args;

@@ -483,6 +555,7 @@ asmlinkage int printk(const char *fmt, .

    return r;
}

+#endif /* CONFIG_IPIPE */

/* cpu currently holding logbuf_lock */ static volatile unsigned int printk_cpu = UINT_MAX;

kernel/sched.c 2007-06-28 16:17:40.000000000 +0200 renamed from kernel/sched.c 2007-01-02 11:01:18.000000000 +0100 +1 -1
diff -Naurdp linux-2.6.17/kernel/sched.c ipipe-2.6.17-arm/kernel/sched.c
@@ -1581,6 +1581,8 @@ asmlinkage void schedule_tail(task_t *pr

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

#endif
    if (current->set_child_tid)
        put_user(current->pid, current->set_child_tid);

+
+ ipipe_init_notify(current);
}

/*
@@ -2903,12 +2905,17 @@ asmlinkage void __sched schedule(void)

    unsigned long run_time;
    int cpu, idx, new_prio;

+#ifdef CONFIG_IPIPE
+ if (unlikely(!ipipe_root_domain_p))
+ return;
+#endif /* CONFIG_IPIPE */
/*
* Test if we are atomic. Since do_exit() needs to call into
* schedule() atomically, we ignore that path for now.
* Otherwise, whine if we are scheduling when we should not be. */
- if (unlikely(in_atomic() && !current->exit_state)) {
+ if (unlikely(in_atomic() && !current->exit_state

+             && !(current->state & TASK_ATOMICSWITCH))) {
        printk(KERN_ERR "BUG: scheduling while atomic: "
            "%s/0x%08x/%d\n",
            current->comm, preempt_count(), current->pid);
@@ -2916,8 +2923,13 @@ asmlinkage void __sched schedule(void)
    }
    profile_hit(SCHED_PROFILING, __builtin_return_address(0));

+ if (unlikely(current->state & TASK_ATOMICSWITCH)) {
+ current->state &= ~TASK_ATOMICSWITCH;
+ goto need_resched_nodisable;
+ }
need_resched:

    preempt_disable();
+need_resched_nodisable:
    prev = current;
    release_kernel_lock(prev);
need_resched_nonpreemptible:
@@ -3055,6 +3067,8 @@ switch_tasks:
        prepare_task_switch(rq, next);
        prev = context_switch(rq, prev, next);
        barrier();

+ if (task_hijacked(prev))
+ return;
/*
* this_rq must be evaluated again because prev may have moved
* CPUs since it called schedule(), thus the 'rq' on its stack
@@ -3068,7 +3082,7 @@ switch_tasks:

    if (unlikely(reacquire_kernel_lock(prev) < 0))
        goto need_resched_nonpreemptible;
    preempt_enable_no_resched();
-    if (unlikely(test_thread_flag(TIF_NEED_RESCHED)))
+    if (unlikely(test_thread_flag(TIF_NEED_RESCHED) && ipipe_root_domain_p))
        goto need_resched;
}

@@ -3087,6 +3101,11 @@ asmlinkage void __sched preempt_schedule

    struct task_struct *task = current;
    int saved_lock_depth;

#endif
+#ifdef CONFIG_IPIPE
+ /* Do not reschedule over non-Linux domains. */
+ if (unlikely(!ipipe_root_domain_p))
+ return;
+#endif /* CONFIG_IPIPE */
/*
* If there is a non-zero preempt_count or interrupts are disabled,
* we do not want to preempt the current task. Just return..
@@ -3725,6 +3744,7 @@ recheck:

        deactivate_task(p, rq);
    oldprio = p->prio;
    __setscheduler(p, policy, param->sched_priority);
+    ipipe_setsched_notify(p);
    if (array) {
        __activate_task(p, rq);
        /*

@@ -6252,3 +6272,50 @@ void set_curr_task(int cpu, task_t *p) }

#endif
+
+#ifdef CONFIG_IPIPE
+
+int ipipe_setscheduler_root (struct task_struct *p, int policy, int prio) +{

+    prio_array_t *array;
+    unsigned long flags;
+    runqueue_t *rq;
+    int oldprio;
+
+    rq = task_rq_lock(p, &flags);
+    array = p->array;
+    if (array)
+        deactivate_task(p, rq);
+    oldprio = p->prio;
+    __setscheduler(p, policy, prio);
+    if (array) {

+ __activate_task(p, rq);
+ if (task_running(rq, p)) {
+ if (p->prio > oldprio)
+ resched_task(rq->curr);
+ } else if (TASK_PREEMPTS_CURR(p, rq))
+ resched_task(rq->curr);
+ }
+ task_rq_unlock(rq, &flags);
+
+ return 0;
+}
+
+EXPORT_SYMBOL(ipipe_setscheduler_root);
+
+int ipipe_reenter_root (struct task_struct *prev, int policy, int prio) +{
+ finish_task_switch(this_rq(), prev);
+ if (reacquire_kernel_lock(current) < 0)
+ ;
+ preempt_enable_no_resched();
+
+ if (current->policy != policy || current->rt_priority != prio)
+ return ipipe_setscheduler_root(current,policy,prio);
+
+ return 0;
+}
+
+EXPORT_SYMBOL(ipipe_reenter_root);
+
+#endif /* CONFIG_IPIPE */

kernel/signal.c 2007-06-28 16:05:48.000000000 +0200 renamed from kernel/signal.c 2007-01-02 11:01:18.000000000 +0100 +1 -0
diff -Naurdp linux-2.6.17/kernel/signal.c ipipe-2.6.17-arm/kernel/signal.c

Lines of this file are not shown. View the raw message.

lib/Kconfig.debug 2007-06-28 16:05:48.000000000 +0200 renamed from lib/Kconfig.debug 2007-01-02 11:01:18.000000000 +0100 +2 -0
diff -Naurdp linux-2.6.17/lib/Kconfig.debug ipipe-2.6.17-arm/lib/Kconfig.debug

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

config DEBUG_KERNEL
bool "Kernel debugging"
help

lib/smp_processor_id.c 2007-06-28 16:05:48.000000000 +0200 renamed from lib/smp_processor_id.c 2007-01-02 10:58:50.000000000 +0100 +5 -0
diff -Naurdp linux-2.6.17/lib/smp_processor_id.c ipipe-2.6.17-arm/lib/smp_processor_id.c

Lines of this file are not shown. View the raw message.

lib/spinlock_debug.c 2007-06-28 16:05:48.000000000 +0200 renamed from lib/spinlock_debug.c 2007-01-02 10:59:48.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/lib/spinlock_debug.c ipipe-2.6.17-arm/lib/spinlock_debug.c
@@ -10,6 +10,7 @@

The rest of this diff is not shown. View the raw message.

#include <linux/spinlock.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
+#include <linux/module.h>

static void spin_bug(spinlock_t *lock, const char *msg) {
@@ -96,6 +97,8 @@ void _raw_spin_lock(spinlock_t *lock)

    debug_spin_lock_after(lock);
}

+EXPORT_SYMBOL(_raw_spin_lock);
+
int _raw_spin_trylock(spinlock_t *lock)

{
    int ret = __raw_spin_trylock(&lock->raw_lock);
@@ -111,12 +114,16 @@ int _raw_spin_trylock(spinlock_t *lock)
    return ret;
}

+EXPORT_SYMBOL(_raw_spin_trylock);
+
void _raw_spin_unlock(spinlock_t *lock)

{
    debug_spin_unlock(lock);
    __raw_spin_unlock(&lock->raw_lock);
}

+EXPORT_SYMBOL(_raw_spin_unlock);
+
static void rwlock_bug(rwlock_t *lock, const char *msg)

{
    static long print_once = 1;
@@ -167,6 +174,8 @@ void _raw_read_lock(rwlock_t *lock)
        __read_lock_debug(lock);
}

+EXPORT_SYMBOL(_raw_read_lock);
+
int _raw_read_trylock(rwlock_t *lock)

{
    int ret = __raw_read_trylock(&lock->raw_lock);
@@ -180,12 +189,16 @@ int _raw_read_trylock(rwlock_t *lock)
    return ret;
}

+EXPORT_SYMBOL(_raw_read_trylock);
+
void _raw_read_unlock(rwlock_t *lock)

{
    RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic");
    __raw_read_unlock(&lock->raw_lock);
}

+EXPORT_SYMBOL(_raw_read_unlock);
+
static inline void debug_write_lock_before(rwlock_t *lock)

{
    RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic");
@@ -241,6 +254,8 @@ void _raw_write_lock(rwlock_t *lock)
    debug_write_lock_after(lock);
}

+EXPORT_SYMBOL(_raw_write_lock);
+
int _raw_write_trylock(rwlock_t *lock)

{
    int ret = __raw_write_trylock(&lock->raw_lock);
@@ -256,8 +271,12 @@ int _raw_write_trylock(rwlock_t *lock)
    return ret;
}

+EXPORT_SYMBOL(_raw_write_trylock);
+
void _raw_write_unlock(rwlock_t *lock)

{
    debug_write_unlock(lock);
    __raw_write_unlock(&lock->raw_lock);
}

+
+EXPORT_SYMBOL(_raw_write_unlock);

Makefile 2007-06-28 16:05:47.000000000 +0200 renamed from Makefile 2007-01-02 11:00:54.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/Makefile ipipe-2.6.17-arm/Makefile
@@ -469,6 +469,10 @@ else

CFLAGS += -O2
endif

+ifdef CONFIG_IPIPE_TRACE_MCOUNT
+CFLAGS += -pg
+endif
+
ifdef CONFIG_FRAME_POINTER
CFLAGS += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,)
else

mm/memory.c 2007-06-28 16:05:48.000000000 +0200 renamed from mm/memory.c 2007-01-02 11:01:18.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/mm/memory.c ipipe-2.6.17-arm/mm/memory.c
@@ -48,6 +48,7 @@

#include <linux/rmap.h>
#include <linux/module.h>
#include <linux/init.h>
+#include <linux/vmalloc.h>

#include <asm/pgalloc.h>
#include <asm/uaccess.h>
@@ -416,13 +417,40 @@ struct page *vm_normal_page(struct vm_ar

    return pfn_to_page(pfn);
}

+static inline void cow_user_page(struct page *dst, struct page *src, unsigned long va) +{
+ /*

+     * If the source page was a PFN mapping, we don't have
+     * a "struct page" for it. We do a best-effort copy by
+     * just copying from the original user address. If that
+     * fails, we just zero-fill it. Live with it.
+     */

+ if (unlikely(!src)) {
+ void *kaddr = kmap_atomic(dst, KM_USER0);
+ void __user *uaddr = (void __user *)(va & PAGE_MASK);
+
+ /*

+         * This really shouldn't fail, because the page is there
+         * in the page tables. But it might just be unreadable,
+         * in which case we just give up and fill the result with
+         * zeroes.
+         */

+ if (__copy_from_user_inatomic(kaddr, uaddr, PAGE_SIZE))
+ memset(kaddr, 0, PAGE_SIZE);
+ kunmap_atomic(kaddr, KM_USER0);
+ return;
+ + }
+ copy_user_highpage(dst, src, va);
+}
+
/*
* copy one vm_area from one task to the other. Assumes the page tables
* already present in the new task to be cleared in the whole range
* covered by this vma.
*/

-static inline void
+static inline int
copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,
pte_t *dst_pte, pte_t *src_pte, struct vm_area_struct *vma, unsigned long addr, int *rss)
@@ -452,6 +480,25 @@ copy_one_pte(struct mm_struct *dst_mm, s

     * in the parent and the child
     */
    if (is_cow_mapping(vm_flags)) {
+#ifdef CONFIG_IPIPE
+        if (((vm_flags|src_mm->def_flags) & (VM_LOCKED|VM_PINNED)) == (VM_LOCKED|VM_PINNED)) {
+            struct page *old_page = vm_normal_page(vma, addr, pte);
+            page = alloc_page_vma(GFP_HIGHUSER, vma, addr);
+            if (!page)

+ return -ENOMEM;
+
+ cow_user_page(page, old_page, addr);
+ pte = mk_pte(page, vma->vm_page_prot);
+ + if (vm_flags & VM_SHARED)
+ pte = pte_mkclean(pte);
+ pte = pte_mkold(pte);
+

+            page_dup_rmap(page);
+            rss[!!PageAnon(page)]++;
+            goto out_set_pte;
+        }
+#endif /* CONFIG_IPIPE */
        ptep_set_wrprotect(src_mm, addr, src_pte);
        pte = *src_pte;
    }

@@ -473,6 +520,7 @@ copy_one_pte(struct mm_struct *dst_mm, s

out_set_pte:

    set_pte_at(dst_mm, addr, dst_pte, pte);

+ return 0;
}

static int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, @@ -509,7 +557,9 @@ again:

            progress++;
            continue;
        }
-        copy_one_pte(dst_mm, src_mm, dst_pte, src_pte, vma, addr, rss);
+        if (copy_one_pte(dst_mm, src_mm, dst_pte,
+                 src_pte, vma, addr, rss))
+            return -ENOMEM;
        progress += 8;
    } while (dst_pte++, src_pte++, addr += PAGE_SIZE, addr != end);

@@ -1394,33 +1444,6 @@ static inline pte_t maybe_mkwrite(pte_t

    return pte;
}

-static inline void cow_user_page(struct page *dst, struct page *src, unsigned long va) -{
- /*

-     * If the source page was a PFN mapping, we don't have
-     * a "struct page" for it. We do a best-effort copy by
-     * just copying from the original user address. If that
-     * fails, we just zero-fill it. Live with it.
-     */

- if (unlikely(!src)) {
- void *kaddr = kmap_atomic(dst, KM_USER0);
- void __user *uaddr = (void __user *)(va & PAGE_MASK);
-
- /*

-         * This really shouldn't fail, because the page is there
-         * in the page tables. But it might just be unreadable,
-         * in which case we just give up and fill the result with
-         * zeroes.
-         */

- if (__copy_from_user_inatomic(kaddr, uaddr, PAGE_SIZE))
- memset(kaddr, 0, PAGE_SIZE);
- kunmap_atomic(kaddr, KM_USER0);
- return;
- - }
- copy_user_highpage(dst, src, va);
-}
-
/*
* This routine handles present pages, when users try to write
* to a shared page. It is done by copying the page to a new address
@@ -2440,3 +2463,104 @@ int in_gate_area_no_task(unsigned long a }

#endif /* __HAVE_ARCH_GATE_AREA */
+
+#ifdef CONFIG_IPIPE
+
+static inline int ipipe_pin_pte_range(struct mm_struct *mm, pmd_t *pmd,
+ struct vm_area_struct *vma,
+ unsigned long addr, unsigned long end)
+{
+ spinlock_t *ptl;
+ pte_t *pte;

+   +    do {
+        pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
+        if (!pte)

+ continue;
+
+ if (!pte_present(*pte)) {
+ pte_unmap_unlock(pte, ptl);
+ continue;
+ }
+
+ if (do_wp_page(mm, vma, addr, pte, pmd, ptl, *pte) == VM_FAULT_OOM)
+ return -ENOMEM;
+ } while (addr += PAGE_SIZE, addr != end);
+ return 0;
+}
+
+static inline int ipipe_pin_pmd_range(struct mm_struct *mm, pud_t *pud,
+ struct vm_area_struct *vma,
+ unsigned long addr, unsigned long end)
+{
+ unsigned long next;
+ pmd_t *pmd;
+
+ pmd = pmd_offset(pud, addr);
+ do {
+ next = pmd_addr_end(addr, end);
+ if (ipipe_pin_pte_range(mm, pmd, vma, addr, end))
+ return -ENOMEM;
+ } while (pmd++, addr = next, addr != end);
+ return 0;
+}
+
+static inline int ipipe_pin_pud_range(struct mm_struct *mm, pgd_t *pgd,
+ struct vm_area_struct *vma,
+ unsigned long addr, unsigned long end)
+{
+ unsigned long next;
+ pud_t *pud;
+
+ pud = pud_offset(pgd, addr);
+ do {
+ next = pud_addr_end(addr, end);
+ if (ipipe_pin_pmd_range(mm, pud, vma, addr, end))
+ return -ENOMEM;
+ } while (pud++, addr = next, addr != end);
+ return 0;
+}
+
+int ipipe_disable_ondemand_mappings(struct task_struct *tsk) +{

+    unsigned long addr, next, end;
+    struct vm_area_struct *vma;
+    struct mm_struct *mm;
+    int result = 0;
+    pgd_t *pgd;

+
+ mm = get_task_mm(tsk);
+ if (!mm)
+ return -EPERM;
+
+ down_write(&mm->mmap_sem);
+ if (mm->def_flags & VM_PINNED)
+ goto done_mm;
+
+ for (vma = mm->mmap; vma; vma = vma->vm_next) {
+ if (!is_cow_mapping(vma->vm_flags))
+ continue;
+
+ addr = vma->vm_start;
+ end = vma->vm_end;
+ + pgd = pgd_offset(mm, addr);
+ do {
+ next = pgd_addr_end(addr, end);
+ if (ipipe_pin_pud_range(mm, pgd, vma, addr, next)) {
+ result = -ENOMEM;
+ goto done_mm;
+ }
+ } while (pgd++, addr = next, addr != end);
+ }
+ mm->def_flags |= VM_PINNED;
+
+ done_mm:

+    up_write(&mm->mmap_sem);
+    mmput(mm);
+    return result;

+}
+
+EXPORT_SYMBOL(ipipe_disable_ondemand_mappings);
+
+#endif

mm/mlock.c 2007-06-28 16:05:48.000000000 +0200 renamed from mm/mlock.c 2007-01-02 10:59:48.000000000 +0100 +2 -1
diff -Naurdp linux-2.6.17/mm/mlock.c ipipe-2.6.17-arm/mm/mlock.c

Lines of this file are not shown. View the raw message.

mm/vmalloc.c 2007-06-28 16:05:48.000000000 +0200 renamed from mm/vmalloc.c 2007-01-02 11:01:18.000000000 +0100 +0 -0
diff -Naurdp linux-2.6.17/mm/vmalloc.c ipipe-2.6.17-arm/mm/vmalloc.c

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

#include <asm/uaccess.h>
#include <asm/tlbflush.h>
+#include <asm/pgalloc.h>

DEFINE_RWLOCK(vmlist_lock);
@@ -148,10 +149,14 @@ int map_vm_area(struct vm_struct *area,

    BUG_ON(addr >= end);
    pgd = pgd_offset_k(addr);
    do {
+        pgd_t oldpgd;
+        memcpy(&oldpgd,pgd,sizeof(pgd_t));
        next = pgd_addr_end(addr, end);
        err = vmap_pud_range(pgd, addr, next, prot, pages);
        if (err)
            break;
+        if (pgd_val(oldpgd) != pgd_val(*pgd))
+            set_pgdir(addr, *pgd);
    } while (pgd++, addr = next, addr != end);
    flush_cache_vmap((unsigned long) area->addr, end);
    return err;

Part of the diff is not shown here. View the raw message.

#2 lore raw
Quoted 10 lines · Will Wiles

Using the low-level debugging tools makes the kernel hang earlier, so I'm starting to think it is a more serious problem with the interrupt handling that I first expected.

Below is the 2.6.17 patch, I was wondering if anyone had an ARM setup around that they could use this ipipe patch on and get a successful boot. It's hard for me to verify since I only have one setup and the debugging tools aren't helpful in this scenario.

Which "low-level debugging tools" are enabled? (.config would help).

A verbatim copy of the boot messages would help trying to figure out where the problem starts too.

Signature · 1 line
Philippe.
#3 lore raw
In reply to Will Wiles
Quoted 27 lines · Will Wiles
Quoted 18 lines · WILLIAM QUINTON

I'm working with a PXA based embedded board attempting to get Adeos on it's feet. Right now at boot after the pipeline is enabled (a few printk's for devices later) the process stalls without any information as to why.

I've checked arch/arm/mach-pxa/time.c & irq.c against the information here,

http://www.xenomai.org/index.php/I-pipe:ArmPorting

and everything seems to be in order. I'm not too versed in interrupt handling as it relates specifically to the linux implementation, but Gilles was mentioning this as a likely culprit, and it seems fairly plausible.

If anyone has seen a similar problem (I'm hoping it's something simple as an incorrect register name), or a good strategy for trying to track down the offending routine, information would be appreciated.

Quoted 7 lines

Will Wiles

_______________________________________________
Adeos-main mailing list
[email protected]
https://mail.gna.org/listinfo/adeos-main

Quoted 8 lines

Using the low-level debugging tools makes the kernel hang earlier, so I'm starting to think it is a more serious problem with the interrupt handling that I first expected.

Below is the 2.6.17 patch, I was wondering if anyone had an ARM setup around that they could use this ipipe patch on and get a successful boot. It's hard for me to verify since I only have one setup and the debugging tools aren't helpful in this scenario.

Hi Will,

much later than expected I could test the I-pipe 2.6.17 patch for ARM. There was a bug (actually, a diff hunk that patch applied at the wrong location, yes, this happens !). So, here is a new patch, which is tested and runs fine on AT91.

If you still have your issue (actually, what is the issue you have, a lockup ? a kernel oops ?), the best way to debug it is to do a bisection in the code by adding printks to find what exactly fails.

Signature · 1 line
					    Gilles Chanteperdrix.
Makefile +4 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/Makefile linux/Makefile
@@ -469,6 +469,10 @@ else
 CFLAGS		+= -O2
 endif
 
+ifdef CONFIG_IPIPE_TRACE_MCOUNT
+CFLAGS          += -pg
+endif
+
 ifdef CONFIG_FRAME_POINTER
 CFLAGS		+= -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,)
 else
arch/arm/Kconfig +2 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/Kconfig linux/arch/arm/Kconfig
@@ -429,6 +429,8 @@ config LOCAL_TIMERS
 	  accounting to be spread across the timer interval, preventing a
 	  "thundering herd" at every timer tick.
 
+source "kernel/ipipe/Kconfig"
+
 config PREEMPT
 	bool "Preemptible Kernel (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
arch/arm/boot/compressed/head.S +10 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/boot/compressed/head.S linux/arch/arm/boot/compressed/head.S
@@ -820,6 +820,16 @@ memdump:	mov	r12, r0
 		mov	pc, r10
 #endif
 
+#ifdef CONFIG_IPIPE_TRACE_MCOUNT
+                .text
+                .align 0
+                .type mcount %function
+                .global mcount
+mcount:
+		mov pc, lr	@ just return
+#endif
+
+
 reloc_end:
 
 		.align
arch/arm/kernel/Makefile +2 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/kernel/Makefile linux/arch/arm/kernel/Makefile
@@ -21,6 +21,8 @@ obj-$(CONFIG_ISA_DMA)		+= dma-isa.o
 obj-$(CONFIG_PCI)		+= bios32.o
 obj-$(CONFIG_SMP)		+= smp.o
 obj-$(CONFIG_OABI_COMPAT)	+= sys_oabi-compat.o
+obj-$(CONFIG_IPIPE)		+= ipipe-core.o ipipe-root.o
+obj-$(CONFIG_IPIPE_TRACE_MCOUNT)	+= ipipe-mcount.o
 
 obj-$(CONFIG_IWMMXT)		+= iwmmxt.o
 AFLAGS_iwmmxt.o			:= -Wa,-mcpu=iwmmxt
arch/arm/kernel/entry-armv.S +88 -7

206 lines not on this page · raw message

arch/arm/kernel/entry-common.S +57 -9

116 lines not on this page · raw message

arch/arm/kernel/entry-header.S +9 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/kernel/entry-header.S linux/arch/arm/kernel/entry-header.S
@@ -50,6 +50,15 @@
 #endif
 	.endm
 
+	.macro slow_restore_user_regs
+	ldr	r1, [sp, #S_PSR]		@ get calling cpsr
+	ldr	lr, [sp, #S_PC]!		@ get pc
+	msr	spsr_cxsf, r1			@ save in spsr_svc
+	ldmdb	sp, {r0 - lr}^			@ get calling r1 - lr
+	mov	r0, r0
+	add	sp, sp, #S_FRAME_SIZE - S_PC
+	movs	pc, lr				@ return & move spsr_svc into cpsr
+	.endm
 
 /*
  * These are the registers used in the syscall handler, and allow us to
arch/arm/kernel/ipipe-core.c +239 -0

239 lines not on this page · raw message

arch/arm/kernel/ipipe-mcount.S +40 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/kernel/ipipe-mcount.S linux/arch/arm/kernel/ipipe-mcount.S
@@ -0,0 +1,40 @@
+/*
+ *  linux/arch/arm/kernel/ipipe-mcount.S
+ *
+ *  Copyright (C) 2006 Sebastian Smolorz <[email protected]>, emlix GmbH
+ */
+
+#include <linux/config.h>
+
+#ifdef CONFIG_FRAME_POINTER
+
+	.text
+	.align 0
+	.type mcount %function
+	.global mcount
+
+mcount:
+
+	ldr	ip, =ipipe_trace_enable	@ leave early, if disabled
+	ldr	ip, [ip]
+	cmp	ip, #0
+	moveq	pc,lr
+
+	mov	ip,  sp
+	stmdb   sp!, {r0 - r3, fp, ip, lr, pc}	@ create stack frame
+
+	mov	r3, #0			@ no additional value (v)
+	ldr	r2, [fp, #-4]		@ get lr (the return address
+					@ of the caller of the
+					@ instrumented function)
+	mov	r1, lr			@ get lr - (the return address
+					@ of the instrumented function)
+	mov	r0, #0			@ IPIPE_TRACE_FN
+
+	sub	fp, ip, #4		@ point fp at this frame
+
+	bl	__ipipe_trace
+
+	ldmdb   fp, {r0 - r3, fp, sp, pc}	@ pop entry frame and return
+
+#endif
arch/arm/kernel/ipipe-root.c +419 -0

419 lines not on this page · raw message

arch/arm/kernel/irq.c +10 -1
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/kernel/irq.c linux/arch/arm/kernel/irq.c
@@ -54,10 +54,11 @@
 
 static int noirqdebug;
 static volatile unsigned long irq_err_count;
-static DEFINE_SPINLOCK(irq_controller_lock);
+DEFINE_SPINLOCK(irq_controller_lock);
 static LIST_HEAD(irq_pending);
 
 struct irqdesc irq_desc[NR_IRQS];
+EXPORT_SYMBOL(irq_desc);
 void (*init_arch_irq)(void) __initdata = NULL;
 
 /*
@@ -417,7 +418,9 @@ do_edge_IRQ(unsigned int irq, struct irq
 	/*
 	 * Acknowledge and clear the IRQ, but don't mask it.
 	 */
+#ifndef CONFIG_IPIPE
 	desc->chip->ack(irq);
+#endif /* CONFIG_IPIPE */
 
 	/*
 	 * Mark the IRQ currently in progress.
@@ -455,8 +458,10 @@ do_edge_IRQ(unsigned int irq, struct irq
 	 * currently running.  Delay it.
 	 */
 	desc->pending = 1;
+#ifndef CONFIG_IPIPE
 	desc->chip->mask(irq);
 	desc->chip->ack(irq);
+#endif /* CONFIG_IPIPE */
 }
 
 /*
@@ -473,7 +478,9 @@ do_level_IRQ(unsigned int irq, struct ir
 	/*
 	 * Acknowledge, clear _AND_ disable the interrupt.
 	 */
+#ifndef CONFIG_IPIPE
 	desc->chip->ack(irq);
+#endif /* CONFIG_IPIPE */
 
 	if (likely(!desc->disable_depth)) {
 		kstat_cpu(cpu).irqs[irq]++;
@@ -559,7 +566,9 @@ asmlinkage void asm_do_IRQ(unsigned int 
 	if (!list_empty(&irq_pending))
 		do_pending_irqs(regs);
 
+#ifndef CONFIG_IPIPE
 	irq_finish(irq);
+#endif /* CONFIG_IPIPE */
 
 	spin_unlock(&irq_controller_lock);
 	irq_exit();
arch/arm/kernel/process.c +7 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/kernel/process.c linux/arch/arm/kernel/process.c
@@ -92,6 +92,12 @@ static void default_idle(void)
 		local_irq_disable();
 		if (!need_resched()) {
 			timer_dyn_reprogram();
+#ifdef CONFIG_IPIPE
+			__ipipe_unstall_root();
+#ifdef CONFIG_IPIPE_TRACE_IRQSOFF
+			ipipe_trace_end(0x8000000E);
+#endif /* CONFIG_IPIPE_TRACE_IRQSOFF */
+#endif /* CONFIG_IPIPE */
 			arch_idle();
 		}
 		local_irq_enable();
@@ -120,6 +126,7 @@ void cpu_idle(void)
 
 		if (!idle)
 			idle = default_idle;
+ 		ipipe_suspend_domain();
 		leds_event(led_idle_start);
 		while (!need_resched())
 			idle();
arch/arm/kernel/ptrace.c +4 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/kernel/ptrace.c linux/arch/arm/kernel/ptrace.c
@@ -486,6 +486,10 @@ void ptrace_break(struct task_struct *ts
 
 static int break_trap(struct pt_regs *regs, unsigned int instr)
 {
+
+	if (ipipe_trap_notify(IPIPE_TRAP_BREAK,regs))
+		return 0;
+
 	ptrace_break(current, regs);
 	return 0;
 }
arch/arm/kernel/traps.c +3 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/kernel/traps.c linux/arch/arm/kernel/traps.c
@@ -310,6 +310,9 @@ asmlinkage void do_undefinstr(struct pt_
 	}
 	spin_unlock_irq(&undef_lock);
 
+	if (ipipe_trap_notify(IPIPE_TRAP_UNDEFINSTR,regs))
+		return;
+
 #ifdef CONFIG_DEBUG_USER
 	if (user_debug & UDBG_UNDEFINED) {
 		printk(KERN_INFO "%s (%d): undefined instruction: pc=%p\n",
arch/arm/mach-at91rm9200/Kconfig +18 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/mach-at91rm9200/Kconfig linux/arch/arm/mach-at91rm9200/Kconfig
@@ -49,6 +49,24 @@ config AT91_PROGRAMMABLE_CLOCKS
 	  Select this if you need to program one or more of the PCK0..PCK3
 	  programmable clock outputs.
 
+config IPIPE_AT91_TC
+	depends on IPIPE
+	int "AT91 TC used as time base"
+	default 0
+	help
+	When Adeos interrupt pipeline is enabled, TC0 is used by default
+	as time base, but you can use TC1 or TC2 by setting this variable to 1
+	or 2. This should only be needed to avoid conflicts with other drivers.
+
+config IPIPE_AT91_MCK
+	depends on IPIPE
+	int "AT91 Master clock Frequency"
+	default 46080000
+	help
+	When Adeos interrupt pipeline is enabled, AT91 timer is based on
+	the AT91 master clock, whose frequency need hence to be known at
+	compilation time.
+
 endmenu
 
 endif
arch/arm/mach-at91rm9200/clock.c +28 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/mach-at91rm9200/clock.c linux/arch/arm/mach-at91rm9200/clock.c
@@ -250,6 +250,29 @@ static struct clk spi_clk = {
 	.mode		= pmc_periph_mode,
 };
 
+#ifdef CONFIG_IPIPE
+static struct clk tc0 = {
+	.name		= "tc0",
+	.parent         = &mck,
+	.pmc_mask       = 1 << AT91_ID_TC0,
+	.mode           = pmc_periph_mode,
+};
+
+static struct clk tc1 = {
+	.name		= "tc1",
+	.parent         = &mck,
+	.pmc_mask       = 1 << AT91_ID_TC1,
+	.mode           = pmc_periph_mode,
+};
+
+static struct clk tc2 = {
+	.name		= "tc2",
+	.parent         = &mck,
+	.pmc_mask       = 1 << AT91_ID_TC2,
+	.mode           = pmc_periph_mode,
+};
+#endif /* CONFIG_IPIPE */
+
 static struct clk *const clock_list[] = {
 	/* four primary clocks -- MUST BE FIRST! */
 	&clk32k,
@@ -281,6 +304,11 @@ static struct clk *const clock_list[] = 
 	&spi_clk,
 	// ssc0..ssc2
 	// tc0..tc5
+#ifdef CONFIG_IPIPE
+	&tc0,
+	&tc1,
+	&tc2,
+#endif /* CONFIG_IPIPE */
 	&ohci_clk,
 	&ether_clk,
 };
arch/arm/mach-at91rm9200/gpio.c +55 -0

77 lines not on this page · raw message

arch/arm/mach-at91rm9200/irq.c +37 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/mach-at91rm9200/irq.c linux/arch/arm/mach-at91rm9200/irq.c
@@ -41,6 +41,7 @@
  * The default interrupt priority levels (0 = lowest, 7 = highest).
  */
 static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = {
+#ifndef CONFIG_IPIPE
 	7,	/* Advanced Interrupt Controller */
 	7,	/* System Peripheral */
 	0,	/* Parallel IO Controller A */
@@ -73,6 +74,42 @@ static unsigned int at91rm9200_default_i
 	0,	/* Advanced Interrupt Controller */
 	0,	/* Advanced Interrupt Controller */
 	0	/* Advanced Interrupt Controller */
+#else /* CONFIG_IPIPE */
+/* Give the highest priority to TC, since they are used as timer interrupt by
+   I-pipe. */
+	7,	/* Advanced Interrupt Controller */
+	6,	/* System Peripheral */
+	0,	/* Parallel IO Controller A */
+	0,	/* Parallel IO Controller B */
+	0,	/* Parallel IO Controller C */
+	0,	/* Parallel IO Controller D */
+	5,	/* USART 0 */
+	5,	/* USART 1 */
+	5,	/* USART 2 */
+	5,	/* USART 3 */
+	0,	/* Multimedia Card Interface */
+	3,	/* USB Device Port */
+	0,	/* Two-Wire Interface */
+	5,	/* Serial Peripheral Interface */
+	4,	/* Serial Synchronous Controller */
+	4,	/* Serial Synchronous Controller */
+	4,	/* Serial Synchronous Controller */
+	7,	/* Timer Counter 0 */
+	7,	/* Timer Counter 1 */
+	7,	/* Timer Counter 2 */
+	0,	/* Timer Counter 3 */
+	0,	/* Timer Counter 4 */
+	0,	/* Timer Counter 5 */
+	2,	/* USB Host port */
+	2,	/* Ethernet MAC */
+	0,	/* Advanced Interrupt Controller */
+	0,	/* Advanced Interrupt Controller */
+	0,	/* Advanced Interrupt Controller */
+	0,	/* Advanced Interrupt Controller */
+	0,	/* Advanced Interrupt Controller */
+	0,	/* Advanced Interrupt Controller */
+	0	/* Advanced Interrupt Controller */
+#endif /*CONFIG_IPIPE */
 };
 
 
arch/arm/mach-at91rm9200/time.c +255 -1

278 lines not on this page · raw message

arch/arm/mach-integrator/core.c +116 -48

221 lines not on this page · raw message

arch/arm/mach-integrator/integrator_cp.c +33 -1
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/mach-integrator/integrator_cp.c linux/arch/arm/mach-integrator/integrator_cp.c
@@ -2,6 +2,7 @@
  *  linux/arch/arm/mach-integrator/integrator_cp.c
  *
  *  Copyright (C) 2003 Deep Blue Solutions Ltd
+ *  Copyright (C) 2005 Stelian Pop.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,6 +20,7 @@
 #include <linux/amba/bus.h>
 #include <linux/amba/kmi.h>
 #include <linux/amba/clcd.h>
+#include <linux/ipipe.h>
 
 #include <asm/hardware.h>
 #include <asm/io.h>
@@ -219,6 +221,31 @@ sic_handle_irq(unsigned int irq, struct 
 	} while (status);
 }
 
+#ifdef CONFIG_IPIPE
+void __ipipe_mach_demux_irq(unsigned irq, struct pt_regs *regs)
+{
+	unsigned long status = sic_readl(INTCP_VA_SIC_BASE + IRQ_STATUS);
+	struct irqdesc *desc_unused = irq_desc + irq;
+	unsigned irq_unused = irq;
+
+	if (status == 0) {
+		do_bad_IRQ(irq, desc_unused, regs);
+		return;
+	}
+
+	do {
+		irq = ffs(status) - 1;
+		status &= ~(1 << irq);
+
+		irq += IRQ_SIC_START;
+
+		__ipipe_handle_irq(irq, regs);
+	} while (status);
+
+	desc_unused->chip->unmask(irq_unused);
+}
+#endif /* CONFIG_IPIPE */
+
 static void __init intcp_init_irq(void)
 {
 	unsigned int i;
@@ -565,9 +592,14 @@ static void __init intcp_init(void)
 
 #define TIMER_CTRL_IE	(1 << 5)			/* Interrupt Enable */
 
+#ifdef CONFIG_IPIPE
+unsigned int __ipipe_mach_ticks_per_jiffy = 1000000 * TICKS_PER_uSEC / HZ;
+EXPORT_SYMBOL(__ipipe_mach_ticks_per_jiffy);
+#endif
+
 static void __init intcp_timer_init(void)
 {
-	integrator_time_init(1000000 / HZ, TIMER_CTRL_IE);
+	integrator_time_init(1000000 * TICKS_PER_uSEC / HZ, TIMER_CTRL_IE);
 }
 
 static struct sys_timer cp_timer = {
arch/arm/mach-pxa/irq.c +37 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/mach-pxa/irq.c linux/arch/arm/mach-pxa/irq.c
@@ -16,6 +16,7 @@
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/ptrace.h>
+#include <linux/ipipe.h>
 
 #include <asm/hardware.h>
 #include <asm/irq.h>
@@ -214,6 +215,42 @@ static void pxa_gpio_demux_handler(unsig
 	} while (loop);
 }
 
+#ifdef CONFIG_IPIPE
+void __ipipe_mach_demux_irq(unsigned irq, struct pt_regs *regs)
+{
+	struct irqdesc *desc_unused = irq_desc + irq;
+	unsigned irq_unused = irq;
+	unsigned int i, mask[4];
+	int loop;
+
+	do {
+		loop = 0;
+
+		mask[0] = GEDR0 & ~3;
+		mask[1] = GEDR1;
+		mask[2] = GEDR2;
+#if PXA_LAST_GPIO < 96
+		i = 3;
+#else /* PXA_LAST_GPIO >= 96 */
+		mask[3] = GEDR3;
+		i = 4;
+#endif /* PXA_LAST_GPIO >= 96 */
+		for (; i; i--) {
+			loop |= mask[i - 1];
+			while (mask[i - 1]) {
+				irq = fls(mask[i - 1]) - 1;
+				mask[i - 1] &= ~(1 << irq);
+				irq = IRQ_GPIO((i - 1) * 32 + irq);
+
+				__ipipe_handle_irq(irq, regs);
+			}
+		}
+	} while (loop);
+
+	desc_unused->chip->unmask(irq_unused);
+}
+#endif /* CONFIG_IPIPE */
+
 static void pxa_ack_muxed_gpio(unsigned int irq)
 {
 	int gpio = irq - IRQ_GPIO(2) + 2;
arch/arm/mach-pxa/time.c +119 -0

161 lines not on this page · raw message

arch/arm/mach-s3c2410/irq.c +88 -1

119 lines not on this page · raw message

arch/arm/mach-s3c2410/s3c2440-irq.c +34 -1
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/mach-s3c2410/s3c2440-irq.c linux/arch/arm/mach-s3c2410/s3c2440-irq.c
@@ -3,6 +3,8 @@
  * Copyright (c) 2003,2004 Simtec Electronics
  *	Ben Dooks <[email protected]>
  *
+ * Copyright (C) 2006 Sebastian Smolorz <[email protected]>, emlix GmbH
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -19,8 +21,10 @@
  *
  * Changelog:
  *	25-Jul-2005 BJD		Split from irq.c
+ *   	11-Oct-2006 Sebastian Smolorz
+ *		    Added Adeos/Ipipe support
  *
-*/
+ */
 
 #include <linux/init.h>
 #include <linux/module.h>
@@ -28,6 +32,7 @@
 #include <linux/ioport.h>
 #include <linux/ptrace.h>
 #include <linux/sysdev.h>
+#include <linux/ipipe.h>
 
 #include <asm/hardware.h>
 #include <asm/irq.h>
@@ -157,6 +162,34 @@ static struct irqchip s3c_irq_cam = {
 	.ack	    = s3c_irq_cam_ack,
 };
 
+#ifdef CONFIG_IPIPE
+void __ipipe_s3c_irq_demux_wdtac97(unsigned int subsrc, struct pt_regs *regs)
+{
+	subsrc >>= 13;
+	subsrc &= 3;
+
+	if (subsrc != 0) {
+		if (subsrc & 1)
+			__ipipe_handle_irq(IRQ_S3C2440_WDT, regs);
+		if (subsrc & 2)
+			__ipipe_handle_irq(IRQ_S3C2440_AC97, regs);
+	}
+}
+
+void __ipipe_s3c_irq_demux_cam(unsigned int subsrc, struct pt_regs *regs)
+{
+	subsrc >>= 11;
+	subsrc &= 3;
+
+	if (subsrc != 0) {
+		if (subsrc & 1)
+			__ipipe_handle_irq(IRQ_S3C2440_CAM_C, regs);
+		if (subsrc & 2)
+			__ipipe_handle_irq(IRQ_S3C2440_CAM_P, regs);
+	}
+}
+#endif /* CONFIG_IPIPE */
+
 static int s3c2440_irq_add(struct sys_device *sysdev)
 {
 	unsigned int irqno;
arch/arm/mach-s3c2410/time.c +149 -47

288 lines not on this page · raw message

arch/arm/mach-sa1100/irq.c +32 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/mach-sa1100/irq.c linux/arch/arm/mach-sa1100/irq.c
@@ -14,6 +14,7 @@
 #include <linux/ioport.h>
 #include <linux/ptrace.h>
 #include <linux/sysdev.h>
+#include <linux/ipipe.h>
 
 #include <asm/hardware.h>
 #include <asm/irq.h>
@@ -136,6 +137,37 @@ sa1100_high_gpio_handler(unsigned int ir
 	} while (mask);
 }
 
+#ifdef CONFIG_IPIPE
+void __ipipe_mach_demux_irq(unsigned irq, struct pt_regs *regs)
+{
+	struct irqdesc *desc_unused = irq_desc + irq;
+	unsigned irq_unused = irq;
+	unsigned int mask;
+
+	mask = GEDR & 0xfffff800;
+	do {
+		/*
+		 * clear down all currently active IRQ sources.
+		 * We will be processing them all.
+		 */
+		GEDR = mask;
+
+		irq = IRQ_GPIO11;
+		mask >>= 11;
+		do {
+			if (mask & 1)
+				__ipipe_handle_irq(irq, regs);
+			mask >>= 1;
+			irq++;
+		} while (mask);
+
+		mask = GEDR & 0xfffff800;
+	} while (mask);
+
+	desc_unused->chip->unmask(irq_unused);
+}
+#endif /* CONFIG_IPIPE */
+
 /*
  * Like GPIO0 to 10, GPIO11-27 IRQs need to be handled specially.
  * In addition, the IRQs are all collected up into one bit in the
arch/arm/mach-sa1100/time.c +116 -0

157 lines not on this page · raw message

arch/arm/mm/copypage-v4mc.c +2 -2
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/mm/copypage-v4mc.c linux/arch/arm/mm/copypage-v4mc.c
@@ -43,7 +43,7 @@ static DEFINE_SPINLOCK(minicache_lock);
  * instruction.  If your processor does not supply this, you have to write your
  * own copy_user_page that does the right thing.
  */
-static void __attribute__((naked))
+static void notrace __attribute__((naked))
 mc_copy_user_page(void *from, void *to)
 {
 	asm volatile(
@@ -82,7 +82,7 @@ void v4_mc_copy_user_page(void *kto, con
 /*
  * ARMv4 optimised clear_user_page
  */
-void __attribute__((naked))
+void notrace __attribute__((naked))
 v4_mc_clear_user_page(void *kaddr, unsigned long vaddr)
 {
 	asm volatile(
arch/arm/mm/copypage-xscale.c +2 -2
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/mm/copypage-xscale.c linux/arch/arm/mm/copypage-xscale.c
@@ -41,7 +41,7 @@ static DEFINE_SPINLOCK(minicache_lock);
  * Dcache aliasing issue.  The writes will be forwarded to the write buffer,
  * and merged as appropriate.
  */
-static void __attribute__((naked))
+static void notrace __attribute__((naked))
 mc_copy_user_page(void *from, void *to)
 {
 	/*
@@ -104,7 +104,7 @@ void xscale_mc_copy_user_page(void *kto,
 /*
  * XScale optimised clear_user_page
  */
-void __attribute__((naked))
+void notrace __attribute__((naked))
 xscale_mc_clear_user_page(void *kaddr, unsigned long vaddr)
 {
 	asm volatile(
arch/arm/mm/fault.c +16 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/arch/arm/mm/fault.c linux/arch/arm/mm/fault.c
@@ -223,6 +223,9 @@ do_page_fault(unsigned long addr, unsign
 	struct mm_struct *mm;
 	int fault, sig, code;
 
+	if (ipipe_trap_notify(IPIPE_TRAP_ACCESS,regs))
+		return 0;
+
 	tsk = current;
 	mm  = tsk->mm;
 
@@ -354,6 +357,9 @@ do_translation_fault(unsigned long addr,
 bad_area:
 	tsk = current;
 
+	if (ipipe_trap_notify(IPIPE_TRAP_ACCESS,regs))
+		return 0;
+
 	do_bad_area(tsk, tsk->active_mm, addr, fsr, regs);
 	return 0;
 }
@@ -366,6 +372,10 @@ static int
 do_sect_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
 {
 	struct task_struct *tsk = current;
+
+	if (ipipe_trap_notify(IPIPE_TRAP_SECTION,regs))
+		return 0;
+
 	do_bad_area(tsk, tsk->active_mm, addr, fsr, regs);
 	return 0;
 }
@@ -376,6 +386,9 @@ do_sect_fault(unsigned long addr, unsign
 static int
 do_bad(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
 {
+	if (ipipe_trap_notify(IPIPE_TRAP_DABT,regs))
+		return 0;
+
 	return 1;
 }
 
@@ -451,6 +464,9 @@ do_DataAbort(unsigned long addr, unsigne
 	if (!inf->fn(addr, fsr, regs))
 		return;
 
+	if (ipipe_trap_notify(IPIPE_TRAP_UNKNOWN,regs))
+		return;
+
 	printk(KERN_ALERT "Unhandled fault: %s (0x%03x) at 0x%08lx\n",
 		inf->name, fsr, addr);
 
drivers/pci/msi.c +18 -3
diff -x '*xenomai*' -Naurdp linux-2.6.17/drivers/pci/msi.c linux/drivers/pci/msi.c
@@ -151,6 +151,21 @@ static void unmask_MSI_irq(unsigned int 
 	msi_set_mask_bit(vector, 0);
 }
 
+#ifdef CONFIG_IPIPE
+static void ack_MSI_irq_w_maskbit(unsigned int vector)
+{
+    mask_MSI_irq(vector);
+    __ack_APIC_irq();
+}
+static void ack_MSI_irq_wo_maskbit(unsigned int vector)
+{
+    __ack_APIC_irq();
+}
+#else /* !CONFIG_IPIPE */
+#define ack_MSI_irq_wo_maskbit  do_nothing
+#define ack_MSI_irq_w_maskbit   mask_MSI_irq
+#endif /* CONFIG_IPIPE */
+
 static unsigned int startup_msi_irq_wo_maskbit(unsigned int vector)
 {
 	struct msi_desc *entry;
@@ -214,7 +229,7 @@ static struct hw_interrupt_type msix_irq
 	.shutdown	= shutdown_msi_irq,
 	.enable		= unmask_MSI_irq,
 	.disable	= mask_MSI_irq,
-	.ack		= mask_MSI_irq,
+	.ack		= ack_MSI_irq_w_maskbit,
 	.end		= end_msi_irq_w_maskbit,
 	.set_affinity	= set_msi_affinity
 };
@@ -230,7 +245,7 @@ static struct hw_interrupt_type msi_irq_
 	.shutdown	= shutdown_msi_irq,
 	.enable		= unmask_MSI_irq,
 	.disable	= mask_MSI_irq,
-	.ack		= mask_MSI_irq,
+	.ack		= ack_MSI_irq_w_maskbit,
 	.end		= end_msi_irq_w_maskbit,
 	.set_affinity	= set_msi_affinity
 };
@@ -246,7 +261,7 @@ static struct hw_interrupt_type msi_irq_
 	.shutdown	= shutdown_msi_irq,
 	.enable		= do_nothing,
 	.disable	= do_nothing,
-	.ack		= do_nothing,
+	.ack		= ack_MSI_irq_wo_maskbit,
 	.end		= end_msi_irq_wo_maskbit,
 	.set_affinity	= set_msi_affinity
 };
include/asm-arm/arch-at91rm9200/at91_tc.h +146 -0

86 lines not on this page · raw message

include/asm-arm/arch-at91rm9200/irqs.h +8 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/asm-arm/arch-at91rm9200/irqs.h linux/include/asm-arm/arch-at91rm9200/irqs.h

Lines of this file are not shown. View the raw message.

include/asm-arm/arch-at91rm9200/timex.h +4 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/asm-arm/arch-at91rm9200/timex.h linux/include/asm-arm/arch-at91rm9200/timex.h

Lines of this file are not shown. View the raw message.

include/asm-arm/arch-integrator/entry-macro.S +5 -1
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/asm-arm/arch-integrator/entry-macro.S linux/include/asm-arm/arch-integrator/entry-macro.S

Lines of this file are not shown. View the raw message.

include/asm-arm/arch-integrator/irqs.h +3 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/asm-arm/arch-integrator/irqs.h linux/include/asm-arm/arch-integrator/irqs.h

Lines of this file are not shown. View the raw message.

include/asm-arm/arch-integrator/platform.h +9 -2
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/asm-arm/arch-integrator/platform.h linux/include/asm-arm/arch-integrator/platform.h

Lines of this file are not shown. View the raw message.

include/asm-arm/arch-integrator/timex.h +2 -2
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/asm-arm/arch-integrator/timex.h linux/include/asm-arm/arch-integrator/timex.h

Lines of this file are not shown. View the raw message.

include/asm-arm/arch-pxa/irqs.h +4 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/asm-arm/arch-pxa/irqs.h linux/include/asm-arm/arch-pxa/irqs.h

Lines of this file are not shown. View the raw message.

include/asm-arm/arch-s3c2410/irqs.h +25 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/asm-arm/arch-s3c2410/irqs.h linux/include/asm-arm/arch-s3c2410/irqs.h

Lines of this file are not shown. View the raw message.

include/asm-arm/arch-sa1100/irqs.h +4 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/asm-arm/arch-sa1100/irqs.h linux/include/asm-arm/arch-sa1100/irqs.h

Lines of this file are not shown. View the raw message.

include/asm-arm/atomic.h +10 -10
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/asm-arm/atomic.h linux/include/asm-arm/atomic.h

Lines of this file are not shown. View the raw message.

include/asm-arm/bitops.h +12 -12
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/asm-arm/bitops.h linux/include/asm-arm/bitops.h

Lines of this file are not shown. View the raw message.

include/asm-arm/ipipe.h +217 -0

217 lines not on this page · raw message

include/asm-arm/mmu_context.h +4 -1
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/asm-arm/mmu_context.h linux/include/asm-arm/mmu_context.h

Lines of this file are not shown. View the raw message.

include/asm-arm/pgalloc.h +5 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/asm-arm/pgalloc.h linux/include/asm-arm/pgalloc.h

Lines of this file are not shown. View the raw message.

include/asm-arm/system.h +110 -26

136 lines not on this page · raw message

include/linux/hardirq.h +13 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/linux/hardirq.h linux/include/linux/hardirq.h

Lines of this file are not shown. View the raw message.

include/linux/ipipe.h +772 -0

772 lines not on this page · raw message

include/linux/ipipe_trace.h +40 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/linux/ipipe_trace.h linux/include/linux/ipipe_trace.h

Lines of this file are not shown. View the raw message.

include/linux/linkage.h +4 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/linux/linkage.h linux/include/linux/linkage.h

Lines of this file are not shown. View the raw message.

include/linux/mm.h +1 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/linux/mm.h linux/include/linux/mm.h

Lines of this file are not shown. View the raw message.

include/linux/preempt.h +31 -16

47 lines not on this page · raw message

include/linux/sched.h +16 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/include/linux/sched.h linux/include/linux/sched.h

Lines of this file are not shown. View the raw message.

init/Kconfig +29 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/init/Kconfig linux/init/Kconfig

Lines of this file are not shown. View the raw message.

init/main.c +6 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/init/main.c linux/init/main.c

Lines of this file are not shown. View the raw message.

kernel/Makefile +1 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/kernel/Makefile linux/kernel/Makefile

Lines of this file are not shown. View the raw message.

kernel/exit.c +1 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/kernel/exit.c linux/kernel/exit.c

Lines of this file are not shown. View the raw message.

kernel/fork.c +10 -1
diff -x '*xenomai*' -Naurdp linux-2.6.17/kernel/fork.c linux/kernel/fork.c

Lines of this file are not shown. View the raw message.

kernel/ipipe/Kconfig +6 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/kernel/ipipe/Kconfig linux/kernel/ipipe/Kconfig

Lines of this file are not shown. View the raw message.

kernel/ipipe/Kconfig.debug +69 -0

69 lines not on this page · raw message

kernel/ipipe/Makefile +3 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/kernel/ipipe/Makefile linux/kernel/ipipe/Makefile

Lines of this file are not shown. View the raw message.

kernel/ipipe/core.c +1051 -0

1,051 lines not on this page · raw message

kernel/ipipe/generic.c +424 -0

424 lines not on this page · raw message

kernel/ipipe/tracer.c +1241 -0

1,241 lines not on this page · raw message

kernel/irq/handle.c +15 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/kernel/irq/handle.c linux/kernel/irq/handle.c

Lines of this file are not shown. View the raw message.

kernel/printk.c +73 -0

73 lines not on this page · raw message

kernel/sched.c +70 -3

73 lines not on this page · raw message

kernel/signal.c +1 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/kernel/signal.c linux/kernel/signal.c

Lines of this file are not shown. View the raw message.

lib/Kconfig.debug +2 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/lib/Kconfig.debug linux/lib/Kconfig.debug

Lines of this file are not shown. View the raw message.

lib/smp_processor_id.c +5 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/lib/smp_processor_id.c linux/lib/smp_processor_id.c

Lines of this file are not shown. View the raw message.

lib/spinlock_debug.c +19 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/lib/spinlock_debug.c linux/lib/spinlock_debug.c

Lines of this file are not shown. View the raw message.

mm/memory.c +153 -29

182 lines not on this page · raw message

mm/mlock.c +2 -1
diff -x '*xenomai*' -Naurdp linux-2.6.17/mm/mlock.c linux/mm/mlock.c

Lines of this file are not shown. View the raw message.

mm/vmalloc.c +5 -0
diff -x '*xenomai*' -Naurdp linux-2.6.17/mm/vmalloc.c linux/mm/vmalloc.c

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.