linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: junio@siamese.dhis.twinsun.com
To: Alan Cox <laughing@shared-source.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] link failur in Linux 2.4.9-ac16 around apm.o and sysrq.o
Date: 27 Sep 2001 22:47:21 -0700	[thread overview]
Message-ID: <7v1ykrkgt2.fsf@siamese.dhis.twinsun.com> (raw)
In-Reply-To: <20010927185107.A17861@lightning.swansea.linux.org.uk> <7v8zezki0b.fsf@siamese.dhis.twinsun.com>
In-Reply-To: <7v8zezki0b.fsf@siamese.dhis.twinsun.com>

>>>>> "JNH" == junio  <junio@siamese.dhis.twinsun.com> 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
defined.

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>
 
+#ifdef CONFIG_MAGIC_SYSRQ
 #include <linux/sysrq.h>
+#endif
 
 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) {
 	        apm_power_off();
 }
+#ifdef CONFIG_MAGIC_SYSRQ
 struct sysrq_key_op sysrq_poweroff_op = {
 	handler:        handle_poweroff,
 	help_msg:       "Off",
 	action_msg:     "Power Off\n"
 };
-
+#else
+# define register_sysrq_key(ig,no) /*re*/
+# define unregister_sysrq_key(ig,no) /*re*/
+#endif
 
 #ifdef CONFIG_APM_DO_ENABLE
 static int apm_enable_power_management(int enable)



  reply	other threads:[~2001-09-28  5:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-27 17:51 Linux 2.4.9-ac16 Alan Cox
2001-09-27 18:26 ` Udo A. Steinberg
2001-09-27 18:28 ` Rik van Riel
2001-09-27 19:03 ` [PATCH] 2.4.9-ac16 swapoff 2*vfree Hugh Dickins
2001-09-27 19:36   ` Alexander Viro
2001-09-27 19:03 ` Linux 2.4.9-ac16 Tom Rini
2001-09-27 23:06   ` Alan Cox
2001-09-27 23:11     ` Tom Rini
2001-09-27 19:31 ` Kent Borg
2001-09-28  1:07 ` [REPORT] (PPC) Compile Error (Linux 2.4.9-ac[12-16]) Tsunehiko Baba
2001-09-28 14:15   ` Tom Rini
2001-09-28 14:40     ` Alan Cox
2001-09-28 14:41       ` Tom Rini
2001-09-28  5:21 ` [PATCH] link failur in Linux 2.4.9-ac16 around apm.o and sysrq.o junio
2001-09-28  5:47   ` junio [this message]
2001-09-28 15:41     ` Randy.Dunlap
2001-09-28 15:58     ` Crutcher Dunnavant
2001-09-28 15:30 ` Linux 2.4.9-ac16 Stefan Becker
2001-09-28 16:39   ` Rik van Riel
2001-09-28 17:15     ` Tim Connors
2001-09-28 20:52 ` Russell King

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=7v1ykrkgt2.fsf@siamese.dhis.twinsun.com \
    --to=junio@siamese.dhis.twinsun.com \
    --cc=laughing@shared-source.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).