1 /* 2 * Copyright (c) 2015 Intel corporation 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 /** 8 * @file Software interrupts utility code - ARC implementation 9 */ 10 11 #include <kernel.h> 12 #include <irq_offload.h> 13 14 static irq_offload_routine_t offload_routine; 15 static const void *offload_param; 16 17 /* Called by trap_s exception handler */ z_irq_do_offload(void)18void z_irq_do_offload(void) 19 { 20 offload_routine(offload_param); 21 } 22 arch_irq_offload(irq_offload_routine_t routine,const void * parameter)23void arch_irq_offload(irq_offload_routine_t routine, const void *parameter) 24 { 25 26 offload_routine = routine; 27 offload_param = parameter; 28 29 __asm__ volatile ("trap_s %[id]" 30 : 31 : [id] "i"(_TRAP_S_SCALL_IRQ_OFFLOAD) : ); 32 33 } 34