📄 adeos-ipipe-2.6.12-bf533-1.2-00.patch
字号:
- while (!need_resched())+ while (!need_resched()) {+ ipipe_suspend_domain(); __asm__("nop;\n\t \ nop;\n\t \ nop;\n\t \ idle;\n\t": : :"cc");+ } leds_switch(LED_ON); schedule(); }diff -uNrp linux-2.6.12/arch/blackfin/kernel/time.c 2.6.12-ipipe/arch/blackfin/kernel/time.c--- linux-2.6.12/arch/blackfin/kernel/time.c 2005-10-18 06:23:57.000000000 +0200+++ 2.6.12-ipipe/arch/blackfin/kernel/time.c 2006-02-13 07:36:35.000000000 +0100@@ -7,7 +7,7 @@ * Description: This file contains the bfin-specific time handling details. * Most of the stuff is located in the machine specific files. *- * Rev: $Id: time.c,v 1.30 2005/10/18 04:23:57 magicyang Exp $+ * Rev: $Id: time.c,v 1.1 2006/02/11 22:01:00 rpm Exp $ * * Modified: * Copyright 2004-2005 Analog Devices Inc.@@ -134,6 +134,27 @@ static struct irqaction bfin_timer_irq = void time_sched_init(irqreturn_t(*timer_routine) (int, void *, struct pt_regs *)) {+#ifdef CONFIG_IPIPE+ /* Use builtin TIMER0 for time source instead of the high+ * priority core timer; this makes the latter available to+ * client RTOS running over the I-pipe. Xenomai will make good+ * use of this. */++ /* Power down the core timer, just to play safe. */+ *pTCNTL = 0;+ __builtin_bfin_csync();+ /* We use TIMER0 in PWM_OUT, periodic mode. */+ *pTIMER_DISABLE = 1; /* Disable TIMER0 for now. */+ __builtin_bfin_ssync();+ *pTIMER0_CONFIG = 0x19; /* IRQ enable, periodic, PWM_OUT, SCLKed */+ __builtin_bfin_ssync();+ *pTIMER0_PERIOD = get_sclk() / HZ;+ __builtin_bfin_ssync();+ *pTIMER0_WIDTH = 1;+ __builtin_bfin_ssync();+ *pTIMER_ENABLE = 1; /* Enable TIMER0. */+ __builtin_bfin_ssync();+#else /* !CONFIG_IPIPE */ /* power up the timer, but don't enable it just yet */ *pTCNTL = 1; __builtin_bfin_csync();@@ -149,10 +170,11 @@ time_sched_init(irqreturn_t(*timer_routi __builtin_bfin_csync(); *pTCNTL = 7;-+#endif /* CONFIG_IPIPE */ bfin_timer_irq.handler = timer_routine;- /* call setup_irq instead of request_irq because request_irq calls kmalloc which has not been initialized yet */- setup_irq(IRQ_CORETMR, &bfin_timer_irq);+ /* call setup_irq instead of request_irq because request_irq+ calls kmalloc which has not been initialized yet */+ setup_irq(IRQ_SYSTMR, &bfin_timer_irq); } unsigned long gettimeoffset(void)@@ -164,7 +186,7 @@ unsigned long gettimeoffset(void) tick_usec * (clocks_per_jiffy - (*pTCOUNT + 1)) / clocks_per_jiffy; /* Check if we just wrapped the counters and maybe missed a tick */- if ((*pILAT & (1 << IRQ_CORETMR)) && (offset < (100000 / HZ / 2)))+ if ((*pILAT & (1 << IRQ_PRIOTMR)) && (offset < (100000 / HZ / 2))) offset += (1000000 / HZ); return offset;diff -uNrp linux-2.6.12/arch/blackfin/kernel/traps.c 2.6.12-ipipe/arch/blackfin/kernel/traps.c--- linux-2.6.12/arch/blackfin/kernel/traps.c 2005-12-29 07:47:47.000000000 +0100+++ 2.6.12-ipipe/arch/blackfin/kernel/traps.c 2006-02-11 23:01:00.000000000 +0100@@ -6,7 +6,7 @@ * Created: * Description: uses S/W interrupt 15 for the system calls *- * Rev: $Id: traps.c,v 1.38.2.1 2005/12/29 06:47:47 sonicz Exp $+ * Rev: $Id: traps.c,v 1.1 2006/02/11 22:01:00 rpm Exp $ * * Modified: * Copyright 2004-2005 Analog Devices Inc.@@ -249,6 +249,10 @@ asmlinkage void trap_c(struct pt_regs *f sig = SIGTRAP; break; }++ if (ipipe_trap_notify(fp->seqstat & 0x3f,fp))+ goto nsig;+ info.si_signo = sig; info.si_errno = 0; info.si_addr = (void *)fp->pc;diff -uNrp linux-2.6.12/arch/blackfin/lib/ins.S 2.6.12-ipipe/arch/blackfin/lib/ins.S--- linux-2.6.12/arch/blackfin/lib/ins.S 2005-10-28 06:02:10.000000000 +0200+++ 2.6.12-ipipe/arch/blackfin/lib/ins.S 2006-02-12 23:12:21.000000000 +0100@@ -1,7 +1,7 @@ /* * File: ins.S * Description: Implementation of ins{bwl} for BlackFin processors using zero overhead loops.- * Rev: $Id: ins.S,v 1.7 2005/10/28 04:02:10 magicyang Exp $+ * Rev: $Id: ins.S,v 1.1 2006/02/12 22:12:21 rpm Exp $ * Created: Tue Mar 22 15:27:24 CEST 2005 * Author: Bas Vermeulen * Email: bas@buyways.nl@@ -31,7 +31,16 @@ ENTRY(_insl) P0 = R0; /* P0 = port */ P1 = R1; /* P1 = address */ P2 = R2; /* P2 = count */+#ifdef CONFIG_IPIPE+ [--sp] = rets+ [--sp] = (P5:0);+ sp += -12+ call _ipipe_stall_root_raw+ sp += 12+ (P5:0) = [sp++];+#else /* !CONFIG_IPIPE */ cli R2;+#endif /* CONFIG_IPIPE */ NOP; NOP; @@ -39,14 +48,30 @@ ENTRY(_insl) long_loop_s: R0 = [P0]; long_loop_e: [P1++] = R0; - sti R2;+#ifdef CONFIG_IPIPE+ sp += -12+ call _ipipe_unstall_root_raw+ sp += 12+ rets = [sp++]+#else /* !CONFIG_IPIPE */+ sti R2;+#endif /* CONFIG_IPIPE */ RTS; ENTRY(_insw) P0 = R0; /* P0 = port */ P1 = R1; /* P1 = address */ P2 = R2; /* P2 = count */+#ifdef CONFIG_IPIPE+ [--sp] = rets+ [--sp] = (P5:0);+ sp += -12+ call _ipipe_stall_root_raw+ sp += 12+ (P5:0) = [sp++];+#else /* !CONFIG_IPIPE */ cli R2;+#endif /* CONFIG_IPIPE */ NOP; NOP; @@ -54,19 +79,42 @@ ENTRY(_insw) word_loop_s: R0 = W[P0]; word_loop_e: W[P1++] = R0; +#ifdef CONFIG_IPIPE+ sp += -12+ call _ipipe_unstall_root_raw+ sp += 12+ rets = [sp++]+#else /* !CONFIG_IPIPE */ sti R2;+#endif /* CONFIG_IPIPE */ RTS; ENTRY(_insb) P0 = R0; /* P0 = port */ P1 = R1; /* P1 = address */ P2 = R2; /* P2 = count */+#ifdef CONFIG_IPIPE+ [--sp] = rets+ [--sp] = (P5:0);+ sp += -12+ call _ipipe_stall_root_raw+ sp += 12+ (P5:0) = [sp++];+#else cli R2;+#endif NOP; NOP; LSETUP( byte_loop_s, byte_loop_e) LC0 = P2; byte_loop_s: R0 = B[P0]; byte_loop_e: B[P1++] = R0;+#ifdef CONFIG_IPIPE+ sp += -12+ call _ipipe_unstall_root_raw+ sp += 12+ rets = [sp++]+#else sti R2;+#endif RTS;diff -uNrp linux-2.6.12/arch/blackfin/mach-bf533/Kconfig 2.6.12-ipipe/arch/blackfin/mach-bf533/Kconfig--- linux-2.6.12/arch/blackfin/mach-bf533/Kconfig 2005-10-28 06:07:34.000000000 +0200+++ 2.6.12-ipipe/arch/blackfin/mach-bf533/Kconfig 2006-02-11 22:41:02.000000000 +0100@@ -60,7 +60,7 @@ config DMA7_UARTTX config TIMER0 int "TIMER0"- default 11+ default 7 config TIMER1 int "TIMER1" default 11diff -uNrp linux-2.6.12/arch/blackfin/mach-common/entry.S 2.6.12-ipipe/arch/blackfin/mach-common/entry.S--- linux-2.6.12/arch/blackfin/mach-common/entry.S 2005-12-29 07:47:47.000000000 +0100+++ 2.6.12-ipipe/arch/blackfin/mach-common/entry.S 2006-02-13 08:14:50.000000000 +0100@@ -383,6 +383,19 @@ ENTRY(system_call) p2 = [p2]; [p2+(TASK_THREAD+THREAD_KSP)] = sp;+#ifdef CONFIG_IPIPE+ r0 = sp; + SP += -12;+ call ___ipipe_syscall_root; + SP += 12;+ cc = r0 == 1;+ if cc jump syscall_really_exit;+ cc = r0 == -1;+ if cc jump resume_userspace;+ r3 = [sp + PT_R3]; + r4 = [sp + PT_R4]; + p0 = [sp + PT_ORIG_P0]; +#endif /* CONFIG_IPIPE */ /* Check the System Call */ r7 = __NR_syscall;@@ -564,6 +577,15 @@ new_old_task: rts; ENTRY(ret_from_exception)+#ifdef CONFIG_IPIPE+ [--sp] = rets;+ SP += -12;+ call ___ipipe_check_root+ SP += 12+ rets = [sp++];+ cc = r0 == 0;+ if cc jump 4f; /* not on behalf of Linux, get out */+#endif /* CONFIG_IPIPE */ p2.l = lo(IPEND); p2.h = hi(IPEND); @@ -657,7 +679,7 @@ ENTRY(return_from_int) 2: rts; -ENTRY(_lower_to_irq14)+ENTRY(_lower_to_irq14) /* Not called when the I-pipe is enabled. */ r0 = 0x401f; sti r0; raise 14;diff -uNrp linux-2.6.12/arch/blackfin/mach-common/interrupt.S 2.6.12-ipipe/arch/blackfin/mach-common/interrupt.S--- linux-2.6.12/arch/blackfin/mach-common/interrupt.S 2005-12-21 02:38:51.000000000 +0100+++ 2.6.12-ipipe/arch/blackfin/mach-common/interrupt.S 2006-02-16 15:40:40.000000000 +0100@@ -39,6 +39,85 @@ #include <asm/entry.h> #include <asm/asm-offsets.h> +#ifdef CONFIG_IPIPE++/* Note: we do call return_from_int before eventually branching to+ the IRQ tail code, since the former returns early - and as+ such would not cause high latencies - if the condition which+ triggers the latter is detected (i.e. the current IRQ did not+ preempt user code). */+ +.macro handle_irq /* r0 contains the IRQ level set by caller. */+ p2.l = lo(IPEND);+ p2.h = hi(IPEND);+ csync;+ r2 = [p2]; /* Read current IPEND */+ [sp + PT_IPEND] = r2; /* Store IPEND */+ r1 = sp+ sp += -12+ call ___ipipe_grab_irq+ sp += 12+ cc = r0 == 0;+ if cc jump 1f;+ call return_from_int;+1: +.endm++ENTRY(___ipipe_call_irqtail)++ r0.l = 1f;+ r0.h = 1f;+ reti = r0; + rti+1:+ [--sp] = rets; + [--sp] = ( r7:4, p5:3 );+ p0.l = ___ipipe_irq_tail_hook;+ p0.h = ___ipipe_irq_tail_hook;+ p0 = [p0] ;+ sp += -12 ; + call (p0) ;+ sp += 12;+ ( r7:4, p5:3 ) = [sp++];+ rets = [sp++]; ++ [--sp] = reti;+ reti = [sp++]; /* IRQs are off. */+ r0.h = 3f; + r0.l = 3f; + p0.l = lo(EVT14);+ p0.h = hi(EVT14);+ [p0] = r0;+ csync; + r0 = 0x401f; + sti r0;+ raise 14;+ [--sp] = reti; /* IRQs on. */+2:+ jump 2b /* Likely paranoid. */+3:+ sp += 4; /* Discard saved RETI */+ r0.h = _evt14_softirq; + r0.l = _evt14_softirq; + p0.l = lo(EVT14);+ p0.h = hi(EVT14);+ [p0] = r0; + csync+ p0.l = _irq_flags;+ p0.h = _irq_flags;+ r0 = [p0];+ sti r0+ rts;++#else /* !CONFIG_IPIPE */+.macro handle_irq+ r1 = sp+ sp += -12+ call _do_irq+ sp += 12+ call return_from_int;+.endm+#endif /* CONFIG_IPIPE */ .text .align 4 /* just in case */@@ -103,26 +182,15 @@ call_do_ovf: RESTORE_CONTEXT rti; #endif-/* interrupt routine for core timer - 6 */+/* interrupt routine for core timer - 6. CONFIG_IPIPE reserves it for+ client RTOS. Linux is timed by TIMER0. */ ENTRY(_evt_timer) SAVE_CONTEXT #ifdef CONFIG_FRAME_POINTER fp = 0; #endif- /* SAVE_CONTEXT ignores IPEND; we need to save it since the user_mode- macro accesses it to determine where to account time. */- p2.l = lo(IPEND);- p2.h = hi(IPEND);- csync;- r0 = [p2];- [sp + PT_IPEND] = r0;- r0 = EVT_IVTMR_P;- r1 = sp;- SP += -12;- call _do_irq;- SP += 12;- call return_from_int;+ handle_irq; RESTORE_CONTEXT rti; @@ -147,11 +215,7 @@ ENTRY(_evt_evt7) fp = 0; #endif r0 = EVT_IVG7_P;- r1 = sp;- SP += -12;- call _do_irq;- SP += 12;- call return_from_int;+ handle_irq; RESTORE_CONTEXT rti; @@ -162,11 +226,7 @@ ENTRY(_evt_evt8) fp = 0; #endif r0 = EVT_IVG8_P;- r1 = sp;- SP += -12;- call _do_irq;- SP += 12;- call return_from_int;+ handle_irq; RESTORE_CONTEXT rti; @@ -177,11 +237,7 @@ ENTRY(_evt_evt9) fp = 0; #endif r0 = EVT_IVG9_P;- r1 = sp;- SP += -12;- call _do_irq;- SP += 12;- call return_from_int;+ handle_irq; RESTORE_CONTEXT rti; @@ -192,11 +248,7 @@ ENTRY(_evt_evt10) fp = 0; #endif r0 = EVT_IVG10_P;- r1 = sp;- SP += -12;- call _do_irq;- SP += 12;- call return_from_int;+ handle_irq; RESTORE_CONTEXT rti; @@ -207,11 +259,7 @@ ENTRY(_evt_evt11) fp = 0; #endif r0 = EVT_IVG11_P;- r1 = sp;- SP += -12;- call _do_irq;- SP += 12;- call return_from_int;+ handle_irq; RESTORE_CONTEXT rti; @@ -222,11 +270,7 @@ ENTRY(_evt_evt12) fp = 0; #endif r0 = EVT_IVG12_P;- r1 = sp;- SP += -12;- call _do_irq;- SP += 12;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -