Files
Deshab-OS/CODE/UTSM/include/utsm/pckc.h
T

33 lines
750 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef UTSM_PCKC_H
#define UTSM_PCKC_H
#include <utsm/types.h>
#include <utsm/config.h>
#include <utsm/uuid.h>
#include <utsm/crypto.h>
struct utsm_segment_desc;
typedef struct {
bool valid;
u32 segment_slot;
u64 key_epoch;
utsm_key_material key;
} utsm_pckc_entry;
typedef struct {
uuid128_t current_process_uuid;
utsm_pckc_entry entries[UTSM_MAX_PCKC_KEYS];
u64 hit_count;
u64 miss_count;
u32 next_replace;
} utsm_pckc;
void utsm_pckc_init(void);
int utsm_pckc_get_or_derive(u32 segment_slot, struct utsm_segment_desc *desc, utsm_key_material *out_key);
/* Phase 9: 失效某段全部缓存 key(key_epoch bump / task_kill crypto erase 用) */
void utsm_pckc_invalidate_slot(u32 segment_slot);
#endif