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

📄 kernel_patch-2.4.20-rtl3.2-pre2

📁 fsmlabs的real time linux的内核
💻 2-PRE2
📖 第 1 页 / 共 4 页
字号:
  * to the GPIO registers.  Let's map them at 0x0fc0 which is right  * after the PIIX4 PM section.  */-	outb_p(SIO_DEV_SEL, SIO_INDEX);-	outb_p(SIO_GP_DEV, SIO_DATA);	/* Talk to GPIO regs. */+	outb(SIO_DEV_SEL, SIO_INDEX);+	outb(SIO_GP_DEV, SIO_DATA);	/* Talk to GPIO regs. */     -	outb_p(SIO_DEV_MSB, SIO_INDEX);-	outb_p(SIO_GP_MSB, SIO_DATA);	/* MSB of GPIO base address */+	outb(SIO_DEV_MSB, SIO_INDEX);+	outb(SIO_GP_MSB, SIO_DATA);	/* MSB of GPIO base address */ -	outb_p(SIO_DEV_LSB, SIO_INDEX);-	outb_p(SIO_GP_LSB, SIO_DATA);	/* LSB of GPIO base address */+	outb(SIO_DEV_LSB, SIO_INDEX);+	outb(SIO_GP_LSB, SIO_DATA);	/* LSB of GPIO base address */ -	outb_p(SIO_DEV_ENB, SIO_INDEX);-	outb_p(1, SIO_DATA);		/* Enable GPIO registers. */+	outb(SIO_DEV_ENB, SIO_INDEX);+	outb(1, SIO_DATA);		/* Enable GPIO registers. */      /*  * Now, we have to map the power management section to write  * a bit which enables access to the GPIO registers.  * What lunatic came up with this shit?  */-	outb_p(SIO_DEV_SEL, SIO_INDEX);-	outb_p(SIO_PM_DEV, SIO_DATA);	/* Talk to GPIO regs. */+	outb(SIO_DEV_SEL, SIO_INDEX);+	outb(SIO_PM_DEV, SIO_DATA);	/* Talk to GPIO regs. */ -	outb_p(SIO_DEV_MSB, SIO_INDEX);-	outb_p(SIO_PM_MSB, SIO_DATA);	/* MSB of PM base address */+	outb(SIO_DEV_MSB, SIO_INDEX);+	outb(SIO_PM_MSB, SIO_DATA);	/* MSB of PM base address */     -	outb_p(SIO_DEV_LSB, SIO_INDEX);-	outb_p(SIO_PM_LSB, SIO_DATA);	/* LSB of PM base address */+	outb(SIO_DEV_LSB, SIO_INDEX);+	outb(SIO_PM_LSB, SIO_DATA);	/* LSB of PM base address */ -	outb_p(SIO_DEV_ENB, SIO_INDEX);-	outb_p(1, SIO_DATA);		/* Enable PM registers. */+	outb(SIO_DEV_ENB, SIO_INDEX);+	outb(1, SIO_DATA);		/* Enable PM registers. */      /*  * Now, write the PM register which enables the GPIO registers.  */-	outb_p(SIO_PM_FER2, SIO_PM_INDEX);-	outb_p(SIO_PM_GP_EN, SIO_PM_DATA);+	outb(SIO_PM_FER2, SIO_PM_INDEX);+	outb(SIO_PM_GP_EN, SIO_PM_DATA);      /*  * Now, initialize the GPIO registers.@@ -299,7 +299,7 @@  * power on default, so let's leave them alone.  * So, let's just read the board rev!  */-	raw = inb_p(SIO_GP_DATA1);+	raw = inb(SIO_GP_DATA1); 	raw &= 0x7f;	/* 7 bits of valid board revision ID. */  	if (visws_board_type == VISWS_320) {diff -rbNu linux-2.4.20/arch/i386/kernel/smp.c linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/smp.c--- linux-2.4.20/arch/i386/kernel/smp.c	2002-11-29 00:53:09.000000000 +0100+++ linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/smp.c	2003-02-16 19:07:03.000000000 +0100@@ -134,6 +134,10 @@ 	 */ 	unsigned int cfg; +#ifdef CONFIG_RTLINUX+	unsigned long flags;+	rtl_hard_local_irq_save_kernel(flags);+#endif 	/* 	 * Wait for idle. 	 */@@ -148,6 +152,9 @@ 	 * Send the IPI. The write to APIC_ICR fires this off. 	 */ 	apic_write_around(APIC_ICR, cfg);+#ifdef CONFIG_RTLINUX+	rtl_hard_local_irq_restore_kernel(flags);+#endif }  void send_IPI_self(int vector)@@ -160,8 +167,12 @@ 	unsigned long cfg; 	unsigned long flags; +#ifdef CONFIG_RTLINUX+	rtl_hard_local_irq_save_kernel(flags);+#else 	__save_flags(flags); 	__cli();+#endif  		 	/*@@ -185,7 +196,11 @@ 	 */ 	apic_write_around(APIC_ICR, cfg); +#ifdef CONFIG_RTLINUX+	rtl_hard_local_irq_restore_kernel(flags);+#else 	__restore_flags(flags);+#endif }  static inline void send_IPI_mask_sequence(int mask, int vector)@@ -199,8 +214,12 @@ 	 * should be modified to do 1 message per cluster ID - mbligh 	 */  +#ifdef CONFIG_RTLINUX+	rtl_hard_local_irq_save_kernel(flags);+#else 	__save_flags(flags); 	__cli();+#endif  	for (query_cpu = 0; query_cpu < NR_CPUS; ++query_cpu) { 		query_mask = 1 << query_cpu;@@ -228,7 +247,11 @@ 			apic_write_around(APIC_ICR, cfg); 		} 	}+#ifdef CONFIG_RTLINUX+	rtl_hard_local_irq_restore_kernel(flags);+#else 	__restore_flags(flags);+#endif }  static inline void send_IPI_mask(int mask, int vector)@@ -289,7 +312,7 @@  *	Optimizations Manfred Spraul <manfred@colorfullife.com>  */ -static volatile unsigned long flush_cpumask;+volatile unsigned long flush_cpumask; static struct mm_struct * flush_mm; static unsigned long flush_va; static spinlock_t tlbstate_lock = SPIN_LOCK_UNLOCKED;@@ -383,6 +406,10 @@ 	clear_bit(cpu, &flush_cpumask); } +#ifdef CONFIG_RTLINUX+int rtl_reserved_cpumask;+#endif+ static void flush_tlb_others (unsigned long cpumask, struct mm_struct *mm, 						unsigned long va) {@@ -413,6 +440,10 @@ 	flush_mm = mm; 	flush_va = va; 	atomic_set_mask(cpumask, &flush_cpumask);+#ifdef CONFIG_RTLINUX+	/* make shure that reserved cpu's are excluded ! */+	atomic_clear_mask(rtl_reserved_cpumask,&flush_cpumask);+#endif 	/* 	 * We have to send the IPI only to 	 * CPUs affected.@@ -499,6 +530,13 @@ 	send_IPI_mask(1 << cpu, RESCHEDULE_VECTOR); } +#ifdef CONFIG_RTLINUX+#define RTL_RESCHEDULE_VECTOR 0xEE+void rtl_reschedule(int cpu)+{+	send_IPI_mask(1 << cpu, RTL_RESCHEDULE_VECTOR);+}+#endif /*  * Structure and data for smp_call_function(). This is designed to minimise  * static memory requirements. It also looks cleaner.diff -rbNu linux-2.4.20/arch/i386/kernel/time.c linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/time.c--- linux-2.4.20/arch/i386/kernel/time.c	2002-11-29 00:53:09.000000000 +0100+++ linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/time.c	2003-02-16 20:47:49.000000000 +0100@@ -121,7 +121,7 @@  extern spinlock_t i8259A_lock; -#ifndef CONFIG_X86_TSC+#if defined (CONFIG_RTLINUX) || ! defined (CONFIG_X86_TSC)  /* This function must be called with interrupts disabled   * It was inspired by Steve McCanne's microtime-i386 for BSD.  -- jrs@@ -170,9 +170,9 @@ 	/* gets recalled with irq locally disabled */ 	spin_lock(&i8253_lock); 	/* timer count may underflow right here */-	outb_p(0x00, 0x43);	/* latch the count ASAP */+	outb(0x00, 0x43);	/* latch the count ASAP */ -	count = inb_p(0x40);	/* read the latched count */+	count = inb(0x40);	/* read the latched count */  	/* 	 * We do this guaranteed double memory access instead of a _p @@ -180,12 +180,12 @@ 	 */  	jiffies_t = jiffies; -	count |= inb_p(0x40) << 8;+	count |= inb(0x40) << 8; 	         /* VIA686a test code... reset the latch if count > max + 1 */         if (count > LATCH) {-                outb_p(0x34, 0x43);-                outb_p(LATCH & 0xff, 0x40);+                outb(0x34, 0x43);+                outb(LATCH & 0xff, 0x40);                 outb(LATCH >> 8, 0x40);                 count = LATCH - 1;         }@@ -211,6 +211,10 @@  			int i; +#ifdef CONFIG_RTLINUX+			unsigned long flags;+			rtl_hard_local_irq_save_kernel(flags);+#endif 			spin_lock(&i8259A_lock); 			/* 			 * This is tricky when I/O APICs are used;@@ -218,6 +222,9 @@ 			 */ 			i = inb(0x20); 			spin_unlock(&i8259A_lock);+#ifdef CONFIG_RTLINUX+			rtl_hard_local_irq_restore_kernel(flags);+#endif  			/* assumption about timer being IRQ0 */ 			if (i & 0x01) {@@ -254,7 +261,7 @@ 	return count; } -static unsigned long (*do_gettimeoffset)(void) = do_slow_gettimeoffset;+unsigned long (*do_gettimeoffset)(void) = do_slow_gettimeoffset;  #else @@ -403,11 +410,18 @@ 		 * This will also deassert NMI lines for the watchdog if run 		 * on an 82489DX-based system. 		 */+#ifdef CONFIG_RTLINUX+		unsigned long flags;+		rtl_hard_local_irq_save_kernel(flags);+#endif 		spin_lock(&i8259A_lock); 		outb(0x0c, 0x20); 		/* Ack the IRQ; AEOI will end it automatically. */ 		inb(0x20); 		spin_unlock(&i8259A_lock);+#ifdef CONFIG_RTLINUX+		rtl_hard_local_irq_restore_kernel(flags);+#endif 	} #endif @@ -455,13 +469,13 @@ 		high bit of the PPI port B (0x61).  Note that some PS/2s, 		notably the 55SX, work fine if this is removed.  */ -		irq = inb_p( 0x61 );	/* read the current state */-		outb_p( irq|0x80, 0x61 );	/* reset the IRQ */+		irq = inb( 0x61 );	/* read the current state */+		outb( irq|0x80, 0x61 );	/* reset the IRQ */ 	} #endif } -static int use_tsc;+int use_tsc;  /*  * This is the same as the above, except we _also_ save the current@@ -500,9 +514,9 @@ 		rdtscl(last_tsc_low);  		spin_lock(&i8253_lock);-		outb_p(0x00, 0x43);     /* latch the count ASAP */+		outb(0x00, 0x43);     /* latch the count ASAP */ -		count = inb_p(0x40);    /* read the latched count */+		count = inb(0x40);    /* read the latched count */ 		count |= inb(0x40) << 8; 		spin_unlock(&i8253_lock); diff -rbNu linux-2.4.20/arch/i386/kernel/traps.c linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/traps.c--- linux-2.4.20/arch/i386/kernel/traps.c	2002-11-29 00:53:09.000000000 +0100+++ linux-2.4.20-rtl3.2-pre2/arch/i386/kernel/traps.c	2003-02-16 19:07:03.000000000 +0100@@ -467,11 +467,16 @@ 	printk("Do you have a strange power saving mode enabled?\n"); } + asmlinkage void do_nmi(struct pt_regs * regs, long error_code) { 	unsigned char reason = inb(0x61); +#ifdef CONFIG_RTLINUX+	++nmi_count(hw_smp_processor_id());+#else 	++nmi_count(smp_processor_id());+#endif  	if (!(reason & 0xc0)) { #if CONFIG_X86_LOCAL_APICdiff -rbNu linux-2.4.20/arch/i386/mm/fault.c linux-2.4.20-rtl3.2-pre2/arch/i386/mm/fault.c--- linux-2.4.20/arch/i386/mm/fault.c	2002-11-29 00:53:09.000000000 +0100+++ linux-2.4.20-rtl3.2-pre2/arch/i386/mm/fault.c	2003-02-16 19:07:03.000000000 +0100@@ -25,6 +25,9 @@ #include <asm/pgalloc.h> #include <asm/hardirq.h> +// need that for hard_sti in do_page_fault - thanks to Paolo Mantegazza .+#include <asm/rtlinux_cli.h>+ extern void die(const char *,struct pt_regs *,long);  /*@@ -153,8 +156,8 @@  	/* It's safe to allow irq's after cr2 has been saved */ 	if (regs->eflags & X86_EFLAGS_IF)-		local_irq_enable();-+//		local_irq_enable();+ 		rtl_hard_sti_kernel(); 	tsk = current;  	/*diff -rbNu linux-2.4.20/arch/i386/mm/ioremap.c linux-2.4.20-rtl3.2-pre2/arch/i386/mm/ioremap.c--- linux-2.4.20/arch/i386/mm/ioremap.c	2002-08-03 02:39:42.000000000 +0200+++ linux-2.4.20-rtl3.2-pre2/arch/i386/mm/ioremap.c	2003-02-16 19:07:03.000000000 +0100@@ -82,6 +82,7 @@ 					 phys_addr + address, flags)) 			break; 		error = 0;+		set_pgdir(address, *dir); 		address = (address + PGDIR_SIZE) & PGDIR_MASK; 		dir++; 	} while (address && (address < end));diff -rbNu linux-2.4.20/.cofnig linux-2.4.20-rtl3.2-pre2/.cofnig--- linux-2.4.20/.cofnig	1970-01-01 01:00:00.000000000 +0100+++ linux-2.4.20-rtl3.2-pre2/.cofnig	2003-04-03 11:45:23.000000000 +0200@@ -0,0 +1,736 @@+#+# Automatically generated make config: don't edit+#+CONFIG_X86=y+# CONFIG_SBUS is not set+CONFIG_RTLINUX=y+CONFIG_RTL=y+CONFIG_UID16=y++#+# Code maturity level options+#+CONFIG_EXPERIMENTAL=y++#+# Loadable module support+#+CONFIG_MODULES=y+# CONFIG_MODVERSIONS is not set+CONFIG_KMOD=y++#+# Processor type and features+#+# CONFIG_M386 is not set+# CONFIG_M486 is not set+# CONFIG_M586 is not set+# CONFIG_M586TSC is not set+# CONFIG_M586MMX is not set+CONFIG_M686=y+# CONFIG_MPENTIUMIII is not set+# CONFIG_MPENTIUM4 is not set+# CONFIG_MK6 is not set+# CONFIG_MK7 is not set+# CONFIG_MELAN is not set+# CONFIG_MCRUSOE is not set+# CONFIG_MWINCHIPC6 is not set+# CONFIG_MWINCHIP2 is not set+# CONFIG_MWINCHIP3D is not set+# CONFIG_MCYRIXIII is not set+CONFIG_X86_WP_WORKS_OK=y+CONFIG_X86_INVLPG=y+CONFIG_X86_CMPXCHG=y+CONFIG_X86_XADD=y+CONFIG_X86_BSWAP=y+CONFIG_X86_POPAD_OK=y+# CONFIG_RWSEM_GENERIC_SPINLOCK is not set+CONFIG_RWSEM_XCHGADD_ALGORITHM=y+CONFIG_X86_L1_CACHE_SHIFT=5+CONFIG_X86_HAS_TSC=y+CONFIG_X86_GOOD_APIC=y+CONFIG_X86_PGE=y+CONFIG_X86_USE_PPRO_CHECKSUM=y+CONFIG_X86_PPRO_FENCE=y+CONFIG_X86_F00F_WORKS_OK=y+# CONFIG_X86_MCE is not set+# CONFIG_TOSHIBA is not set+# CONFIG_I8K is not set+# CONFIG_MICROCODE is not set+# CONFIG_X86_MSR is not set+# CONFIG_X86_CPUID is not set+CONFIG_NOHIGHMEM=y+# CONFIG_HIGHMEM4G is not set+# CONFIG_HIGHMEM64G is not set+# CONFIG_HIGHMEM is not set+# CONFIG_MATH_EMULATION is not set+# CONFIG_MTRR is not set+# CONFIG_SMP is not set+# CONFIG_X86_UP_APIC is not set+# CONFIG_X86_UP_IOAPIC is not set+# CONFIG_X86_TSC_DISABLE is not set+CONFIG_X86_TSC=y++#+# General setup+#+CONFIG_NET=y+CONFIG_PCI=y+# CONFIG_PCI_GOBIOS is not set+# CONFIG_PCI_GODIRECT is not set+CONFIG_PCI_GOANY=y+CONFIG_PCI_BIOS=y+CONFIG_PCI_DIRECT=y+CONFIG_ISA=y+CONFIG_PCI_NAMES=y+# CONFIG_EISA is not set+# CONFIG_MCA is not set+# CONFIG_HOTPLUG is not set+# CONFIG_PCMCIA is not set+# CONFIG_HOTPLUG_PCI is not set+CONFIG_SYSVIPC=y+# CONFIG_BSD_PROCESS_ACCT is not set+CONFIG_SYSCTL=y+CONFIG_KCORE_ELF=y+# CONFIG_KCORE_AOUT is not set+CONFIG_BINFMT_AOUT=y+CONFIG_BINFMT_ELF=y+# CONFIG_BINFMT_MISC is not set+# CONFIG_PM is not set+# CONFIG_ACPI is not set+# CONFIG_APM is not set++#+# Memory Technology Devices (MTD)+#+# CONFIG_MTD is not set++#+# Parallel port support+#+# CONFIG_PARPORT is not set++#+# Plug and Play configuration+#+# CONFIG_PNP is not set+# CONFIG_ISAPNP is not set++#+# Block devices+#+CONFIG_BLK_DEV_FD=y+# CONFIG_BLK_DEV_XD is not set+# CONFIG_PARIDE is not set+# CONFIG_BLK_CPQ_DA is not set+# CONFIG_BLK_CPQ_CISS_DA is not set+# CONFIG_CISS_SCSI_TAPE is not set+# CONFIG_BLK_DEV_DAC960 is not set+# CONFIG_BLK_DEV_UMEM is not set+CONFIG_BLK_DEV_LOOP=y+# CONFIG_BLK_DEV_NBD is not set

⌨️ 快捷键说明

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