]> rtime.felk.cvut.cz Git - sysless.git/commitdiff
Added support for irq in thumb mode for lpc23xx (as for lpc21xx).
authornemecep1 <pavel.nemecek1@gmail.com>
Thu, 17 Feb 2011 19:55:08 +0000 (20:55 +0100)
committernemecep1 <pavel.nemecek1@gmail.com>
Thu, 17 Feb 2011 19:55:08 +0000 (20:55 +0100)
Signed-off-by: nemecep1 <pavel.nemecek1@gmail.com>
arch/arm/mach-lpc23xx/libs/hal/Makefile.omk
arch/arm/mach-lpc23xx/libs/hal/hal.c
arch/arm/mach-lpc23xx/libs/hal/irq_fnc_compat.S [new symlink]

index a7917dbe4e2567498fcbfacb905e5d1e6dce2238..359dd3a52581955fe64158e3380bdefcb6cd96e7 100644 (file)
@@ -6,7 +6,7 @@ lib_LIBRARIES = mach_hal
 
 include_HEADERS = hal_ints.h hal_machperiph.h
 
-mach_hal_SOURCES = hal.c hal_machperiph.c
+mach_hal_SOURCES = hal.c hal_machperiph.c irq_fnc_compat.S
 
 
 
index 78674e8ce3cb13169c5f434211503b71ce75a3e8..1111ed9acea420e47445fd27398ae708a3f01d9b 100644 (file)
@@ -6,19 +6,6 @@
 // -------------------------------------------------------------------------
 // Hardware init
 
-// Return value of VPBDIV register. According to errata doc
-// we need to read twice consecutively to get correct value
-/*uint32_t lpc_get_vpbdiv(void)
-{   
-    uint32_t vpbdiv_reg;
-
-    vpbdiv_reg=VPBDIV;
-    vpbdiv_reg=VPBDIV;
-
-    return (vpbdiv_reg);
-}
-*/
-
 // -------------------------------------------------------------------------
 // This routine is called to respond to a hardware interrupt (IRQ).  It
 // should interrogate the hardware and return the IRQ vector number.
@@ -126,7 +113,9 @@ uint32_t hal_default_isr(int vector, uint32_t data)
 uint32_t hal_interrupt_handlers[HAL_ISR_COUNT]={[0 ... HAL_ISR_COUNT-1]=(uint32_t)hal_default_isr};
 uint32_t hal_interrupt_data[HAL_ISR_COUNT];
 
+#if !defined(__thumb__)
 void irq_handler_resolver(void) __attribute__ ((interrupt));
+#endif
 void irq_handler_resolver(void)
 {
   int v;
@@ -139,3 +128,17 @@ void irq_handler_resolver(void)
   ((hal_isr)f)(v,d);  
   hal_interrupt_acknowledge(v);
 }
+
+int request_irq(unsigned int irqnum, irq_handler_t handler, unsigned long flags,
+                const char *name, void *context)
+{
+  HAL_INTERRUPT_ATTACH(irqnum, handler, context);
+  HAL_INTERRUPT_UNMASK(irqnum);
+  return irqnum;
+}
+
+void free_irq(unsigned int irqnum,void *ctx)
+{
+  HAL_INTERRUPT_MASK(irqnum);
+  HAL_INTERRUPT_DETACH(irqnum, NULL);
+}
diff --git a/arch/arm/mach-lpc23xx/libs/hal/irq_fnc_compat.S b/arch/arm/mach-lpc23xx/libs/hal/irq_fnc_compat.S
new file mode 120000 (symlink)
index 0000000..5f478dc
--- /dev/null
@@ -0,0 +1 @@
+../../../mach-lpc21xx/libs/hal/irq_fnc_compat.S
\ No newline at end of file