915-dragonfly.diff

corecode, 02/05/2007 09:04 PM

Download (4.28 KB)

View differences:

Makefile 5 Feb 2007 20:56:43 -0000
9 9
HOMEPAGE=	http://www.geocities.com/stomljen/
10 10
COMMENT=	BIOS VESA resolution utility for 8XX/9XX Intel chips
11 11

  
12
ONLY_FOR_PLATFORM=	NetBSD-*-i386 NetBSD-*-x86_64 Linux-*-i386
12
ONLY_FOR_PLATFORM=	NetBSD-*-i386 NetBSD-*-x86_64 Linux-*-i386 DragonFly-*-i386
13 13

  
14 14
USE_TOOLS+=	gmake
15 15

  
distinfo 5 Feb 2007 20:56:43 -0000
3 3
SHA1 (915resolution-0.5.2.tar.gz) = 9f26eb1b728ca0b2d28c948207b034a49b477089
4 4
RMD160 (915resolution-0.5.2.tar.gz) = 722b352a83f41f0e9822ed4e096e8064f239dcc1
5 5
Size (915resolution-0.5.2.tar.gz) = 21183 bytes
6
SHA1 (patch-aa) = 8556275046ccc2a9ebabe03b422b2b764bacbc9d
7
SHA1 (patch-ab) = b65a38c9c7edd95f295619c9cdedc26449b3f177
6
SHA1 (patch-aa) = 8edaeab4a17a230f3460581a77f291c58605658a
7
SHA1 (patch-ab) = 52fd75d1fdec7f9bc04809643545417876e3f5c7
patches/patch-aa 5 Feb 2007 20:56:43 -0000
1 1
$NetBSD: patch-aa,v 1.2 2006/11/13 04:15:02 obache Exp $
2 2

  
3
--- 915resolution.c.orig	2006-02-02 23:28:34.000000000 +0900
3
--- 915resolution.c.orig	2006-02-02 15:28:34.000000000 +0100
4 4
+++ 915resolution.c
5
@@ -22,7 +22,22 @@
5
@@ -22,11 +22,58 @@
6 6
 #include <string.h>
7 7
 #include <sys/mman.h>
8 8
 #include <fcntl.h>
......
22 22
+#define OUTL(a, b)     outl(b, a)
23 23
+#define OUTB(a, b)     outb(b, a)
24 24
+#endif
25
+#ifdef __DragonFly__
26
+#include <machine/cpufunc.h>
27
+#define iopl(a) open("/dev/io", O_RDWR)
28
+#define OUTL(a, b)	outl(b, a)
29
+#define OUTB(a, b)	outb(b, a)
30
+#endif
25 31
 #include <unistd.h>
26 32
 #include <assert.h>
27 33
 
28
@@ -169,7 +184,7 @@ void initialize_system(char * filename) 
34
 
35
+#ifdef __DragonFly__
36
+void *
37
+memmem(const void *large, size_t llen, const void *small, size_t slen)
38
+{
39
+	void *hit;
40
+	size_t pos;
41
+
42
+	if (slen == 0)
43
+		return NULL;
44
+
45
+	for (;;) {
46
+		hit = memchr(large, *(unsigned char*)small, llen);
47
+		if (hit == NULL)
48
+			return NULL;
49
+		pos = (uintptr_t)hit - (uintptr_t)large;
50
+		llen -= pos;
51
+		if (llen < slen)
52
+			return NULL;
53
+		if (memcmp(hit, small, slen) == 0)
54
+			return hit;
55
+		large = (const void *)((uintptr_t)hit + 1);
56
+		llen--;
57
+	}
58
+}
59
+#endif
60
+
61
 
62
 #define NEW(a) ((a *)(calloc(1, sizeof(a))))
63
 #define FREE(a) (free(a))
64
@@ -169,7 +216,7 @@ void initialize_system(char * filename) 
29 65
 }
30 66
 
31 67
 cardinal get_chipset_id(void) {
......
34 70
     return inl(0xcfc);
35 71
 }
36 72
 
37
@@ -476,11 +491,11 @@ void unlock_vbios(vbios_map * map) {
73
@@ -476,11 +523,11 @@ void unlock_vbios(vbios_map * map) {
38 74
         case CT_UNKWN:
39 75
             break;
40 76
         case CT_855GM:
......
49 85
             break;
50 86
         case CT_845G:
51 87
         case CT_865G:
52
@@ -488,13 +503,13 @@ void unlock_vbios(vbios_map * map) {
88
@@ -488,13 +535,13 @@ void unlock_vbios(vbios_map * map) {
53 89
         case CT_915GM:
54 90
         case CT_945G:
55 91
         case CT_945GM:
......
67 103
             break;
68 104
         }
69 105
     }
70
@@ -526,8 +541,8 @@ void relock_vbios(vbios_map * map) {
106
@@ -526,8 +573,8 @@ void relock_vbios(vbios_map * map) {
71 107
         case CT_UNKWN:
72 108
             break;
73 109
         case CT_855GM:
......
78 114
             break;
79 115
         case CT_845G:
80 116
         case CT_865G:
81
@@ -535,9 +550,9 @@ void relock_vbios(vbios_map * map) {
117
@@ -535,9 +582,9 @@ void relock_vbios(vbios_map * map) {
82 118
         case CT_915GM:
83 119
         case CT_945G:
84 120
         case CT_945GM: