| 289 | } |
| 290 | |
| 291 | rt_err_t rt_pic_cascade(struct rt_pic_irq *pirq, int parent_irq) |
| 292 | { |
| 293 | rt_err_t err = RT_EOK; |
| 294 | |
| 295 | if (pirq && !pirq->parent && parent_irq >= 0) |
| 296 | { |
| 297 | struct rt_pic_irq *parent; |
| 298 | |
| 299 | rt_spin_lock(&pirq->rw_lock); |
| 300 | |
| 301 | parent = irq2pirq(parent_irq); |
| 302 | |
| 303 | if (parent) |
| 304 | { |
| 305 | pirq->parent = parent; |
| 306 | pirq->priority = parent->priority; |
| 307 | rt_memcpy(&pirq->affinity, &parent->affinity, sizeof(pirq->affinity)); |
| 308 | } |
| 309 | |
| 310 | rt_spin_unlock(&pirq->rw_lock); |
| 311 | |
| 312 | if (parent && pirq->pic->ops->flags & RT_PIC_F_IRQ_ROUTING) |
| 313 | { |
| 314 | rt_spin_lock(&parent->rw_lock); |
| 315 | |
| 316 | rt_list_insert_before(&parent->children_nodes, &pirq->list); |
| 317 | |
| 318 | rt_spin_unlock(&parent->rw_lock); |
| 319 | } |
| 320 | } |
| 321 | else |
| 322 | { |
| 323 | err = -RT_EINVAL; |
| 324 | } |
| 325 | |
| 326 | return err; |
| 327 | } |
| 328 | |
| 329 | rt_err_t rt_pic_uncascade(struct rt_pic_irq *pirq) |
| 330 | { |
no test coverage detected