All of lore.kernel.org
 help / color / mirror / Atom feed
From: Taral <taral@taral.net>
To: linux-ide@vger.kernel.org
Subject: Modular IDE
Date: Sun, 11 May 2003 23:39:51 -0500	[thread overview]
Message-ID: <20030512043951.GA26526@taral.net> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 298 bytes --]

I've managed to shoe-horn IDE into compiling itself as a module... Patch
is attached. Any comments?

-- 
Taral <taral@taral.net>
This message is digitally signed. Please PGP encrypt mail to me.
"Most parents have better things to do with their time than take care of
their children." -- Me

[-- Attachment #1.2: ide-mod.patch --]
[-- Type: text/plain, Size: 7650 bytes --]

diff -Nru a/drivers/ide/Makefile b/drivers/ide/Makefile
--- a/drivers/ide/Makefile	Sun May 11 15:26:06 2003
+++ b/drivers/ide/Makefile	Sun May 11 15:26:06 2003
@@ -12,19 +12,23 @@
 
 # Core IDE code - must come before legacy
 
-obj-$(CONFIG_BLK_DEV_IDE)		+= ide-io.o ide-probe.o ide-geometry.o ide-iops.o ide-taskfile.o ide.o ide-lib.o ide-default.o
 obj-$(CONFIG_BLK_DEV_IDEDISK)		+= ide-disk.o
 obj-$(CONFIG_BLK_DEV_IDECD)		+= ide-cd.o
 obj-$(CONFIG_BLK_DEV_IDETAPE)		+= ide-tape.o
 obj-$(CONFIG_BLK_DEV_IDEFLOPPY)		+= ide-floppy.o
 
-obj-$(CONFIG_BLK_DEV_IDEPCI)		+= setup-pci.o
-obj-$(CONFIG_BLK_DEV_IDEDMA_PCI)	+= ide-dma.o
-obj-$(CONFIG_BLK_DEV_IDE_TCQ)		+= ide-tcq.o
-obj-$(CONFIG_BLK_DEV_IDEPNP)		+= ide-pnp.o
-
+ide-mod-y					:= ide-probe.o ide-io.o ide-geometry.o ide-iops.o ide-taskfile.o ide.o ide-lib.o ide-default.o
+ide-mod-n					:=
+ide-mod-$(CONFIG_PROC_FS)			+= ide-proc.o
+ide-mod-$(CONFIG_BLK_DEV_IDEPCI)		+= setup-pci.o
+ide-mod-$(CONFIG_BLK_DEV_IDEDMA_PCI)	+= ide-dma.o
+ide-mod-$(CONFIG_BLK_DEV_IDE_TCQ)		+= ide-tcq.o
+ide-mod-$(CONFIG_BLK_DEV_IDEPNP)		+= ide-pnp.o
 ifeq ($(CONFIG_BLK_DEV_IDE),y)
-obj-$(CONFIG_PROC_FS)			+= ide-proc.o
+obj-y += $(ide-mod-y)
+endif
+ifeq ($(CONFIG_BLK_DEV_IDE),m)
+obj-m += ide-mod.o
 endif
 
 obj-$(CONFIG_BLK_DEV_IDE)		+= legacy/ ppc/ arm/
diff -Nru a/drivers/ide/ide-default.c b/drivers/ide/ide-default.c
--- a/drivers/ide/ide-default.c	Sun May 11 15:26:06 2003
+++ b/drivers/ide/ide-default.c	Sun May 11 15:26:06 2003
@@ -65,7 +65,3 @@
 	}
 	return 0;
 }
-
-MODULE_DESCRIPTION("IDE Default Driver");
-
-MODULE_LICENSE("GPL");
diff -Nru a/drivers/ide/ide-geometry.c b/drivers/ide/ide-geometry.c
--- a/drivers/ide/ide-geometry.c	Sun May 11 15:26:06 2003
+++ b/drivers/ide/ide-geometry.c	Sun May 11 15:26:06 2003
@@ -2,6 +2,7 @@
  * linux/drivers/ide/ide-geometry.c
  */
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/ide.h>
 #include <linux/mc146818rtc.h>
 #include <asm/io.h>
@@ -69,7 +70,7 @@
  * Returns 1 if the geometry translation was successful.
  */
 
-int ide_xlate_1024 (struct block_device *bdev, int xparm, int ptheads, const char *msg)
+int ide_xlate_1024(struct block_device *bdev, int xparm, int ptheads, const char *msg)
 {
 	ide_drive_t *drive = bdev->bd_disk->private_data;
 	const char *msg1 = "";
@@ -133,3 +134,4 @@
 		       drive->bios_cyl, drive->bios_head, drive->bios_sect);
 	return ret;
 }
+EXPORT_SYMBOL(ide_xlate_1024);
diff -Nru a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
--- a/drivers/ide/ide-io.c	Sun May 11 15:26:06 2003
+++ b/drivers/ide/ide-io.c	Sun May 11 15:26:06 2003
@@ -577,7 +577,7 @@
  *	FIXME: this function needs a rename
  */
  
-ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
+static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
 {
 	ide_startstop_t startstop;
 	unsigned long block;
@@ -633,8 +633,6 @@
 	return ide_stopped;
 }
 
-EXPORT_SYMBOL(start_request);
-
 /**
  *	ide_stall_queue		-	pause an IDE device
  *	@drive: drive to stall
@@ -867,14 +865,6 @@
 }
 
 EXPORT_SYMBOL(ide_do_request);
-
-/*
- * Passes the stuff to ide_do_request
- */
-void do_ide_request(request_queue_t *q)
-{
-	ide_do_request(q->queuedata, IDE_NO_IRQ);
-}
 
 /*
  * un-busy the hwgroup etc, and clear any pending DMA status. we want to
diff -Nru a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
--- a/drivers/ide/ide-probe.c	Sun May 11 15:26:06 2003
+++ b/drivers/ide/ide-probe.c	Sun May 11 15:26:06 2003
@@ -683,8 +683,6 @@
 	return(addr_errs);
 }
 
-//EXPORT_SYMBOL(hwif_check_regions);
-
 #define hwif_request_region(addr, num, name)	\
 	((hwif->mmio) ? request_mem_region((addr),(num),(name)) : request_region((addr),(num),(name)))
 
@@ -721,8 +719,6 @@
 		hwif_request_region(hwif->io_ports[i], 1, hwif->name);
 }
 
-//EXPORT_SYMBOL(hwif_register);
-
 /* Enable code below on all archs later, for now, I want it on PPC
  */
 #ifdef CONFIG_PPC
@@ -976,7 +972,7 @@
  *
  * This routine detects and reports such situations, but does not fix them.
  */
-void save_match (ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match)
+static void save_match (ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match)
 {
 	ide_hwif_t *m = *match;
 
@@ -989,10 +985,17 @@
 	if (!m || m->irq != hwif->irq) /* don't undo a prior perfect match */
 		*match = new;
 }
-EXPORT_SYMBOL(save_match);
 #endif /* MAX_HWIFS > 1 */
 
 /*
+ * Passes the stuff to ide_do_request
+ */
+static void do_ide_request(request_queue_t *q)
+{
+	ide_do_request(q->queuedata, IDE_NO_IRQ);
+}
+
+/*
  * init request queue
  */
 static void ide_init_queue(ide_drive_t *drive)
@@ -1309,8 +1312,6 @@
 			THIS_MODULE, ata_probe, ata_lock, hwif);
 }
 
-EXPORT_SYMBOL(init_gendisk);
-
 int hwif_init (ide_hwif_t *hwif)
 {
 	int old_irq, unit;
@@ -1381,21 +1382,6 @@
 
 EXPORT_SYMBOL(hwif_init);
 
-void export_ide_init_queue (ide_drive_t *drive)
-{
-	ide_init_queue(drive);
-	ide_init_drive(drive);
-}
-
-EXPORT_SYMBOL(export_ide_init_queue);
-
-u8 export_probe_for_drive (ide_drive_t *drive)
-{
-	return probe_for_drive(drive);
-}
-
-EXPORT_SYMBOL(export_probe_for_drive);
-
 int ideprobe_init (void);
 static ide_module_t ideprobe_module = {
 	IDE_PROBE_MODULE,
@@ -1438,26 +1424,3 @@
 	MOD_DEC_USE_COUNT;
 	return 0;
 }
-
-#ifdef MODULE
-extern int (*ide_xlate_1024_hook)(struct block_device *, int, int, const char *);
-
-int init_module (void)
-{
-	unsigned int index;
-	
-	for (index = 0; index < MAX_HWIFS; ++index)
-		ide_unregister(index);
-	ideprobe_init();
-	create_proc_ide_interfaces();
-	ide_xlate_1024_hook = ide_xlate_1024;
-	return 0;
-}
-
-void cleanup_module (void)
-{
-	ide_probe = NULL;
-	ide_xlate_1024_hook = 0;
-}
-MODULE_LICENSE("GPL");
-#endif /* MODULE */
diff -Nru a/drivers/ide/ide.c b/drivers/ide/ide.c
--- a/drivers/ide/ide.c	Sun May 11 15:26:06 2003
+++ b/drivers/ide/ide.c	Sun May 11 15:26:06 2003
@@ -178,6 +178,7 @@
 static int initializing;	/* set while initializing built-in drivers */
 
 DECLARE_MUTEX(ide_cfg_sem);
+EXPORT_SYMBOL(ide_cfg_sem);
 spinlock_t ide_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 
 static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */
@@ -1355,6 +1356,7 @@
 	if (drive->media != ide_disk)
 		ide_add_setting(drive,	"ide-scsi",		SETTING_RW,					-1,		HDIO_SET_IDE_SCSI,		TYPE_BYTE,	0,	1,				1,		1,		&drive->scsi,			ide_atapi_to_scsi);
 }
+EXPORT_SYMBOL(ide_add_generic_settings);
 
 /*
  * Delay for *at least* 50ms.  As we don't know how much time is left
@@ -2185,7 +2187,6 @@
 	 */
 	probe_for_hwifs ();
 
-#ifdef CONFIG_BLK_DEV_IDE
 	if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
 		ide_get_lock(NULL, NULL); /* for atari only */
 
@@ -2193,7 +2194,6 @@
 
 	if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
 		ide_release_lock();	/* for atari only */
-#endif /* CONFIG_BLK_DEV_IDE */
 
 #ifdef CONFIG_PROC_FS
 	proc_ide_create();
@@ -2456,6 +2456,7 @@
 struct bus_type ide_bus_type = {
 	.name		= "ide",
 };
+EXPORT_SYMBOL(ide_bus_type);
 
 /*
  * This is gets invoked once during initialization, to set *everything* up
diff -Nru a/drivers/pci/pci.c b/drivers/pci/pci.c
--- a/drivers/pci/pci.c	Sun May 11 15:26:06 2003
+++ b/drivers/pci/pci.c	Sun May 11 15:26:06 2003
@@ -736,6 +736,7 @@
 EXPORT_SYMBOL(isa_bridge);
 #endif
 
+EXPORT_SYMBOL(pci_enable_device_bars);
 EXPORT_SYMBOL(pci_enable_device);
 EXPORT_SYMBOL(pci_disable_device);
 EXPORT_SYMBOL(pci_max_busnr);

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

                 reply	other threads:[~2003-05-12  4:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030512043951.GA26526@taral.net \
    --to=taral@taral.net \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.