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

📄 kernel_patch-2.4.20-rtl3.2-pre2

📁 fsmlabs的real time linux的内核
💻 2-PRE2
📖 第 1 页 / 共 4 页
字号:
diff -rbNu linux-2.4.20/arch/i386/config.in linux-2.4.20-rtl3.2-pre2/arch/i386/config.in--- linux-2.4.20/arch/i386/config.in	2002-11-29 00:53:09.000000000 +0100+++ linux-2.4.20-rtl3.2-pre2/arch/i386/config.in	2003-02-16 19:07:03.000000000 +0100@@ -2,11 +2,17 @@ # For a description of the syntax of this configuration file, # see Documentation/kbuild/config-language.txt. #-mainmenu_name "Linux Kernel Configuration"+mainmenu_name "RTLinux/GPL Kernel Configuration"  define_bool CONFIG_X86 y define_bool CONFIG_SBUS n +  +define_bool CONFIG_RTLINUX  y+if [ "$CONFIG_RTLINUX" = "y" ]; then+  define_bool CONFIG_RTL y+fi+   define_bool CONFIG_UID16 y  mainmenu_option next_commentdiff -rbNu linux-2.4.20/arch/i386/kernel/apic.c linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/apic.c--- linux-2.4.20/arch/i386/kernel/apic.c	2002-11-29 00:53:09.000000000 +0100+++ linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/apic.c	2003-02-16 20:48:09.000000000 +0100@@ -728,9 +728,9 @@  	spin_lock_irqsave(&i8253_lock, flags); -	outb_p(0x00, 0x43);-	count = inb_p(0x40);-	count |= inb_p(0x40) << 8;+	outb(0x00, 0x43);+	count = inb(0x40);+	count |= inb(0x40) << 8;  	spin_unlock_irqrestore(&i8253_lock, flags); diff -rbNu linux-2.4.20/arch/i386/kernel/entry.S linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/entry.S--- linux-2.4.20/arch/i386/kernel/entry.S	2002-11-29 00:53:09.000000000 +0100+++ linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/entry.S	2003-02-16 19:07:03.000000000 +0100@@ -184,6 +184,7 @@   ENTRY(ret_from_fork)+	sti 	pushl %ebx 	call SYMBOL_NAME(schedule_tail) 	addl $4, %esp@@ -197,11 +198,34 @@  * but we want the default path for a system call return to  * go as quickly as possible which is why some of this is  * less clear than it otherwise should be.+ *+ * (c) Victor Yodaiken 1999+ * RTLINUX_IRET emulates the turn on interrupts effect of+ * iret since, under RTLinux we may have pended interrupts+ * that will not be automatically enabled on an iret.  */+#ifdef CONFIG_RTLINUX+#define RTLINUX_IRET 	\+	movl  rtl_emulate_iret,%eax; \+	testl %eax, %eax; \+	je  1f;	\+	call  *%eax;	\+	1:+#else+#define RTLINUX_IRET+#endif  ENTRY(system_call) 	pushl %eax			# save orig_eax 	SAVE_ALL+#ifdef CONFIG_RTLINUX+	movl  rtl_syscall_intercept,%ebx+	testl %ebx, %ebx+	je  991f+	call  *%ebx+	movl ORIG_EAX(%esp), %eax+991:+#endif 	GET_CURRENT(%ebx) 	testb $0x02,tsk_ptrace(%ebx)	# PT_TRACESYS 	jne tracesys@@ -210,17 +234,21 @@ 	call *SYMBOL_NAME(sys_call_table)(,%eax,4) 	movl %eax,EAX(%esp)		# save the return value ENTRY(ret_from_sys_call)-	cli				# need_resched and signals atomic test+	call *(SYMBOL_NAME(irq_control)+8) # cli from irq_control structure 	cmpl $0,need_resched(%ebx) 	jne reschedule 	cmpl $0,sigpending(%ebx) 	jne signal_return+	call *(SYMBOL_NAME(irq_control)+12) # sti from irq_control structure+	 restore_all:+	RTLINUX_IRET 	RESTORE_ALL  	ALIGN signal_return:-	sti				# we can get here from an interrupt handler+	call *(SYMBOL_NAME(irq_control)+12) # sti from irq_control structure+	RTLINUX_IRET 	testl $(VM_MASK),EFLAGS(%esp) 	movl %esp,%eax 	jne v86_signal_return@@ -267,6 +295,12 @@ 	call SYMBOL_NAME(schedule)    # test 	jmp ret_from_sys_call +#define RTL_PUSH_VECTOR(vector,routine) \+1:	cmpl $routine, %edi; \+	jne 1f; \+	pushl $vector; \+	jmp 7f;+ ENTRY(divide_error) 	pushl $0		# no error code 	pushl $ SYMBOL_NAME(do_divide_error)@@ -294,6 +328,39 @@ 	movl $(__KERNEL_DS),%edx 	movl %edx,%ds 	movl %edx,%es+#ifdef CONFIG_RTLINUX+	movl  rtl_exception_intercept,%eax+	testl %eax, %eax+	je  8f+	RTL_PUSH_VECTOR(0,do_divide_error)+	RTL_PUSH_VECTOR(1,do_debug)+	RTL_PUSH_VECTOR(3,do_int3)+	RTL_PUSH_VECTOR(4,do_overflow)+	RTL_PUSH_VECTOR(5,do_bounds)+	RTL_PUSH_VECTOR(6,do_invalid_op)+	RTL_PUSH_VECTOR(8,do_double_fault)+	RTL_PUSH_VECTOR(9,do_coprocessor_segment_overrun)+	RTL_PUSH_VECTOR(10,do_invalid_TSS)+	RTL_PUSH_VECTOR(11,do_segment_not_present)+	RTL_PUSH_VECTOR(12,do_stack_segment)+	RTL_PUSH_VECTOR(13,do_general_protection)+	RTL_PUSH_VECTOR(14,do_page_fault)+	RTL_PUSH_VECTOR(15,do_spurious_interrupt_bug)+	RTL_PUSH_VECTOR(16,do_coprocessor_error)+	RTL_PUSH_VECTOR(17,do_alignment_check)+	RTL_PUSH_VECTOR(18,do_machine_check)+	RTL_PUSH_VECTOR(19,do_simd_coprocessor_error)+1:	push $-1+7:	mov %ecx, %ebx			# ebx will not be corrupted by a C routine+	call  *%eax+	popl %ecx+	mov %ebx, %ecx+	testl %eax, %eax+	je 8f+	addl $8,%esp+	RESTORE_ALL+8:+#endif 	GET_CURRENT(%ebx) 	call *%edi 	addl $8,%esp@@ -312,6 +379,21 @@ ENTRY(device_not_available) 	pushl $-1		# mark this as an int 	SAVE_ALL+#ifdef CONFIG_RTLINUX+	movl  rtl_exception_intercept,%eax+	testl %eax, %eax+	je  8f+	movl %esp,%edx+	pushl $0		# no error code+	pushl %edx+	pushl $7		# vector+	call  *%eax+	addl $12,%esp+	testl %eax, %eax+	je 8f+	RESTORE_ALL+8:+#endif 	GET_CURRENT(%ebx) 	movl %cr0,%eax 	testl $0x4,%eax			# EM (math emulation bit)diff -rbNu linux-2.4.20/arch/i386/kernel/i386_ksyms.c linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/i386_ksyms.c--- linux-2.4.20/arch/i386/kernel/i386_ksyms.c	2002-08-03 02:39:42.000000000 +0200+++ linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/i386_ksyms.c	2003-02-16 19:07:03.000000000 +0100@@ -176,6 +176,51 @@ extern int is_sony_vaio_laptop; EXPORT_SYMBOL(is_sony_vaio_laptop); +#ifdef CONFIG_RTLINUX+#include <asm/mpspec.h>+#ifdef CONFIG_X86_IO_APIC+EXPORT_SYMBOL(smp_found_config);+#endif+#include <linux/vt_kern.h>+EXPORT_SYMBOL(kd_mksound);+extern void *__start_rtlinux_funcs,*__stop_rtlinux_funcs;+EXPORT_SYMBOL(__start_rtlinux_funcs);+EXPORT_SYMBOL(__stop_rtlinux_funcs);+EXPORT_SYMBOL(irq_control);+extern unsigned long (*do_gettimeoffset)(void);+extern int use_tsc;+EXPORT_SYMBOL(do_gettimeoffset);+EXPORT_SYMBOL(use_tsc);+EXPORT_SYMBOL(tick);+extern unsigned long wall_jiffies;+extern rwlock_t xtime_lock;+EXPORT_SYMBOL(wall_jiffies);+EXPORT_SYMBOL(xtime_lock);+extern unsigned char *rtl_cached21;+EXPORT_SYMBOL(rtl_cached21);+extern void (*rtl_do_exit_handler)(long code);+extern void (*rtl_syscall_intercept)(struct pt_regs regs);+EXPORT_SYMBOL(init_tss);+EXPORT_SYMBOL(rtl_syscall_intercept);+EXPORT_SYMBOL(rtl_do_exit_handler);+#ifdef CONFIG_SMP+EXPORT_SYMBOL(flush_tlb_all);+extern int rtl_reserved_cpumask;+EXPORT_SYMBOL(rtl_reserved_cpumask);+extern unsigned long irq_affinity[NR_IRQS];+EXPORT_SYMBOL(irq_affinity);+extern volatile int physical_apicid_2_cpu[];+EXPORT_SYMBOL(physical_apicid_2_cpu);+extern unsigned long flush_cpumask;+EXPORT_SYMBOL(flush_cpumask);+EXPORT_SYMBOL(cpu_tlbstate);+#endif /* CONFIG_SMP */+extern struct console *console_drivers;+EXPORT_SYMBOL(console_drivers);+EXPORT_SYMBOL(set_ldt_desc);+EXPORT_SYMBOL(default_ldt);+#endif /* CONFIG_RTLINUX */+ #ifdef CONFIG_MULTIQUAD EXPORT_SYMBOL(xquad_portio); #endifdiff -rbNu linux-2.4.20/arch/i386/kernel/i8259.c linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/i8259.c--- linux-2.4.20/arch/i386/kernel/i8259.c	2001-09-18 08:03:09.000000000 +0200+++ linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/i8259.c	2003-02-16 20:48:32.000000000 +0100@@ -131,6 +131,14 @@  spinlock_t i8259A_lock = SPIN_LOCK_UNLOCKED; +#ifdef CONFIG_RTLINUX+#undef spin_lock_irqsave+#define spin_lock_irqsave(lock, flags)		do { rtl_hard_local_irq_save_kernel(flags);       spin_lock(lock); } while (0)++#undef spin_unlock_irqrestore+#define spin_unlock_irqrestore(lock, flags)	do { spin_unlock(lock);  rtl_hard_local_irq_restore_kernel(flags); } while (0)+#endif+ static void end_8259A_irq (unsigned int irq) { 	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))@@ -171,6 +179,8 @@ #define cached_21	(__byte(0,cached_irq_mask)) #define cached_A1	(__byte(1,cached_irq_mask)) +unsigned char *rtl_cached21=&cached_21;+ /*  * Not all IRQs can be routed through the IO-APIC, eg. on certain (older)  * boards the timer interrupt is not really connected to any IO-APIC pin,@@ -343,20 +353,20 @@ 	outb(0xff, 0xA1);	/* mask all of 8259A-2 */  	/*-	 * outb_p - this has to work on a wide range of PC hardware.+	 * outb - this has to work on a wide range of PC hardware. 	 */-	outb_p(0x11, 0x20);	/* ICW1: select 8259A-1 init */-	outb_p(0x20 + 0, 0x21);	/* ICW2: 8259A-1 IR0-7 mapped to 0x20-0x27 */-	outb_p(0x04, 0x21);	/* 8259A-1 (the master) has a slave on IR2 */+	outb(0x11, 0x20);	/* ICW1: select 8259A-1 init */+	outb(0x20 + 0, 0x21);	/* ICW2: 8259A-1 IR0-7 mapped to 0x20-0x27 */+	outb(0x04, 0x21);	/* 8259A-1 (the master) has a slave on IR2 */ 	if (auto_eoi)-		outb_p(0x03, 0x21);	/* master does Auto EOI */+		outb(0x03, 0x21);	/* master does Auto EOI */ 	else-		outb_p(0x01, 0x21);	/* master expects normal EOI */+		outb(0x01, 0x21);	/* master expects normal EOI */ -	outb_p(0x11, 0xA0);	/* ICW1: select 8259A-2 init */-	outb_p(0x20 + 8, 0xA1);	/* ICW2: 8259A-2 IR0-7 mapped to 0x28-0x2f */-	outb_p(0x02, 0xA1);	/* 8259A-2 is a slave on master's IR2 */-	outb_p(0x01, 0xA1);	/* (slave's support for AEOI in flat mode+	outb(0x11, 0xA0);	/* ICW1: select 8259A-2 init */+	outb(0x20 + 8, 0xA1);	/* ICW2: 8259A-2 IR0-7 mapped to 0x28-0x2f */+	outb(0x02, 0xA1);	/* 8259A-2 is a slave on master's IR2 */+	outb(0x01, 0xA1);	/* (slave's support for AEOI in flat mode 				    is to be investigated) */  	if (auto_eoi)@@ -493,8 +503,8 @@ 	 * Set the clock to HZ Hz, we already have a valid 	 * vector now: 	 */-	outb_p(0x34,0x43);		/* binary, mode 2, LSB/MSB, ch 0 */-	outb_p(LATCH & 0xff , 0x40);	/* LSB */+	outb(0x34,0x43);		/* binary, mode 2, LSB/MSB, ch 0 */+	outb(LATCH & 0xff , 0x40);	/* LSB */ 	outb(LATCH >> 8 , 0x40);	/* MSB */  #ifndef CONFIG_VISWSdiff -rbNu linux-2.4.20/arch/i386/kernel/io_apic.c linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/io_apic.c--- linux-2.4.20/arch/i386/kernel/io_apic.c	2002-11-29 00:53:09.000000000 +0100+++ linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/io_apic.c	2003-02-16 19:07:03.000000000 +0100@@ -44,6 +44,14 @@ unsigned char int_delivery_mode = dest_LowestPrio;  +#ifdef CONFIG_RTLINUX+#undef spin_lock_irqsave+#define spin_lock_irqsave(lock, flags)		do { rtl_hard_local_irq_save_kernel(flags);       spin_lock(lock); } while (0)++#undef spin_unlock_irqrestore+#define spin_unlock_irqrestore(lock, flags)	do { spin_unlock(lock);  rtl_hard_local_irq_restore_kernel(flags); } while (0)+#endif+ /*  * # of IRQ routing registers  */diff -rbNu linux-2.4.20/arch/i386/kernel/irq.c linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/irq.c--- linux-2.4.20/arch/i386/kernel/irq.c	2002-11-29 00:53:09.000000000 +0100+++ linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/irq.c	2003-02-16 19:07:03.000000000 +0100@@ -1090,7 +1090,7 @@  static struct proc_dir_entry * smp_affinity_entry [NR_IRQS]; -static unsigned long irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = ~0UL };+unsigned long irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = ~0UL }; static int irq_affinity_read_proc (char *page, char **start, off_t off, 			int count, int *eof, void *data) {diff -rbNu linux-2.4.20/arch/i386/kernel/Makefile linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/Makefile--- linux-2.4.20/arch/i386/kernel/Makefile	2002-11-29 00:53:09.000000000 +0100+++ linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/Makefile	2003-02-16 19:07:03.000000000 +0100@@ -30,6 +30,7 @@ endif endif +obj-$(CONFIG_RTLINUX)           += rtlinux.o obj-$(CONFIG_MCA)		+= mca.o obj-$(CONFIG_MTRR)		+= mtrr.o obj-$(CONFIG_X86_MSR)		+= msr.odiff -rbNu linux-2.4.20/arch/i386/kernel/nmi.c linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/nmi.c--- linux-2.4.20/arch/i386/kernel/nmi.c	2002-08-03 02:39:42.000000000 +0200+++ linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/nmi.c	2003-02-16 19:07:03.000000000 +0100@@ -341,7 +341,12 @@ 	 * Since current-> is always on the stack, and we always switch 	 * the stack NMI-atomically, it's safe to use smp_processor_id(). 	 */+#ifdef CONFIG_RTLINUX+	/* For RTLinux this is not always the case, hence hard_smp_processor_id */+	int sum, cpu = hw_smp_processor_id();+#else 	int sum, cpu = smp_processor_id();+#endif  	sum = apic_timer_irqs[cpu]; diff -rbNu linux-2.4.20/arch/i386/kernel/pci-irq.c linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/pci-irq.c--- linux-2.4.20/arch/i386/kernel/pci-irq.c	2002-11-29 00:53:09.000000000 +0100+++ linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/pci-irq.c	2003-02-16 20:49:04.000000000 +0100@@ -400,14 +400,14 @@  */ static int pirq_serverworks_get(struct pci_dev *router, struct pci_dev *dev, int pirq) {-	outb_p(pirq, 0xc00);+	outb(pirq, 0xc00); 	return inb(0xc01) & 0xf; }  static int pirq_serverworks_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) {-	outb_p(pirq, 0xc00);-	outb_p(irq, 0xc01);+	outb(pirq, 0xc00);+	outb(irq, 0xc01); 	return 1; } diff -rbNu linux-2.4.20/arch/i386/kernel/process.c linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/process.c--- linux-2.4.20/arch/i386/kernel/process.c	2002-08-03 02:39:42.000000000 +0200+++ linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/process.c	2003-02-16 20:49:37.000000000 +0100@@ -267,7 +267,7 @@ 	int i;  	for (i=0; i<0x10000; i++)-		if ((inb_p(0x64) & 0x02) == 0)+		if ((inb(0x64) & 0x02) == 0) 			break; } diff -rbNu linux-2.4.20/arch/i386/kernel/rtlinux.c linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/rtlinux.c--- linux-2.4.20/arch/i386/kernel/rtlinux.c	1970-01-01 01:00:00.000000000 +0100+++ linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/rtlinux.c	2003-02-16 19:07:03.000000000 +0100@@ -0,0 +1,80 @@+#include <linux/config.h>+#include <linux/ptrace.h>+#include <linux/errno.h>+#include <linux/signal.h>+#include <linux/sched.h>+#include <linux/ioport.h>+#include <linux/interrupt.h>+#include <linux/timex.h>+#include <linux/malloc.h>+#include <linux/random.h>+#include <linux/smp_lock.h>+#include <linux/init.h>+#include <linux/kernel_stat.h>++#include <asm/system.h>+#include <asm/io.h>+#include <asm/irq.h>+#include <asm/bitops.h>+#include <asm/pgtable.h>+#include <asm/delay.h>+#include <asm/desc.h>++#include <linux/irq.h>++static void rtl_hard_save_flags_f(unsigned long  *z){+	unsigned long y;+	rtl_hard_save_flags_kernel(y);+	*z=y;+}+static void rtl_hard_restore_flags_f(unsigned long  x) { rtl_hard_restore_flags_kernel(x); }+static void rtl_hard_cli_f(void) { rtl_hard_cli_kernel(); }+static void rtl_hard_sti_f(void) { rtl_hard_sti_kernel(); }+static void rtl_hard_local_irq_save_f(unsigned long  *x)+{ unsigned long y;rtl_hard_local_irq_save_kernel(y);*x=y; }+static void rtl_hard_local_irq_restore_f(unsigned long  x){+	rtl_hard_local_irq_restore_kernel(x);+}+struct irq_control_s irq_control = {+ 	rtl_hard_save_flags_f,+ 	rtl_hard_restore_flags_f,+ 	rtl_hard_cli_f,+ 	rtl_hard_sti_f,+ 	rtl_hard_local_irq_save_f,+ 	rtl_hard_local_irq_restore_f+ };+void *rtl_emulate_iret = 0;+void *rtl_exception_intercept = 0;+void *rtl_syscall_intercept = 0;++extern void *__start_rtlinux_patch,*__stop_rtlinux_patch;+extern asmlinkage void do_IRQ(struct pt_regs );+extern void ret_from_intr(void);+RTLINUX_EXPORT(__start_rtlinux_patch);+RTLINUX_EXPORT(__stop_rtlinux_patch);+RTLINUX_EXPORT(rtl_emulate_iret);+RTLINUX_EXPORT(irq_desc);+RTLINUX_EXPORT(do_IRQ);+RTLINUX_EXPORT(ret_from_intr);+RTLINUX_EXPORT(rtl_exception_intercept);++#ifdef CONFIG_X86_LOCAL_APIC+extern asmlinkage void smp_spurious_interrupt(void);+extern asmlinkage void smp_error_interrupt(void);+extern void smp_apic_timer_interrupt(struct pt_regs *);++RTLINUX_EXPORT(smp_spurious_interrupt);+RTLINUX_EXPORT(smp_error_interrupt);+RTLINUX_EXPORT(smp_apic_timer_interrupt);+#endif++#ifdef CONFIG_SMP+extern void rtl_reschedule(int cpu);+extern asmlinkage void smp_reschedule_interrupt(void);+extern asmlinkage void smp_invalidate_interrupt(void);+extern asmlinkage void smp_call_function_interrupt(void);+RTLINUX_EXPORT(smp_reschedule_interrupt);+RTLINUX_EXPORT(smp_invalidate_interrupt);+RTLINUX_EXPORT(smp_call_function_interrupt);+RTLINUX_EXPORT(rtl_reschedule);+#endifdiff -rbNu linux-2.4.20/arch/i386/kernel/setup.c linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/setup.c--- linux-2.4.20/arch/i386/kernel/setup.c	2002-11-29 00:53:09.000000000 +0100+++ linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/setup.c	2003-02-16 20:50:08.000000000 +0100@@ -250,7 +250,7 @@ { 	int raw; -	visws_board_type = (char)(inb_p(PIIX_GPI_BD_REG) & PIIX_GPI_BD_REG)+	visws_board_type = (char)(inb(PIIX_GPI_BD_REG) & PIIX_GPI_BD_REG) 							 >> PIIX_GPI_BD_SHIFT; /*  * Get Board rev.@@ -258,40 +258,40 @@

⌨️ 快捷键说明

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