1 $NetBSD: patch-aa,v 1.4 2010/06/20 11:06:03 wiz Exp $
3 --- 915resolution.c.orig 2007-04-15 10:46:56.000000000 +0000
13 +#include <machine/pio.h>
14 +#include <machine/sysarch.h>
15 +# if defined(__i386__)
16 +#define iopl(a) i386_iopl(a)
17 +# elif defined(__x86_64__)
18 +#define iopl(a) x86_64_iopl(a)
25 +asm_inb(unsigned port)
28 + __asm volatile("inb %w1,%0" : "=a" (data) : "d" (port));
33 +asm_outb(uint8_t data, unsigned port)
35 + __asm volatile("outb %0,%w1" : : "a" (data), "d" (port));
39 +asm_inl(unsigned port)
42 + __asm volatile("inl %w1,%0" : "=a" (data) : "d" (port));
47 +asm_outl(uint32_t data, unsigned port)
49 + __asm volatile("outl %0,%w1" : : "a" (data), "d" (port));
55 +#define outb asm_outb
59 +#define outl asm_outl
61 #define NEW(a) ((a *)(calloc(1, sizeof(a))))
62 #define FREE(a) (free(a))
63 @@ -165,7 +211,12 @@ typedef struct {
64 void initialize_system(char * filename) {
67 +#if !defined(__FreeBSD__) & !defined(__DragonFly__)
70 + FILE *iof = fopen("/dev/io", "r");
73 perror("Unable to obtain the proper IO permissions");