akaros/kern/include/ros/ring_syscall.h
<<
>>
Prefs
   1#pragma once
   2
   3#include <ros/common.h>
   4#include <ros/ring_buffer.h>
   5
   6#define NUM_SYSCALL_ARGS 6
   7/* This will need to change to represent sending pointers to syscalls, not the
   8 * syscalls themselves */
   9struct syscall;
  10typedef enum {
  11        // The response has been digested by the user space, can be reallocated
  12        RES_free, 
  13        // Space fo request is allocated
  14        REQ_alloc,
  15        // The request is populated by the caller
  16        REQ_ready,
  17        // The request is being processed, or a kernel thread is going to pick
  18        // up the stack to process this later.
  19        REQ_processing,
  20        // The response is ready to be picked up
  21        RES_ready
  22} syscall_status_t;
  23
  24typedef struct syscall_req {
  25    syscall_status_t status; // TODO:rethink this
  26        void (*cleanup)(void* data);
  27        void *data;
  28        struct syscall* sc;
  29} syscall_req_t, syscall_rsp_t;
  30
  31#define RSP_ERRNO(rsp) (rsp->sc->err)
  32#define RSP_RESULT(rsp) (rsp->sc->retval)
  33
  34// Generic Syscall Ring Buffer
  35#define SYSCALLRINGSIZE    PGSIZE
  36DEFINE_RING_TYPES(syscall, syscall_req_t, syscall_rsp_t);
  37