[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    [PATCH] 2.3.18ac1 APM as module
From:       "Robert H. de Vries" <rhdv () rhdv ! cistron ! nl>
Date:       1999-09-11 15:44:46
[Download RAW message or body]

Currently APM does not compile when configured as a module. Simply #ifdeffing
out the offending code makes the module compile, but then it doesn't load. The
missing symbols have been added to the symbol list. See attached patch.

When testing this patch I found out that when it is loaded as a module, not
many APM functions work. For instance power off on shutdown only works when it
is compiled into the kernel. So at some point I was wondering why it is
possible to compile it as a module when so many things don't work in that
situation? If the answer to that question is that indeed APM should not be
compilable as a module, then the patch is much simpler:
tristate -> bool on line 105 of arch/i386/config.in

	Robert
-- 
Robert de Vries
rhdv@rhdv.cistron.nl

["apm-2.3.18ac1.patch" (text/x-c)]

--- linux-2.3.18ac1-vanilla/kernel/ksyms.c	Sat Sep 11 14:34:31 1999
+++ linux-2.3.18ac1-devt/kernel/ksyms.c	Sat Sep 11 16:21:31 1999
@@ -112,6 +112,7 @@
 EXPORT_SYMBOL(find_vma);
 EXPORT_SYMBOL(get_unmapped_area);
 EXPORT_SYMBOL(init_mm);
+EXPORT_SYMBOL(check_pgt_cache);
 
 /* filesystem internal functions */
 EXPORT_SYMBOL(in_group_p);
--- linux-2.3.18ac1-vanilla/arch/i386/kernel/apm.c	Sat Sep 11 14:34:24 1999
+++ linux-2.3.18ac1-devt/arch/i386/kernel/apm.c	Sat Sep 11 15:55:15 1999
@@ -1404,6 +1404,8 @@
 	return 0;
 }
 
+#ifndef MODULE
+
 static int __init apm_setup(char *str)
 {
 	int	invert;
@@ -1428,6 +1430,8 @@
 }
 
 __setup("apm=", apm_setup);
+
+#endif /* !MODULE */
 
 /*
  * Just start the APM thread. We do NOT want to do APM BIOS
--- linux-2.3.18ac1-vanilla/arch/i386/kernel/i386_ksyms.c	Sat Sep 11 14:34:24 1999
+++ linux-2.3.18ac1-devt/arch/i386/kernel/i386_ksyms.c	Sat Sep 11 17:43:11 1999
@@ -8,6 +8,7 @@
 #include <linux/in6.h>
 #include <linux/interrupt.h>
 #include <linux/smp_lock.h>
+#include <linux/apm_bios.h>
 
 #include <asm/semaphore.h>
 #include <asm/processor.h>
@@ -18,9 +19,12 @@
 #include <asm/delay.h>
 #include <asm/irq.h>
 #include <asm/mmx.h>
+#include <asm/desc.h>
 
 extern void dump_thread(struct pt_regs *, struct user *);
 extern int dump_fpu(elf_fpregset_t *);
+extern unsigned long get_cmos_time(void);
+extern int hlt_counter;
 
 #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || \
defined(CONFIG_BLK_DEV_HD_MODULE)  extern struct drive_info_struct drive_info;
@@ -73,6 +77,12 @@
 EXPORT_SYMBOL(__generic_copy_from_user);
 EXPORT_SYMBOL(__generic_copy_to_user);
 EXPORT_SYMBOL(strlen_user);
+
+/* needed for APM */
+EXPORT_SYMBOL(get_cmos_time);
+EXPORT_SYMBOL(apm_bios_info);
+EXPORT_SYMBOL(hlt_counter);
+EXPORT_SYMBOL(gdt);
 
 #ifdef CONFIG_X86_USE_3DNOW
 EXPORT_SYMBOL(_mmx_memcpy);


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic