// -------------------------------------------------------------------------
// 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.
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;
((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);
+}