projects
/
platform
/
upstream
/
libpciaccess.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4bdaca5
)
FreeBSD: don't set the MTRR if it's the default mode (uncacheable).
author
Eric Anholt
<eric@anholt.net>
Tue, 9 Oct 2007 19:12:34 +0000
(12:12 -0700)
committer
Eric Anholt
<eric@anholt.net>
Tue, 9 Oct 2007 19:12:34 +0000
(12:12 -0700)
src/freebsd_pci.c
patch
|
blob
|
history
diff --git
a/src/freebsd_pci.c
b/src/freebsd_pci.c
index
84a0a78
..
be934a8
100644
(file)
--- a/
src/freebsd_pci.c
+++ b/
src/freebsd_pci.c
@@
-108,8
+108,11
@@
pci_device_freebsd_map_range(struct pci_device *dev,
mro.mo_desc = &mrd;
mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- if (ioctl(fd, MEMRANGE_SET, &mro)) {
- fprintf(stderr, "failed to set mtrr: %s\n", strerror(errno));
+ /* No need to set an MTRR if it's the default mode. */
+ if (mrd.mr_flags != MDF_UNCACHEABLE) {
+ if (ioctl(fd, MEMRANGE_SET, &mro)) {
+ fprintf(stderr, "failed to set mtrr: %s\n", strerror(errno));
+ }
}
close(fd);