More fixups for kernel build: EXPORT_SYMTAB warning removal
authorRik Faith <faith@alephnull.com>
Thu, 20 Jul 2000 05:17:49 +0000 (05:17 +0000)
committerRik Faith <faith@alephnull.com>
Thu, 20 Jul 2000 05:17:49 +0000 (05:17 +0000)
    put_module_symbol clean up of tdfx tdfx_cleanup routine Makefile.kernel
    fix

14 files changed:
linux-core/Makefile.kernel
linux-core/drmP.h
linux-core/i810_drv.c
linux-core/mga_drv.c
linux-core/r128_drv.c
linux-core/tdfx_drv.c
linux/Makefile.kernel
linux/agpsupport.c
linux/drmP.h
linux/gamma_drv.c
linux/i810_drv.c
linux/mga_drv.c
linux/r128_drv.c
linux/tdfx_drv.c

index bf92d77..2937898 100644 (file)
@@ -66,7 +66,7 @@ ifeq ($(CONFIG_DRM_R128),y)
  OX_OBJS += r128_drv.o
  O_OBJS += r128_context.o r128_bufs.o r128_dma.o
 else
-  ifeq ($(CONFIG_DRM_I810),m)
+  ifeq ($(CONFIG_DRM_R128),m)
     MIX_OBJS += r128_drv.o
     MI_OBJS += r128_context.o r128_bufs.o r128_dma.o
     M_OBJS += r128.o
@@ -102,7 +102,7 @@ i810.o: i810_drv.o i810_context.o i810_bufs.o i810_dma.o $(L_OBJS)
        $(LD) $(LD_RFLAG) -r -o $@ i810_drv.o i810_bufs.o i810_dma.o \
                i810_context.o $(L_OBJS)
 
-r128.o: r128_drv.o r128_context.o r128_bufs.o $(L_OBJS)
+r128.o: r128_drv.o r128_context.o r128_bufs.o r128_dma.o $(L_OBJS)
        $(LD) $(LD_RFLAG) -r -o $@ r128_drv.o r128_bufs.o r128_dma.o \
                r128_context.o $(L_OBJS)
 
index 866aabf..d8791bf 100644 (file)
@@ -728,6 +728,7 @@ extern void      drm_ctxbitmap_free(drm_device_t *dev, int ctx_handle);
 #ifdef DRM_AGP
                                /* AGP/GART support (agpsupport.c) */
 extern drm_agp_head_t *drm_agp_init(void);
+extern void           drm_agp_uninit(void);
 extern int            drm_agp_acquire(struct inode *inode, struct file *filp,
                                      unsigned int cmd, unsigned long arg);
 extern int            drm_agp_release(struct inode *inode, struct file *filp,
index c01008e..d8c49a5 100644 (file)
@@ -30,7 +30,9 @@
  */
 
 #include <linux/config.h>
+#ifndef EXPORT_SYMTAB
 #define EXPORT_SYMTAB
+#endif
 #include "drmP.h"
 #include "i810_drv.h"
 
@@ -420,6 +422,7 @@ void i810_cleanup(void)
        drm_ctxbitmap_cleanup(dev);
        i810_takedown(dev);
        if (dev->agp) {
+               drm_agp_uninit();
                drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
                dev->agp = NULL;
        }
index 75f14be..30c8880 100644 (file)
@@ -31,7 +31,9 @@
  */
 
 #include <linux/config.h>
+#ifndef EXPORT_SYMTAB
 #define EXPORT_SYMTAB
+#endif
 #include "drmP.h"
 #include "mga_drv.h"
 EXPORT_SYMBOL(mga_init);
@@ -434,6 +436,7 @@ void mga_cleanup(void)
 
        mga_takedown(dev);
        if (dev->agp) {
+               drm_agp_uninit();
                drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
                dev->agp = NULL;
        }
index 125de17..e78d023 100644 (file)
@@ -30,7 +30,9 @@
  */
 
 #include <linux/config.h>
+#ifndef EXPORT_SYMTAB
 #define EXPORT_SYMTAB
+#endif
 #include "drmP.h"
 #include "r128_drv.h"
 EXPORT_SYMBOL(r128_init);
@@ -409,7 +411,7 @@ void r128_cleanup(void)
        r128_takedown(dev);
 #ifdef DRM_AGP
        if (dev->agp) {
-                               /* FIXME -- free other information, too */
+               drm_agp_uninit();
                drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
                dev->agp = NULL;
        }
index b8e2ec3..97bd418 100644 (file)
@@ -31,7 +31,9 @@
  */
 
 #include <linux/config.h>
+#ifndef EXPORT_SYMTAB
 #define EXPORT_SYMTAB
+#endif
 #include "drmP.h"
 #include "tdfx_drv.h"
 EXPORT_SYMBOL(tdfx_init);
@@ -241,9 +243,7 @@ static int tdfx_takedown(drm_device_t *dev)
                        drm_free(temp, sizeof(*temp), DRM_MEM_AGPLISTS);
                        temp = temp_next;
                }
-               if(dev->agp->acquired) (*drm_agp.release)();
-               drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
-               dev->agp = NULL;
+               if (dev->agp->acquired) (*drm_agp.release)();
        }
 #endif
                                /* Clear vma list (only built for debugging) */
@@ -368,6 +368,13 @@ void tdfx_cleanup(void)
        }
        drm_ctxbitmap_cleanup(dev);
        tdfx_takedown(dev);
+#ifdef DRM_AGP
+       if (dev->agp) {
+               drm_agp_uninit();
+               drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
+               dev->agp = NULL;
+       }
+#endif
 }
 
 int tdfx_version(struct inode *inode, struct file *filp, unsigned int cmd,
index bf92d77..2937898 100644 (file)
@@ -66,7 +66,7 @@ ifeq ($(CONFIG_DRM_R128),y)
  OX_OBJS += r128_drv.o
  O_OBJS += r128_context.o r128_bufs.o r128_dma.o
 else
-  ifeq ($(CONFIG_DRM_I810),m)
+  ifeq ($(CONFIG_DRM_R128),m)
     MIX_OBJS += r128_drv.o
     MI_OBJS += r128_context.o r128_bufs.o r128_dma.o
     M_OBJS += r128.o
@@ -102,7 +102,7 @@ i810.o: i810_drv.o i810_context.o i810_bufs.o i810_dma.o $(L_OBJS)
        $(LD) $(LD_RFLAG) -r -o $@ i810_drv.o i810_bufs.o i810_dma.o \
                i810_context.o $(L_OBJS)
 
-r128.o: r128_drv.o r128_context.o r128_bufs.o $(L_OBJS)
+r128.o: r128_drv.o r128_context.o r128_bufs.o r128_dma.o $(L_OBJS)
        $(LD) $(LD_RFLAG) -r -o $@ r128_drv.o r128_bufs.o r128_dma.o \
                r128_context.o $(L_OBJS)
 
index c89c3e2..628e8ca 100644 (file)
@@ -313,3 +313,15 @@ drm_agp_head_t *drm_agp_init(void)
        }
        return head;
 }
+
+void drm_agp_uninit(void)
+{
+       drm_agp_fill_t *fill;
+       
+       for (fill = &drm_agp_fill[0]; fill->name; fill++) {
+#if LINUX_VERSION_CODE >= 0x020400
+               if ((*fill->f).address) put_module_symbol((*fill->f).address);
+#endif
+               (*fill->f).address = 0;
+       }
+}
index 866aabf..d8791bf 100644 (file)
@@ -728,6 +728,7 @@ extern void      drm_ctxbitmap_free(drm_device_t *dev, int ctx_handle);
 #ifdef DRM_AGP
                                /* AGP/GART support (agpsupport.c) */
 extern drm_agp_head_t *drm_agp_init(void);
+extern void           drm_agp_uninit(void);
 extern int            drm_agp_acquire(struct inode *inode, struct file *filp,
                                      unsigned int cmd, unsigned long arg);
 extern int            drm_agp_release(struct inode *inode, struct file *filp,
index cfe20ad..7290bc2 100644 (file)
@@ -30,7 +30,9 @@
  */
 
 #include <linux/config.h>
+#ifndef EXPORT_SYMTAB
 #define EXPORT_SYMTAB
+#endif
 #include "drmP.h"
 #include "gamma_drv.h"
 #include <linux/pci.h>
index c01008e..d8c49a5 100644 (file)
@@ -30,7 +30,9 @@
  */
 
 #include <linux/config.h>
+#ifndef EXPORT_SYMTAB
 #define EXPORT_SYMTAB
+#endif
 #include "drmP.h"
 #include "i810_drv.h"
 
@@ -420,6 +422,7 @@ void i810_cleanup(void)
        drm_ctxbitmap_cleanup(dev);
        i810_takedown(dev);
        if (dev->agp) {
+               drm_agp_uninit();
                drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
                dev->agp = NULL;
        }
index 75f14be..30c8880 100644 (file)
@@ -31,7 +31,9 @@
  */
 
 #include <linux/config.h>
+#ifndef EXPORT_SYMTAB
 #define EXPORT_SYMTAB
+#endif
 #include "drmP.h"
 #include "mga_drv.h"
 EXPORT_SYMBOL(mga_init);
@@ -434,6 +436,7 @@ void mga_cleanup(void)
 
        mga_takedown(dev);
        if (dev->agp) {
+               drm_agp_uninit();
                drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
                dev->agp = NULL;
        }
index 125de17..e78d023 100644 (file)
@@ -30,7 +30,9 @@
  */
 
 #include <linux/config.h>
+#ifndef EXPORT_SYMTAB
 #define EXPORT_SYMTAB
+#endif
 #include "drmP.h"
 #include "r128_drv.h"
 EXPORT_SYMBOL(r128_init);
@@ -409,7 +411,7 @@ void r128_cleanup(void)
        r128_takedown(dev);
 #ifdef DRM_AGP
        if (dev->agp) {
-                               /* FIXME -- free other information, too */
+               drm_agp_uninit();
                drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
                dev->agp = NULL;
        }
index b8e2ec3..97bd418 100644 (file)
@@ -31,7 +31,9 @@
  */
 
 #include <linux/config.h>
+#ifndef EXPORT_SYMTAB
 #define EXPORT_SYMTAB
+#endif
 #include "drmP.h"
 #include "tdfx_drv.h"
 EXPORT_SYMBOL(tdfx_init);
@@ -241,9 +243,7 @@ static int tdfx_takedown(drm_device_t *dev)
                        drm_free(temp, sizeof(*temp), DRM_MEM_AGPLISTS);
                        temp = temp_next;
                }
-               if(dev->agp->acquired) (*drm_agp.release)();
-               drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
-               dev->agp = NULL;
+               if (dev->agp->acquired) (*drm_agp.release)();
        }
 #endif
                                /* Clear vma list (only built for debugging) */
@@ -368,6 +368,13 @@ void tdfx_cleanup(void)
        }
        drm_ctxbitmap_cleanup(dev);
        tdfx_takedown(dev);
+#ifdef DRM_AGP
+       if (dev->agp) {
+               drm_agp_uninit();
+               drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
+               dev->agp = NULL;
+       }
+#endif
 }
 
 int tdfx_version(struct inode *inode, struct file *filp, unsigned int cmd,