1/* 2 * Copyright 2017, Data61 3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) 4 * ABN 41 687 119 230. 5 * 6 * This software may be distributed and modified according to the terms of 7 * the BSD 2-Clause license. Note that NO WARRANTY is provided. 8 * See "LICENSE_BSD2.txt" for details. 9 * 10 * @TAG(DATA61_BSD) 11 */ 12 13#include <sel4platsupport/device.h> 14#include <utils/util.h> 15 16int sel4platsupport_arch_copy_irq_cap(arch_simple_t *arch_simple, ps_irq_t *irq, cspacepath_t *dest) 17{ 18 switch (irq->type) { 19 case PS_TRIGGER: 20 return arch_simple_get_IRQ_trigger(arch_simple, irq->trigger.number, irq->trigger.trigger, *dest); 21 case PS_PER_CPU: 22 return arch_simple_get_IRQ_trigger_cpu(arch_simple, irq->cpu.number, irq->cpu.trigger, irq->cpu.cpu_idx, *dest); 23 default: 24 ZF_LOGE("unknown irq type"); 25 return -1; 26 } 27} 28