CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
MemoryMaps.h File Reference

Legacy shared-memory maps for the page-based allocator: reserved page ids, map entry layouts and the static MemoryMaps facade. More...

#include "MemoryManager.h"
#include "PsyTime.h"
#include "MemoryMaps.tpl.h"
Include dependency graph for MemoryMaps.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cmlabs::TypeMapHeader
 Legacy type-map header (bitfield + TypeMapEntry array). More...
struct  cmlabs::TypeMapEntry
 Type-map entry: one registered message type name/id. More...
struct  cmlabs::ContextMapHeader
 Legacy context-map header. More...
struct  cmlabs::ContextMapEntry
 Context-map entry: one registered psychological/system context name/id. More...
struct  cmlabs::TopicMapHeader
 Legacy topic-map header. More...
struct  cmlabs::TopicMapEntry
 Legacy topic-map entry. More...
struct  cmlabs::CrankMapHeader
 Legacy crank-map header. More...
struct  cmlabs::CrankMapEntry
 Crank-map entry: one registered crank (user callback/script) with its function, library and inline script. More...
struct  cmlabs::QueueMapHeader
 Legacy queue-map header. More...
struct  cmlabs::QueueMapEntry
 Legacy queue-map entry. More...
struct  cmlabs::ProcessMapHeader
 Legacy process-map header. More...
struct  cmlabs::ProcessMapEntry
 Legacy process-map entry with the ids of the process's five queues. More...
struct  cmlabs::RequestMapHeader
 Legacy request-map header. More...
struct  cmlabs::RequestMapEntry
 Request-map entry tracking one cross-component request/reply transaction. More...
struct  cmlabs::GenericMapHeader
 Common header of every map inside the data-maps segment. More...
class  cmlabs::MemoryMaps
 Legacy static facade over the page-based shared maps (types, contexts, topics, cranks). More...
class  cmlabs::GenericMemoryMap< T, ID >
 Static algorithms shared by all bitfield-indexed maps in the data-maps segment. More...

Namespaces

namespace  cmlabs

Macros

Reserved system-page ids of the legacy page allocator

The first RESERVEDPAGECOUNT page ids are fixed system pages holding allocator structures and the shared maps.

#define ID_SYSPAGE   0
 Allocator system data.
#define ID_PAGEPOOL   1
 Idle-page pool.
#define ID_EOLPAGE   2
 End-of-life time wheel.
#define ID_QUEUEPAGE   3
 Message queues.
#define ID_COMPMAPPAGE   4
 Component map.
#define ID_TYPEMAPPAGE   5
 Type map.
#define ID_TOPICMAPPAGE   6
 Topic map.
#define ID_QUEUEMAPPAGE   7
 Queue map.
#define ID_PROCESSMAPPAGE   8
 Process map.
#define ID_REQUESTMAPPAGE   9
 Request map.
#define ID_CRANKMAPPAGE   10
 Crank map.
#define ID_CONTEXTMAPPAGE   11
 Context map.
#define RESERVEDPAGECOUNT   12
 Number of reserved system pages.
Legacy per-process queue slot ids
#define SIGNALQ_ID   0
 Signal queue slot.
#define MSGQ_ID   1
 Data-message queue slot.
#define REQQ_ID   2
 Request queue slot.
#define CMDQ_ID   3
 Command queue slot.
Legacy process status values (ProcessMapEntry::status)
#define PROC_ERROR   0
 Error state.
#define PROC_INIT   1
 Initialising.
#define PROC_IDLE   2
 Idle.
#define PROC_READY   3
 Ready.
#define PROC_ACTIVE   4
 Actively running.
Legacy request lifecycle status values
Note
Numbering differs from the newer REQ_* set in DataMapsMemory.h (no REQ_FAILED_TO_SEND here).
#define REQ_CREATED   1
#define REQ_RECEIVED_LOCAL   2
#define REQ_RECEIVED_REMOTE   3
#define REQ_PROCESSING_LOCAL   4
#define REQ_PROCESSING_REMOTE   5
#define REQ_REPLY_READY   6
#define REQ_FAILED   7
#define REQ_FAILED_DATA   8
#define REQ_FAILED_NODATA   9
#define REQ_FAILED_DATA_EOL   10
#define REQ_SUCCESS   11
#define REQ_SUCCESS_DATA   12
#define REQ_SUCCESS_NODATA   13
#define REQ_SUCCESS_DATA_EOL   14

Functions

Map-entry to page-id dispatch

Overload resolution maps an entry type to the reserved system page storing its map.

uint16 cmlabs::TypePageID (TypeMapEntry *e)
uint16 cmlabs::TypePageID (TopicMapEntry *e)
uint16 cmlabs::TypePageID (QueueMapEntry *e)
uint16 cmlabs::TypePageID (ProcessMapEntry *e)
uint16 cmlabs::TypePageID (RequestMapEntry *e)
uint16 cmlabs::TypePageID (CrankMapEntry *e)
uint16 cmlabs::TypePageID (ContextMapEntry *e)

Detailed Description

Legacy shared-memory maps for the page-based allocator: reserved page ids, map entry layouts and the static MemoryMaps facade.

Part of the older MemoryManagerX design in which each name/id map (types, topics, cranks, queues, processes, requests) lived in its own reserved system page of the page allocator. Superseded by DataMapsMemory/ProcessMemory but retained for compatibility; large parts of the facade are already commented out.

Warning
Shared-memory layouts; changing any struct here requires a full rebuild of all binaries (make clean && make) — see MemoryManager.h for the ABI warning.

Definition in file MemoryMaps.h.

Macro Definition Documentation

◆ CMDQ_ID

#define CMDQ_ID   3

Command queue slot.

Definition at line 45 of file MemoryMaps.h.

◆ ID_COMPMAPPAGE

#define ID_COMPMAPPAGE   4

Component map.

Definition at line 28 of file MemoryMaps.h.

Referenced by cmlabs::ComponentData::GetComponentID().

◆ ID_CONTEXTMAPPAGE

#define ID_CONTEXTMAPPAGE   11

Context map.

Definition at line 36 of file MemoryMaps.h.

Referenced by cmlabs::TypePageID().

◆ ID_CRANKMAPPAGE

#define ID_CRANKMAPPAGE   10

Crank map.

Definition at line 35 of file MemoryMaps.h.

Referenced by cmlabs::TypePageID().

◆ ID_EOLPAGE

#define ID_EOLPAGE   2

End-of-life time wheel.

Definition at line 26 of file MemoryMaps.h.

◆ ID_PAGEPOOL

#define ID_PAGEPOOL   1

Idle-page pool.

Definition at line 25 of file MemoryMaps.h.

◆ ID_PROCESSMAPPAGE

#define ID_PROCESSMAPPAGE   8

Process map.

Definition at line 33 of file MemoryMaps.h.

Referenced by cmlabs::TypePageID().

◆ ID_QUEUEMAPPAGE

#define ID_QUEUEMAPPAGE   7

Queue map.

Definition at line 32 of file MemoryMaps.h.

Referenced by cmlabs::TypePageID().

◆ ID_QUEUEPAGE

#define ID_QUEUEPAGE   3

Message queues.

Definition at line 27 of file MemoryMaps.h.

◆ ID_REQUESTMAPPAGE

#define ID_REQUESTMAPPAGE   9

Request map.

Definition at line 34 of file MemoryMaps.h.

Referenced by cmlabs::TypePageID().

◆ ID_SYSPAGE

#define ID_SYSPAGE   0

Allocator system data.

Definition at line 24 of file MemoryMaps.h.

◆ ID_TOPICMAPPAGE

#define ID_TOPICMAPPAGE   6

Topic map.

Definition at line 30 of file MemoryMaps.h.

Referenced by cmlabs::TypePageID().

◆ ID_TYPEMAPPAGE

#define ID_TYPEMAPPAGE   5

Type map.

Definition at line 29 of file MemoryMaps.h.

Referenced by cmlabs::TypePageID().

◆ MSGQ_ID

#define MSGQ_ID   1

Data-message queue slot.

Definition at line 43 of file MemoryMaps.h.

◆ PROC_ACTIVE

#define PROC_ACTIVE   4

Actively running.

Definition at line 157 of file MemoryMaps.h.

◆ PROC_ERROR

#define PROC_ERROR   0

Error state.

Definition at line 153 of file MemoryMaps.h.

Referenced by cmlabs::utils::GetProcessStatus(), and cmlabs::utils::WaitForProcess().

◆ PROC_IDLE

#define PROC_IDLE   2

Idle.

Definition at line 155 of file MemoryMaps.h.

◆ PROC_INIT

#define PROC_INIT   1

Initialising.

Definition at line 154 of file MemoryMaps.h.

◆ PROC_READY

#define PROC_READY   3

Ready.

Definition at line 156 of file MemoryMaps.h.

◆ REQ_CREATED

#define REQ_CREATED   1

Definition at line 233 of file MemoryMaps.h.

◆ REQ_FAILED

#define REQ_FAILED   7

Definition at line 239 of file MemoryMaps.h.

◆ REQ_FAILED_DATA

#define REQ_FAILED_DATA   8

Definition at line 240 of file MemoryMaps.h.

◆ REQ_FAILED_DATA_EOL

#define REQ_FAILED_DATA_EOL   10

Definition at line 242 of file MemoryMaps.h.

◆ REQ_FAILED_NODATA

#define REQ_FAILED_NODATA   9

Definition at line 241 of file MemoryMaps.h.

◆ REQ_PROCESSING_LOCAL

#define REQ_PROCESSING_LOCAL   4

Definition at line 236 of file MemoryMaps.h.

◆ REQ_PROCESSING_REMOTE

#define REQ_PROCESSING_REMOTE   5

Definition at line 237 of file MemoryMaps.h.

◆ REQ_RECEIVED_LOCAL

#define REQ_RECEIVED_LOCAL   2

Definition at line 234 of file MemoryMaps.h.

◆ REQ_RECEIVED_REMOTE

#define REQ_RECEIVED_REMOTE   3

Definition at line 235 of file MemoryMaps.h.

◆ REQ_REPLY_READY

#define REQ_REPLY_READY   6

Definition at line 238 of file MemoryMaps.h.

◆ REQ_SUCCESS

#define REQ_SUCCESS   11

Definition at line 243 of file MemoryMaps.h.

◆ REQ_SUCCESS_DATA

#define REQ_SUCCESS_DATA   12

Definition at line 244 of file MemoryMaps.h.

◆ REQ_SUCCESS_DATA_EOL

#define REQ_SUCCESS_DATA_EOL   14

Definition at line 246 of file MemoryMaps.h.

◆ REQ_SUCCESS_NODATA

#define REQ_SUCCESS_NODATA   13

Definition at line 245 of file MemoryMaps.h.

◆ REQQ_ID

#define REQQ_ID   2

Request queue slot.

Definition at line 44 of file MemoryMaps.h.

◆ RESERVEDPAGECOUNT

#define RESERVEDPAGECOUNT   12

Number of reserved system pages.

Definition at line 37 of file MemoryMaps.h.

◆ SIGNALQ_ID

#define SIGNALQ_ID   0

Signal queue slot.

Definition at line 42 of file MemoryMaps.h.