Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <sys/pciio.h>
- #include <unistd.h>
- #include <fcntl.h>
- #define PCIOCUNBIND _IOWR('p', 9, struct pcisel)
- int main(int argc, char *argv[]) {
- struct pcisel ps;
- int fd, rc;
- if (argc > 3) {
- ps.pc_bus = atoi(argv[1]);
- ps.pc_dev = atoi(argv[2]);
- ps.pc_func= atoi(argv[3]);
- fd = open("/dev/pci0", O_RDONLY);
- rc = ioctl(fd, PCIOCUNBIND, &ps);
- printf("%d %d %d : fd = %d rc = %d\n", ps.pc_bus, ps.pc_dev, ps.pc_func, fd, rc);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement