⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adeos-ipipe-2.4.25-ppc-denx-1.0-03.patch

📁 xenomai 很好的linux实时补丁
💻 PATCH
📖 第 1 页 / 共 5 页
字号:
diff -uNrp 2.4.25-ppc/arch/ppc/config.in 2.4.25-ppc-ipipe/arch/ppc/config.in--- 2.4.25-ppc/arch/ppc/config.in	2005-10-24 16:39:53.000000000 +0200+++ 2.4.25-ppc-ipipe/arch/ppc/config.in	2006-01-30 15:58:04.000000000 +0100@@ -787,6 +787,12 @@ else   fi fi +bool 'Interrupt pipeline' CONFIG_IPIPE+if [ "$CONFIG_IPIPE" = "y" ]; then+   define_bool CONFIG_IPIPE_EXTENDED y+   bool 'Collect pipeline statistics' CONFIG_IPIPE_STATS+fi+ bool 'Networking support' CONFIG_NET bool 'Sysctl support' CONFIG_SYSCTL bool 'System V IPC' CONFIG_SYSVIPCdiff -uNrp 2.4.25-ppc/arch/ppc/kernel/Makefile 2.4.25-ppc-ipipe/arch/ppc/kernel/Makefile--- 2.4.25-ppc/arch/ppc/kernel/Makefile	2005-10-15 19:14:59.000000000 +0200+++ 2.4.25-ppc-ipipe/arch/ppc/kernel/Makefile	2005-11-12 23:33:42.000000000 +0100@@ -46,7 +46,8 @@ export-objs			:= ppc_ksyms.o time.o ocp. 					ppc4xx_dma.o ppc4xx_sgdma.o \ 					ppc4xx_stbdma.o ppc4xx_pm.o \ 					gt64260_common.o mpc5xxx_common.o \-					ppc85xx_common.o ppc83xx_common.o+					ppc85xx_common.o ppc83xx_common.o \+					ipipe-root.o ipipe-core.o  obj-y				:= entry.o traps.o irq.o idle.o time.o misc.o \ 					process.o signal.o ptrace.o align.o \@@ -62,6 +63,7 @@ obj-$(CONFIG_PCI)		+= pci-dma.o obj-$(CONFIG_KGDB)		+= ppc-stub.o obj-$(CONFIG_PPCBUG_NVRAM)	+= prep_nvram.o obj-$(CONFIG_SMP)		+= smp.o+obj-$(CONFIG_IPIPE)		+= ipipe-root.o ipipe-core.o obj-$(CONFIG_TAU)		+= temp.o ifeq ($(CONFIG_SERIAL)$(CONFIG_GEN550),yy) obj-$(CONFIG_KGDB)		+= gen550_kgdb.o gen550_dbg.odiff -uNrp 2.4.25-ppc/arch/ppc/kernel/entry.S 2.4.25-ppc-ipipe/arch/ppc/kernel/entry.S--- 2.4.25-ppc/arch/ppc/kernel/entry.S	2005-03-16 00:12:45.000000000 +0100+++ 2.4.25-ppc-ipipe/arch/ppc/kernel/entry.S	2005-11-17 14:42:10.000000000 +0100@@ -53,6 +53,21 @@ _GLOBAL(DoSyscall) 	lis	r10,0x1000 	andc	r11,r11,r10 	stw	r11,_CCR(r1)+#ifdef CONFIG_IPIPE+	addi	r3,r1,GPR0+	bl	__ipipe_syscall_root+	cmpwi	r3,0+	lwz	r3,GPR3(r1)+	lwz	r0,GPR0(r1)+	lwz	r4,GPR4(r1)+	lwz	r5,GPR5(r1)+	lwz	r6,GPR6(r1)+	lwz	r7,GPR7(r1)+	lwz	r8,GPR8(r1)+	lwz	r9,GPR9(r1)+	bgt	restore+	blt	ret_from_except_1+#endif /* CONFIG_IPIPE */ #ifdef SHOW_SYSCALLS #ifdef SHOW_SYSCALLS_TASK 	lis	r31,show_syscalls_task@ha@@ -288,10 +303,21 @@ ret_from_intercept: 	 * We may be returning from RTL and cannot do the normal checks 	 * -- Cort 	 */+	/*+	 * We may also be returning from Adeos and cannot do the normal checks either+	 * -- rpm+	 */ 	cmpi	0,r3,0 	beq	restore+	b	ret_from_except_1 	.globl	ret_from_except ret_from_except:+#ifdef CONFIG_IPIPE+        bl	__ipipe_check_root+        cmpwi	r3, 0+        beq-	restore+#endif /* CONFIG_IPIPE */+ret_from_except_1: 	lwz	r3,_MSR(r1)	/* Returning to user mode? */ 	andi.	r3,r3,MSR_PR 	beq+	do_signal_ret	/* if so, check need_resched and signals */diff -uNrp 2.4.25-ppc/arch/ppc/kernel/head.S 2.4.25-ppc-ipipe/arch/ppc/kernel/head.S--- 2.4.25-ppc/arch/ppc/kernel/head.S	2003-11-15 02:31:44.000000000 +0100+++ 2.4.25-ppc-ipipe/arch/ppc/kernel/head.S	2005-11-09 15:26:12.000000000 +0100@@ -435,7 +435,11 @@ HardwareInterrupt: 	bl	transfer_to_handler 	.globl do_IRQ_intercept do_IRQ_intercept:-	.long	do_IRQ;+#ifdef CONFIG_IPIPE+	.long	__ipipe_grab_irq+#else /* !CONFIG_IPIPE */+	.long	do_IRQ+#endif /* CONFIG_IPIPE */ 	.long	ret_from_intercept  /* Alignment exception */@@ -485,7 +489,11 @@ Decrementer: 	bl	transfer_to_handler 	.globl timer_interrupt_intercept timer_interrupt_intercept:+#ifdef CONFIG_IPIPE+	.long	__ipipe_grab_timer+#else /* !CONFIG_IPIPE */ 	.long	timer_interrupt+#endif /* CONFIG_IPIPE */ 	.long	ret_from_intercept  	STD_EXCEPTION(0xa00, Trap_0a, UnknownException)diff -uNrp 2.4.25-ppc/arch/ppc/kernel/head_440.S 2.4.25-ppc-ipipe/arch/ppc/kernel/head_440.S--- 2.4.25-ppc/arch/ppc/kernel/head_440.S	2003-10-30 01:32:14.000000000 +0100+++ 2.4.25-ppc-ipipe/arch/ppc/kernel/head_440.S	2005-11-09 15:14:35.000000000 +0100@@ -539,7 +539,11 @@ interrupt_base: 	li      r4,0 	bl      transfer_to_handler _GLOBAL(do_IRQ_intercept)-	.long   do_IRQ+#ifdef CONFIG_IPIPE+	.long	__ipipe_grab_irq+#else /* !CONFIG_IPIPE */+	.long	do_IRQ+#endif /* CONFIG_IPIPE */ 	.long   ret_from_intercept 	.long	0x500 @@ -590,7 +594,11 @@ _GLOBAL(do_IRQ_intercept) 	li      r20,MSR_KERNEL 	bl      transfer_to_handler _GLOBAL(timer_interrupt_intercept)-	.long   timer_interrupt+#ifdef CONFIG_IPIPE+	.long	__ipipe_grab_timer+#else /* !CONFIG_IPIPE */+	.long	timer_interrupt+#endif /* CONFIG_IPIPE */ 	.long   ret_from_intercept 	.long	0x1000 diff -uNrp 2.4.25-ppc/arch/ppc/kernel/head_44x.S 2.4.25-ppc-ipipe/arch/ppc/kernel/head_44x.S--- 2.4.25-ppc/arch/ppc/kernel/head_44x.S	2004-05-07 07:59:53.000000000 +0200+++ 2.4.25-ppc-ipipe/arch/ppc/kernel/head_44x.S	2005-11-09 15:15:12.000000000 +0100@@ -552,7 +552,11 @@ interrupt_base: 	li      r4,0 	bl      transfer_to_handler _GLOBAL(do_IRQ_intercept)-	.long   do_IRQ+#ifdef CONFIG_IPIPE+	.long	__ipipe_grab_irq+#else /* !CONFIG_IPIPE */+	.long	do_IRQ+#endif /* CONFIG_IPIPE */ 	.long   ret_from_intercept 	.long	0x500 @@ -603,7 +607,11 @@ _GLOBAL(do_IRQ_intercept) 	li      r20,MSR_KERNEL 	bl      transfer_to_handler _GLOBAL(timer_interrupt_intercept)-	.long   timer_interrupt+#ifdef CONFIG_IPIPE+	.long	__ipipe_grab_timer+#else /* !CONFIG_IPIPE */+	.long	timer_interrupt+#endif /* CONFIG_IPIPE */ 	.long   ret_from_intercept 	.long	0x1000 diff -uNrp 2.4.25-ppc/arch/ppc/kernel/head_4xx.S 2.4.25-ppc-ipipe/arch/ppc/kernel/head_4xx.S--- 2.4.25-ppc/arch/ppc/kernel/head_4xx.S	2003-10-30 01:32:14.000000000 +0100+++ 2.4.25-ppc-ipipe/arch/ppc/kernel/head_4xx.S	2005-11-09 15:14:57.000000000 +0100@@ -384,7 +384,11 @@ label: 	li	r4,0 	bl	transfer_to_handler _GLOBAL(do_IRQ_intercept)+#ifdef CONFIG_IPIPE+	.long	__ipipe_grab_irq+#else /* !CONFIG_IPIPE */ 	.long	do_IRQ+#endif /* CONFIG_IPIPE */ 	.long	ret_from_intercept  /* 0x0600 - Alignment Exception@@ -456,7 +460,11 @@ _GLOBAL(do_IRQ_intercept) 	li	r20,MSR_KERNEL 	bl	transfer_to_handler _GLOBAL(timer_interrupt_intercept)+#ifdef CONFIG_IPIPE+	.long	__ipipe_grab_timer+#else /* !CONFIG_IPIPE */ 	.long	timer_interrupt+#endif /* CONFIG_IPIPE */ 	.long	ret_from_intercept  #if 0diff -uNrp 2.4.25-ppc/arch/ppc/kernel/head_8xx.S 2.4.25-ppc-ipipe/arch/ppc/kernel/head_8xx.S--- 2.4.25-ppc/arch/ppc/kernel/head_8xx.S	2005-02-13 21:04:14.000000000 +0100+++ 2.4.25-ppc-ipipe/arch/ppc/kernel/head_8xx.S	2005-11-19 19:02:03.000000000 +0100@@ -231,7 +231,11 @@ HardwareInterrupt: 	bl	transfer_to_handler 	.globl	do_IRQ_intercept do_IRQ_intercept:-	.long	do_IRQ;+#ifdef CONFIG_IPIPE+	.long   __ipipe_grab_irq+#else /* !CONFIG_IPIPE */+	.long	do_IRQ+#endif /* CONFIG_IPIPE */ 	.long	ret_from_intercept  /* Alignment exception */@@ -268,7 +272,11 @@ Decrementer: 	bl	transfer_to_handler 	.globl	timer_interrupt_intercept timer_interrupt_intercept:-	.long	timer_interrupt+#ifdef CONFIG_IPIPE+	.long   __ipipe_grab_timer+#else /* !CONFIG_IPIPE */+	.long   timer_interrupt+#endif /* CONFIG_IPIPE */ 	.long	ret_from_intercept  	STD_EXCEPTION(0xa00, Trap_0a, UnknownException)diff -uNrp 2.4.25-ppc/arch/ppc/kernel/head_e500.S 2.4.25-ppc-ipipe/arch/ppc/kernel/head_e500.S--- 2.4.25-ppc/arch/ppc/kernel/head_e500.S	2005-03-16 00:12:45.000000000 +0100+++ 2.4.25-ppc-ipipe/arch/ppc/kernel/head_e500.S	2005-11-09 15:15:31.000000000 +0100@@ -618,7 +618,11 @@ interrupt_base: 	li      r4,0 	bl      transfer_to_handler _GLOBAL(do_IRQ_intercept)-	.long   do_IRQ+#ifdef CONFIG_IPIPE+	.long	__ipipe_grab_irq+#else /* !CONFIG_IPIPE */+	.long	do_IRQ+#endif /* CONFIG_IPIPE */ 	.long   ret_from_intercept 	.long	0x500 @@ -669,7 +673,11 @@ _GLOBAL(do_IRQ_intercept) 	li      r20,MSR_KERNEL 	bl      transfer_to_handler _GLOBAL(timer_interrupt_intercept)-	.long   timer_interrupt+#ifdef CONFIG_IPIPE+	.long	__ipipe_grab_timer+#else /* !CONFIG_IPIPE */+	.long	timer_interrupt+#endif /* CONFIG_IPIPE */ 	.long   ret_from_intercept 	.long	0x900 diff -uNrp 2.4.25-ppc/arch/ppc/kernel/idle.c 2.4.25-ppc-ipipe/arch/ppc/kernel/idle.c--- 2.4.25-ppc/arch/ppc/kernel/idle.c	2003-10-30 01:32:14.000000000 +0100+++ 2.4.25-ppc-ipipe/arch/ppc/kernel/idle.c	2005-11-09 15:37:16.000000000 +0100@@ -50,6 +50,7 @@ int idled(void) 	current->counter = -100; 	init_idle(); 	for (;;) {+		ipipe_suspend_domain(); #ifdef CONFIG_SMP 		if (!do_power_save) { 			/*diff -uNrp 2.4.25-ppc/arch/ppc/kernel/ipipe-core.c 2.4.25-ppc-ipipe/arch/ppc/kernel/ipipe-core.c--- 2.4.25-ppc/arch/ppc/kernel/ipipe-core.c	1970-01-01 01:00:00.000000000 +0100+++ 2.4.25-ppc-ipipe/arch/ppc/kernel/ipipe-core.c	2006-01-04 17:41:22.000000000 +0100@@ -0,0 +1,381 @@+/* -*- linux-c -*-+ * linux/arch/ppc/kernel/ipipe-core.c+ *+ * Copyright (C) 2002-2005 Philippe Gerum.+ * Copyright (C) 2004 Wolfgang Grandegger (Adeos/ppc port over 2.4).+ * Copyright (C) 2005 Heikki Lindholm (PowerPC 970 fixes).+ *+ * 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.+ *+ * Architecture-dependent I-PIPE core support for PowerPC.+ */++#include <linux/config.h>+#include <linux/kernel.h>+#include <linux/smp.h>+#include <linux/sched.h>+#include <linux/slab.h>+#include <linux/bitops.h>+#include <linux/interrupt.h>+#include <linux/irq.h>+#include <linux/module.h>+#include <asm/system.h>+#include <asm/atomic.h>+#include <asm/hardirq.h>+#include <asm/io.h>+#include <asm/time.h>++/* Current reload value for the decrementer. */+unsigned long __ipipe_decr_ticks;++/* Next tick date (timebase value). */+unsigned long long __ipipe_decr_next[IPIPE_NR_CPUS];++struct pt_regs __ipipe_tick_regs[IPIPE_NR_CPUS];++static inline unsigned long ffnz(unsigned long ul)+{++	__asm__ __volatile__("cntlzw %0, %1":"=r"(ul):"r"(ul & (-ul)));+	return 31 - ul;+}++#ifdef CONFIG_POWER4+extern struct irqaction k2u3_cascade_action;+extern int openpic2_get_irq(struct pt_regs *regs);+#endif++#ifdef CONFIG_SMP++static cpumask_t __ipipe_cpu_sync_map;++static cpumask_t __ipipe_cpu_lock_map;++static ipipe_spinlock_t __ipipe_cpu_barrier = IPIPE_SPIN_LOCK_UNLOCKED;++static atomic_t __ipipe_critical_count = ATOMIC_INIT(0);++static void (*__ipipe_cpu_sync) (void);++/* Always called with hw interrupts off. */++void __ipipe_do_critical_sync(unsigned irq)+{+	ipipe_declare_cpuid;++	ipipe_load_cpuid();++	cpu_set(cpuid, __ipipe_cpu_sync_map);++	/*+	 * Now we are in sync with the lock requestor running on another+	 * CPU. Enter a spinning wait until he releases the global+	 * lock.+	 */+	spin_lock_hw(&__ipipe_cpu_barrier);++	/* Got it. Now get out. */++	if (__ipipe_cpu_sync)+		/* Call the sync routine if any. */+		__ipipe_cpu_sync();++	spin_unlock_hw(&__ipipe_cpu_barrier);++	cpu_clear(cpuid, __ipipe_cpu_sync_map);+}++#endif	/* CONFIG_SMP */++/*+ * ipipe_critical_enter() -- Grab the superlock excluding all CPUs+ * but the current one from a critical section. This lock is used when+ * we must enforce a global critical section for a single CPU in a+ * possibly SMP system whichever context the CPUs are running.+ */+unsigned long ipipe_critical_enter(void (*syncfn) (void))+{+	unsigned long flags;++	local_irq_save_hw(flags);++#ifdef CONFIG_SMP+	if (num_online_cpus() > 1) {	/* We might be running a SMP-kernel on a UP box... */+		ipipe_declare_cpuid;+		cpumask_t lock_map;++		ipipe_load_cpuid();++		if (!cpu_test_and_set(cpuid, __ipipe_cpu_lock_map)) {+			while (cpu_test_and_set(BITS_PER_LONG - 1,+						__ipipe_cpu_lock_map)) {+				int n = 0;+				do {+					cpu_relax();+				} while (++n < cpuid);+			}++			spin_lock_hw(&__ipipe_cpu_barrier);++			__ipipe_cpu_sync = syncfn;++			/* Send the sync IPI to all processors but the current one. */+			send_IPI_allbutself(IPIPE_CRITICAL_VECTOR);++			cpus_andnot(lock_map, cpu_online_map,+				    __ipipe_cpu_lock_map);++			while (!cpus_equal(__ipipe_cpu_sync_map, lock_map))+				cpu_relax();+		}++		atomic_inc(&__ipipe_critical_count);+	}+#endif	/* CONFIG_SMP */++	return flags;+}++/* ipipe_critical_exit() -- Release the superlock. */++void ipipe_critical_exit(unsigned long flags)+{+#ifdef CONFIG_SMP+	if (num_online_cpus() > 1) {	/* We might be running a SMP-kernel on a UP box... */+		ipipe_declare_cpuid;++		ipipe_load_cpuid();++		if (atomic_dec_and_test(&__ipipe_critical_count)) {+			spin_unlock_hw(&__ipipe_cpu_barrier);+

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -