65#define CS_SELFTEST_EXPECTED 0x29B1u
77 static const uint8_t vec[] = {
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9' };
120 if ((idx >= (uint8_t)
CS_MAX_REGIONS) || (addr == NULL) || (size == 0u)) {
181 uint8_t failures = 0u;
189 if (actual !=
regions[i].baseline) {
208 if (!
regions[idx].registered) {
uint16_t crc16_ccitt(const uint8_t *data, uint16_t len)
Compute CRC16-CCITT (poly 0x1021, init 0xFFFF) over a byte buffer.
bool __cs_enable(uint8_t idx, bool enabled)
Privileged implementation of cs_enable().
void __cs_set_callback(cs_mismatch_fn fn)
Privileged implementation of cs_set_callback().
bool __cs_get_region(uint8_t idx, cs_region_t *out)
Privileged implementation of cs_get_region().
uint8_t __cs_region_count(void)
Privileged implementation of cs_region_count().
bool __cs_add_region(uint8_t idx, const uint8_t *addr, uint32_t size)
Privileged implementation of cs_add_region().
void __cs_init(void)
Privileged implementation of cs_init().
#define CS_SELFTEST_EXPECTED
Known CRC16-CCITT test vector.
static bool cs_hw_ok
CRC engine self-test result.
uint8_t __cs_check_all(void)
Privileged implementation of cs_check_all().
static bool cs_selftest(void)
Run the CRC engine self-test against a known vector.
static cs_mismatch_fn mismatch_cb
User-supplied mismatch callback.
bool __cs_rebaseline(uint8_t idx)
Privileged implementation of cs_rebaseline().
static cs_entry_t regions[8]
Region table — privileged DTCM, zero wait-state.
void(* cs_mismatch_fn)(uint8_t region_idx, uint16_t expected, uint16_t actual)
Mismatch callback signature.
#define CS_MAX_REGIONS
Maximum number of monitored memory regions.
ICARUS OS - Main API Header.
Per-region entry in the monitor table.
uint32_t size
Size in bytes.
const uint8_t * addr
Start address of the monitored region.
bool registered
True if this slot has been configured.
uint16_t baseline
Expected CRC16-CCITT.
bool enabled
True if actively scanned.
Descriptor for a monitored memory region.
const uint8_t * addr
Start address of the region.
bool enabled
True if this region is actively scanned.
uint32_t size
Size in bytes.
uint16_t baseline
Expected CRC16-CCITT value.