24#ifndef PROTOCORE_WORKER_H
25#define PROTOCORE_WORKER_H
29#include "locus_carcerum/locus_carcerum.h"
31#if PROTOCORE_ENABLE_PREEMPT_QUEUE
34#if PROTOCORE_ENABLE_IDEMIP
35#include "src/idemip_owners.h"
54#if PROTOCORE_WORKER_COUNT == 1
101#if PROTOCORE_ENABLE_IDEMIP
102#define PROTOCORE_OWNERS(owner_) \
103 owner_(protocore_owner_plain, "protocore_plain") owner_(protocore_owner_secure, "protocore_secure") \
104 IDEMIP_OWNERS(owner_)
106#define PROTOCORE_OWNERS(owner_) \
107 owner_(protocore_owner_plain, "protocore_plain") owner_(protocore_owner_secure, "protocore_secure")
195#if PROTOCORE_ENABLE_PREEMPT_QUEUE
197 const PreemptQueueNs *queue;
210 void (*
const stop)(uint8_t *work);
211 void (*
const wake)(uint8_t *work);
223#if PROTOCORE_ENABLE_PREEMPT_QUEUE
230static const WorkerNs Workers __attribute__((unused)) = {
237#if PROTOCORE_ENABLE_PREEMPT_QUEUE
User-configurable preempting work queues + high-priority processing tasks (PROTOCORE_ENABLE_PREEMPT_Q...
One deferred call: what runs, and what it is given.
protocore_deferred_fn fn
what the worker runs
void * arg
the opaque context it is given
void(*const wake)(uint8_t *work)
void(*const run_deferred)(uint8_t *work)
void(*const running)(uint8_t *work)
void(*const stop)(uint8_t *work)
void(*const start)(uint8_t *work)
void(*const defer)(uint8_t *work)
WorkerDeferArgs defer_args
the call handed to a worker to run in its own context
protocore_worker_pump_fn pump
what a started worker runs each time it wakes
int worker_id
the worker every call names
void(* protocore_deferred_fn)(void *arg)
Deferred callback signature.
void protocore_workers_stop(uint8_t *work)
void protocore_workers_defer(uint8_t *work)
const MinimumSecurityGuard * protocore_plain_guard(void)
The plaintext guard the calling worker borrows through. Never NULL.
void protocore_workers_run_deferred(uint8_t *work)
void protocore_workers_running(uint8_t *work)
const CellOwner * protocore_secure_owner(void)
The owner that every key-material take in the library names. Never NULL.
void protocore_worker_set_self(int id)
Bind the calling task/thread to worker id id (worker entry / tests).
uint8_t * protocore_worker_span(void)
The PROTOCORE_WORKER_BORROW bytes this module's state lives in.
void protocore_workers_start(uint8_t *work)
void * protocore_secure_persist(size_t n)
n persistent key-material bytes, zeroed, or NULL if the calling worker's cellblock is full.
const MaxSecurityGuard * protocore_secure_guard(void)
The key-material guard the calling worker borrows through. Never NULL.
int protocore_worker_self(void)
Worker id [0, count) of the calling task; 0 by default / single-worker.
void * protocore_plain_persist(size_t n)
n persistent plaintext bytes, zeroed, or NULL if the calling worker's cellblock is full.
void protocore_cellblocks_bind(int worker, const MinimumSecurityGuard *plain, const MaxSecurityGuard *secure)
Hand worker slot worker the guards it borrows through.
#define PROTOCORE_OWNERS(owner_)
The owners of the library, as the list that MMGR_OWNERS takes.
WorkersVars WorkersV
The operands and the outcome.
const CellOwner * protocore_plain_owner(void)
The owner that every plaintext take in the library names. Never NULL.
void(* protocore_worker_pump_fn)(int worker_id)
Pump callback run by each worker task with its worker id.
void protocore_workers_wake(uint8_t *work)
EMBED_BEGIN_DECLS int protocore_worker_count(void)
Number of server worker tasks (PROTOCORE_WORKER_COUNT).