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

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...

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.

Detailed Description

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.

Author
dstroy0 (Douglas Quigg) dquig.nosp@m.g123.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
Date
2026-09-01
Note
A context exists only where DMA has to schedule internally. A channel is not a context.
Two separate concerns live here and must not be folded together. The quaternary core in the flag word is the channel's DMA state, where busy means the engine is moving bytes. The busy volatile below is the reader/setter's lock, and means it is mid-update.
Time is microseconds throughout. DMA timing is tight enough that a millisecond is not a unit anything here can be expressed in.

Definition in file praet_ordo.h.

Macro Definition Documentation

◆ PRAET_DENUNTIATIO_ATTR

#define PRAET_DENUNTIATIO_ATTR ( message_)

Marks a declaration so that every use of it reports, carrying a message.

Parameters
[in]message_Text the diagnostic reports, as a string literal.
Note
Aliased under this module's prefix and written once, as embed_compiler_directives.h asks a consumer to do with an attribute.
The deprecated attribute, where the error and warning ones fall short. Those report at a call that survives compilation, and a declaration at file scope has no call in it - measured, both silent. This one reports at any use, and a typedef naming the type is a use.
Nothing marked with this is deprecated. It is the only attribute that reports from a declarator, and what it is being used for is to make a deliberate answer visible. Nothing is retired. The message says which answer, and so the line reads correctly whatever GCC prefixes it with.
Warning
Expands to nothing where EMBED_HAS_ATTRIBUTE(deprecated) is 0. The answer is then silent and only a wrong token still fails, the half that cannot be missed.

Definition at line 105 of file praet_ordo.h.

Referenced by PRAET_DENUNTIATIO_ATTR(), and PRAET_DENUNTIATIO_ATTR().

◆ PRAET_CRC_RESPONSUM_IN_LOCO_FIGERE

#define PRAET_CRC_RESPONSUM_IN_LOCO_FIGERE ( token_)

Pastes token_ onto the answer type prefix.

Parameters
[in]token_One of the two AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC tokens.
Returns
The answer type for that token.

Definition at line 138 of file praet_ordo.h.

◆ PRAET_CRC_RESPONSUM

#define PRAET_CRC_RESPONSUM ( token_)

The answer type token_ names, after expanding it.

Parameters
[in]token_One of the two AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC tokens, or a macro holding one.
Returns
That token's answer type.
Note
This is what refuses a plain 1 or TRUE in the answer's place. Those are values, and the two tokens are the only things that name a type here.

Definition at line 148 of file praet_ordo.h.

◆ PRAET_CRC_VALUE_AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_DISABLE

#define PRAET_CRC_VALUE_AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_DISABLE

The value the AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_DISABLE token stands for.

Note
Pasted onto, and so the declarator gets the answer at preprocessing time and can assert on it.

Definition at line 156 of file praet_ordo.h.

◆ PRAET_CRC_VALUE_AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_ENABLE

#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.

◆ PRAET_CRC_VALUE_IN_LOCO_FIGERE

#define PRAET_CRC_VALUE_IN_LOCO_FIGERE ( token_)

Pastes token_ onto the value prefix.

Parameters
[in]token_One of the two AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC tokens.
Returns
The value macro for that token.

Definition at line 169 of file praet_ordo.h.

◆ PRAET_CRC_VALUE

#define PRAET_CRC_VALUE ( token_)

The value token_ stands for, after expanding it.

Parameters
[in]token_One of the two AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC tokens, or a macro holding one.
Returns
1 for the ENABLE token, 0 for the DISABLE token.
Note
Usable in an #if, as lets a caller compile one thing or another around their own answer without keeping a second macro in step with it.

Definition at line 179 of file praet_ordo.h.

◆ PRAET_ORDINEM_INCIPE

#define PRAET_ORDINEM_INCIPE ( crc_choice_)

An empty context, for a build with no recovery machinery to configure.

Parameters
crc_choice_One of the two AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC tokens, unused here.
Returns
A zero initializer.
Note
The token is still demanded by the declarator and still reports. What changes is that there is no member to put it in, and the assertion there refuses the ENABLE arm outright.

Definition at line 201 of file praet_ordo.h.

◆ PraetOrdoContext

#define PraetOrdoContext ( name_,
crc_choice_ )

Declares one schedule context and answers the boundary word question for it.

Parameters
name_Name of the context this declares.
crc_choice_AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_ENABLE or AD_VERBI_CONFINIUM_RESTITUE_PAULATIM_CRC_DISABLE.
Note
The instantiation is the declaration. This emits initialized data carrying the answer, and so nothing runs to make a context usable and the answer cannot be changed afterwards.
Reports whichever token it was given. A caller who wanted a quieter build takes the message away by not declaring a context, the only honest way out of it.
Warning
A token that is neither of the two fails on the typedef, with the token it was given in the message. Asking for the check on a build with PRAET_RECOVERY off fails the assertion below, which names what to do about it.

Definition at line 219 of file praet_ordo.h.

◆ PraetAttach

#define PraetAttach ( context_,
channel_,
pool_,
region_ )

Attaches a channel over a declared pool, by name.

Parameters
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.
Returns
What praet_ordo_adnectere answered.
Note
The attach surface on a buffer, and how a caller is meant to reach a channel. Naming the pool makes the address and the extent come from one place: mmgr_pars_storage_##pool_ and pool_##_bytes are both emitted by the declaration, and neither exists for anything that was not declared as a pool.
Not a question of who owns the bytes. What is being tested is whether whoever hands them over has every answer about them: the address, the extent, and which channel is over them. A caller holding all three has said everything this needs, and where the bytes came from is their business.
Both names have internal linkage. A translation unit that did not declare the pool cannot reach either and does not compile. That leaves the answers first hand, and a caller giving all of them makes these bytes legal to touch. The caller said so.
Warning
The region descriptor is still stated here. Which memory a pool sits in was settled by which of the two declarations wrote it, and neither emits a marker this could read, and so deriving it needs something added where the pool is declared.

Definition at line 368 of file praet_ordo.h.

◆ PraetChannel

#define PraetChannel ( context_,
channel_,
pool_ )

Declares which pool a channel of a context is over.

Parameters
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.
Note
Written once per channel, at file scope, beside the context's own declaration. It emits an enumerator whose name carries the context, the channel and the pool, and that name is the binding: PraetAttach and PraetSubmit both name it, and so reaching either with a pool the channel was not declared over is an undeclared identifier that prints the triple that was written.
The same shape locus_carcerum uses. MMGR_CARCER_BODY pastes the site and the pool into prisonsite_##_##name_##_ctx and MMGR_CARCER_MEM makes the pool the member's name. A cellblock's entries cannot be handed another cellblock's bytes. Here the channel joins the paste, because a context has several and they may be over different pools.
Costs nothing. An enumerator emits no storage and is settled while the unit compiles.
Warning
Channel numbers are settled at compile time, as lets this paste one. A channel chosen at run time cannot be bound this way and reaches praet_ordo_adnectere directly, where nothing relates the address to the extent.

Definition at line 392 of file praet_ordo.h.

◆ PRAET_ALVEUS_SUPERARE

#define PRAET_ALVEUS_SUPERARE ( context_,
channel_,
pool_ )

Names the binding a channel was declared with, and fails where there is none.

Parameters
context_Context the channel belongs to.
channel_Channel number, as a literal.
pool_Pool the caller believes the channel is over.
Note
Reads the enumerator PraetChannel emitted. Nothing is computed from it, and the reference is the purpose: a triple nobody declared names an identifier that does not exist.

Definition at line 411 of file praet_ordo.h.

◆ PRAET_SPAN_FITS

#define PRAET_SPAN_FITS ( pool_,
offset_,
length_ )

Fails the build when a span runs past the pool it names.

Parameters
pool_Pool declared by ParsMemoriaeInternae or ParsMemoriaeExternum.
offset_Bytes into that pool the span starts at.
length_Bytes in the span.
Note
The same check as on the other arm, and present here for the same reason it is there. A build with no recovery records nothing about a transfer, and a span that runs off the end of the pool is still a span that runs off the end of the pool.

Definition at line 556 of file praet_ordo.h.

◆ PraetSubmit

#define PraetSubmit ( context_,
channel_,
pool_,
offset_,
length_ )

Submits a span of a declared pool on a channel attached over that pool.

Parameters
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.
Returns
What praet_ordo_relatio answered.
Note
The submit surface on a buffer, and the counterpart of PraetAttach. Naming the pool again gives the bound something to compare against, since the extent lives with the declaration and not with the channel.
The bound is checked here and never inside the entry. Sizes and spans are settled while compiling. A test at run time would be paying for a question that was already answered.
Names the binding PraetChannel declared, and so submitting a pool this channel is not over fails on an identifier carrying the context, the channel and the pool that was written. That is the same guarantee locus_carcerum gets from pasting the site and the pool into one symbol.

Definition at line 601 of file praet_ordo.h.

Enumeration Type Documentation

◆ PraetRecoveryWordBoundaryBitwiseCrc

The two answers a declaration may give about the boundary word check.

Note
Written at length deliberately. This is not a knob that rides along with recovery being on - it is its own deliberate yes or no, made once per context, and the name is meant to be impossible to skim past in a declaration.
Real enumerators. A mistyped token is an undeclared identifier at the declaration instead of quietly reading as the off arm.

Definition at line 80 of file praet_ordo.h.

Function Documentation

◆ PRAET_DENUNTIATIO_ATTR() [1/2]

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.

Note
The declarator pastes the token onto this and typedefs the result. A token that is neither of the two fails on an unknown type name that has the offending token in it. Pasting onto a macro instead gave a syntax error several lines down that named nothing - measured, on the mistyped token this exists to catch.
That same typedef makes the answer report. Both arms carry the attribute, because a choice that only speaks up one way trains everyone to read its silence as the safe answer, and neither answer here is safe by default.

References PRAET_DENUNTIATIO_ATTR.

◆ PRAET_DENUNTIATIO_ATTR() [2/2]

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.

◆ praet_hw_progress()

uint16_t praet_hw_progress ( embed_word channel)

Returns how far the port says channel has got, in bytes.

Parameters
[in]channelChannel to read.
Returns
Bytes moved so far. Zero from a port with nothing to say.
Note
The fifth port hook, and the one the four in memoriam_praetereo.h do not have. Every controller this library targets exposes a remaining count, and the orchestrator needs it to feed a watchdog with something a caller can act on.
Reached only from praet_ordo_poll. Nothing above it sees a byte count that has not been through the flag word first, as keeps how progress is tracked out of a caller's business.
Carries a weak refusing default, the same as the four hooks in memoriam_praetereo.c. It returns zero, and praet_ordo_take_progress treats zero as no movement. A build that supplies no port walks every channel and still marks a stalled one, because an unkicked keepalive window is what marks a channel stopped.
The default sits in praet_ordo.c, the unit that calls it. GCC on PE-COFF emits a weak definition as a weak external that ld does not resolve from another unit, and a weak definition beside its call resolves on every linker this library is built with.

References praet_hw_progress().

Referenced by praet_hw_progress().

◆ praet_ordo_reset()

void praet_ordo_reset ( PraetOrdo * context)

Clears a context back to every channel detached.

Parameters
[out]contextContext to clear [BORROWS].
Note
A declaration emits this as initialized data. The entry exists so one context can be reused.
Warning
Leaves the boundary word answer alone. That came from the declaration and is not state a reset has any business changing.

References praet_ordo_reset().

Referenced by praet_ordo_reset().

◆ praet_ordo_adnectere()

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.

Parameters
[in,out]contextContext the channel belongs to [BORROWS].
[in]channelChannel to attach.
[in]boundFirst byte of the memory this channel moves. The caller's [BORROWS].
[in]bytesHow many bytes are there.
[in]regionRegion descriptor for this channel, as a byte.
Returns
EMBED_TRUE where the channel was detached and is now attached.
Note
Attach and detach are the only entry and exit, and configuration takes no part in either. How long the engine takes to come up is a property of the part, and so it arrives as PRAET_SETTLE_MICROS at compile time and not as an argument here.
Reach this through PraetAttach, which takes the pool by name. Calling it directly means stating an address and an extent separately, and nothing here can tell whether the two go together.
Attaching does not claim the pool. A cellblock and a ring both write their own records into the bytes they dress, and so MMGR_PARS_CLAIMED_ONCE exists to keep two of those off one pool. This writes no records into the bytes, and an engine filling ring segments while a consumer drains them is the arrangement the module is for.
Warning
Fails closed. A channel that is not detached is left exactly as it was.
Two channels may be attached over one block, and nothing here reports it. Which of them runs when is the caller's plan, and this library does not have it.

References praet_ordo_adnectere().

Referenced by praet_ordo_adnectere().

◆ praet_ordo_separare()

void praet_ordo_separare ( PraetOrdo * context,
embed_word channel )

Asks for a channel to be detached.

Parameters
[in,out]contextContext the channel belongs to [BORROWS].
[in]channelChannel to detach.
Note
Writes the request and reports nothing. The caller reads the result out of the flag word, as gives a void teardown something to report through.
A second request against a channel already detaching changes nothing. Hardware teardown writes the disable and polls the busy bit, and so calling again is the normal path.

References praet_ordo_efficere(), praet_ordo_relatio(), and praet_ordo_separare().

Referenced by praet_ordo_separare().

◆ praet_ordo_relatio()

embed_bool praet_ordo_relatio ( PraetOrdo * context,
embed_word channel )

Marks a channel busy and starts its keepalive window.

Parameters
[in,out]contextContext the channel belongs to [BORROWS].
[in]channelChannel to run on.
Returns
EMBED_TRUE where the channel took it.
Note
Takes no bytes. Where PRAET_RECOVERY is off nothing records what a transfer was pointed at. A start and a length would be stored and never read.
Warning
Refuses a channel that is settling, already busy, detaching, or not attached. Fails closed: a refused submit changes no state.

References praet_ordo_relatio().

Referenced by praet_ordo_relatio(), and praet_ordo_separare().

◆ praet_ordo_efficere()

void praet_ordo_efficere ( PraetOrdo * context,
embed_word channel )

Feeds the watchdog for one channel.

Parameters
[in,out]contextContext the channel belongs to [BORROWS].
[in]channelChannel that showed a sign of life.
Note
A sign of life, alone. How far the engine got is what PRAET_RECOVERY buys, and this build does not carry it.
Pushes the keepalive window out and clears a stall that had been recorded, because a channel that is moving again is not stalled.

References praet_ordo_efficere().

Referenced by praet_ordo_efficere(), and praet_ordo_separare().

◆ praet_ordo_completed()

void praet_ordo_completed ( PraetOrdo * context,
embed_word channel,
embed_bool failed )

Reports that a channel's transfer finished.

Parameters
[in,out]contextContext the channel belongs to [BORROWS].
[in]channelChannel that finished.
[in]failedEMBED_TRUE where it ended in an error, EMBED_FALSE on a completion.
Note
Completion arrives from the port and never from a timer. A timer deciding a transfer had finished would be this library guessing at hardware.

References praet_ordo_completed().

Referenced by praet_ordo_completed().

◆ praet_ordo_advance()

void praet_ordo_advance ( PraetOrdo * context,
embed_word micros )

Advances the clock by micros.

Parameters
[in,out]contextContext to advance [BORROWS].
[in]microsMicroseconds to add.
Note
Raises set, because time passing is one of the things that changes what a service call would find - a keepalive window can elapse without anything else happening.

References praet_ordo_advance().

Referenced by praet_ordo_advance().

◆ praet_ordo_advance_ticks()

void praet_ordo_advance_ticks ( PraetOrdo * context,
embed_word ticks )

Advances the clock by ticks, scaled against the declared frequency.

Parameters
[in,out]contextContext to advance [BORROWS].
[in]ticksTicks read off the clock this build declared.
Note
What a port calls, because a counter reads in ticks and every deadline here is microseconds. The scaling is one compile-time constant. A build whose clock runs at a whole megahertz pays a multiply and a shift for it.
Warning
Ticks short of a whole microsecond are dropped, and nothing carries them over. A port feeding this one tick at a time on a fast clock never advances anything, and for that reason a port reads the counter and passes the difference instead of counting calls.

References praet_ordo_advance_ticks().

Referenced by praet_ordo_advance_ticks().

◆ praet_ordo_raise()

void praet_ordo_raise ( PraetOrdo * context)

Stands in for the interrupt raising the set volatile.

Parameters
[in,out]contextContext the interrupt belongs to [BORROWS].
Note
All an interrupt does. It may run any number of times and the raises collapse, because there is exactly one reader and setting a raised flag is a no-op. Nothing is counted and nothing is queued.

References praet_ordo_raise().

Referenced by praet_ordo_raise().

◆ praet_ordo_poll()

void praet_ordo_poll ( PraetOrdo * context)

Drives the port and brings every flag word up to date. The caller's poll.

Parameters
[in,out]contextContext to poll [BORROWS].
Note
What a caller calls, and the only thing they have to. Everything a channel does between an attach and a completion happens here: the port is asked how far each running channel has got, the watchdog is fed with the answer, a settle that has elapsed is cleared, a channel nothing reported on is marked stalled, and a detach whose transfer has finished completes.
Reports nothing. What a caller wants is in the flag word, which this leaves current, and one load reads it. A return value here would be a second way to learn the same thing, and the two would eventually disagree.
Also the reader/setter, and the first call on interrupt exit. It reads set, takes busy, does the above, then unsets both volatiles. Taking busy makes it ignore the interrupt for that span, and the interrupt may keep raising set throughout without anything being lost, because this recomputes every channel from what it can see and consumes no event.
Does nothing where set was not raised, and where busy was already set. A nested call while the lock is out is the re-entry case, and it declines, leaving the outer call's half-done state untouched.
Every state change a channel undergoes goes through here, as puts all of the access control in one function. That fell out of the lock: one reader means one place.

References praet_ordo_poll().

Referenced by praet_ordo_poll().

◆ praet_ordo_flags()

uint32_t praet_ordo_flags ( const PraetOrdo * context,
embed_word channel )

Returns one channel's flag word.

Parameters
[in]contextContext the channel belongs to [BORROWS].
[in]channelChannel to read.
Returns
The whole word: quaternary core at the bottom, statuses and region above.
Note
One load. Knowing a channel is idle does not require waiting for a callback.

References praet_ordo_flags().

Referenced by praet_ordo_flags().