📄 rthal5g-2.4.22.patch
字号:
diff -Nur -X dontdiff.dat linux-2.4.22.orig/arch/mips/config-shared.in linux-2.4.22/arch/mips/config-shared.in--- linux-2.4.22.orig/arch/mips/config-shared.in 2003-08-27 16:14:26.000000000 -0700+++ linux-2.4.22/arch/mips/config-shared.in 2003-08-20 09:45:44.000000000 -0700@@ -534,6 +534,7 @@ define_bool CONFIG_NONCOHERENT_IO y define_bool CONFIG_DUMMY_KEYB y define_bool CONFIG_SCSI n+ define_bool CONFIG_ISA y #steve fi if [ "$CONFIG_NEC_EAGLE" = "y" ]; then define_bool CONFIG_IRQ_CPU y@@ -772,6 +773,7 @@ else define_bool CONFIG_CPU_HAS_SYNC y fi+bool 'Real-Time Hardware Abstraction Layer (RTAI)' CONFIG_RTHAL endmenu #diff -Nur -X dontdiff.dat linux-2.4.22.orig/arch/mips/kernel/entry.S linux-2.4.22/arch/mips/kernel/entry.S--- linux-2.4.22.orig/arch/mips/kernel/entry.S 2003-08-27 16:14:29.000000000 -0700+++ linux-2.4.22/arch/mips/kernel/entry.S 2003-08-27 13:20:36.000000000 -0700@@ -6,7 +6,10 @@ * Copyright (C) 1994 - 2000, 2001 by Ralf Baechle * Copyright (C) 1999, 2000 Silicon Graphics, Inc. * Copyright (C) 2001 MIPS Technologies, Inc.+ *+ * rthal mods by Steven Seeger (sseeger@stellartec.com) 16Apr03 */+ #include <linux/config.h> #include <linux/init.h> #include <linux/sys.h>@@ -26,7 +29,6 @@ #include <asm/unistd.h> #include <asm/isadep.h> - .text .align 5 .set push@@ -36,19 +38,40 @@ lw t0, PT_STATUS(sp) # returning to kernel mode? andi t0, t0, KU_USER beqz t0, restore_all-+ nop FEXPORT(ret_from_sys_call) # here to prevent code duplication ret_from_schedule:+#ifndef CONFIG_RTHAL mfc0 t0, CP0_STATUS # need_resched and signals atomic test ori t0, t0, 1 xori t0, t0, 1 mtc0 t0, CP0_STATUS SSNOP; SSNOP; SSNOP-+#else+ mfc0 t0, CP0_STATUS+ ori t0, t0, 1+ mtc0 t0, CP0_STATUS+ nop+ nop+ nop++ lw t0, (rthal + 16) //cli+ nop+ jalr t0+ nop+#endif lw v0, TASK_NEED_RESCHED($28) lw v1, TASK_SIGPENDING($28) bnez v0, reschedule bnez v1, signal_return++#ifdef CONFIG_RTHAL+ lw t0, (rthal + 20) /* sti */+ nop+ jalr t0+ nop+#endif + restore_all: .set noat RESTORE_ALL_AND_RET .set at@@ -56,20 +79,27 @@ /* Put this behind restore_all for the sake of the branch prediction. */ signal_return: .type signal_return, @function-+#ifndef CONFIG_RTHAL mfc0 t0, CP0_STATUS ori t0, t0, 1 mtc0 t0, CP0_STATUS+#else+ lw t0, (rthal+20) //sti+ nop+ jalr t0+ nop+#endif move a0, zero move a1, sp jal do_signal b restore_all+ nop reschedule: jal schedule b ret_from_schedule-+ nop /* * Common spurious interrupt handler. */@@ -173,14 +203,14 @@ */ #define __BUILD_clear_none(exception) #define __BUILD_clear_sti(exception) \- STI+ STI #define __BUILD_clear_cli(exception) \- CLI+ CLI #define __BUILD_clear_fpe(exception) \ cfc1 a1,fcr31; \ li a2,~(0x3f<<12); \ and a2,a1; \- ctc1 a2,fcr31; \+ ctc1 a2,fcr31; STI #define __BUILD_clear_ade(exception) \ .set reorder; \@@ -227,7 +257,7 @@ BUILD_HANDLER(ibe,be,cli,silent) /* #6 */ BUILD_HANDLER(dbe,be,cli,silent) /* #7 */ BUILD_HANDLER(bp,bp,sti,silent) /* #9 */- BUILD_HANDLER(ri,ri,sti,silent) /* #10 */+ BUILD_HANDLER(ri,ri,sti,silent) /* #10 */ BUILD_HANDLER(cpu,cpu,sti,silent) /* #11 */ BUILD_HANDLER(ov,ov,sti,silent) /* #12 */ BUILD_HANDLER(tr,tr,sti,silent) /* #13 */diff -Nur -X dontdiff.dat linux-2.4.22.orig/arch/mips/kernel/head.S linux-2.4.22/arch/mips/kernel/head.S--- linux-2.4.22.orig/arch/mips/kernel/head.S 2003-08-27 16:14:29.000000000 -0700+++ linux-2.4.22/arch/mips/kernel/head.S 2003-08-11 12:20:29.000000000 -0700@@ -151,11 +151,12 @@ .set mips0 END(nmi_handler) - __INIT+// __INIT //move kernel entry up so my bootloader doesn't barf steve s. /* * Kernel entry point */+ NESTED(kernel_entry, 16, sp) .set noreorder @@ -184,7 +185,7 @@ nop END(kernel_entry) -+ __INIT #ifdef CONFIG_SMP /*diff -Nur -X dontdiff.dat linux-2.4.22.orig/arch/mips/kernel/irq.c linux-2.4.22/arch/mips/kernel/irq.c--- linux-2.4.22.orig/arch/mips/kernel/irq.c 2003-08-27 16:14:29.000000000 -0700+++ linux-2.4.22/arch/mips/kernel/irq.c 2003-08-27 09:44:18.000000000 -0700@@ -7,6 +7,8 @@ * * Copyright (C) 1992 Linus Torvalds * Copyright (C) 1994 - 2000 Ralf Baechle+ * + * rthal mods by Steven Seeger (sseeger@stellartec.com) 16Apr03 */ #include <linux/config.h> #include <linux/kernel.h>@@ -412,7 +414,14 @@ * SMP cross-CPU interrupts have their own specific * handlers). */-asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs)++asmlinkage unsigned int +#ifdef CONFIG_RTHAL+ _do_IRQ+#else+ do_IRQ+#endif + (int irq, struct pt_regs *regs) { /* * We ack quickly, we don't want the irq controller@@ -493,6 +502,22 @@ return 1; } +#ifdef CONFIG_RTHAL++/* Ok here is where the fun begins. Since I'm trying to be nice to all boards,+ * I'm going to put the RTHAL stuff here. Our do_IRQ function will handle+ * the RTHAL gate. However, I am using only a VR4181 for MIPS right now+ * and I know this will work. If other boards' specific interrupt handlers+ * go to functions other than this do_IRQ, they'll have to fiddle with their+ * interrupt handlers. */++asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs)+{+ return rthal.mips_interrupt(irq, regs);+}++#endif //CONFIG_RTHAL+ /** * request_irq - allocate an interrupt line * @irq: Interrupt line to allocate@@ -1063,3 +1088,76 @@ for (i = 0; i < NR_IRQS; i++) register_irq_proc(i); }++#ifdef CONFIG_RTHAL++static void linux_cli(void)+{ + hard_cli();+}++static void linux_sti(void)+{ + hard_sti(); +}++static unsigned long linux_save_flags(void)+{+ unsigned long flags;+ + hard_save_flags(flags);+ + return flags;+}++static void linux_restore_flags(unsigned long flags)+{+ hard_restore_flags(flags);+}++static unsigned long linux_save_flags_and_cli(void)+{+ unsigned long flags;+ + hard_save_flags_and_cli(flags);+ return flags;+}++static unsigned long linux_save_flags_and_sti(void)+{+ unsigned long flags;+ + hard_save_flags_and_sti(flags);+ return flags;+}++static asmlinkage long long rtai_srq_interrupt(unsigned int srq, unsigned int args)+{+ return 1;+}++extern void *ret_from_irq;+extern void linux_mips_timer_intr(int irq, void *dev_id, struct pt_regs *);+extern void linux_soft_mips_timer_intr(int irq, void *dev_id, struct pt_regs *);++asmlinkage struct rt_hal rthal =+{+ ret_from_intr: &ret_from_irq,+ mips_interrupt: _do_IRQ,+ mips_timer_interrupt: 0, //not used anymore+ rtai_srq_interrupt: rtai_srq_interrupt,+ disint: linux_cli,+ enint: linux_sti,+ rtai_active: 0,+ getflags: linux_save_flags,+ setflags: linux_restore_flags,+ getflags_and_cli: linux_save_flags_and_cli,+ irq_desc: irq_desc,+ tsc: {tsc: 0LL},+ linux_mips_timer_intr: linux_mips_timer_intr,+ linux_soft_mips_timer_intr: linux_soft_mips_timer_intr,+ getflags_and_sti: linux_save_flags_and_sti,+ soft_enint: linux_sti+};++#endif //CONFIG_RTHALdiff -Nur -X dontdiff.dat linux-2.4.22.orig/arch/mips/kernel/mips_ksyms.c linux-2.4.22/arch/mips/kernel/mips_ksyms.c--- linux-2.4.22.orig/arch/mips/kernel/mips_ksyms.c 2003-08-27 16:14:29.000000000 -0700+++ linux-2.4.22/arch/mips/kernel/mips_ksyms.c 2003-08-26 07:48:36.000000000 -0700@@ -6,7 +6,10 @@ * for more details. * * Copyright (C) 1996, 1997, 1998, 2000, 2001 by Ralf Baechle+ * + * rthal mods by Steven Seeger (sseeger@stellartec.com) 16Apr03 */+ #include <linux/config.h> #include <linux/module.h> #include <linux/string.h>@@ -40,6 +43,23 @@ extern long __strnlen_user_nocheck_asm(const char *s); extern long __strnlen_user_asm(const char *s); +//extern void flush_dcache_page(struct page *page);+//EXPORT_SYMBOL(flush_dcache_page);++extern unsigned long cycles_per_jiffy;+EXPORT_SYMBOL(cycles_per_jiffy);++#ifdef CONFIG_RTHAL+/*+ * RTHAL exports+ */+extern struct rt_hal rthal;+EXPORT_SYMBOL(rthal);+extern unsigned int mips_hpt_frequency;+EXPORT_SYMBOL(mips_hpt_frequency);+#include <linux/console.h>+EXPORT_SYMBOL(console_drivers);+#endif EXPORT_SYMBOL(mips_machtype); #ifdef CONFIG_EISA EXPORT_SYMBOL(EISA_bus);diff -Nur -X dontdiff.dat linux-2.4.22.orig/arch/mips/kernel/proc.c linux-2.4.22/arch/mips/kernel/proc.c--- linux-2.4.22.orig/arch/mips/kernel/proc.c 2003-08-27 16:14:29.000000000 -0700+++ linux-2.4.22/arch/mips/kernel/proc.c 2003-08-11 12:20:29.000000000 -0700@@ -115,6 +115,10 @@ seq_printf(m, fmt, 'D', vced_count); seq_printf(m, fmt, 'I', vcei_count); +//#ifndef CONFIG_CPU_HAS_LLSC+// seq_printf(m, "ll emulations\t\t: %lu\n", ll_ops);+// seq_printf(m, "sc emulations\t\t: %lu\n", sc_ops);+//#endif return 0; } diff -Nur -X dontdiff.dat linux-2.4.22.orig/arch/mips/kernel/r4k_switch.S linux-2.4.22/arch/mips/kernel/r4k_switch.S--- linux-2.4.22.orig/arch/mips/kernel/r4k_switch.S 2003-08-27 16:14:29.000000000 -0700+++ linux-2.4.22/arch/mips/kernel/r4k_switch.S 2003-08-12 14:38:02.000000000 -0700@@ -47,8 +47,8 @@ #ifndef CONFIG_CPU_HAS_LLSC sw zero, ll_bit #endif- mfc0 t1, CP0_STATUS- sw t1, THREAD_STATUS(a0)+// mfc0 t1, CP0_STATUS+// sw t1, THREAD_STATUS(a0) CPU_SAVE_NONSCRATCH(a0) sw ra, THREAD_REG31(a0) @@ -95,14 +95,14 @@ #else sw t0, kernelsp #endif- mfc0 t1, CP0_STATUS /* Do we really need this? */- li a3, 0xff00- and t1, a3- lw a2, THREAD_STATUS($28)- nor a3, $0, a3- and a2, a3- or a2, t1- mtc0 a2, CP0_STATUS+// mfc0 t1, CP0_STATUS /* Do we really need this? */+// li a3, 0xff00+// and t1, a3+// lw a2, THREAD_STATUS($28)+// nor a3, $0, a3+// and a2, a3+// or a2, t1+// mtc0 a2, CP0_STATUS jr ra move v0, a0 END(resume)diff -Nur -X dontdiff.dat linux-2.4.22.orig/arch/mips/kernel/scall_o32.S linux-2.4.22/arch/mips/kernel/scall_o32.S--- linux-2.4.22.orig/arch/mips/kernel/scall_o32.S 2003-08-27 16:14:29.000000000 -0700+++ linux-2.4.22/arch/mips/kernel/scall_o32.S 2003-08-26 09:55:56.000000000 -0700@@ -5,7 +5,10 @@ * * Copyright (C) 1997, 1998, 1999, 2000, 2001 by Ralf Baechle * Copyright (C) 2001 MIPS Technologies, Inc.+ *+ * rthal modifications by Steven Seeger (sseeger@stellartec.com) 16Apr03 */+ #include <linux/config.h> #include <linux/errno.h> #include <asm/asm.h>@@ -28,11 +31,30 @@ .set at lw t1, PT_EPC(sp) # skip syscall on return+ addiu t1, 4 # skip to next instruction+ sw t1, PT_EPC(sp)++#ifdef CONFIG_RTHAL+ move t0, v0+ li t2, 0xfe000000 #rtai syscalls start at 0xfe000000+ nop+ and t2, t0+ beqz t2, lnx_scall+ nop+ lw t2, (rthal + 12) #rtai_srq_interrupt + nop+ jalr t2 #through the rthal gate+ nop+ + sw v0, PT_R2(sp) #result+ sw v1, PT_R3(sp)+ j fast_ret_from_sys_call+ nop +lnx_scall:+#endif //CONFIG_RTHAL sltiu t0, v0, MAX_SYSCALL_NO + 1 # check syscall number- addiu t1, 4 # skip to next instruction beqz t0, illegal_syscall- sw t1, PT_EPC(sp) /* XXX Put both in one cacheline, should save a bit. */ sll t0, v0, 2@@ -63,16 +85,28 @@ fast_ret_from_sys_call: ret_from_schedule:+#ifndef CONFIG_RTHAL mfc0 t0, CP0_STATUS # need_resched and signals atomic test ori t0, t0, 1 xori t0, t0, 1 mtc0 t0, CP0_STATUS SSNOP; SSNOP; SSNOP-+#else+ lw t0, (rthal + 16) //cli+ nop+ jalr t0+ nop+#endif lw t2, TASK_NEED_RESCHED($28) lw v0, TASK_SIGPENDING($28) bnez t2, reschedule bnez v0, signal_return+#ifdef CONFIG_RTHAL+ lw t0, (rthal+20) //sti+ nop+ jalr t0+ nop+#endif restore_all: RESTORE_SOME RESTORE_SP_AND_RET@@ -99,11 +133,16 @@ /* Put this behind restore_all for the sake of the branch prediction. */ signal_return: .type signal_return, @function-+#ifndef CONFIG_RTHAL mfc0 t0, CP0_STATUS ori t0, t0, 1 mtc0 t0, CP0_STATUS-+#else+ lw t0, (rthal + 20) //sti+ nop+ jalr t0+ nop+#endif SAVE_STATIC move a0, zero move a1, spdiff -Nur -X dontdiff.dat linux-2.4.22.orig/arch/mips/kernel/time.c linux-2.4.22/arch/mips/kernel/time.c--- linux-2.4.22.orig/arch/mips/kernel/time.c 2003-08-27 16:14:29.000000000 -0700+++ linux-2.4.22/arch/mips/kernel/time.c 2003-08-27 10:25:49.000000000 -0700@@ -30,6 +30,7 @@ #include <asm/time.h> #include <asm/hardirq.h> #include <asm/div64.h>+#include <asm/mipsregs.h> /* * The integer part of the number of usecs per jiffy is taken from tick,@@ -71,13 +72,9 @@ int (*rtc_set_time)(unsigned long) = null_rtc_set_time; int (*rtc_set_mmss)(unsigned long); - /* usecs per counter cycle, shifted to left by 32 bits */ static unsigned int sll32_usecs_per_cycle;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -