Add support to run intel_reg_dumper on OpenBSD.
This commit is contained in:
parent
1faf8dcd02
commit
af2481e434
5
driver/xf86-video-intel/src/reg_dumper/README.OpenBSD
Normal file
5
driver/xf86-video-intel/src/reg_dumper/README.OpenBSD
Normal file
@ -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.
|
@ -34,6 +34,13 @@
|
|||||||
|
|
||||||
#include "reg_dumper.h"
|
#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)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
struct pci_device *dev;
|
struct pci_device *dev;
|
||||||
@ -48,6 +55,15 @@ int main(int argc, char **argv)
|
|||||||
exit(1);
|
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 */
|
/* Grab the graphics card */
|
||||||
dev = pci_device_find_by_slot(0, 0, 2, 0);
|
dev = pci_device_find_by_slot(0, 0, 2, 0);
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user