diff options
author | Marc Balmer <mbalmer@cvs.openbsd.org> | 2008-06-18 06:29:42 +0000 |
---|---|---|
committer | Marc Balmer <mbalmer@cvs.openbsd.org> | 2008-06-18 06:29:42 +0000 |
commit | efc4f8b8ebea7d50a6f4911feebc488bee0b6354 (patch) | |
tree | 2cd0a087c4232420b1aa50ea781f656a036b4de7 /driver | |
parent | 2b7614029a377710329df6642e2a74bee9617ded (diff) |
Call FatalError() instead of ErrorF() in case the amdmsr(4) is not
available or an ioctl returns an error. This properly terminates and
the X server and restores the text console instead of hanging in an
undefined screen mode.
Diffstat (limited to 'driver')
-rw-r--r-- | driver/xf86-video-geode/src/geode_msr.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/driver/xf86-video-geode/src/geode_msr.c b/driver/xf86-video-geode/src/geode_msr.c index 6a774bc29..b62c9e0a0 100644 --- a/driver/xf86-video-geode/src/geode_msr.c +++ b/driver/xf86-video-geode/src/geode_msr.c @@ -33,7 +33,8 @@ _msr_open(void) msrfd = open(_PATH_MSRDEV, O_RDWR); #endif if (msrfd == -1) - ErrorF("Unable to open %s: %s\n", _PATH_MSRDEV, strerror(errno)); + FatalError("Unable to open %s: %s\n", _PATH_MSRDEV, + strerror(errno)); } return msrfd; @@ -51,7 +52,8 @@ GeodeReadMSR(unsigned long addr, unsigned long *lo, unsigned long *hi) req.addr = addr; if (ioctl(fd, RDMSR, &req) == -1) - ErrorF("Unable to RDMSR %d\n", errno); + FatalError("Unable to read MSR at address %0x06x: %s\n", addr, + strerror(errno)); *hi = req.val >> 32; *lo = req.val & 0xffffffff; @@ -92,7 +94,8 @@ GeodeWriteMSR(unsigned long addr, unsigned long lo, unsigned long hi) req.val = (u_int64_t)hi << 32 | (u_int64_t)lo; if (ioctl(fd, WRMSR, &req) == -1) - ErrorF("Unable to WRMSR %d\n", errno); + FatalError("Unable to write MSR at address 0x%06x: %s\n", addr, + strerror(errno)); #else unsigned int data[2]; int fd = _msr_open(); |