Loading...
Searching...
No Matches
Bottom Half Processor

Base implementation of Bottom Half Processor module for generic IRQ offloading. More...

Detailed Description

Base implementation of Bottom Half Processor module for generic IRQ offloading.

This module provides a generic mechanism to schedule an offload request (Top Half) from interrupt context and run the IRQ handler in thread context. A Bottom Half Processor interface stores a pointer to the device IRQ handler and context, which allows device agnostic IRQ offloading.

A user of this module can either use the Bottom Half Processor interface directly or use an existing implementation of a Bottom Half Processor (see Event based implementation of Bottom Half Processor)

Author
José I. Alamos jose..nosp@m.alam.nosp@m.os@ha.nosp@m.w-ha.nosp@m.mburg.nosp@m..de

Modules

 Event based implementation of Bottom Half Processor
 Bottom Half Processor module for generic IRQ offloading.
 
 Message based implementation of Bottom Half Processor
 Bottom Half Processor module for generic IRQ offloading using messages.
 

Data Structures

struct  bhp
 Bottom Half Processor descriptor. More...
 

Typedefs

typedef struct bhp bhp_t
 Forward declaration of the Bottom Half Processor descriptor.
 
typedef void(* bhp_cb_t) (void *arg)
 A Bottom Half Processor callback.
 

Functions

static void bhp_irq_handler (bhp_t *bhp)
 Call the IRQ handler associated to a Bottom Half Processor descriptor.
 
static void bhp_set_cb (bhp_t *bhp, bhp_cb_t cb, void *ctx)
 Set the callback for a Bottom Half Processor.
 

Typedef Documentation

◆ bhp_cb_t

typedef void(* bhp_cb_t) (void *arg)

A Bottom Half Processor callback.

Parameters
[in]argContext of the callback

Definition at line 46 of file bhp.h.

◆ bhp_t

typedef struct bhp bhp_t

Forward declaration of the Bottom Half Processor descriptor.

Definition at line 39 of file bhp.h.

Function Documentation

◆ bhp_irq_handler()

static void bhp_irq_handler ( bhp_t bhp)
inlinestatic

Call the IRQ handler associated to a Bottom Half Processor descriptor.

Note
It is possible, although not recommended, to call this function on ISR. This can be done e.g when it is required to process the handler during ISR.
Parameters
[in]bhpPointer to the Bottom Half Processor descriptor

Definition at line 64 of file bhp.h.

◆ bhp_set_cb()

static void bhp_set_cb ( bhp_t bhp,
bhp_cb_t  cb,
void *  ctx 
)
inlinestatic

Set the callback for a Bottom Half Processor.

This function should be called inside the init function of a device that requires ISR offloading.

Parameters
[in]bhpPointer to the Bottom Half Processor
[in]cbIRQ handler of the Bottom Half Processor
[in]ctxContext of the IRQ handler

Definition at line 79 of file bhp.h.