From 506be1528d52f7405ac7a2b1fe3a7cd2879bbe80 Mon Sep 17 00:00:00 2001 From: Simon 'corecode' Schubert Date: Sat, 12 Jan 2008 20:39:16 +0100 Subject: [PATCH] Switch to native xorg wrapper. Not functional yet. --- obj/wrap/Makefile | 6 ++++-- obj/wrap/nvidia_wrap.c | 49 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/obj/wrap/Makefile b/obj/wrap/Makefile index e544662..adac61c 100644 --- a/obj/wrap/Makefile +++ b/obj/wrap/Makefile @@ -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 diff --git a/obj/wrap/nvidia_wrap.c b/obj/wrap/nvidia_wrap.c index 2024a86..49b94b7 100644 --- a/obj/wrap/nvidia_wrap.c +++ b/obj/wrap/nvidia_wrap.c @@ -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 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)); -- 2.41.0