PatchworkOS  19e446b
A non-POSIX operating system.
Loading...
Searching...
No Matches
ring.c File Reference
#include <kernel/cpu/syscall.h>
#include <kernel/fs/file_table.h>
#include <kernel/fs/path.h>
#include <kernel/io/ring.h>
#include <kernel/io/irp.h>
#include <kernel/log/log.h>
#include <kernel/log/panic.h>
#include <kernel/mem/paging_types.h>
#include <kernel/mem/pmm.h>
#include <kernel/mem/vmm.h>
#include <kernel/proc/process.h>
#include <kernel/sched/clock.h>
#include <errno.h>
#include <sys/ioring.h>
#include <sys/list.h>
#include <time.h>
Include dependency graph for ring.c:

Go to the source code of this file.

Data Structures

struct  ioring_ctx_notify_ctx_t
 

Functions

static uint64_t ioring_ctx_acquire (ioring_ctx_t *ctx)
 
static void ioring_ctx_release (ioring_ctx_t *ctx)
 
static uint64_t ioring_ctx_map (ioring_ctx_t *ctx, process_t *process, ioring_id_t id, ioring_t *userRing, void *address, size_t sentries, size_t centries)
 
static uint64_t ioring_ctx_unmap (ioring_ctx_t *ctx)
 
static uint64_t ioring_ctx_avail_cqes (ioring_ctx_t *ctx)
 
void ioring_ctx_init (ioring_ctx_t *ctx)
 Initialize a I/O context.
 
void ioring_ctx_deinit (ioring_ctx_t *ctx)
 Deinitialize a I/O context.
 
static void ioring_ctx_dispatch (irp_t *irp)
 
static void ioring_ctx_complete (irp_t *irp, void *_ptr)
 
static uint64_t nop_cancel (irp_t *irp)
 
static uint64_t ioring_ctx_sqe_pop (ioring_ctx_t *ctx, ioring_ctx_notify_ctx_t *notify)
 
uint64_t ioring_ctx_notify (ioring_ctx_t *ctx, size_t amount, size_t wait)
 Notify the context of new SQEs.
 
 SYSCALL_DEFINE (SYS_SETUP, ioring_id_t, ioring_t *userRing, void *address, size_t sentries, size_t centries)
 
 SYSCALL_DEFINE (SYS_TEARDOWN, uint64_t, ioring_id_t id)
 
 SYSCALL_DEFINE (SYS_ENTER, uint64_t, ioring_id_t id, size_t amount, size_t wait)
 

Function Documentation

◆ ioring_ctx_acquire()

static uint64_t ioring_ctx_acquire ( ioring_ctx_t ctx)
inlinestatic

Definition at line 19 of file ring.c.

Here is the caller graph for this function:

◆ ioring_ctx_release()

static void ioring_ctx_release ( ioring_ctx_t ctx)
inlinestatic

Definition at line 30 of file ring.c.

Here is the caller graph for this function:

◆ ioring_ctx_map()

static uint64_t ioring_ctx_map ( ioring_ctx_t ctx,
process_t process,
ioring_id_t  id,
ioring_t userRing,
void *  address,
size_t  sentries,
size_t  centries 
)
inlinestatic

Definition at line 35 of file ring.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ioring_ctx_unmap()

static uint64_t ioring_ctx_unmap ( ioring_ctx_t ctx)
inlinestatic

Definition at line 126 of file ring.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ioring_ctx_avail_cqes()

static uint64_t ioring_ctx_avail_cqes ( ioring_ctx_t ctx)
inlinestatic

Definition at line 138 of file ring.c.

Here is the caller graph for this function:

◆ ioring_ctx_dispatch()

static void ioring_ctx_dispatch ( irp_t irp)
static

Definition at line 251 of file ring.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ioring_ctx_complete()

static void ioring_ctx_complete ( irp_t irp,
void *  _ptr 
)
static
Todo:
Handle overflow properly.

Definition at line 188 of file ring.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nop_cancel()

static uint64_t nop_cancel ( irp_t irp)
static

Definition at line 245 of file ring.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ioring_ctx_sqe_pop()

static uint64_t ioring_ctx_sqe_pop ( ioring_ctx_t ctx,
ioring_ctx_notify_ctx_t notify 
)
static

Definition at line 306 of file ring.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYSCALL_DEFINE() [1/3]

SYSCALL_DEFINE ( SYS_SETUP  ,
ioring_id_t  ,
ioring_t userRing,
void *  address,
size_t  sentries,
size_t  centries 
)

Definition at line 405 of file ring.c.

Here is the call graph for this function:

◆ SYSCALL_DEFINE() [2/3]

SYSCALL_DEFINE ( SYS_TEARDOWN  ,
uint64_t  ,
ioring_id_t  id 
)

Definition at line 443 of file ring.c.

Here is the call graph for this function:

◆ SYSCALL_DEFINE() [3/3]

SYSCALL_DEFINE ( SYS_ENTER  ,
uint64_t  ,
ioring_id_t  id,
size_t  amount,
size_t  wait 
)

Definition at line 483 of file ring.c.

Here is the call graph for this function: