Switch to native xorg wrapper. Not functional yet.
authorSimon 'corecode' Schubert <corecode@fs.ei.tum.de>
Sat, 12 Jan 2008 19:39:16 +0000 (20:39 +0100)
committerSimon 'corecode' Schubert <corecode@fs.ei.tum.de>
Sun, 13 Jan 2008 03:25:01 +0000 (04:25 +0100)
obj/wrap/Makefile
obj/wrap/nvidia_wrap.c

index e544662..adac61c 100644 (file)
@@ -1,6 +1,8 @@
-LIB=   nvidia_wrap
+SHLIB_NAME= nvidia_wrap_drv.so
 SRCS=  nvidia_wrap.c
-SHLIB_MAJOR= 1
 NOMAN=
 
+XORGDIR?=      /usr/pkg
+CFLAGS+=       -I${XORGDIR}/include/xorg -I${XORGDIR}/include
+
 .include <bsd.lib.mk>
index 2024a86..49b94b7 100644 (file)
@@ -1,20 +1,61 @@
+#include "xorg-server.h"
+#include "xf86Module.h"
+
+/* Module setup */
+
+static MODULESETUPPROTO(nvidia_wrapSetup);
+
+static XF86ModuleVersionInfo nvidia_wrapVersRec = {
+       "nvidia_wrap",
+       "Magic hacking solutions",
+       MODINFOSTRING1,
+       MODINFOSTRING2,
+       XORG_VERSION_CURRENT,
+       1, 0, 0,
+       ABI_CLASS_VIDEODRV,
+       ABI_VIDEODRV_VERSION,
+       MOD_CLASS_VIDEODRV
+};
+
+_X_EXPORT XF86ModuleData nvidia_wrapModuleData = {
+       &nvidia_wrapVersRec,
+       nvidia_wrapSetup
+};
+
+static pointer
+nvidia_wrapSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+       xf86DrvMsg(0, X_INFO, "Nvidia binary wrapper loaded.  Now loading real driver.\n");
+
+       return (LoadSubModule(module,
+                             "nvidia",
+                             NULL,
+                             NULL,
+                             opts,
+                             NULL,
+                             errmaj,
+                             errmin));
+}
+
+/* Wrapper symbols */
+
 #include <ctype.h>
 
 extern __thread int    errno;
 
-int *
+_X_EXPORT int *
 __error(void)
 {
        return (&errno);
 }
 
-int
+_X_EXPORT int
 ___tolower(int c)
 {
        return (tolower(c));
 }
 
-int
+_X_EXPORT int
 ___toupper(int c)
 {
        return (toupper(c));
@@ -22,7 +63,7 @@ ___toupper(int c)
 
 unsigned long ___runetype_mb(int);
 
-unsigned long
+_X_EXPORT unsigned long
 ___runetype(int c)
 {
        return (___runetype_mb(c));