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

📄 adeos-ipipe-2.6.14-i386-1.2-01.patch

📁 xenomai 很好的linux实时补丁
💻 PATCH
📖 第 1 页 / 共 5 页
字号:
--- 2.6.14/drivers/pci/msi.c	2005-10-28 02:02:08.000000000 +0200+++ 2.6.14-ipipe/drivers/pci/msi.c	2006-02-16 18:04:49.000000000 +0100@@ -146,6 +146,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;@@ -209,7 +224,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_irq_affinity };@@ -225,7 +240,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_irq_affinity };@@ -241,7 +256,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_irq_affinity };--- 2.6.14/include/linux/hardirq.h	2005-10-28 02:02:08.000000000 +0200+++ 2.6.14-ipipe/include/linux/hardirq.h	2005-10-31 10:15:18.000000000 +0100@@ -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 */  #ifndef CONFIG_VIRT_CPU_ACCOUNTING static inline void account_user_vtime(struct task_struct *tsk)--- 2.6.14/include/linux/ipipe.h	1970-01-01 01:00:00.000000000 +0100+++ 2.6.14-ipipe/include/linux/ipipe.h	2006-02-11 18:27:51.000000000 +0100@@ -0,0 +1,796 @@+/* -*- linux-c -*-+ * include/linux/ipipe.h+ *+ * Copyright (C) 2002-2005 Philippe Gerum.+ *+ * 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_H+#define __LINUX_IPIPE_H++#include <linux/config.h>+#include <linux/spinlock.h>+#include <linux/cache.h>+#include <asm/ipipe.h>++#ifdef CONFIG_IPIPE++#define IPIPE_VERSION_STRING	IPIPE_ARCH_STRING+#define IPIPE_RELEASE_NUMBER	((IPIPE_MAJOR_NUMBER << 16) | \+				 (IPIPE_MINOR_NUMBER <<  8) | \+				 (IPIPE_PATCH_NUMBER))++#ifndef BROKEN_BUILTIN_RETURN_ADDRESS+#define __BUILTIN_RETURN_ADDRESS0 ((unsigned long)__builtin_return_address(0))+#define __BUILTIN_RETURN_ADDRESS1 ((unsigned long)__builtin_return_address(1))+#endif /* !BUILTIN_RETURN_ADDRESS */++#define IPIPE_ROOT_PRIO		100+#define IPIPE_ROOT_ID		0+#define IPIPE_ROOT_NPTDKEYS	4	/* Must be <= BITS_PER_LONG */++#define IPIPE_RESET_TIMER	0x1+#define IPIPE_GRAB_TIMER	0x2++/* Global domain flags */+#define IPIPE_SPRINTK_FLAG	0	/* Synchronous printk() allowed */++#define IPIPE_STALL_FLAG	0	/* Stalls a pipeline stage */+#define IPIPE_SYNC_FLAG		1	/* The interrupt syncer is running for the domain */++#define IPIPE_HANDLE_FLAG	0+#define IPIPE_PASS_FLAG		1+#define IPIPE_ENABLE_FLAG	2+#define IPIPE_DYNAMIC_FLAG	IPIPE_HANDLE_FLAG+#define IPIPE_STICKY_FLAG	3+#define IPIPE_SYSTEM_FLAG	4+#define IPIPE_LOCK_FLAG		5+#define IPIPE_SHARED_FLAG	6+#define IPIPE_EXCLUSIVE_FLAG	31	/* ipipe_catch_event() is the reason why. */++#define IPIPE_HANDLE_MASK	(1 << IPIPE_HANDLE_FLAG)+#define IPIPE_PASS_MASK		(1 << IPIPE_PASS_FLAG)+#define IPIPE_ENABLE_MASK	(1 << IPIPE_ENABLE_FLAG)+#define IPIPE_DYNAMIC_MASK	IPIPE_HANDLE_MASK+#define IPIPE_EXCLUSIVE_MASK	(1 << IPIPE_EXCLUSIVE_FLAG)+#define IPIPE_STICKY_MASK	(1 << IPIPE_STICKY_FLAG)+#define IPIPE_SYSTEM_MASK	(1 << IPIPE_SYSTEM_FLAG)+#define IPIPE_LOCK_MASK		(1 << IPIPE_LOCK_FLAG)+#define IPIPE_SHARED_MASK	(1 << IPIPE_SHARED_FLAG)+#define IPIPE_SYNC_MASK		(1 << IPIPE_SYNC_FLAG)++#define IPIPE_DEFAULT_MASK	(IPIPE_HANDLE_MASK|IPIPE_PASS_MASK)+#define IPIPE_STDROOT_MASK	(IPIPE_HANDLE_MASK|IPIPE_PASS_MASK|IPIPE_SYSTEM_MASK)++#define IPIPE_EVENT_SELF        0x80000000++/* Number of virtual IRQs */+#define IPIPE_NR_VIRQS		BITS_PER_LONG+/* First virtual IRQ # */+#define IPIPE_VIRQ_BASE		(((IPIPE_NR_XIRQS + BITS_PER_LONG - 1) / BITS_PER_LONG) * BITS_PER_LONG)+/* Total number of IRQ slots */+#define IPIPE_NR_IRQS		(IPIPE_VIRQ_BASE + IPIPE_NR_VIRQS)+/* Number of indirect words needed to map the whole IRQ space. */+#define IPIPE_IRQ_IWORDS	((IPIPE_NR_IRQS + BITS_PER_LONG - 1) / BITS_PER_LONG)+#define IPIPE_IRQ_IMASK		(BITS_PER_LONG - 1)+#define IPIPE_IRQMASK_ANY	(~0L)+#define IPIPE_IRQMASK_VIRT	(IPIPE_IRQMASK_ANY << (IPIPE_VIRQ_BASE / BITS_PER_LONG))++#ifdef CONFIG_SMP++#define IPIPE_NR_CPUS		NR_CPUS+#define ipipe_declare_cpuid	int cpuid+#define ipipe_load_cpuid()	do { \+					(cpuid) = ipipe_processor_id();	\+				} while(0)+#define ipipe_lock_cpu(flags)	do { \+					local_irq_save_hw(flags); \+					(cpuid) = ipipe_processor_id(); \+				} while(0)+#define ipipe_unlock_cpu(flags)	local_irq_restore_hw(flags)+#define ipipe_get_cpu(flags)	ipipe_lock_cpu(flags)+#define ipipe_put_cpu(flags)	ipipe_unlock_cpu(flags)+#define ipipe_current_domain	(ipipe_percpu_domain[ipipe_processor_id()])++#else /* !CONFIG_SMP */++#define IPIPE_NR_CPUS		1+#define ipipe_declare_cpuid	const int cpuid = 0+#define ipipe_load_cpuid()	do { } while(0)+#define ipipe_lock_cpu(flags)	local_irq_save_hw(flags)+#define ipipe_unlock_cpu(flags)	local_irq_restore_hw(flags)+#define ipipe_get_cpu(flags)	do { (void)(flags); } while(0)+#define ipipe_put_cpu(flags)	do { } while(0)+#define ipipe_current_domain	(ipipe_percpu_domain[0])++#endif /* CONFIG_SMP */++#define ipipe_virtual_irq_p(irq)	((irq) >= IPIPE_VIRQ_BASE && \+					 (irq) < IPIPE_NR_IRQS)++typedef void (*ipipe_irq_handler_t)(unsigned irq,+				    void *cookie);++typedef int (*ipipe_irq_ackfn_t)(unsigned irq);++#define IPIPE_SAME_HANDLER	((ipipe_irq_handler_t)(-1))++struct ipipe_domain {++	struct list_head p_link;	/* Link in pipeline */++	struct ipcpudata {+		unsigned long status;+		unsigned long irq_pending_hi;+		unsigned long irq_pending_lo[IPIPE_IRQ_IWORDS];+		struct ipirqcnt {+			unsigned long pending_hits;+			unsigned long total_hits;+		} irq_counters[IPIPE_NR_IRQS];+	} ____cacheline_aligned_in_smp cpudata[IPIPE_NR_CPUS];++	struct {+		unsigned long control;+		ipipe_irq_ackfn_t acknowledge;+		ipipe_irq_handler_t handler;+		void *cookie;+	} ____cacheline_aligned irqs[IPIPE_NR_IRQS];++	int (*evhand[IPIPE_NR_EVENTS])(unsigned event,+				       struct ipipe_domain *from,+				       void *data); /* Event handlers. */+	unsigned long long evself;	/* Self-monitored event bits. */++#ifdef CONFIG_IPIPE_STATS+	struct ipipe_stats { /* All in timebase units. */+		unsigned long long last_stall_date;+		unsigned long last_stall_eip;+		unsigned long max_stall_time;+		unsigned long max_stall_eip;+		struct ipipe_irq_stats {+			unsigned long long last_receipt_date;+			unsigned long max_delivery_time;+		} irq_stats[IPIPE_NR_IRQS];+	} ____cacheline_aligned_in_smp stats[IPIPE_NR_CPUS];+#endif /* CONFIG_IPIPE_STATS */+	unsigned long flags;+	unsigned domid;+	const char *name;+	int priority;+	void *pdd;+};++struct ipipe_domain_attr {++	unsigned domid;		/* Domain identifier -- Magic value set by caller */+	const char *name;	/* Domain name -- Warning: won't be dup'ed! */+	int priority;		/* Priority in interrupt pipeline */+	void (*entry) (void);	/* Domain entry point */+	void *pdd;		/* Per-domain (opaque) data pointer */+};++/* The following macros must be used hw interrupts off. */++#define __ipipe_irq_cookie(ipd,irq)	(ipd)->irqs[irq].cookie+#define __ipipe_irq_handler(ipd,irq)	(ipd)->irqs[irq].handler++#define __ipipe_cpudata_irq_hits(ipd,cpuid,irq)	((ipd)->cpudata[cpuid].irq_counters[irq].total_hits)++#define __ipipe_set_irq_bit(ipd,cpuid,irq) \+do { \+	if (!test_bit(IPIPE_LOCK_FLAG,&(ipd)->irqs[irq].control)) { \+		__set_bit(irq & IPIPE_IRQ_IMASK,&(ipd)->cpudata[cpuid].irq_pending_lo[irq >> IPIPE_IRQ_ISHIFT]); \+		__set_bit(irq >> IPIPE_IRQ_ISHIFT,&(ipd)->cpudata[cpuid].irq_pending_hi); \+	} \+} while(0)++#define __ipipe_clear_pend(ipd,cpuid,irq) \+do { \+	__clear_bit(irq & IPIPE_IRQ_IMASK,&(ipd)->cpudata[cpuid].irq_pending_lo[irq >> IPIPE_IRQ_ISHIFT]); \+	if ((ipd)->cpudata[cpuid].irq_pending_lo[irq >> IPIPE_IRQ_ISHIFT] == 0) \+		__clear_bit(irq >> IPIPE_IRQ_ISHIFT,&(ipd)->cpudata[cpuid].irq_pending_hi); \+} while(0)++#define __ipipe_lock_irq(ipd,cpuid,irq) \+do { \+	if (!test_and_set_bit(IPIPE_LOCK_FLAG,&(ipd)->irqs[irq].control)) \+		__ipipe_clear_pend(ipd,cpuid,irq); \+} while(0)++#define __ipipe_unlock_irq(ipd,irq) \+do { \+	int __cpuid, __nr_cpus = num_online_cpus(); \+	if (test_and_clear_bit(IPIPE_LOCK_FLAG,&(ipd)->irqs[irq].control)) \+		for (__cpuid = 0; __cpuid < __nr_cpus; __cpuid++) \+			if ((ipd)->cpudata[__cpuid].irq_counters[irq].pending_hits > 0) { /* We need atomic ops next. */ \+				set_bit(irq & IPIPE_IRQ_IMASK,&(ipd)->cpudata[__cpuid].irq_pending_lo[irq >> IPIPE_IRQ_ISHIFT]); \+				set_bit(irq >> IPIPE_IRQ_ISHIFT,&(ipd)->cpudata[__cpuid].irq_pending_hi); \+			} \+} while(0)++#define __ipipe_clear_irq(ipd,irq) \+do { \+	int __cpuid, __nr_cpus = num_online_cpus(); \+	clear_bit(IPIPE_LOCK_FLAG,&(ipd)->irqs[irq].control); \+	for (__cpuid = 0; __cpuid < __nr_cpus; __cpuid++) { \+		(ipd)->cpudata[__cpuid].irq_counters[irq].pending_hits = 0; \+		__ipipe_clear_pend(ipd,__cpuid,irq); \+	} \+} while(0)++#ifdef __RAW_SPIN_LOCK_UNLOCKED+#define spin_lock_hw(x)			_raw_spin_lock(x)+#define spin_trylock_hw(x)		_raw_spin_trylock(x)+#define spin_unlock_hw(x)		_raw_spin_unlock(x)+#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)+#define write_lock_hw(x)		_raw_write_lock(x)+#define write_trylock_hw(x)		_raw_write_trylock(x)+#define write_unlock_hw(x)		_raw_write_unlock(x)+#define read_lock_hw(x)			_raw_read_lock(x)+#define read_trylock_hw(x)		_raw_read_trylock(x)+#define read_unlock_hw(x)		_raw_read_unlock(x)+#else /* UP non-debug */+#define write_lock_hw(lock)		do { (void)(lock); } while (0)+#define write_trylock_hw(lock)		({ (void)(lock); 1; })+#define write_unlock_hw(lock)		do { (void)(lock); } while (0)+#define read_lock_hw(lock)		do { (void)(lock); } while (0)+#define read_trylock_hw(lock)		({ (void)(lock); 1; })+#define read_unlock_hw(lock)		do { (void)(lock); } while (0)+#endif /* CONFIG_SMP || CONFIG_DEBUG_SPINLOCK */+#else	/* !__RAW_SPIN_LOCK_UNLOCKED */+#define spin_lock_hw(x)			_spin_lock(x)+#define spin_unlock_hw(x)		_spin_unlock(x)+#define spin_trylock_hw(x)		_spin_trylock(x)+#define write_lock_hw(x)		_write_lock(x)+#define write_unlock_hw(x)		_write_unlock(x)+#define write_trylock_hw(x)		_write_trylock(x)+#define read_lock_hw(x)			_read_lock(x)+#define read_unlock_hw(x)		_read_unlock(x)+#endif	/* __RAW_SPIN_LOCK_UNLOCKED */++typedef spinlock_t			ipipe_spinlock_t;+typedef rwlock_t			ipipe_rwlock_t;+#define IPIPE_SPIN_LOCK_UNLOCKED	SPIN_LOCK_UNLOCKED+#define IPIPE_RW_LOCK_UNLOCKED		RW_LOCK_UNLOCKED++#define spin_lock_irqsave_hw(x,flags)		\+do {						\+	local_irq_save_hw(flags);		\+	spin_lock_hw(x);			\+} while (0)++#define spin_unlock_irqrestore_hw(x,flags)	\+do {						\+	spin_unlock_hw(x);			\+	local_irq_restore_hw(flags);		\+} while (0)++#define spin_lock_irq_hw(x)			\+do {						\+	local_irq_disable_hw();			\+	spin_lock_hw(x);			\+} while (0)++#define spin_unlock_irq_hw(x)			\+do {						\+	spin_unlock_hw(x);			\+	local_irq_enable_hw();			\+} while (0)++#define read_lock_irqsave_hw(lock, flags)	\+do {						\+	local_irq_save_hw(flags);		\+	read_lock_hw(lock);			\+} while (0)++#define read_unlock_irqrestore_hw(lock, flags)	\+do {						\+	read_unlock_hw(lock);			\+	local_irq_restore_hw(flags);		\+} while (0)++#define write_lock_irqsave_hw(lock, flags)	\+do {						\+	local_irq_save_hw(flags);		\+	write_lock_hw(lock);			\+} while (0)++#define write_unlock_irqrestore_hw(lock, flags)	\+do {						\+	write_unlock_hw(lock);			\+	local_irq_restore_hw(flags);		\+} while (0)++extern struct ipipe_domain *ipipe_percpu_domain[], *ipipe_root_domain;++extern unsigned __ipipe_printk_virq;++extern unsigned long __ipipe_virtual_irq_map;++extern struct list_head __ipipe_pipeline;++extern ipipe_spinlock_t __ipipe_pipelock;++extern int __ipipe_event_monitors[];++/* Private interface */++void ipipe_init(void);++#ifdef CONFIG_PROC_FS+void ipipe_init_proc(void);++#ifdef CONFIG_IPIPE_TRACE+void __ipipe_init_trace_proc(void);+#else /* !CONFIG_IPIPE_TRACE */+#define __ipipe_init_trace_proc()   do { } while(0)+#endif /* CONFIG_IPIPE_TRACE */++#else	/* !CONFIG_PROC_FS */+#define ipipe_init_proc()	do { } while(0)+#endif	/* CONFIG_PROC_FS */++void __ipipe_init_stage(struct ipipe_domain *ipd);++void __ipipe_cleanup_domain(struct ipipe_domain *ipd);++void __ipipe_add_domain_proc(struct ipipe_domain *ipd);++void __ipipe_remove_domain_proc(struct ipipe_domain *ipd);++void __ipipe_flush_printk(unsigned irq, void *cookie);++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 fastcall __ipipe_restore_root(unsigned long flags);++int fastcall __ipipe_schedule_irq(unsigned irq, struct list_head *head);++int fastcall __ipipe_dispatch_event(unsigned event, void *data);++#define __ipipe_pipeline_head_p(ipd) (&(ipd)->p_link == __ipipe_pipeline.next)++#define __ipipe_event_pipelined_p(ev) \+	(__ipipe_event_monitors[ev] > 0 || (ipipe_current_domain->evself & (1LL << ev)))++#ifdef CONFIG_SMP++cpumask_t __ipipe_set_irq_affinity(unsigned irq,+				   cpumask_t cpumask);++int fastcall __ipipe_send_ipi(unsigned ipi,+			      cpumask_t cpumask);++#endif /* CONFIG_SMP */++/* Called with hw interrupts off. */+static inline void __ipipe_switch_to(struct ipipe_domain *out,+				     struct ipipe_domain *in, int cpuid)+{+	void ipipe_suspend_domain(void);+

⌨️ 快捷键说明

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