Commit b4ef46b0 authored by Alessandro Rubini's avatar Alessandro Rubini

define hooks (currently empty) and provide them

This new "struct pp_ext_hooks" is used to include pointers to
extension-specific hooks that allow to avoid code duplication.
I'm now going to apply it to ext-whiterabbit, one state at a time.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <>
parent 44deab24
......@@ -297,6 +297,21 @@ static inline struct pp_servo *SRV(struct pp_instance *ppi)
return ppi->servo;
* Each extension should fill this structure that is used to augment
* the standard stated and avoid code duplications. Please remember
* that proto-standard functions are picked as a fall-back when non
* extension-specific code is provided. The set of hooks here is designed
* based on what White Rabbit does. If you add more please remember to
* allow NULL pointers.
struct pp_ext_hooks {
extern struct pp_ext_hooks pp_hooks; /* The one for the extension we build */
/* The channel for an instance must be created and possibly destroyed. */
extern int pp_open_instance(struct pp_instance *ppi,
struct pp_runtime_opts *rt_opts);
......@@ -16,6 +16,7 @@ OBJ-libwr := $D/fsm-table.o \
$D/msg.o \
$D/arith.o \
$D/servo.o \
$D/hooks.o \
$D/open-close.o \
$D/state-wr-present.o \
$D/state-wr-m-lock.o \
#include <ppsi/ppsi.h>
/* ext-whiterabbit must offer its own hooks */
struct pp_ext_hooks pp_hooks;
......@@ -22,6 +22,7 @@ OBJ-libstd := $D/fsm-table.o \
$D/msg.o \
$D/arith.o \
$D/servo.o \
$D/hooks.o \
#include <ppsi/ppsi.h>
/* proto-standard offers all-null hooks as a default extension */
struct pp_ext_hooks pp_hooks;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment