Index:
[thread]
[date]
[subject]
[author]
From: Jim Ursetto <ursetto@uiuc.edu>
To : ggi-develop@eskimo.com
Date: Sat, 24 Oct 1998 14:35:06 -0500
symbol exporting solution
This is what I did:
Index: system.h
===================================================================
RCS file: /projects/ggi/cvsdevel/degas/kgicon/include/kgi/system.h,v
retrieving revision 1.3
diff -u -r1.3 system.h
--- system.h 1998/09/23 12:44:03 1.3
+++ system.h 1998/10/24 19:30:07
@@ -30,6 +30,12 @@
#ifdef __KERNEL__
#include <linux/version.h>
+#ifdef MODULE
+#define __NO_VERSION__
+#include <linux/module.h>
+#else
+#define EXPORT_SYMBOL(name) ;
+#endif
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/errno.h>
@@ -44,6 +50,7 @@
#include <asm/io.h>
#define LinuxVersionCode(v, p, s) (((v)<<16)+((p)<<8)+(s))
#else /* __KERNEL__ */
+#define EXPORT_SYMBOL(name) ;
#include <errno.h>
#include <sys/types.h>
#include <sys/ioctl.h>
Files which use the EXPORT_SYMBOL construct should #include <kgi/system.h>
at the top. The #define EXPORT_SYMBOL is there for os's on which it's
undefined or when you compile this into the kernel. Better, we could
skip the #ifdef MODULE check above and always include module.h, and remove
the first #define:
#ifdef __KERNEL__
#include <linux/version.h>
+#define __NO_VERSION__
+#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
The following change is not necessary, but sets all symbols unexported by
default, in all drivers, without further changes. This means nothing will
show up in ksyms for unmodified drivers.
Index: fbcon-kgi.c
===================================================================
RCS file: /projects/ggi/cvsdevel/degas/kgicon/kgi/fbcon-kgi.c,v
retrieving revision 1.35
diff -u -r1.35 fbcon-kgi.c
--- fbcon-kgi.c 1998/10/19 06:49:11 1.35
+++ fbcon-kgi.c 1998/10/24 19:11:43
@@ -1760,6 +1760,9 @@
#ifdef MODULE
+
+EXPORT_NO_SYMBOLS;
+
int init_module(void)
{
if (kgifb_init(1) != 0)
In any driver you want to export a symbol from, just #include
<kgi/system.h>, and do EXPORT_SYMBOL(name) for relevant symbols.
Comments?
--
Jim Ursetto | timepresentandtimepastarebothperhapspresen
ursetto@uiuc.edu | s -t.s.eliot
e38 | apemitnideniatnocerutufemitdnaerutufemitni
-------------------------------------------------------------->
Index:
[thread]
[date]
[subject]
[author]