Nexus Embedded Platform 1.0.0
Statically assembled reusable embedded mechanisms
Loading...
Searching...
No Matches
stack_observation.h File Reference

Bounded read-only observation of caller-painted stack spans. More...

#include "nexus/core/status.h"
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  nx_stack_observation_t
 Byte-prefix paint observations, not an exact physical stack peak. More...

Functions

nx_result_t nx_stack_observe (const void *base, size_t bytes, uint8_t paint, nx_stack_observation_t *out)
 Read a bounded low-address paint prefix without mutation.

Detailed Description

Bounded read-only observation of caller-painted stack spans.

Author
Nexus Team

Definition in file stack_observation.h.

Function Documentation

◆ nx_stack_observe()

nx_result_t nx_stack_observe ( const void * base,
size_t bytes,
uint8_t paint,
nx_stack_observation_t * out )

Read a bounded low-address paint prefix without mutation.

Parameters
[in]baseLive downward-growing stack region, caller-provenance.
[in]bytesOriginal positive painted region capacity in bytes.
[in]paintExact fill used before the region became active.
[out]outDistinct output, unchanged on invalid span or alias.
Returns
SUCCESS or INVALID, without allocation or retained pointers.
Note
Caller ensures this region is quiescent and painting had no live frames. No Arch/OS dependency or internal mask occurs. Work is at most bytes reads. Unwritten reservations or writes equal to paint can hide usage; this is not overflow detection. MSP qualification needs independently established boot paint and a quiescent sampling point. The span excludes current SP, all active frames and exception-stack reservation. It never paints or claims to read the physical MSP register.