| /** | |
| * ring_buffer.h | |
| * Ring Buffer Public API | |
| * | |
| * Author: Ahmad Ali Parr | |
| * License: Sovereign Source | |
| */ | |
| /* Forward declaration */ | |
| struct IntentRing; | |
| struct vm_area_struct; | |
| /* Ring buffer lifecycle */ | |
| struct IntentRing *ring_buffer_create(size_t capacity); | |
| void ring_buffer_destroy(struct IntentRing *ring); | |
| /* Producer operations (user space) */ | |
| int ring_buffer_submit(struct IntentRing *ring, | |
| const struct SystemIntent __user *user_intent); | |
| /* Consumer operations (kernel) */ | |
| int ring_buffer_consume(struct IntentRing *ring, | |
| struct SystemIntent *intent_out); | |
| int ring_buffer_complete(struct IntentRing *ring, | |
| const struct IntentResult *result); | |
| /* Status */ | |
| int ring_buffer_stats(struct IntentRing *ring, | |
| unsigned int *head_out, | |
| unsigned int *tail_out, | |
| unsigned int *active_out); | |
| /* Memory mapping */ | |
| int ring_buffer_mmap(struct IntentRing *ring, struct vm_area_struct *vma); | |