summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
Diffstat (limited to 'driver')
-rw-r--r--driver/xf86-video-intel/src/reg_dumper/README.OpenBSD5
-rw-r--r--driver/xf86-video-intel/src/reg_dumper/main.c16
2 files changed, 21 insertions, 0 deletions
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 <errno.h>
+#include <fcntl.h>
+#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)