Loading...
Searching...
No Matches
msg.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
24#ifndef BHP_MSG_H
25#define BHP_MSG_H
26
27#include "msg.h"
28#include "thread.h"
29#include "bhp.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
38#define BHP_MSG_BH_REQUEST 0x1539
39
48
57void bhp_msg_init(bhp_msg_t *bhp_msg, bhp_cb_t cb, void *ctx);
58
73void bhp_msg_isr_cb(void *bhp_msg_ctx);
74
81static inline void bhp_msg_claim_thread(bhp_msg_t *bhp_msg, kernel_pid_t pid)
82{
83 bhp_msg->pid = pid;
84}
85
95static inline void bhp_msg_handler(msg_t *msg)
96{
99}
100
101#ifdef __cplusplus
102}
103#endif
104
105#endif /* BHP_MSG_H */
#define assert(cond)
abort the program if assertion is false
Definition assert.h:137
int16_t kernel_pid_t
Unique process identifier.
Definition sched.h:139
static void bhp_msg_handler(msg_t *msg)
Handle a Bottom Half Processor message with type BHP_MSG_BH_REQUEST.
Definition msg.h:95
#define BHP_MSG_BH_REQUEST
The message type to trigger Bottom Half Processing.
Definition msg.h:38
void bhp_msg_init(bhp_msg_t *bhp_msg, bhp_cb_t cb, void *ctx)
Init a Bottom Half Processor to be used with messages.
void bhp_msg_isr_cb(void *bhp_msg_ctx)
Message based Bottom Half Processor ISR callback To be called from ISR in order to trigger the Bottom...
static void bhp_msg_claim_thread(bhp_msg_t *bhp_msg, kernel_pid_t pid)
Claim a thread with a message queue to be used as Bottom Half Processor.
Definition msg.h:81
static void bhp_irq_handler(bhp_t *bhp)
Call the IRQ handler associated to a Bottom Half Processor descriptor.
Definition bhp.h:64
void(* bhp_cb_t)(void *arg)
A Bottom Half Processor callback.
Definition bhp.h:46
Message based Bottom Half Processor descriptor.
Definition msg.h:43
bhp_t bhp
Bottom Half Processor descriptor.
Definition msg.h:44
msg_t msg
Message containing the Bottom Half Processing request.
Definition msg.h:46
kernel_pid_t pid
PID of the thread that process the Bottom Half Processor.
Definition msg.h:45
Bottom Half Processor descriptor.
Definition bhp.h:51
Describes a message object which can be sent between threads.
Definition msg.h:196
uint16_t type
Type field.
Definition msg.h:199
union msg_t::@1 content
Content of the message.
void * ptr
Pointer content field.
Definition msg.h:201
Definitions for parsing and composition of DNS messages.