MMgr v2.3.0
Zero-heap memory manager in C11. One borrowed buffer, carved by asserted offset.
Loading...
Searching...
No Matches
praet_tabula_vexillorum.h File Reference

Every bit of the channel flag word, and the assertions that retain the map from drift. More...

#include "mmgr.h"

Go to the source code of this file.

Macros

#define PRAET_SEPARATUS
 Detached: the channel holds no engine and no vector.
#define PRAET_ADNEXUS
 Attached: the channel holds the engine and will take a transfer.
#define PRAET_BUSY
 Busy: the engine moves bytes on this channel.
#define PRAET_OK
 Ok: the last transfer finished and the channel is still attached.
#define PRAET_CORE_BITS
 Bits the quaternary core occupies, at the bottom of the word.
#define PRAET_CORE_MASK
 The two bits the quaternary core occupies.
#define PRAET_ID_CLAIMED
 Token id of the status set while the channel holds an interrupt vector.
#define PRAET_ID_SETTLING
 Token id of the status set while the engine settles.
#define PRAET_ID_SEPARANS
 Token id of the status set while a detach is in progress.
#define PRAET_ID_ERROR
 Token id of the status set where the last transfer ended in an error.
#define PRAET_ID_STALLED
 Token id of the status set where an active channel went unkicked for a whole window.
#define PRAET_ID_ABANDONED
 Token id of the status set where a stalled transfer went back.
#define PRAET_ID_SCRUBBED
 Token id of the status set where a stalled transfer's bytes counted as unsafe.
#define PRAET_ID_MEASURED
 Token id of the status set where a recovery measured the boundary word.
#define PRAET_STATUS_COUNT
 How many status token ids there are.
#define PRAET_STATUS_SHIFT
 First bit the statuses occupy, the bit above the core.
#define PRAET_STATUS_BIT(id_)
 The bit a status token id owns.
#define PRAET_STATUS_MASK
 Every bit the statuses occupy, derived from how many there are.
#define PRAET_CLAIMED
 Set while the channel holds an interrupt vector.
#define PRAET_SETTLING
 Set while the engine settles and will take no transfer.
#define PRAET_SEPARANS
 Set where a detach is in progress and the channel did not finish it.
#define PRAET_ERROR
 Set where the last transfer ended in an error, clear where it completed.
#define PRAET_STALLED
 Set where an active channel went a whole keepalive window with no kick.
#define PRAET_ABANDONED
 Set where a stalled transfer went back and its bytes stayed as they were.
#define PRAET_SCRUBBED
 Set where a stalled transfer resolved with its bytes counted as unsafe.
#define PRAET_MEASURED
 Set where a recovery measured the word the engine was in the middle of.
#define PRAET_EVERY_STATUS
 Every status, listed by name.
#define PRAET_REGION_SHIFT
 First bit of the region descriptor.
#define PRAET_REGION_BITS
 How wide the region descriptor is.
#define PRAET_REGION_MAX
 The largest descriptor the region field holds.
#define PRAET_REGION_MASK
 The bits the region descriptor occupies once shifted into place.
#define PRAET_REGION_FIELD(region_)
 A region descriptor placed in the field the map gives it.
#define PRAET_REGION_ID_HIGHEST
 The largest region token id there is.
#define PRAET_MAP_MASK
 Every bit the map accounts for.

Enumerations

enum  PraetRegion {
  PRAET_REGION_INTERNAL ,
  PRAET_REGION_EXTERNAL
}
 The regions a channel can attach over. More...

Detailed Description

Every bit of the channel flag word, and the assertions that retain the map from drift.

Author
dstroy0 (Douglas Quigg) dquig.nosp@m.g123.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
Date
2026-09-01
Note
The map is ours, and for that reason it needs a check. Nothing outside this library assigns these bits. A status added at the wrong offset or a region moved one byte down is a change no compiler would question. No test would necessarily reach it.
A token id names each status and its bit derives from it. A name and its bit cannot disagree. What the assertions below check is the id set. It is dense, no two ids collide, and the three fields do not overlap each other.
The map is the same on every build. A status a build never sets still owns its bit. A flag word read on one part has to mean what it means on another.

Definition in file praet_tabula_vexillorum.h.