bhp.h
1 /*
2  * SPDX-FileCopyrightText: 2022 HAW Hamburg
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
35 typedef struct bhp bhp_t;
36 
42 typedef void (*bhp_cb_t)(void *arg);
43 
47 struct bhp {
49  void *ctx;
50 };
51 
60 static inline void bhp_irq_handler(bhp_t *bhp)
61 {
63 }
64 
75 static inline void bhp_set_cb(bhp_t *bhp, bhp_cb_t cb, void *ctx)
76 {
77  bhp->irq_handler = cb;
78  bhp->ctx = ctx;
79 }
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
static void bhp_irq_handler(bhp_t *bhp)
Call the IRQ handler associated to a Bottom Half Processor descriptor.
Definition: bhp.h:60
static void bhp_set_cb(bhp_t *bhp, bhp_cb_t cb, void *ctx)
Set the callback for a Bottom Half Processor.
Definition: bhp.h:75
void(* bhp_cb_t)(void *arg)
A Bottom Half Processor callback.
Definition: bhp.h:42
Bottom Half Processor descriptor.
Definition: bhp.h:47
void * ctx
Context of the IRQ handler.
Definition: bhp.h:49
bhp_cb_t irq_handler
Bottom Half Processor IRQ handler.
Definition: bhp.h:48