From 8d9e94c75a1d4651256976d0397da59188e37e5b Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Thu, 29 Jan 2009 17:17:25 +0000 Subject: Add support to run intel_reg_dumper on OpenBSD. --- driver/xf86-video-intel/src/reg_dumper/README.OpenBSD | 5 +++++ driver/xf86-video-intel/src/reg_dumper/main.c | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 driver/xf86-video-intel/src/reg_dumper/README.OpenBSD (limited to 'driver') diff --git a/driver/xf86-video-intel/src/reg_dumper/README.OpenBSD b/driver/xf86-video-intel/src/reg_dumper/README.OpenBSD new file mode 100644 index 000000000..b3f6606fa --- /dev/null +++ b/driver/xf86-video-intel/src/reg_dumper/README.OpenBSD @@ -0,0 +1,5 @@ +To use the reg dumper program on a running X server you need : + +- to build a kernel with 'options INSECURE' and reboot in it +- to set 'securelevel=-1' in /etc/rc.securelevel +- to run intel_reg_dumper as root. diff --git a/driver/xf86-video-intel/src/reg_dumper/main.c b/driver/xf86-video-intel/src/reg_dumper/main.c index 5c8ef9ede..46542e7a3 100644 --- a/driver/xf86-video-intel/src/reg_dumper/main.c +++ b/driver/xf86-video-intel/src/reg_dumper/main.c @@ -34,6 +34,13 @@ #include "reg_dumper.h" +#ifdef __OpenBSD__ +#define DEV_APERTURE "/dev/mem" +int devMemFd = -1; +#include +#include +#endif + int main(int argc, char **argv) { struct pci_device *dev; @@ -48,6 +55,15 @@ int main(int argc, char **argv) exit(1); } +#ifdef __OpenBSD__ + devMemFd = open(DEV_APERTURE, O_RDWR); + if (devMemFd < 0) { + fprintf(stderr, "Could not open aperture driver: %s\n", strerror(errno)); + exit(1); + } + pci_system_init_dev_mem(devMemFd); +#endif + /* Grab the graphics card */ dev = pci_device_find_by_slot(0, 0, 2, 0); if (dev == NULL) -- cgit v1.2.3