[Mplayer-cvslog] CVS: main/libdha mtrr.c,1.3,1.4

Arpi of Ize arpi at mplayerhq.hu
Sun Apr 28 00:42:57 CEST 2002


Update of /cvsroot/mplayer/main/libdha
In directory mail:/var/tmp.root/cvs-serv19906/libdha

Modified Files:
	mtrr.c 
Log Message:
OpenBSD, NetBSD portability patches by
Björn Sandell <biorn at dce.chalmers.se>
Marcus <core at antbear.org>
Bernd Ernesti <mplayer at lists.veego.de>


Index: mtrr.c
===================================================================
RCS file: /cvsroot/mplayer/main/libdha/mtrr.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mtrr.c	3 Feb 2002 13:19:39 -0000	1.3
+++ mtrr.c	27 Apr 2002 22:42:24 -0000	1.4
@@ -12,6 +12,12 @@
 #include "libdha.h"
 #include "AsmMacros.h"
 
+#if defined (__i386__) && defined (__NetBSD__)
+#include <stdint.h>
+#include <stdlib.h>
+#include <machine/mtrr.h>
+#include <machine/sysarch.h>
+#endif
 
 #if defined( __i386__ )
 int	mtrr_set_type(unsigned base,unsigned size,int type)
@@ -40,6 +46,23 @@
 	return wr_len == strlen(sout) ? 0 : EPERM;
     }
     return ENOSYS;
+#elif defined (__NetBSD__)
+    struct mtrr *mtrrp;
+    int n;
+
+    mtrrp = malloc(sizeof (struct mtrr));
+    mtrrp->base = base;
+    mtrrp->len = size;
+    mtrrp->type = type;  
+    mtrrp->flags = MTRR_VALID | MTRR_PRIVATE;
+    n = 1;
+
+    if (i386_set_mtrr(mtrrp, &n) < 0) {
+	free(mtrrp);
+	return errno;
+    }
+    free(mtrrp);
+    return 0;
 #else
 #warning Please port MTRR stuff!!!
     return ENOSYS;




More information about the MPlayer-cvslog mailing list