Patch to make APM_NOINTS configurable from 'make config' etc. in

Jesper Juhl (jesper.juhl@dif.dk)
Wed, 9 Dec 1998 09:49:58 +0100


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------ =_NextPart_000_01BE2350.E70B6B96
Content-Type: text/plain

Hi,

I recently bought an IBM ThinkPad 600, ad had the problem that it locked
up when resuming from hibernation mode. This was easily fixed by
changing "#define APM_NOINTS" to "#undef APM_NOINTS" in
"drivers/char/apm_bios.c". Although this was quite easy to fix, many new
Linux users who compile a kernel for the first time, won't find it very
easy!
So I created the attached patch in order to allow people to change this
option from 'make config', 'make menuconfig' and so on.

The patch is very simple, and only modifies these 4 files;
"Documentation/Configure.help", "drivers/char/apm_bios.c",
"drivers/char/Config.in" & "drivers/char/ChangeLog". The patch applies
to a clean 2.0.36

Besides sending this to linux-kernel for comments, I have CC'd it to
Stephen Rothwell (who wrote apm_bios.c) and Alan Cox (since I understand
that you are responsible for 2.0.x - right?).

If people think it's a good idear with this patch, I'll quickly throw
one together for 2.1.131 as well.

Best regards
Jesper Juhl

------ =_NextPart_000_01BE2350.E70B6B96
Content-Type: application/octet-stream;
name="PATCH"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="PATCH"

diff -u -r linux-2.0.36.orig/Documentation/Configure.help =
linux-2.0.36/Documentation/Configure.help=0A=
--- linux-2.0.36.orig/Documentation/Configure.help Tue Dec 8 21:55:00 =
1998=0A=
+++ linux-2.0.36/Documentation/Configure.help Tue Dec 8 21:48:47 =
1998=0A=
@@ -4179,6 +4179,17 @@=0A=
events while one is already being processed they will be ignored.=0A=
Without this the Thinkpad 560 has troubles with apmd, and =
pcmcia-cs.=0A=
=0A=
+Enable interrupts in APM BIOS calls=0A=
+CONFIG_APM_INTS=0A=
+ This option will enable interrupts in APM BIOS calls (normally=0A=
+ disabled; the CPU Idle BIOS call should turn interrupts on before=0A=
+ it does a 'hlt').=0A=
+ This option will cause hibernation mode to work properly on the =
IBM=0A=
+ ThinkPad 600 (and possibly on other ThinkPads as well).=0A=
+ Only turn this on if you experience problems with sleep and/or=0A=
+ hibernation mode.=0A=
+ Most people say N.=0A=
+=0A=
Watchdog Timer Support=0A=
CONFIG_WATCHDOG=0A=
If you enable this option and create a character special file=0A=
diff -u -r linux-2.0.36.orig/drivers/char/ChangeLog =
linux-2.0.36/drivers/char/ChangeLog=0A=
--- linux-2.0.36.orig/drivers/char/ChangeLog Tue Dec 8 21:54:36 =
1998=0A=
+++ linux-2.0.36/drivers/char/ChangeLog Tue Dec 8 22:11:23 1998=0A=
@@ -1,3 +1,10 @@=0A=
+Tue Dec 8 22:04:45 1998 Jesper Juhl <jesper.juhl@dif.dk>=0A=
+=0A=
+ * apm_bios.c (APM_NOINTS):=0A=
+ Changed this option to be configurable from 'make config'=0A=
+ etc. This was done, since some IBM ThinkPad's (notably =0A=
+ the ThinkPad 600) lockup if you have APM_NOINTS defined. =0A=
+=0A=
Wed Jun 5 18:52:04 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>=0A=
=0A=
* tty_io.c (do_tty_hangup): =0A=
Only in linux-2.0.36/drivers/char: ChangeLog~=0A=
diff -u -r linux-2.0.36.orig/drivers/char/Config.in =
linux-2.0.36/drivers/char/Config.in=0A=
--- linux-2.0.36.orig/drivers/char/Config.in Tue Dec 8 22:00:24 =
1998=0A=
+++ linux-2.0.36/drivers/char/Config.in Tue Dec 8 21:43:26 1998=0A=
@@ -61,6 +61,7 @@=0A=
bool ' Enable console blanking using APM' =
CONFIG_APM_DISPLAY_BLANK=0A=
bool ' Power off on shutdown' CONFIG_APM_POWER_OFF=0A=
bool ' Ignore multiple suspend' =
CONFIG_APM_IGNORE_MULTIPLE_SUSPEND=0A=
+ bool ' Enable interrupts in APM BIOS calls' CONFIG_APM_INTS=0A=
fi=0A=
if [ "$CONFIG_ALPHA_BOOK1" =3D "y" ]; then=0A=
bool 'Tadpole ANA H8 Support' CONFIG_H8=0A=
diff -u -r linux-2.0.36.orig/drivers/char/apm_bios.c =
linux-2.0.36/drivers/char/apm_bios.c=0A=
--- linux-2.0.36.orig/drivers/char/apm_bios.c Tue Dec 8 21:54:38 =
1998=0A=
+++ linux-2.0.36/drivers/char/apm_bios.c Tue Dec 8 21:44:04 1998=0A=
@@ -26,6 +26,9 @@=0A=
* April 1996, Stephen Rothwell (Stephen.Rothwell@canb.auug.org.au)=0A=
* Version 1.0 and 1.1=0A=
* May 1996, Version 1.2=0A=
+ * December 1998, Jesper Juhl (jesper.juhl@dif.dk):=0A=
+ * Made APM_NOINTS configurable from 'make config' etc. as this =
often=0A=
+ * causes problems with IBM ThinkPad's.=0A=
*=0A=
* History:=0A=
* 0.6b: first version in official kernel, Linux 1.3.46=0A=
@@ -164,7 +167,11 @@=0A=
* Define to disable interrupts in APM BIOS calls (the CPU Idle BIOS =
call=0A=
* should turn interrupts on before it does a 'hlt').=0A=
*/=0A=
-#define APM_NOINTS=0A=
+#ifdef CONFIG_APM_INTS=0A=
+# undef APM_NOINTS=0A=
+#else=0A=
+# define APM_NOINTS=0A=
+#endif=0A=
=0A=
/*=0A=
* Define to make the APM BIOS calls zero all data segment registers =
(do=0A=
@@ -207,6 +214,7 @@=0A=
#else=0A=
# define APM_DO_CLI=0A=
#endif=0A=
+=0A=
#ifdef APM_ZERO_SEGS=0A=
# define APM_DO_ZERO_SEGS \=0A=
"pushl %%ds\n\t" \=0A=

------ =_NextPart_000_01BE2350.E70B6B96--

-
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/