[lkml]   [2001]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [PATCH] link failur in Linux 2.4.9-ac16 around apm.o and sysrq.o
>>>>> "JNH" == junio  <> writes:

JNH> 2.4.9-ac16 fails to link with CONFIG_APM=y and
JNH> CONFIG_MAGIC_SYSRQ=n. This is because apm.c unconditionally
JNH> makes calls to functions (__sysrq_lock_table and friends)
JNH> defined in sysrq.c.

JNH> I can think of a couple of different approaches to work this
JNH> around, but is there an established proper way to resolve this
JNH> kind of dependency in the kernel code?

The approaches I listed as (1) and (3) in my previous message
are non solutions, since it will result in a kernel where apm.o
makes calls into sysrq functions, whose proper operations would
depend on sysrq.o to have been properly initialized by other
parts of the kernel, which still think CONFIG_MAGIC_SYSRQ is not

The below should be a better fix.

--- 2.4.9-ac16.sffix/arch/i386/kernel/apm.c Thu Sep 27 12:46:43 2001
+++ 2.4.9-ac16.sffix/arch/i386/kernel/apm.c Thu Sep 27 22:41:53 2001
@@ -201,7 +201,9 @@
#include <asm/uaccess.h>
#include <asm/desc.h>

#include <linux/sysrq.h>

extern unsigned long get_cmos_time(void);
extern void machine_real_restart(unsigned char *, int);
@@ -697,12 +699,16 @@
struct kbd_struct *kbd, struct tty_struct *tty) {
struct sysrq_key_op sysrq_poweroff_op = {
handler: handle_poweroff,
help_msg: "Off",
action_msg: "Power Off\n"
+# define register_sysrq_key(ig,no) /*re*/
+# define unregister_sysrq_key(ig,no) /*re*/

static int apm_enable_power_management(int enable)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:03    [W:0.112 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site