Loading...
Searching...
No Matches
bhp.h
1/*
2 * Copyright (C) 2022 HAW Hamburg
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser General
5 * Public License v2.1. See the file LICENSE in the top level directory for more
6 * details.
7 */
8
9#pragma once
10
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
38typedef struct bhp bhp_t;
39
45typedef void (*bhp_cb_t)(void *arg);
46
50struct bhp {
52 void *ctx;
53};
54
63static inline void bhp_irq_handler(bhp_t *bhp)
64{
66}
67
78static inline void bhp_set_cb(bhp_t *bhp, bhp_cb_t cb, void *ctx)
79{
80 bhp->irq_handler = cb;
81 bhp->ctx = ctx;
82}
83
84#ifdef __cplusplus
85}
86#endif
87
static void bhp_irq_handler(bhp_t *bhp)
Call the IRQ handler associated to a Bottom Half Processor descriptor.
Definition bhp.h:63
struct bhp bhp_t
Forward declaration of the Bottom Half Processor descriptor.
Definition bhp.h:38
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:78
void(* bhp_cb_t)(void *arg)
A Bottom Half Processor callback.
Definition bhp.h:45
Bottom Half Processor descriptor.
Definition bhp.h:50
void * ctx
Context of the IRQ handler.
Definition bhp.h:52
bhp_cb_t irq_handler
Bottom Half Processor IRQ handler.
Definition bhp.h:51