Advertisement
Guest User

Untitled

a guest
Aug 26th, 2020
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <sys/pciio.h>
  3. #include <unistd.h>
  4. #include <fcntl.h>
  5.  
  6. #define PCIOCUNBIND _IOWR('p', 9, struct pcisel)
  7.  
  8. int main(int argc, char *argv[]) {
  9. struct pcisel ps;
  10. int fd, rc;
  11. if (argc > 3) {
  12. ps.pc_bus = atoi(argv[1]);
  13. ps.pc_dev = atoi(argv[2]);
  14. ps.pc_func= atoi(argv[3]);
  15. fd = open("/dev/pci0", O_RDONLY);
  16. rc = ioctl(fd, PCIOCUNBIND, &ps);
  17. printf("%d %d %d : fd = %d rc = %d\n", ps.pc_bus, ps.pc_dev, ps.pc_func, fd, rc);
  18. }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement