summaryrefslogtreecommitdiff
path: root/include/irq_offload.h
blob: 17beb14b05879488f8cf29b78f80e853eea9a96d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * Copyright (c) 2015 Intel corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/**
 * @file
 * @brief IRQ Offload interface
 */
#ifndef _IRQ_OFFLOAD_H_
#define _IRQ_OFFLOAD_H_

#ifdef __cplusplus
extern "C" {
#endif

typedef void (*irq_offload_routine_t)(void *parameter);

/**
 * @brief Run a function in interrupt context
 *
 * This function synchronously runs the provided function in interrupt
 * context, passing in the supplied parameter. Useful for test code
 * which needs to show that kernel objects work correctly in interrupt
 * context.
 *
 * @param routine The function to run
 * @param parameter Argument to pass to the function when it is run as an
 * interrupt
 */
void irq_offload(irq_offload_routine_t routine, void *parameter);

#ifdef __cplusplus
}
#endif

#endif /* _SW_IRQ_H_ */