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

A transfer written down: where from, where to, how many bytes, how each address moves, and what runs after it. More...

Go to the source code of this file.

Data Structures

struct  PraetDescriptor
 One transfer, written down. More...

Macros

#define PRAET_MENSURA_MAXIMA
 The largest measure this module knows about.
#define PRAET_DIRECTIO_MOTUS_VERBI_FOR(from_, to_, bytes_)
 The direction of the movement of the word, for two spans of one pool.
#define PRAET_STEPS_FIT(what_, pool_, offset_, bytes_, mensura_)
 Fails the build where one end of a transfer does not sit whole steps inside its pool.
#define PRAET_DESCRIPTOR_BODY(name_, source_, source_mode_, dest_, dest_mode_, bytes_, mensura_, motus_, next_)
 Declares one memory to memory transfer, and what runs after it.
#define PraetDescriptorDeclare(name_, from_pool_, from_offset_, to_pool_, to_offset_, bytes_, mensura_, motus_, next_)
 Declares one memory to memory transfer, and what runs after it.
#define PRAET_DESCRIPTOR_ENDS_DIFFER(name_, from_pool_, to_pool_)
 Fails the build where a transfer between two pools names one pool twice.
#define PraetOneShot(name_, from_pool_, from_offset_, to_pool_, to_offset_, bytes_, mensura_)
 Declares one transfer that runs once and stops.
#define PraetDescriptorWithin(name_, pool_, from_offset_, to_offset_, bytes_, mensura_, next_)
 Declares one transfer that moves bytes inside a single pool, and works out which way.
#define PraetCircular(name_, from_pool_, from_offset_, to_pool_, to_offset_, bytes_, mensura_)
 Declares one transfer that runs itself again, forever.
#define PraetPingPong(first_, second_, from_pool_, to_pool_, first_from_, first_to_, second_from_, second_to_, bytes_, mensura_)
 Declares two transfers that hand off to each other, forever.
#define PraetPeripheralDeclare(name_, address_)
 Declares one peripheral register a transfer may reach.
#define PraetToPeripheral(name_, from_pool_, from_offset_, peripheral_, address_, at_offset_, bytes_, mensura_, next_)
 Declares one transfer that reads a pool and writes a peripheral.
#define PraetFromPeripheral(name_, peripheral_, address_, at_offset_, to_pool_, to_offset_, bytes_, mensura_, next_)
 Declares one transfer that reads a peripheral and writes a pool.

Enumerations

enum  PraetAddressing {
  PRAET_ADDRESS_ADVANCES ,
  PRAET_ADDRESS_FIXED
}
 How an address behaves as a transfer runs. More...
enum  EgoSumMensura {
  PRAET_MENSURA_OCTETUS ,
  PRAET_MENSURA_SEMIVERBUM ,
  PRAET_MENSURA_VERBUM
}
 Bytes the engine moves in one step, the measure of everything else. More...
enum  DirectioMotusVerbi {
  PRAET_MOTUS_NEUTRUM ,
  PRAET_MOTUS_SURSUM ,
  PRAET_MOTUS_DEORSUM
}
 Which way a transfer walks the words it moves. More...
enum  PraetDescriptorOwner {
  PRAET_OWNER_SOFTWARE ,
  PRAET_OWNER_ENGINE
}
 Who holds a descriptor. More...

Functions

EMBED_HOST_DEVICE embed_word praet_descriptor_chain_length (const PraetDescriptor *first, embed_word limit)
 Counts the descriptors a chain reaches before it repeats or ends.

Detailed Description

A transfer written down: where from, where to, how many bytes, how each address moves, and what runs after it.

Author
dstroy0 (Douglas Quigg) dquig.nosp@m.g123.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
Date
2026-09-01
Note
The shape three vendors already agree on. An ESP32 GDMA dma_descriptor_t, an i.MX RT eDMA TCD and a Zephyr dma_block_config each carry the same six things. Where from, where to, how much, how the addresses move, who holds it, and what is next. Three architectures, one descriptor.
Descriptors link, and that is where the arrangements come from. Two whose next point at each other are ping-pong. One that points at itself is circular. A chain is scatter-gather. A next of NULL is one shot. No part has a ping-pong feature and neither does this.
Who holds a descriptor is per descriptor and not per channel. A channel's own state is the quaternary core in its flag word, and that answers a different question. The core says what the channel does, and an owner says which link in the chain the engine is on.
A peripheral end is an address that does not advance. Where that address is comes from the vendor's own header, which the compiler has already read. A caller names theirs and no number of any part appears in this tree.

Definition in file praet_descriptor.h.