graphene-ipc.h 920 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef _GRAPHENE_IPC_H
  2. #define _GRAPHENE_IPC_H
  3. #include <linux/ioctl.h>
  4. #define GIPC_FILE "/dev/gipc"
  5. #define GIPC_MINOR 240
  6. /* Ioctl codes */
  7. #define GIPC_SEND _IOW('k', 0, void *)
  8. #define GIPC_RECV _IOR('k', 1, void *)
  9. #define GIPC_CREATE _IOR('k', 2, void *)
  10. #define GIPC_JOIN _IOR('k', 3, void *)
  11. // Must be a power of 2!
  12. #define PAGE_BUFS 2048
  13. #define PAGE_BITS (PAGE_BUFS / sizeof(unsigned long))
  14. #define ADDR_ENTS 32
  15. #define PAGE_PRESENT 1
  16. /* Argument Structures */
  17. typedef struct gipc_send {
  18. unsigned long entries;
  19. unsigned long *addr;
  20. unsigned long *len; // Rounded up to PAGE_SIZE
  21. } gipc_send;
  22. typedef struct gipc_recv {
  23. unsigned long entries;
  24. unsigned long *addr;
  25. unsigned long *len; // Rounded up to PAGE_SIZE
  26. int *prot;
  27. } gipc_recv;
  28. struct file_operations;
  29. #ifdef __KERNEL__
  30. struct gipc_queue {
  31. struct list_head list;
  32. s64 token;
  33. u32 owner;
  34. };
  35. #endif
  36. #endif // _GRAPHENE_IPC_H