Bug #555 ยป 915-dragonfly.diff
Makefile 5 Feb 2007 20:56:43 -0000 | ||
---|---|---|
HOMEPAGE= http://www.geocities.com/stomljen/
|
||
COMMENT= BIOS VESA resolution utility for 8XX/9XX Intel chips
|
||
ONLY_FOR_PLATFORM= NetBSD-*-i386 NetBSD-*-x86_64 Linux-*-i386
|
||
ONLY_FOR_PLATFORM= NetBSD-*-i386 NetBSD-*-x86_64 Linux-*-i386 DragonFly-*-i386
|
||
USE_TOOLS+= gmake
|
||
distinfo 5 Feb 2007 20:56:43 -0000 | ||
---|---|---|
SHA1 (915resolution-0.5.2.tar.gz) = 9f26eb1b728ca0b2d28c948207b034a49b477089
|
||
RMD160 (915resolution-0.5.2.tar.gz) = 722b352a83f41f0e9822ed4e096e8064f239dcc1
|
||
Size (915resolution-0.5.2.tar.gz) = 21183 bytes
|
||
SHA1 (patch-aa) = 8556275046ccc2a9ebabe03b422b2b764bacbc9d
|
||
SHA1 (patch-ab) = b65a38c9c7edd95f295619c9cdedc26449b3f177
|
||
SHA1 (patch-aa) = 8edaeab4a17a230f3460581a77f291c58605658a
|
||
SHA1 (patch-ab) = 52fd75d1fdec7f9bc04809643545417876e3f5c7
|
patches/patch-aa 5 Feb 2007 20:56:43 -0000 | ||
---|---|---|
$NetBSD: patch-aa,v 1.2 2006/11/13 04:15:02 obache Exp $
|
||
--- 915resolution.c.orig 2006-02-02 23:28:34.000000000 +0900
|
||
--- 915resolution.c.orig 2006-02-02 15:28:34.000000000 +0100
|
||
+++ 915resolution.c
|
||
@@ -22,7 +22,22 @@
|
||
@@ -22,11 +22,58 @@
|
||
#include <string.h>
|
||
#include <sys/mman.h>
|
||
#include <fcntl.h>
|
||
... | ... | |
+#define OUTL(a, b) outl(b, a)
|
||
+#define OUTB(a, b) outb(b, a)
|
||
+#endif
|
||
+#ifdef __DragonFly__
|
||
+#include <machine/cpufunc.h>
|
||
+#define iopl(a) open("/dev/io", O_RDWR)
|
||
+#define OUTL(a, b) outl(b, a)
|
||
+#define OUTB(a, b) outb(b, a)
|
||
+#endif
|
||
#include <unistd.h>
|
||
#include <assert.h>
|
||
|
||
@@ -169,7 +184,7 @@ void initialize_system(char * filename)
|
||
|
||
+#ifdef __DragonFly__
|
||
+void *
|
||
+memmem(const void *large, size_t llen, const void *small, size_t slen)
|
||
+{
|
||
+ void *hit;
|
||
+ size_t pos;
|
||
+
|
||
+ if (slen == 0)
|
||
+ return NULL;
|
||
+
|
||
+ for (;;) {
|
||
+ hit = memchr(large, *(unsigned char*)small, llen);
|
||
+ if (hit == NULL)
|
||
+ return NULL;
|
||
+ pos = (uintptr_t)hit - (uintptr_t)large;
|
||
+ llen -= pos;
|
||
+ if (llen < slen)
|
||
+ return NULL;
|
||
+ if (memcmp(hit, small, slen) == 0)
|
||
+ return hit;
|
||
+ large = (const void *)((uintptr_t)hit + 1);
|
||
+ llen--;
|
||
+ }
|
||
+}
|
||
+#endif
|
||
+
|
||
|
||
#define NEW(a) ((a *)(calloc(1, sizeof(a))))
|
||
#define FREE(a) (free(a))
|
||
@@ -169,7 +216,7 @@ void initialize_system(char * filename)
|
||
}
|
||
|
||
cardinal get_chipset_id(void) {
|
||
... | ... | |
return inl(0xcfc);
|
||
}
|
||
|
||
@@ -476,11 +491,11 @@ void unlock_vbios(vbios_map * map) {
|
||
@@ -476,11 +523,11 @@ void unlock_vbios(vbios_map * map) {
|
||
case CT_UNKWN:
|
||
break;
|
||
case CT_855GM:
|
||
... | ... | |
break;
|
||
case CT_845G:
|
||
case CT_865G:
|
||
@@ -488,13 +503,13 @@ void unlock_vbios(vbios_map * map) {
|
||
@@ -488,13 +535,13 @@ void unlock_vbios(vbios_map * map) {
|
||
case CT_915GM:
|
||
case CT_945G:
|
||
case CT_945GM:
|
||
... | ... | |
break;
|
||
}
|
||
}
|
||
@@ -526,8 +541,8 @@ void relock_vbios(vbios_map * map) {
|
||
@@ -526,8 +573,8 @@ void relock_vbios(vbios_map * map) {
|
||
case CT_UNKWN:
|
||
break;
|
||
case CT_855GM:
|
||
... | ... | |
break;
|
||
case CT_845G:
|
||
case CT_865G:
|
||
@@ -535,9 +550,9 @@ void relock_vbios(vbios_map * map) {
|
||
@@ -535,9 +582,9 @@ void relock_vbios(vbios_map * map) {
|
||
case CT_915GM:
|
||
case CT_945G:
|
||
case CT_945GM:
|