MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / ofw_map_irq

Function ofw_map_irq

components/drivers/ofw/irq.c:525–564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

523}
524
525static int ofw_map_irq(struct rt_ofw_cell_args *irq_args)
526{
527 int irq;
528 struct rt_ofw_node *ic_np = irq_args->data;
529 struct rt_pic *pic = rt_pic_dynamic_cast(rt_ofw_data(ic_np));
530
531 /* args.data is "interrupt-controller" */
532 if (pic)
533 {
534 struct rt_pic_irq pirq;
535
536 if (!pic->ops->irq_parse)
537 {
538 LOG_E("Master pic MUST implemented irq_parse");
539 RT_ASSERT(0);
540 }
541
542 if (!pic->ops->irq_map)
543 {
544 LOG_E("Master pic MUST implemented irq_map");
545 RT_ASSERT(0);
546 }
547
548 irq = pic->ops->irq_parse(pic, irq_args, &pirq);
549
550 if (!irq)
551 {
552 irq = pic->ops->irq_map(pic, pirq.hwirq, pirq.mode);
553 }
554 }
555 else
556 {
557 LOG_E("Master pic %s not support", ic_np->full_name);
558 irq = -RT_EIO;
559 }
560
561 rt_ofw_node_put(ic_np);
562
563 return irq;
564}
565
566int rt_ofw_map_irq(struct rt_ofw_cell_args *irq_args)
567{

Callers 2

rt_ofw_map_irqFunction · 0.85
rt_ofw_get_irqFunction · 0.85

Calls 2

rt_pic_dynamic_castFunction · 0.85
rt_ofw_node_putFunction · 0.85

Tested by

no test coverage detected