Advertisement
alsiva

character_dev.h

Dec 18th, 2022
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.72 KB | None | 0 0
  1. #ifndef CHARACTER_DEV_H
  2. #define CHARACTER_DEV_H
  3.  
  4. #include <linux/ioctl.h>
  5.  
  6. #define MAJOR_NUM 100
  7. #define MAX_COUNT_VM_AREA_STRUCTES 50
  8. #define MAX_COUNT_PCI_DEV 20
  9.  
  10.  
  11. #define IOCTL_GET_PCI_DEV _IOR(MAJOR_NUM, 0, char *)
  12. #define IOCTL_GET_VM_AREA_STRUCT _IOR(MAJOR_NUM, 1, char *)
  13.  
  14. struct pci_dev_info
  15. {
  16.     int actual_count;
  17.     unsigned short devices[MAX_COUNT_PCI_DEV];
  18. };
  19.  
  20. struct vm_area_pos_info
  21. {
  22.     unsigned long vm_start;
  23.     unsigned long vm_end;
  24.     unsigned long permissions;
  25.     unsigned long rb_subtree_gap;
  26. };
  27. struct vm_area_struct_info
  28. {
  29.     int pid;
  30.     int actual_count;
  31.     struct vm_area_pos_info vapi[MAX_COUNT_VM_AREA_STRUCTES];
  32. };
  33. #define DEVICE_NAME "lab_character_device"
  34.  
  35. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement