Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/pciconf/pciconf.c
Show First 20 Lines • Show All 1,120 Lines • ▼ Show 20 Lines | if (*el != '\0') | ||||
bar_count); | bar_count); | ||||
} | } | ||||
pbm.pbm_sel = getsel(name); | pbm.pbm_sel = getsel(name); | ||||
pbm.pbm_reg = strtoul(reg, &el, 0); | pbm.pbm_reg = strtoul(reg, &el, 0); | ||||
if (*reg == '\0' || *el != '\0') | if (*reg == '\0' || *el != '\0') | ||||
errx(1, "Invalid bar specification %s", reg); | errx(1, "Invalid bar specification %s", reg); | ||||
pbm.pbm_flags = 0; | pbm.pbm_flags = 0; | ||||
pbm.pbm_memattr = VM_MEMATTR_UNCACHEABLE; /* XXX */ | #ifdef VM_MEMATTR_DEVICE | ||||
pbm.pbm_memattr = VM_MEMATTR_DEVICE; | |||||
#else | |||||
pbm.pbm_memattr = VM_MEMATTR_UNCACHEABLE; | |||||
#endif | |||||
fd = open(_PATH_DEVPCI, O_RDWR, 0); | fd = open(_PATH_DEVPCI, O_RDWR, 0); | ||||
if (fd < 0) | if (fd < 0) | ||||
err(1, "%s", _PATH_DEVPCI); | err(1, "%s", _PATH_DEVPCI); | ||||
if (ioctl(fd, PCIOCBARMMAP, &pbm) < 0) | if (ioctl(fd, PCIOCBARMMAP, &pbm) < 0) | ||||
err(1, "ioctl(PCIOCBARMMAP)"); | err(1, "ioctl(PCIOCBARMMAP)"); | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |