The schedule context: one flag word per channel, the two volatiles that coordinate the interrupt, and the reader/setter that is the only thing touching either. More...
#include "mmgr.h"#include "memoriam_praetereo/praet_praefinitum.h"#include "memoriam_praetereo/praet_tabula_vexillorum.h"#include "memoriam_praetereo/praet_horologiorum_custos.h"#include "memoriam_praetereo/praet_iudex.h"#include "memoriam_praetereo/praet_procurator.h"Go to the source code of this file.
Data Structures | |
| struct | PraetOrdo |
| Everything one context schedules over. More... | |
Macros | |
| #define | PRAET_DENUNTIATIO_ATTR(message_) |
| Marks a declaration so that every use of it reports, carrying a message. | |
| #define | PRAET_CRC_RESPONSUM_IN_LOCO_FIGERE(token_) |
Pastes token_ onto the answer type prefix. | |
| #define | PRAET_CRC_RESPONSUM(token_) |
The answer type token_ names, after expanding it. | |
| #define | PRAET_CRC_VALUE_AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_DISABLE |
| The value the AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_DISABLE token stands for. | |
| #define | PRAET_CRC_VALUE_AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_ENABLE |
| The value the AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_ENABLE token stands for. | |
| #define | PRAET_CRC_VALUE_IN_LOCO_FIGERE(token_) |
Pastes token_ onto the value prefix. | |
| #define | PRAET_CRC_VALUE(token_) |
The value token_ stands for, after expanding it. | |
| #define | PRAET_ORDINEM_INCIPE(crc_choice_) |
| An empty context, for a build with no recovery machinery to configure. | |
| #define | PraetOrdoContext(name_, crc_choice_) |
| Declares one schedule context and answers the boundary word question for it. | |
| #define | PraetAttach(context_, channel_, pool_, region_) |
| Attaches a channel over a declared pool, by name. | |
| #define | PraetChannel(context_, channel_, pool_) |
| Declares which pool a channel of a context is over. | |
| #define | PRAET_ALVEUS_SUPERARE(context_, channel_, pool_) |
| Names the binding a channel was declared with, and fails where there is none. | |
| #define | PRAET_SPAN_FITS(pool_, offset_, length_) |
| Fails the build when a span runs past the pool it names. | |
| #define | PraetSubmit(context_, channel_, pool_, offset_, length_) |
| Submits a span of a declared pool on a channel attached over that pool. | |
Enumerations | |
| enum | PraetRecoveryWordBoundaryBitwiseCrc { AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_DISABLE , AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_ENABLE } |
| The two answers a declaration may give about the boundary word check. More... | |
Functions | |
| typedef | PRAET_DENUNTIATIO_ATTR ("AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_DISABLE - this context measures no boundary word. A " "recovery is exact to the word and no " "finer") unsigned char PraetCrcResponsum_AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_DISABLE |
| A type that exists only for the AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_DISABLE token. | |
| typedef | PRAET_DENUNTIATIO_ATTR ("AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_ENABLE - this context checksums the word a stalled " "transfer was inside, one word, bit at a time, on the recovery path " "only") unsigned char PraetCrcResponsum_AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_ENABLE |
| A type that exists only for the AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_ENABLE token. | |
| uint16_t | praet_hw_progress (embed_word channel) |
Returns how far the port says channel has got, in bytes. | |
| void | praet_ordo_reset (PraetOrdo *context) |
| Clears a context back to every channel detached. | |
| embed_bool | praet_ordo_adnectere (PraetOrdo *context, embed_word channel, uint8_t *bound, embed_word bytes, embed_word region) |
| Attaches a channel over a block of bytes, claims its vector, and starts the settle timer. | |
| void | praet_ordo_separare (PraetOrdo *context, embed_word channel) |
| Asks for a channel to be detached. | |
| embed_bool | praet_ordo_relatio (PraetOrdo *context, embed_word channel) |
| Marks a channel busy and starts its keepalive window. | |
| void | praet_ordo_efficere (PraetOrdo *context, embed_word channel) |
| Feeds the watchdog for one channel. | |
| void | praet_ordo_completed (PraetOrdo *context, embed_word channel, embed_bool failed) |
| Reports that a channel's transfer finished. | |
| void | praet_ordo_advance (PraetOrdo *context, embed_word micros) |
Advances the clock by micros. | |
| void | praet_ordo_advance_ticks (PraetOrdo *context, embed_word ticks) |
Advances the clock by ticks, scaled against the declared frequency. | |
| void | praet_ordo_raise (PraetOrdo *context) |
| Stands in for the interrupt raising the set volatile. | |
| void | praet_ordo_poll (PraetOrdo *context) |
| Drives the port and brings every flag word up to date. The caller's poll. | |
| uint32_t | praet_ordo_flags (const PraetOrdo *context, embed_word channel) |
| Returns one channel's flag word. | |
The schedule context: one flag word per channel, the two volatiles that coordinate the interrupt, and the reader/setter that is the only thing touching either.
Definition in file praet_ordo.h.
| #define PRAET_DENUNTIATIO_ATTR | ( | message_ | ) |
Marks a declaration so that every use of it reports, carrying a message.
| [in] | message_ | Text the diagnostic reports, as a string literal. |
Definition at line 105 of file praet_ordo.h.
Referenced by PRAET_DENUNTIATIO_ATTR(), and PRAET_DENUNTIATIO_ATTR().
| #define PRAET_CRC_RESPONSUM_IN_LOCO_FIGERE | ( | token_ | ) |
Pastes token_ onto the answer type prefix.
| [in] | token_ | One of the two AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC tokens. |
Definition at line 138 of file praet_ordo.h.
| #define PRAET_CRC_RESPONSUM | ( | token_ | ) |
The answer type token_ names, after expanding it.
| [in] | token_ | One of the two AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC tokens, or a macro holding one. |
Definition at line 148 of file praet_ordo.h.
| #define PRAET_CRC_VALUE_AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_DISABLE |
The value the AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_DISABLE token stands for.
Definition at line 156 of file praet_ordo.h.
| #define PRAET_CRC_VALUE_AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_ENABLE |
The value the AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_ENABLE token stands for.
Definition at line 161 of file praet_ordo.h.
| #define PRAET_CRC_VALUE_IN_LOCO_FIGERE | ( | token_ | ) |
Pastes token_ onto the value prefix.
| [in] | token_ | One of the two AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC tokens. |
Definition at line 169 of file praet_ordo.h.
| #define PRAET_CRC_VALUE | ( | token_ | ) |
The value token_ stands for, after expanding it.
| [in] | token_ | One of the two AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC tokens, or a macro holding one. |
Definition at line 179 of file praet_ordo.h.
| #define PRAET_ORDINEM_INCIPE | ( | crc_choice_ | ) |
An empty context, for a build with no recovery machinery to configure.
| crc_choice_ | One of the two AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC tokens, unused here. |
Definition at line 201 of file praet_ordo.h.
| #define PraetOrdoContext | ( | name_, | |
| crc_choice_ ) |
Declares one schedule context and answers the boundary word question for it.
| name_ | Name of the context this declares. |
| crc_choice_ | AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_ENABLE or AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_DISABLE. |
Definition at line 219 of file praet_ordo.h.
| #define PraetAttach | ( | context_, | |
| channel_, | |||
| pool_, | |||
| region_ ) |
Attaches a channel over a declared pool, by name.
| context_ | Context the channel belongs to. |
| channel_ | Channel to attach. |
| pool_ | Pool declared by ParsMemoriaeInternae or ParsMemoriaeExternum. |
| region_ | Region descriptor for this channel, as a byte. |
Definition at line 368 of file praet_ordo.h.
| #define PraetChannel | ( | context_, | |
| channel_, | |||
| pool_ ) |
Declares which pool a channel of a context is over.
| context_ | Context the channel belongs to. |
| channel_ | Channel number, as a literal, since it is pasted into the symbol this emits. |
| pool_ | Pool declared by ParsMemoriaeInternae or ParsMemoriaeExternum. |
Definition at line 392 of file praet_ordo.h.
| #define PRAET_ALVEUS_SUPERARE | ( | context_, | |
| channel_, | |||
| pool_ ) |
Names the binding a channel was declared with, and fails where there is none.
| context_ | Context the channel belongs to. |
| channel_ | Channel number, as a literal. |
| pool_ | Pool the caller believes the channel is over. |
Definition at line 411 of file praet_ordo.h.
| #define PRAET_SPAN_FITS | ( | pool_, | |
| offset_, | |||
| length_ ) |
Fails the build when a span runs past the pool it names.
| pool_ | Pool declared by ParsMemoriaeInternae or ParsMemoriaeExternum. |
| offset_ | Bytes into that pool the span starts at. |
| length_ | Bytes in the span. |
Definition at line 556 of file praet_ordo.h.
| #define PraetSubmit | ( | context_, | |
| channel_, | |||
| pool_, | |||
| offset_, | |||
| length_ ) |
Submits a span of a declared pool on a channel attached over that pool.
| context_ | Context the channel belongs to. |
| channel_ | Channel to run on. |
| pool_ | Pool declared by ParsMemoriaeInternae or ParsMemoriaeExternum. |
| offset_ | Bytes into that pool the transfer starts at. |
| length_ | Bytes it moves. |
Definition at line 601 of file praet_ordo.h.
The two answers a declaration may give about the boundary word check.
Definition at line 80 of file praet_ordo.h.
| typedef PRAET_DENUNTIATIO_ATTR | ( | "AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_DISABLE - this context measures no boundary word. A " "recovery is exact to the word and no " "finer" | ) |
A type that exists only for the AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_DISABLE token.
References PRAET_DENUNTIATIO_ATTR.
| typedef PRAET_DENUNTIATIO_ATTR | ( | "AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_ENABLE - this context checksums the word a stalled " "transfer was | inside, |
| one | word, | ||
| bit at a | time, | ||
| on the recovery path " "only" | ) |
A type that exists only for the AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_ENABLE token.
References PRAET_DENUNTIATIO_ATTR.
| uint16_t praet_hw_progress | ( | embed_word | channel | ) |
Returns how far the port says channel has got, in bytes.
| [in] | channel | Channel to read. |
References praet_hw_progress().
Referenced by praet_hw_progress().
| void praet_ordo_reset | ( | PraetOrdo * | context | ) |
Clears a context back to every channel detached.
| [out] | context | Context to clear [BORROWS]. |
References praet_ordo_reset().
Referenced by praet_ordo_reset().
| embed_bool praet_ordo_adnectere | ( | PraetOrdo * | context, |
| embed_word | channel, | ||
| uint8_t * | bound, | ||
| embed_word | bytes, | ||
| embed_word | region ) |
Attaches a channel over a block of bytes, claims its vector, and starts the settle timer.
| [in,out] | context | Context the channel belongs to [BORROWS]. |
| [in] | channel | Channel to attach. |
| [in] | bound | First byte of the memory this channel moves. The caller's [BORROWS]. |
| [in] | bytes | How many bytes are there. |
| [in] | region | Region descriptor for this channel, as a byte. |
References praet_ordo_adnectere().
Referenced by praet_ordo_adnectere().
| void praet_ordo_separare | ( | PraetOrdo * | context, |
| embed_word | channel ) |
Asks for a channel to be detached.
| [in,out] | context | Context the channel belongs to [BORROWS]. |
| [in] | channel | Channel to detach. |
References praet_ordo_efficere(), praet_ordo_relatio(), and praet_ordo_separare().
Referenced by praet_ordo_separare().
| embed_bool praet_ordo_relatio | ( | PraetOrdo * | context, |
| embed_word | channel ) |
Marks a channel busy and starts its keepalive window.
| [in,out] | context | Context the channel belongs to [BORROWS]. |
| [in] | channel | Channel to run on. |
References praet_ordo_relatio().
Referenced by praet_ordo_relatio(), and praet_ordo_separare().
| void praet_ordo_efficere | ( | PraetOrdo * | context, |
| embed_word | channel ) |
Feeds the watchdog for one channel.
| [in,out] | context | Context the channel belongs to [BORROWS]. |
| [in] | channel | Channel that showed a sign of life. |
References praet_ordo_efficere().
Referenced by praet_ordo_efficere(), and praet_ordo_separare().
| void praet_ordo_completed | ( | PraetOrdo * | context, |
| embed_word | channel, | ||
| embed_bool | failed ) |
Reports that a channel's transfer finished.
| [in,out] | context | Context the channel belongs to [BORROWS]. |
| [in] | channel | Channel that finished. |
| [in] | failed | EMBED_TRUE where it ended in an error, EMBED_FALSE on a completion. |
References praet_ordo_completed().
Referenced by praet_ordo_completed().
| void praet_ordo_advance | ( | PraetOrdo * | context, |
| embed_word | micros ) |
Advances the clock by micros.
| [in,out] | context | Context to advance [BORROWS]. |
| [in] | micros | Microseconds to add. |
References praet_ordo_advance().
Referenced by praet_ordo_advance().
| void praet_ordo_advance_ticks | ( | PraetOrdo * | context, |
| embed_word | ticks ) |
Advances the clock by ticks, scaled against the declared frequency.
| [in,out] | context | Context to advance [BORROWS]. |
| [in] | ticks | Ticks read off the clock this build declared. |
References praet_ordo_advance_ticks().
Referenced by praet_ordo_advance_ticks().
| void praet_ordo_raise | ( | PraetOrdo * | context | ) |
Stands in for the interrupt raising the set volatile.
| [in,out] | context | Context the interrupt belongs to [BORROWS]. |
References praet_ordo_raise().
Referenced by praet_ordo_raise().
| void praet_ordo_poll | ( | PraetOrdo * | context | ) |
Drives the port and brings every flag word up to date. The caller's poll.
| [in,out] | context | Context to poll [BORROWS]. |
References praet_ordo_poll().
Referenced by praet_ordo_poll().
| uint32_t praet_ordo_flags | ( | const PraetOrdo * | context, |
| embed_word | channel ) |
Returns one channel's flag word.
| [in] | context | Context the channel belongs to [BORROWS]. |
| [in] | channel | Channel to read. |
References praet_ordo_flags().
Referenced by praet_ordo_flags().