📄 patch-2.4.19-rmk-arm-rthal5
字号:
+extern asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall);+extern asmlinkage void syscall_trace(int why, struct pt_regs *regs);+asmlinkage void rt_wrap_schedule(void)+{+ unsigned long flags;+ unsigned long i_bit = 0, linux_i_bit = 0;++ if (rthal.do_IRQ != asm_do_IRQ) {+ hard_save_flags(flags);+ i_bit = flags & I_BIT;+ linux_i_bit = rthal.getflags() & I_BIT;+ if (i_bit) {+ if (! linux_i_bit)+ rthal.disint();+ hard_sti();+ } else if (linux_i_bit)+ rthal.enint();+ }+ schedule();+ if (rthal.do_IRQ != asm_do_IRQ) {+ hard_save_flags(flags);+ if (flags & I_BIT) {+ hard_sti();+ BUG();+ }++ if (rthal.getflags() & I_BIT)+ hard_cli();+ rthal.copy_back(linux_i_bit, 0);+ }+}++asmlinkage void rt_wrap_syscall_trace(int why, struct pt_regs *regs)+{+ unsigned long flags;+ unsigned long i_bit = 0, linux_i_bit = 0;++ if (rthal.do_IRQ != asm_do_IRQ) {+ hard_save_flags(flags);+ i_bit = flags & I_BIT;+ linux_i_bit = rthal.getflags() & I_BIT;+ if (i_bit) {+ if (! linux_i_bit)+ rthal.disint();+ hard_sti();+ } else if (linux_i_bit)+ rthal.enint();+ }+ syscall_trace(why, regs);+ if (rthal.do_IRQ != asm_do_IRQ) {+ hard_save_flags(flags);+ if (flags & I_BIT) {+ hard_sti();+ BUG();+ }++ if (rthal.getflags() & I_BIT)+ hard_cli();+ rthal.copy_back(linux_i_bit, 0);+ }+}++asmlinkage int rt_wrap_do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)+{+ unsigned long flags;+ unsigned long i_bit = 0, linux_i_bit = 0;+ int ret;++ if (rthal.do_IRQ != asm_do_IRQ) {+ hard_save_flags(flags);+ i_bit = flags & I_BIT;+ linux_i_bit = rthal.getflags() & I_BIT;+ if (i_bit) {+ if (! linux_i_bit)+ rthal.disint();+ hard_sti();+ } else if (linux_i_bit)+ rthal.enint();+ }+ ret = do_signal(oldset, regs, syscall);+ if (rthal.do_IRQ != asm_do_IRQ) {+ hard_save_flags(flags);+ if (flags & I_BIT) {+ hard_sti();+ BUG();+ }++ if (rthal.getflags() & I_BIT)+ hard_cli();+ rthal.copy_back(linux_i_bit, 0);+ }+ return ret;+}+#endifdiff -urNp --exclude=CVS linux-2.4.19-rmk7-tux1/arch/arm/mach-sa1100/cpu-sa1110.c linux-2.4.19-rmk7-tux1-rthal/arch/arm/mach-sa1100/cpu-sa1110.c--- linux-2.4.19-rmk7-tux1/arch/arm/mach-sa1100/cpu-sa1110.c Wed Jul 9 21:35:36 2003+++ linux-2.4.19-rmk7-tux1-rthal/arch/arm/mach-sa1100/cpu-sa1110.c Wed Dec 17 12:55:36 2003@@ -234,7 +234,11 @@ static void sa1110_setspeed(unsigned int * This means that we won't access SDRAM for the duration of * the programming. */+#ifndef CONFIG_RTHAL local_irq_save(flags);+#else+ hard_local_irq_save(flags);+#endif asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0)); udelay(10); __asm__ __volatile__(" \n\@@ -255,7 +259,11 @@ static void sa1110_setspeed(unsigned int : "r" (&MDCNFG), "r" (&PPCR), "0" (sd.mdcnfg), "r" (sd.mdrefr), "r" (sd.mdcas[0]), "r" (sd.mdcas[1]), "r" (sd.mdcas[2]), "r" (ppcr));+#ifndef CONFIG_RTHAL local_irq_restore(flags);+#else+ hard_local_irq_restore(flags);+#endif /* * Now, return the SDRAM refresh back to normal.diff -urNp --exclude=CVS linux-2.4.19-rmk7-tux1/arch/arm/mach-sa1100/irq.c linux-2.4.19-rmk7-tux1-rthal/arch/arm/mach-sa1100/irq.c--- linux-2.4.19-rmk7-tux1/arch/arm/mach-sa1100/irq.c Thu Dec 25 23:19:27 2003+++ linux-2.4.19-rmk7-tux1-rthal/arch/arm/mach-sa1100/irq.c Fri Dec 26 00:53:26 2003@@ -34,7 +34,7 @@ */ static int GPIO_IRQ_rising_edge; static int GPIO_IRQ_falling_edge;-static int GPIO_IRQ_mask = (1 << 11) - 1;+static volatile int GPIO_IRQ_mask = (1 << 11) - 1; void set_GPIO_IRQ_edge(int gpio_mask, int edge) {@@ -53,8 +53,8 @@ void set_GPIO_IRQ_edge(int gpio_mask, in GPIO_IRQ_rising_edge &= ~gpio_mask; GPDR &= ~gpio_mask; GAFR &= ~gpio_mask;- GRER = GPIO_IRQ_rising_edge & GPIO_IRQ_mask;- GFER = GPIO_IRQ_falling_edge & GPIO_IRQ_mask;+ GRER |= GPIO_IRQ_rising_edge & gpio_mask;+ GFER |= GPIO_IRQ_falling_edge & gpio_mask; while (gpio_mask) { if (irq == 11) irq = IRQ_GPIO11;@@ -77,11 +77,13 @@ EXPORT_SYMBOL(set_GPIO_IRQ_edge); static void sa1100_mask_irq(unsigned int irq) { ICMR &= ~(1 << irq);+ irq_desc[irq].masked = 1; } static void sa1100_unmask_irq(unsigned int irq) { ICMR |= (1 << irq);+ irq_desc[irq].masked = 0; } /*@@ -94,25 +96,31 @@ static void sa1100_mask_and_ack_GPIO0_10 ICMR &= ~mask; GEDR = mask;+ irq_desc[irq].masked = 1; } static void sa1100_mask_GPIO0_10_irq(unsigned int irq) { ICMR &= ~(1 << irq);+ irq_desc[irq].masked = 1; } static void sa1100_unmask_GPIO0_10_irq(unsigned int irq) { ICMR |= 1 << irq;+ irq_desc[irq].masked = 0; } /* * Install handler for GPIO 11-27 edge detect interrupts */ -static int GPIO_11_27_spurious; /* GPIOs that triggered when masked */+static volatile int GPIO_11_27_spurious; /* GPIOs that triggered when masked */ -static void sa1100_GPIO11_27_demux(int irq, void *dev_id,+#ifndef CONFIG_RTHAL+static +#endif+void sa1100_GPIO11_27_demux(int irq, void *dev_id, struct pt_regs *regs) { int i, spurious;@@ -129,17 +137,25 @@ static void sa1100_GPIO11_27_demux(int i */ spurious = irq & ~GPIO_IRQ_mask; if (spurious) {+ unsigned long mask = ~(spurious & GPIO_11_27_spurious); GEDR = spurious;- GRER &= ~(spurious & GPIO_11_27_spurious);- GFER &= ~(spurious & GPIO_11_27_spurious);+ GRER &= mask;+ GFER &= mask; GPIO_11_27_spurious |= spurious; irq ^= spurious; if (!irq) continue; } for (i = 11; i <= 27; ++i) {+#ifndef CONFIG_RTHAL if (irq & (1<<i)) { do_IRQ(IRQ_GPIO11 + i - 11, regs);+#else+ if ((irq = (GEDR & 0xfffff800)) & (1<<i)) {+ sa1100_unmask_irq(11);+ rthal.c_do_IRQ(IRQ_GPIO11 + i - 11, regs);+ break;+#endif } } }@@ -154,21 +170,44 @@ static struct irqaction GPIO11_27_irq = static void sa1100_mask_and_ack_GPIO11_27_irq(unsigned int irq) { unsigned int mask = (1 << GPIO_11_27_IRQ(irq));+#ifdef CONFIG_RTHAL+ unsigned long flags;++ hard_save_flags_cli(flags);+#endif GPIO_11_27_spurious &= ~mask; GPIO_IRQ_mask &= ~mask; GEDR = mask;+ irq_desc[irq].masked = 1;+#ifdef CONFIG_RTHAL+ hard_restore_flags(flags);+#endif } static void sa1100_mask_GPIO11_27_irq(unsigned int irq) { unsigned int mask = (1 << GPIO_11_27_IRQ(irq));+#ifdef CONFIG_RTHAL+ unsigned long flags;++ hard_save_flags_cli(flags);+#endif GPIO_11_27_spurious &= ~mask; GPIO_IRQ_mask &= ~mask;+ irq_desc[irq].masked = 1;+#ifdef CONFIG_RTHAL+ hard_restore_flags(flags);+#endif } static void sa1100_unmask_GPIO11_27_irq(unsigned int irq) { unsigned int mask = (1 << GPIO_11_27_IRQ(irq));+#ifdef CONFIG_RTHAL+ unsigned long flags;++ hard_save_flags_cli(flags);+#endif if (GPIO_11_27_spurious & mask) { /* * We don't want to miss an interrupt that would have occurred@@ -181,8 +220,17 @@ static void sa1100_unmask_GPIO11_27_irq( /* just in case it gets referenced: */ struct pt_regs dummy; +#ifdef CONFIG_RTHAL+ hard_restore_flags(flags);+#endif memzero(&dummy, sizeof(dummy));+#ifndef CONFIG_RTHAL do_IRQ(irq, &dummy);+#else+ hard_cli();+ rthal.c_do_IRQ(irq, &dummy);+ hard_restore_flags(flags);+#endif /* we are being called recursively from do_IRQ() */ return;@@ -191,8 +239,12 @@ static void sa1100_unmask_GPIO11_27_irq( GPIO_IRQ_mask |= mask; - GRER = GPIO_IRQ_rising_edge & GPIO_IRQ_mask;- GFER = GPIO_IRQ_falling_edge & GPIO_IRQ_mask;+ GRER |= (GPIO_IRQ_rising_edge & mask);+ GFER |= (GPIO_IRQ_falling_edge & mask);+ irq_desc[irq].masked = 0;+#ifdef CONFIG_RTHAL+ hard_restore_flags(flags);+#endif } static struct resource irq_resource = {@@ -235,6 +287,7 @@ void __init sa1100_init_irq(void) irq_desc[irq].mask_ack = sa1100_mask_and_ack_GPIO0_10_irq; irq_desc[irq].mask = sa1100_mask_GPIO0_10_irq; irq_desc[irq].unmask = sa1100_unmask_GPIO0_10_irq;+ irq_desc[irq].masked = 0; } for (irq = 11; irq <= 31; irq++) {@@ -243,6 +296,7 @@ void __init sa1100_init_irq(void) irq_desc[irq].mask_ack = sa1100_mask_irq; irq_desc[irq].mask = sa1100_mask_irq; irq_desc[irq].unmask = sa1100_unmask_irq;+ irq_desc[irq].masked = 0; } for (irq = 32; irq <= 48; irq++) {@@ -251,6 +305,9 @@ void __init sa1100_init_irq(void) irq_desc[irq].mask_ack = sa1100_mask_and_ack_GPIO11_27_irq; irq_desc[irq].mask = sa1100_mask_GPIO11_27_irq; irq_desc[irq].unmask = sa1100_unmask_GPIO11_27_irq;+ irq_desc[irq].masked = 0; } setup_arm_irq( IRQ_GPIO11_27, &GPIO11_27_irq ); }++EXPORT_SYMBOL(sa1100_GPIO11_27_demux);diff -urNp --exclude=CVS linux-2.4.19-rmk7-tux1/arch/arm/mm/ioremap.c linux-2.4.19-rmk7-tux1-rthal/arch/arm/mm/ioremap.c--- linux-2.4.19-rmk7-tux1/arch/arm/mm/ioremap.c Thu Jun 19 10:54:32 2003+++ linux-2.4.19-rmk7-tux1-rthal/arch/arm/mm/ioremap.c Wed Dec 17 12:55:36 2003@@ -107,6 +107,9 @@ remap_area_pages(unsigned long address, if (remap_area_pmd(pmd, address, end - address, pfn + (address >> PAGE_SHIFT), flags)) break;+#ifdef CONFIG_RTHAL+ set_pgdir(address, *dir);+#endif error = 0; address = (address + PGDIR_SIZE) & PGDIR_MASK; dir++;diff -urNp --exclude=CVS linux-2.4.19-rmk7-tux1/arch/arm/nwfpe/fpa11.c linux-2.4.19-rmk7-tux1-rthal/arch/arm/nwfpe/fpa11.c--- linux-2.4.19-rmk7-tux1/arch/arm/nwfpe/fpa11.c Wed Nov 27 22:48:00 2002+++ linux-2.4.19-rmk7-tux1-rthal/arch/arm/nwfpe/fpa11.c Wed Dec 17 12:55:36 2003@@ -132,7 +132,12 @@ unsigned int EmulateAll(unsigned int opc unsigned int nRc = 0; unsigned long flags; FPA11 *fpa11; - save_flags(flags); sti();+ save_flags(flags);+#ifndef CONFIG_RTHAL+ sti();+#else+ hard_sti();+#endif fpa11 = GET_FPA11(); diff -urNp --exclude=CVS linux-2.4.19-rmk7-tux1/include/asm-arm/arch-sa1100/irq.h linux-2.4.19-rmk7-tux1-rthal/include/asm-arm/arch-sa1100/irq.h--- linux-2.4.19-rmk7-tux1/include/asm-arm/arch-sa1100/irq.h Mon Dec 22 21:32:37 2003+++ linux-2.4.19-rmk7-tux1-rthal/include/asm-arm/arch-sa1100/irq.h Wed Dec 17 12:55:36 2003@@ -11,3 +11,6 @@ * Since it doesn't exist elsewhere, we'll put it here for now. */ extern void do_IRQ(int irq, struct pt_regs *regs);+#ifdef CONFIG_RTHAL+extern void sa1100_GPIO11_27_demux(int irq, void *dev_id, struct pt_regs *regs);+#endifdiff -urNp --exclude=CVS linux-2.4.19-rmk7-tux1/include/asm-arm/arch-sa1100/time.h linux-2.4.19-rmk7-tux1-rthal/include/asm-arm/arch-sa1100/time.h--- linux-2.4.19-rmk7-tux1/include/asm-arm/arch-sa1100/time.h Wed Jul 9 21:35:36 2003+++ linux-2.4.19-rmk7-tux1-rthal/include/asm-arm/arch-sa1100/time.h Wed Dec 17 12:55:36 2003@@ -52,8 +52,11 @@ static unsigned long sa1100_gettimeoffse unsigned long ticks_to_match, elapsed, usec; /* Get ticks before next timer match */+#ifndef CONFIG_RTHAL ticks_to_match = OSMR0 - OSCR;-+#else+ ticks_to_match = rthal.timer_match - OSCR;+#endif /* We need elapsed ticks since last match */ elapsed = LATCH - ticks_to_match; @@ -74,6 +77,9 @@ static void sa1100_timer_interrupt(int i do_timer(regs); OSSR = OSSR_M0; /* Clear match on timer 0 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -