asos-syscall-os / kernel-module /ring_buffer.h
SNAPKITTYWEST's picture
push from SNAPKITTYWEST/asos-syscall-os
96dc096 verified
Raw
History Blame Contribute Delete
1.21 kB
/**
* ring_buffer.h
* Ring Buffer Public API
*
* Author: Ahmad Ali Parr
* License: Sovereign Source
*/
#ifndef ASOS_RING_BUFFER_H
#define ASOS_RING_BUFFER_H
#include <linux/types.h>
#include "intent_schema.h"
/* 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);
#endif /* ASOS_RING_BUFFER_H */